diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6d93f0c8e7..615a280a9c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -34,7 +34,7 @@ "version": "18.19.0" }, "ghcr.io/devcontainers/features/rust:1": { - "version": "1.63", + "version": "1.74", "profile": "complete" }, "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, diff --git a/.github/workflows/.dast-nuclei-cmd-api-server.yaml b/.github/workflows/.dast-nuclei-cmd-api-server.yaml deleted file mode 100644 index 6f1f0d3ff6..0000000000 --- a/.github/workflows/.dast-nuclei-cmd-api-server.yaml +++ /dev/null @@ -1,145 +0,0 @@ -name: DAST_Scan_Nuclei - -env: - NODEJS_VERSION: v18.18.2 - -on: - push: - branches: [main, dev] - - pull_request: - branches: [main, dev] - -jobs: - nuclei-scan: - runs-on: ubuntu-20.04 - steps: - - name: Install Indy SDK - run: > - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \ - && sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic stable" \ - && sudo apt-get update \ - && sudo apt-get install -y \ - libindy \ - libnullpay \ - libvcx \ - indy-cli \ - && sudo rm -f /etc/apt/sources.list.d/sovrin.list* - - - name: Set up NodeJS ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Install jq - run: sudo apt update && sudo apt install -y jq - - - name: Verify jq - run: jq --version - - - uses: actions/checkout@v3.5.2 - - - uses: actions/setup-go@v4.0.0 - with: - go-version: 1.17 - - - run: go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@v2.7.3 - - - run: nuclei --version - - - run: npm run configure - - - name: Create URLs file for Nuclei - run: | - echo https://localhost:4000/ > urls.txt - echo https://localhost:4000/api/v1/api-server/healthcheck >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics >> urls.txt - echo https://localhost:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record >> urls.txt - - - name: Show file content - run: | - pwd - ls -la - cat urls.txt - - # TODO: Clean up comments - # TODO: Remove --debug flag - - - run: yarn generate-api-server-config - - - run: echo "$(jq '.authorizationProtocol = "NONE"' .config.json)" > .config.json - - - name: Install Fabric connector into the API server - #Uncomment line 87 when the fix for the cactus-plugin-ledger-connector-fabric has been published to npm and remove live 89 - # run: echo "$(jq '.plugins += [{"packageName":"@hyperledger/cactus-plugin-ledger-connector-fabric", "type":"org.hyperledger.cactus.plugin_import_type.LOCAL", "action":"org.hyperledger.cactus.plugin_import_action.INSTALL", "options":{"instanceId":"some-unique-fabric-connector-instance-id", "peerBinary":"/fabric-samples/bin/peer", "connectionProfile":"{}", "dockerBinary":"usr/local/bin/docker","cliContainerEnv":{"CORE_PEER_LOCALMSPID":"Org1MSP","CORE_PEER_ADDRESS":"peer0.org1.example.com:7051","CORE_PEER_MSPCONFIGPATH":"/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp","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","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"},"discoveryOptions":{"enabled":true,"asLocalhost":true}}}] ' .config.json)" > .config.json - #Line 89 is a workaround for the cactus-plugin-connector-fabric issue - run: echo "$(jq '.plugins += [{"packageName":"@hyperledger/cactus-plugin-ledger-connector-fabric", "type":"org.hyperledger.cactus.plugin_import_type.LOCAL", "action":"org.hyperledger.cactus.plugin_import_action.INSTALL", "options":{ "packageSrc":"/home/runner/work/cacti/cacti/packages/cactus-plugin-ledger-connector-fabric/", "instanceId":"some-unique-fabric-connector-instance-id", "peerBinary":"/fabric-samples/bin/peer", "connectionProfile":"{}", "dockerBinary":"usr/local/bin/docker","cliContainerEnv":{"CORE_PEER_LOCALMSPID":"Org1MSP","CORE_PEER_ADDRESS":"peer0.org1.example.com:7051","CORE_PEER_MSPCONFIGPATH":"/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp","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","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"},"discoveryOptions":{"enabled":true,"asLocalhost":true}}}] ' .config.json)" > .config.json - - - name: Install Besu connector into the API server - run: echo "$(jq '.plugins += [{"packageName":"@hyperledger/cactus-plugin-ledger-connector-besu","type":"org.hyperledger.cactus.plugin_import_type.LOCAL","action":"org.hyperledger.cactus.plugin_import_action.INSTALL","options":{"rpcApiHttpHost":"http://localhost:8545", "rpcApiWsHost":"ws://localhost:8546", "instanceId":"some-unique-besu-connector-instance-id"}}]' .config.json)" > .config.json - - - name: Run Besu all-in-one image - run: | - docker run -d -p 0.0.0.0:8545:8545/tcp -p 0.0.0.0:8546:8546/tcp -p 0.0.0.0:8888:8888/tcp -p 0.0.0.0:9001:9001/tcp -p 0.0.0.0:9545:9545/tcp ghcr.io/hyperledger/cactus-besu-all-in-one:2022-04-14-dda3f00 - until curl --fail -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' localhost:8545; do sleep 5; done - - # - run: | - # touch ~/nuclei-github-config.yaml \ - # && echo -e "severity: critical,high" >> ~/nuclei-github-config.yaml \ - # && echo -e "github:" >> ~/nuclei-github-config.yaml \ - # && echo -e " username: \"$GITHUB_ACTOR\"" >> ~/nuclei-github-config.yaml \ - # && echo -e " owner: \"${GITHUB_REPOSITORY%%/*}\"" >> ~/nuclei-github-config.yaml \ - # && echo -e " token: \"${{ inputs.github-token }}\"" >> ~/nuclei-github-config.yaml \ - # && echo -e " project-name: \"${GITHUB_REPOSITORY#*/}\"" >> ~/nuclei-github-config.yaml \ - # && echo -e " issue-label: \"Nuclei\"" >> ~/nuclei-github-config.yaml \ - # && echo "githubconfig=-rc ~/nuclei-github-config.yaml" >> $GITHUB_ENV - - # shell: bash - - # - run: ls -alt - - - name: Start API Server & Run DAST - uses: BerniWittmann/background-server-action@v1.1.0 - env: - # Needed because the wait-on syntax otherwise keeps thinking that - # there is a problem due to our self signed certificates on the - # test instance of the API server - NODE_TLS_REJECT_UNAUTHORIZED: 0 - with: - build: yarn --version - start: yarn start:api-server - command: "nuclei -update-templates --config=.nuclei-config.yaml --list=urls.txt --sarif-export ~/nuclei.sarif --output nuclei.log" - wait-on: "https://localhost:4000/api/v1/api-server/healthcheck" - # wait for 10 minutes for the server to respond - wait-on-timeout: 120 - - - run: pwd - - - run: ls -alt - - - name: GitHub Workflow artifacts - uses: actions/upload-artifact@v3.0.0 - with: - name: nuclei.log - path: nuclei.log - - # - name: GitHub Security Dashboard Alerts update - # uses: github/codeql-action/upload-sarif@v1 - # with: - # sarif_file: ~/nuclei.sarif diff --git a/.github/workflows/actionlint.yaml b/.github/workflows/actionlint.yaml deleted file mode 100644 index 31c06b1e19..0000000000 --- a/.github/workflows/actionlint.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Lint GitHub Actions workflows -on: - workflow_call: - -jobs: - actionlint: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3.5.3 - - name: Download actionlint - id: get_actionlint - run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.6.25/scripts/download-actionlint.bash) - shell: bash - - name: Check workflow files - run: ${{ steps.get_actionlint.outputs.executable }} -color - shell: bash diff --git a/.github/workflows/all-nodejs-packages-publish.yaml b/.github/workflows/all-nodejs-packages-publish.yaml deleted file mode 100644 index 3624acf3d9..0000000000 --- a/.github/workflows/all-nodejs-packages-publish.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: all-nodejs-packages-publish - -env: - NODEJS_VERSION: v18.18.2 - -on: - push: - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - - build-and-publish-packages: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - run: git fetch --unshallow --prune - - uses: actions/setup-node@v3.6.0 - with: - always-auth: true - node-version: ${{ env.NODEJS_VERSION }} - registry-url: 'https://registry.npmjs.org' - - name: ./tools/ci.sh - run: ./tools/ci.sh - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: false - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - - name: lerna-publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - git config --global user.email "npm-ci@hyperledger.org" - git config --global user.name "hyperledger-ghci" - npm whoami - yarn lerna publish from-git --yes --loglevel=debug diff --git a/.github/workflows/besu-all-in-one-publish.yaml b/.github/workflows/besu-all-in-one-publish.yaml deleted file mode 100644 index b497478cc2..0000000000 --- a/.github/workflows/besu-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: besu-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-besu-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/besu-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/besu-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/cacti-dev-container-vscode-publish.yaml b/.github/workflows/cacti-dev-container-vscode-publish.yaml deleted file mode 100644 index 521f520e2b..0000000000 --- a/.github/workflows/cacti-dev-container-vscode-publish.yaml +++ /dev/null @@ -1,67 +0,0 @@ -name: connector-fabric-publish - -env: - NODEJS_VERSION: v20.3.0 - -on: - push: - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cacti-dev-container-vscode - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-fabric/ - permissions: - packages: write - contents: read - - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - uses: actions/checkout@v3.5.2 - - - name: npm_install_@devcontainers/cli@0.44.0 - run: npm install -g @devcontainers/cli@0.44.0 - - - name: npx_yes_devcontainers_cli_build - run: npx --yes @devcontainers/cli@0.44.0 build --workspace-folder=./ --log-level=trace --push=false --config=./.devcontainer/devcontainer.json --image-name=$IMAGE_NAME - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/cactus-whitepaper-publish.yaml b/.github/workflows/cactus-whitepaper-publish.yaml deleted file mode 100644 index c4e7701098..0000000000 --- a/.github/workflows/cactus-whitepaper-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: whitepaper-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-whitepaper - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./whitepaper/Dockerfile - DOCKER_BUILD_DIR: ./whitepaper/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 7eb1d61815..0000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,2074 +0,0 @@ ---- -env: - NODEJS_VERSION: v18.18.2 -jobs: - ActionLint: - uses: ./.github/workflows/actionlint.yaml - DCI-Lint: - name: DCI-Lint - runs-on: ubuntu-20.04 - steps: - - id: lint-git-repo - name: Lint Git Repo - uses: petermetz/gh-action-dci-lint@v0.6.1 - with: - lint-git-repo-request: '{"cloneUrl": "${{ github.server_url }}/${{ github.repository }}.git", "fetchArgs": ["--update-head-ok", "--no-tags", "--prune", "--progress", "--no-recurse-submodules", "--depth=1", "origin" ,"+${{ github.sha }}:${{ github.ref }}"], "checkoutArgs": [ "${{ github.ref }}"], "targetPhrasePatterns": [], "configDefaultsUrl": "https://inclusivenaming.org/json/dci-lint-config-recommended-v1.json" }' - - name: Get the output response - run: echo "${{ steps.lint-git-repo.outputs.lint-git-repo-response }}" - build-dev: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - CONFIGURE_DISABLED: false - CHECK_WORK_TREE_STATUS_DISABLED: true - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Initialize Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - if : ${{ (steps.yarn-cache.outputs.cache-hit != 'true') }} - name: tools_ci_sh - run: ./tools/ci.sh - - yarn_lint: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - run: yarn lint - yarn_codegen: - continue-on-error: false - env: - DEV_BUILD_DISABLED: true - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - CONFIGURE_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - run: git status --porcelain - - run: git status --porcelain | wc -l - - run: yarn codegen - - run: git status --porcelain - - run: git status --porcelain | wc -l - - - name: Set env.GIT_INDEX_FILE_COUNT - id: set_env_git_index_file_count - run: | - echo "GIT_INDEX_FILE_COUNT=$(git status --porcelain | wc -l)" >> $GITHUB_ENV - - - name: Print env.GIT_INDEX_FILE_COUNT - id: print_env_git_index_file_count - run: | - echo "${{ env.GIT_INDEX_FILE_COUNT }}" - - - uses: actions/github-script@v6.4.1 - id: set-result-git_index_file_count - with: - script: | - const { GIT_INDEX_FILE_COUNT } = process.env; - console.log(`env.GIT_INDEX_FILE_COUNT ${GIT_INDEX_FILE_COUNT}`); - return parseInt(GIT_INDEX_FILE_COUNT, 10); - result-encoding: string - - - name: Get result Git Index File Count - id: get_result_git_index_file_count - run: echo "${{steps.set-result-git_index_file_count.outputs.result}}" - - - name: Check CodeGen Side-effects - if: ${{ steps.set-result-git_index_file_count.outputs.result != 0 }} - uses: actions/github-script@v6.4.1 - with: - script: | - const failMsg = "yarn codegen script produced version control " + - "side-effects: source files have been changed by it that are " + - "otherwise are under version control. " + - "This means (99% of the time) that you need to run the " + - "yarn codegen script locally and then include the changes it " + - "makes in your own commit when submitting your pull request."; - core.setFailed(failMsg) - - yarn_custom_checks: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: false - CONFIGURE_DISABLED: false - CACTI_CUSTOM_CHECKS_REQUIRED_OPENAPI_SPEC_VERSION: 3.0.3 - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - yarn_tools_validate_bundle_names: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: false - CUSTOM_CHECKS_DISABLED: true - CONFIGURE_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-api-client: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-api-client/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./packages/cactus-api-client/src/test/typescript/integration/default-consortium-provider.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - cactus-cmd-api-server: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-cmd-api-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-from-github.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-without-install.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/remote-plugin-imports.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/certificates-work-for-mutual-tls.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/generates-working-certificates.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-js-proto-loader-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-m-tls-enabled.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-consortium-manual.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-keychain-memory.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-quorum-0-7-0.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - cactus-cmd-socketio-server: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-cmd-socketio-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - - cactus-common: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-common/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./packages/cactus-common/src/test/typescript/unit/key-converter.test.ts,./packages/cactus-common/src/test/typescript/unit/logging/logger.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - cactus-core: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-core/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-core-api: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-core-api/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-example-carbon-accounting-backend: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-carbon-accounting-backend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./examples/cactus-example-carbon-accounting-backend/src/test/typescript/integration/admin-enroll-v1-endpoint.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-example-carbon-accounting-business-logic-plugin: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-carbon-accounting-business-logic-plugin/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-example-carbon-accounting-frontend: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-carbon-accounting-frontend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-example-supply-chain-backend: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-supply-chain-backend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./examples/cactus-example-supply-chain-backend/src/test/typescript/integration/supply-chain-backend-api-calls.test.ts,./examples/cactus-example-supply-chain-backend/src/test/typescript/integration/supply-chain-cli-via-npm-script.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-example-supply-chain-business-logic-plugin: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-supply-chain-business-logic-plugin/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-example-supply-chain-frontend: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-supply-chain-frontend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-consortium-manual: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-consortium-manual/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-htlc-coordinator-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts,./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/own-htlc-endpoint.test.ts,./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/refund.test.ts,./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/withdraw-counterparty-endpoint.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-htlc-eth-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-htlc-eth-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-htlc-eth-besu-erc20: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-htlc-eth-besu-erc20/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-keychain-aws-sm: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-aws-sm/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: '--files={./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/openapi/openapi-validation.test.ts,./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/plugin-factory-keychain.test.ts,./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/plugin-factory-keychain.test.ts,./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/plugin-keychain-aws-sm.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-keychain-azure-kv: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-azure-kv/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./packages/cactus-plugin-keychain-azure-kv/src/test/typescript/integration/plugin-keychain-azure-kv.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-keychain-google-sm: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-google-sm/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/openapi/openapi-validation.test.ts,./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/plugin-factory-keychain.test.ts,./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/plugin-keychain-google-sm.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-keychain-memory: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-memory/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-keychain-memory-wasm: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-memory-wasm/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./packages/cactus-plugin-keychain-memory-wasm/src/test/typescript/unit/plugin-keychain-memory-wasm.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-keychain-vault: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-vault/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./packages/cactus-plugin-keychain-vault/src/test/typescript/integration/cactus-keychain-vault-server.test.ts,./packages/cactus-plugin-keychain-vault/src/test/typescript/integration/openapi/openapi-validation.test.ts,./packages/cactus-plugin-keychain-vault/src/test/typescript/integration/plugin-keychain-vault.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/deploy-contract-from-json.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/get-block.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/get-past-logs.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/get-record-locator.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-cactus.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-web3-eea.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-deploy-contract-from-json.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-balance.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-block.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-past-logs.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-record-locator.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/openapi/openapi-validation.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/v21-besu-get-transaction.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-corda: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-corda/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.7.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8-express.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/flow-database-access-v4.8.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/jvm-kotlin-spring-server-v4.7.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/jvm-kotlin-spring-server-v4.8.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/openapi/openapi-validation.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - plugin-ledger-connector-fabric-0: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - plugin-ledger-connector-fabric-1: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts - - plugin-ledger-connector-fabric-2: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts - - plugin-ledger-connector-fabric-3: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-lock-asset.test.ts - - plugin-ledger-connector-fabric-4: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/openapi/openapi-validation.test.ts - - plugin-ledger-connector-fabric-5: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/openapi/openapi-validation-go.test.ts - - plugin-ledger-connector-fabric-6: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/unit/identity-internal-crypto-utils.test.ts - - plugin-ledger-connector-fabric-7: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/identity-client.test.ts - - plugin-ledger-connector-fabric-8: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-with-identities.test.ts - - plugin-ledger-connector-fabric-9: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/obtain-profiles.test.ts - - plugin-ledger-connector-fabric-10: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source.test.ts - - plugin-ledger-connector-fabric-11: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/add-orgs.test.ts - - plugin-ledger-connector-fabric-12: - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '{"debug":"console","info":"console","warn": "console","error":"console"}' - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_PATTERN: "" - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: npm run configure - - run: yarn ts-node ./packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/run-transaction-with-ws-ids.test.ts - - cactus-plugin-ledger-connector-go-ethereum-socketio: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-iroha: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/iroha-iroha-transfer-example.test.ts,./packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/openapi/openapi-validation.test.ts,./packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/integration/run-transaction-endpoint-v1.test.ts,./packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/unit/iroha-test-ledger-parameters.test.ts,./packages/cactus-plugin-ledger-connector-iroha/src/test/typescript/unit/postgres-test-container-parameters.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-iroha2: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-iroha2/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-ethereum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-quorum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/openapi/openapi-validation-no-keychain.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/openapi/openapi-validation.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-invoke-contract-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-invoke-contract-json-object.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-deploy-contract-from-json-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-deploy-contract-from-json-json-object.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-invoke-contract-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-invoke-contract-json-object.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-sawtooth: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-sawtooth/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-ledger-connector-xdai: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/deploy-contract-from-json-xdai-json-object.test.ts,./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/invoke-contract-xdai-json-object.test.ts,./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/openapi/openapi-validation-no-keychain.test.ts,./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/openapi/openapi-validation.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-persistence-ethereum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-persistence-ethereum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-plugin-object-store-ipfs: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: extensions/cactus-plugin-object-store-ipfs/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./extensions/cactus-plugin-object-store-ipfs/src/test/typescript/integration/plugin-object-store-ipfs.test.ts,./extensions/cactus-plugin-object-store-ipfs/src/test/typescript/unit/plugin-object-store-ipfs.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - # cactus-plugin-odap-hermes: - # continue-on-error: false - # env: - # FULL_BUILD_DISABLED: true - # JEST_TEST_PATTERN: packages/cactus-plugin-odap-hermes/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - # JEST_TEST_RUNNER_DISABLED: false - # TAPE_TEST_RUNNER_DISABLED: true - # needs: build-dev - # runs-on: ubuntu-20.04 - # steps: - # - name: Use Node.js ${{ env.NODEJS_VERSION }} - # uses: actions/setup-node@v3.6.0 - # with: - # node-version: ${{ env.NODEJS_VERSION }} - # - uses: actions/checkout@v3.5.2 - # - id: yarn-cache-dir-path - # name: Get yarn cache directory path - # run: echo "::set-output name=dir::$(yarn cache dir)" - # - id: yarn-cache - # name: Restore Yarn Cache - # uses: actions/cache@v3.3.1 - # with: - # key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - # path: ./.yarn/ - # restore-keys: | - # ${{ runner.os }}-yarn- - # - run: ./tools/ci.sh - cactus-plugin-connector-ubiquity: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - UBIQUITY_AUTH_TOKEN: ${{ secrets.UBIQUITY_AUTH_TOKEN }} - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - env: - UBIQUITY_AUTH_TOKEN: ${{ secrets.UBIQUITY_AUTH_TOKEN }} - cactus-test-api-client: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-api-client/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-test-cmd-api-server: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-cmd-api-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./packages/cactus-test-cmd-api-server/src/test/typescript/integration/plugin-import-with-npm-install-version-selection.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-test-plugin-consortium-manual: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-consortium-manual/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./packages/cactus-test-plugin-consortium-manual/src/test/typescript/integration/plugin-consortium-manual/openapi/openapi-validation.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-test-plugin-htlc-eth-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/integration/plugin-htlc-eth-besu/get-single-status-endpoint.test.ts,./packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/integration/plugin-htlc-eth-besu/openapi/openapi-validation.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Run solidity tests - run: cd packages/cactus-plugin-htlc-eth-besu && forge test -vvvvv - - cactus-test-plugin-htlc-eth-besu-erc20: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/integration/plugin-htlc-eth-besu-erc20/get-status-endpoint.test.ts,./packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/integration/plugin-htlc-eth-besu-erc20/openapi/openapi-validation.test.ts,./packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/integration/plugin-htlc-eth-besu-erc20/refund-endpoint.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-test-plugin-ledger-connector-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-balance-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-block-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-past-logs-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-transaction-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-balance-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-block-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-past-logs-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-transaction-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-sign-transaction-endpoint.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-test-plugin-ledger-connector-quorum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-test-plugin-ledger-connector-ethereum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-ledger-connector-ethereum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - id: yarn-cache-dir-path - name: Get yarn cache directory path - run: echo "::set-output name=dir::$(yarn cache dir)" - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.0.4 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: ./tools/ci.sh - cactus-test-tooling: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-tooling/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-test-tooling/src/test/typescript/integration/besu/besu-test-ledger/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/fabric/fabric-test-ledger-v1/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/iroha/iroha-test-ledger/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/postgres/postgres-test-container/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/quorum/quorum-test-ledger/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/rustc-container/rustc-container-target-bundler.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/substrate/substrate-test-ledger-constructor.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/substrate/substrate-test-ledger-multiple-concurrent.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-verifier-client: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-verifier-client/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-20.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v3.3.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - ghcr-besu-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-besu-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/besu-all-in-one/ -f ./tools/docker/besu-all-in-one/Dockerfile -t cactus-besu-all-in-one - - name: Run Trivy vulnerability scan for cactus-besu-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-besu-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-cmd-api-server: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-cmd-api-server - run: DOCKER_BUILDKIT=1 docker build . -f ./packages/cactus-cmd-api-server/Dockerfile -t cactus-cmd-api-server - - name: Run Trivy vulnerability scan for cactus-cmd-api-server - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-cmd-api-server' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-connector-besu: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-connector-besu - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-ledger-connector-besu/ -f ./packages/cactus-plugin-ledger-connector-besu/Dockerfile -t cactus-connector-besu - - name: Run Trivy vulnerability scan for cactus-connector-besu - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-connector-besu' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-connector-corda-server: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-connector-corda-server - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-ledger-connector-corda/src/main-server/ -f ./packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile -t cactus-connector-corda-server - - name: Run Trivy vulnerability scan for cactus-connector-corda-server - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-connector-corda-server' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-connector-fabric: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-connector-fabric - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-ledger-connector-fabric/ -f ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile -t cactus-connector-fabric - - name: Run Trivy vulnerability scan for cactus-connector-fabric - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-connector-fabric' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-corda-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-corda-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/corda-all-in-one/ -f ./tools/docker/corda-all-in-one/Dockerfile -t cactus-corda-all-in-one - - name: Run Trivy vulnerability scan for cactus-corda-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-corda-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-corda-all-in-one-flowdb: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-corda-all-in-one-flowdb - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/corda-all-in-one/corda-v4_8-flowdb/ - ghcr-corda-all-in-one-obligation: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-corda-all-in-one-obligation - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/corda-all-in-one/ -f ./tools/docker/corda-all-in-one/corda-v4_8/Dockerfile -t cactus-corda-all-in-one-obligation - - name: Run Trivy vulnerability scan for cactus-corda-all-in-one-obligation - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-corda-all-in-one-obligation' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-dev-container-vscode: - runs-on: ubuntu-20.04 - env: - IMAGE_NAME: cacti-dev-container-vscode - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v3.5.2 - - name: npm_install_@devcontainers/cli@0.44.0 - run: npm install -g @devcontainers/cli@0.44.0 - - name: npx_yes_devcontainers_cli_build - run: npx --yes @devcontainers/cli@0.44.0 build --workspace-folder=./ --log-level=trace --push=false --config=./.devcontainer/devcontainer.json --image-name=$IMAGE_NAME - ghcr-example-carbon-accounting: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-example-carbon-accounting - run: DOCKER_BUILDKIT=1 docker build . -f ./examples/carbon-accounting/Dockerfile -t cactus-example-carbon-accounting - - name: Run Trivy vulnerability scan for cactus-example-carbon-accounting - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-example-carbon-accounting' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-example-supply-chain-app: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-example-supply-chain-app - run: DOCKER_BUILDKIT=1 docker build . -f ./examples/supply-chain-app/Dockerfile -t cactus-example-supply-chain-app - - name: Run Trivy vulnerability scan for cactus-example-supply-chain-app - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-example-supply-chain-app' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-fabric-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-fabric-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/fabric-all-in-one/ -f ./tools/docker/fabric-all-in-one/Dockerfile_v1.4.x -t cactus-fabric-all-in-one - - name: Run Trivy vulnerability scan for cactus-fabric-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-fabric-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-fabric2-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-fabric2-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/fabric-all-in-one/ -f ./tools/docker/fabric-all-in-one/Dockerfile_v2.x -t cactus-fabric2-all-in-one - - name: Run Trivy vulnerability scan for cactus-fabric2-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-fabric2-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-iroha-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-iroha-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/iroha-all-in-one/ -f ./tools/docker/iroha-all-in-one/Dockerfile -t cactus-iroha-all-in-one - - name: Run Trivy vulnerability scan for cactus-iroha-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-iroha-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-keychain-vault-server: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-keychain-vault-server - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/ -f ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/Dockerfile -t cactus-keychain-vault-server - - name: Run Trivy vulnerability scan for cactus-keychain-vault-server - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-keychain-vault-server' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-quorum-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-quorum-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/quorum-all-in-one/ -f ./tools/docker/quorum-all-in-one/Dockerfile -t cactus-quorum-all-in-one - - name: Run Trivy vulnerability scan for cactus-quorum-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-quorum-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-quorum-multi-party-all-in-one: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-quorum-multi-party-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/quorum-multi-party-all-in-one/ -f ./tools/docker/quorum-multi-party-all-in-one/Dockerfile -t cactus-quorum-multi-party-all-in-one - - name: Run Trivy vulnerability scan for cactus-quorum-multi-party-all-in-one - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-quorum-multi-party-all-in-one' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-rust-compiler: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-rust-compiler - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/rust-compiler/ -f ./tools/docker/rust-compiler/Dockerfile -t cactus-rust-compiler - - name: Run Trivy vulnerability scan for cactus-rust-compiler - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-rust-compiler' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-test-npm-registry: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-test-npm-registry - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/test-npm-registry/ -f ./tools/docker/test-npm-registry/Dockerfile -t cactus-test-npm-registry - - name: Run Trivy vulnerability scan for cactus-test-npm-registry - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-test-npm-registry' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - ghcr-whitepaper: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - - name: ghcr.io/hyperledger/cactus-whitepaper - run: DOCKER_BUILDKIT=1 docker build ./whitepaper/ -f ./whitepaper/Dockerfile -t cactus-whitepaper - - name: Run Trivy vulnerability scan for cactus-whitepaper - uses: aquasecurity/trivy-action@0.11.2 - with: - image-ref: 'cactus-whitepaper' - format: 'table' - exit-code: '1' - ignore-unfixed: true - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' -name: Cactus_CI -'on': - pull_request: - branches: - - main - - dev - - petermetz/** - push: - branches: - - main - - dev diff --git a/.github/workflows/cmd-api-server-publish.yaml b/.github/workflows/cmd-api-server-publish.yaml deleted file mode 100644 index 82c4420b6d..0000000000 --- a/.github/workflows/cmd-api-server-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: cmd-api-server-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-cmd-api-server - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-cmd-api-server/Dockerfile - DOCKER_BUILD_DIR: ./ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 43264c3b7d..0000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [main] - pull_request: - # The branches below must be a subset of the branches above - branches: [main] - schedule: - - cron: '0 11 * * 1' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-20.04 - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['typescript'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v3.5.2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/commitlint-pull-request.yaml b/.github/workflows/commitlint-pull-request.yaml deleted file mode 100644 index 3d19e2de95..0000000000 --- a/.github/workflows/commitlint-pull-request.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Commit Lint" -on: [pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - commitlint: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v5.4.1 diff --git a/.github/workflows/connector-besu-publish.yaml b/.github/workflows/connector-besu-publish.yaml deleted file mode 100644 index b7dd635e01..0000000000 --- a/.github/workflows/connector-besu-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: connector-fabric-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-connector-fabric - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-fabric/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/connector-corda-server-publish.yaml b/.github/workflows/connector-corda-server-publish.yaml deleted file mode 100644 index 7e67247e11..0000000000 --- a/.github/workflows/connector-corda-server-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: connector-corda-server-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-connector-corda-server - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-corda/src/main-server/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/connector-fabric-publish.yaml b/.github/workflows/connector-fabric-publish.yaml deleted file mode 100644 index 1f394c644f..0000000000 --- a/.github/workflows/connector-fabric-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: connector-besu-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-connector-besu - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-besu/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-besu/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/corda-4-6-all-in-one-obligation-publish.yaml b/.github/workflows/corda-4-6-all-in-one-obligation-publish.yaml deleted file mode 100644 index bbda484bbe..0000000000 --- a/.github/workflows/corda-4-6-all-in-one-obligation-publish.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: corda-4-6-all-in-one-obligation-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: corda-4-6-all-in-one-obligation - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - # FIXME: build arguments are needed to make it version 4.6 (default is 4.7) - DOCKERFILE_PATH: ./tools/docker/corda-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/corda-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/corda-4-7-all-in-one-obligation-publish.yaml b/.github/workflows/corda-4-7-all-in-one-obligation-publish.yaml deleted file mode 100644 index 216ff44709..0000000000 --- a/.github/workflows/corda-4-7-all-in-one-obligation-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: corda-4-7-all-in-one-obligation-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-corda-4-7-all-in-one-obligation - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/corda-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/corda-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/corda-4-8-all-in-one-obligation-publish.yaml b/.github/workflows/corda-4-8-all-in-one-obligation-publish.yaml deleted file mode 100644 index 4f4b79d130..0000000000 --- a/.github/workflows/corda-4-8-all-in-one-obligation-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: corda-4-8-all-in-one-obligation-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-corda-4-8-all-in-one-obligation - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/corda-all-in-one/corda-v4_8/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/corda-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/dependent-issues.yaml b/.github/workflows/dependent-issues.yaml deleted file mode 100644 index a2abe50ffb..0000000000 --- a/.github/workflows/dependent-issues.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: Dependent Issues - -on: - issues: - types: - - opened - - edited - - reopened - pull_request_target: - types: - - opened - - edited - - reopened - - synchronize - schedule: - - cron: '0 0 * * *' # schedule daily check - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check: - runs-on: ubuntu-latest - name: Dependent Issues - steps: - - uses: z0al/dependent-issues@v1 - env: - # (Required) The token to use to make API calls to GitHub. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # (Optional) The label to use to mark dependent issues - label: dependent - - # (Optional) Enable checking for dependencies in issues. Enable by - # setting the value to "on". Default "off" - check_issues: off - - # (Optional) A comma-separated list of keywords. Default - # "depends on, blocked by" - keywords: depends on, blocked by diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml deleted file mode 100644 index e9c9c87e27..0000000000 --- a/.github/workflows/deploy_docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Docs (Github Pages) - -on: - push: - branches: - - main - paths: - - 'docs/**' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - deploy-docs: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - - name: Use Python 3.x - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' # caching pip dependencies - - - name: Install dependencies - run: pip install -r requirements.txt - working-directory: docs - - - name: Build and publish - run: git pull && mkdocs gh-deploy - working-directory: docs diff --git a/.github/workflows/dev-container-vscode-publish.yaml b/.github/workflows/dev-container-vscode-publish.yaml deleted file mode 100644 index 109e558f85..0000000000 --- a/.github/workflows/dev-container-vscode-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: dev-container-vscode-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-dev-container-vscode - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./.devcontainer/Dockerfile - DOCKER_BUILD_DIR: ./.devcontainer/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/example-carbon-accounting-publish.yaml b/.github/workflows/example-carbon-accounting-publish.yaml deleted file mode 100644 index 0bf6e33a50..0000000000 --- a/.github/workflows/example-carbon-accounting-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: example-carbon-accounting-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-example-carbon-accounting - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./examples/carbon-accounting/Dockerfile - DOCKER_BUILD_DIR: ./ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/example-supply-chain-app-publish.yaml b/.github/workflows/example-supply-chain-app-publish.yaml deleted file mode 100644 index ba932ee715..0000000000 --- a/.github/workflows/example-supply-chain-app-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: example-supply-chain-app-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-example-supply-chain-app - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./examples/supply-chain-app/Dockerfile - DOCKER_BUILD_DIR: ./ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/fabric-all-in-one-publish.yaml b/.github/workflows/fabric-all-in-one-publish.yaml deleted file mode 100644 index b8c790eef4..0000000000 --- a/.github/workflows/fabric-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: fabric-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-fabric-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/fabric-all-in-one/Dockerfile_v1.4.x - DOCKER_BUILD_DIR: ./tools/docker/fabric-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/fabric2-all-in-one-publish.yaml b/.github/workflows/fabric2-all-in-one-publish.yaml deleted file mode 100644 index 485395afbe..0000000000 --- a/.github/workflows/fabric2-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: fabric2-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-fabric2-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/fabric-all-in-one/Dockerfile_v2.x - DOCKER_BUILD_DIR: ./tools/docker/fabric-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/geth-all-in-one-publish.yaml b/.github/workflows/geth-all-in-one-publish.yaml deleted file mode 100644 index 73d5cabc63..0000000000 --- a/.github/workflows/geth-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: geth-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-geth-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/geth-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/geth-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/gg-shield-action.yaml b/.github/workflows/gg-shield-action.yaml deleted file mode 100644 index db0aa2aeb7..0000000000 --- a/.github/workflows/gg-shield-action.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: GitGuardian scan - -on: - push: - pull_request: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -jobs: - scanning: - name: GitGuardian scan - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v3.5.2 - with: - fetch-depth: 0 # fetch all history so multiple commits can be scanned - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: GitGuardian scan - uses: GitGuardian/ggshield-action@v1.14.4 - with: - args: --show-secrets --exit-zero --all-policies --verbose - env: - GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} - GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} - GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} - GITHUB_DEFAULT_BRANCH: main - GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/ghpkg-all-java-api-clients-publish.yaml b/.github/workflows/ghpkg-all-java-api-clients-publish.yaml new file mode 100644 index 0000000000..e189b45968 --- /dev/null +++ b/.github/workflows/ghpkg-all-java-api-clients-publish.yaml @@ -0,0 +1,55 @@ +name: ghpkg-all-java-api-clients-publish + +on: + push: + branches: [main, dev] + + pull_request: + branches: [main, dev] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + publish: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + with: + fetch-depth: 0 + + - name: Get the latest release version + run: | + export GITVERSION=$(git describe --tags | awk -F'.' '{print $$1}') + echo "GITVERSION=$GITVERSION" >> $GITHUB_ENV + + - uses: actions/setup-java@v3.11.0 + with: + distribution: 'adopt' + java-version: '8' + + - name: Setup maven for packaging jars + uses: s4u/setup-maven-action@v1.10.0 + with: + maven-version: 3.9.4 + + - name: Set up NodeJS v16.14.2 + uses: actions/setup-node@v3.6.0 + with: + node-version: v16.14.2 + + - run: yarn && yarn configure + + - name: build-cactus-cmd-api-server-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client + mvn clean package + + - name: publish-cactus-cmd-api-server-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-cmd-api-server-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar \ No newline at end of file diff --git a/.github/workflows/iroha-all-in-one-publish.yaml b/.github/workflows/iroha-all-in-one-publish.yaml deleted file mode 100644 index bf51847c6c..0000000000 --- a/.github/workflows/iroha-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: iroha-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-iroha-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/iroha-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/iroha-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/iroha2-all-in-one-publish.yaml b/.github/workflows/iroha2-all-in-one-publish.yaml deleted file mode 100644 index b76d4c5c6e..0000000000 --- a/.github/workflows/iroha2-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: iroha2-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-iroha2-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/iroha2-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/iroha2-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/keychain-vault-server-publish.yaml b/.github/workflows/keychain-vault-server-publish.yaml deleted file mode 100644 index 52dc3bd0ad..0000000000 --- a/.github/workflows/keychain-vault-server-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: keychain-vault-server-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-keychain-vault-server - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/publish-npm.yaml b/.github/workflows/publish-npm.yaml deleted file mode 100644 index 68f9d046ca..0000000000 --- a/.github/workflows/publish-npm.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: publish-npm-manually - -env: - NODEJS_VERSION: v18.18.2 - -on: - workflow_dispatch: - inputs: - tag-pub: - type: string - description: Tag to publish - required: true - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - - build-and-publish-packages: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.2 - with: - ref: ${{ inputs.tag-pub }} - - run: git fetch --unshallow --prune - - uses: actions/setup-node@v3.6.0 - with: - always-auth: true - node-version: ${{ env.NODEJS_VERSION }} - registry-url: 'https://registry.npmjs.org' - - name: ./tools/ci.sh - run: ./tools/ci.sh - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: false - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - - name: lerna-publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - git config --global user.email "npm-ci@hyperledger.org" - git config --global user.name "hyperledger-ghci" - npm whoami - yarn lerna publish from-git --yes --loglevel=debug diff --git a/.github/workflows/quorum-all-in-one-publish.yaml b/.github/workflows/quorum-all-in-one-publish.yaml deleted file mode 100644 index 9e267e2270..0000000000 --- a/.github/workflows/quorum-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: quorum-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-quorum-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/quorum-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/quorum-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/quorum-multi-party-all-in-one-publish.yaml b/.github/workflows/quorum-multi-party-all-in-one-publish.yaml deleted file mode 100644 index ace53ea99b..0000000000 --- a/.github/workflows/quorum-multi-party-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: quorum-multi-party-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-quorum-multi-party-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/quorum-multi-party-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/quorum-multi-party-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/rust-compiler-publish.yaml b/.github/workflows/rust-compiler-publish.yaml deleted file mode 100644 index 001a3fdf2f..0000000000 --- a/.github/workflows/rust-compiler-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: rust-compiler-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-rust-compiler - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/rust-compiler/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/rust-compiler/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/sawtooth-all-in-one-publish.yaml b/.github/workflows/sawtooth-all-in-one-publish.yaml deleted file mode 100644 index 26d1b49ca7..0000000000 --- a/.github/workflows/sawtooth-all-in-one-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: sawtooth-all-in-one-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-sawtooth-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/sawtooth-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/sawtooth-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/semantic-pull-request.yaml b/.github/workflows/semantic-pull-request.yaml deleted file mode 100644 index f9cda8e4f9..0000000000 --- a/.github/workflows/semantic-pull-request.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Lint PR" - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - main: - name: Validate PR title - runs-on: ubuntu-20.04 - steps: - - uses: amannn/action-semantic-pull-request@v5.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-npm-registry-publish.yaml b/.github/workflows/test-npm-registry-publish.yaml deleted file mode 100644 index 9a02b60999..0000000000 --- a/.github/workflows/test-npm-registry-publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: test-npm-registry-publish - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-test-npm-registry - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-20.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/test-npm-registry/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/test-npm-registry/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v3.5.2 - - - name: Build image - run: docker build $DOCKER_BUILD_DIR --file $DOCKERFILE_PATH --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME - # Change all uppercase to lowercase - IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID=$IMAGE_ID - echo VERSION=$VERSION - docker tag $IMAGE_NAME $IMAGE_ID:$VERSION - docker push $IMAGE_ID:$VERSION diff --git a/.github/workflows/test_weaver-asset-exchange-besu.yaml b/.github/workflows/test_weaver-asset-exchange-besu.yaml deleted file mode 100644 index 9e8a8b704b..0000000000 --- a/.github/workflows/test_weaver-asset-exchange-besu.yaml +++ /dev/null @@ -1,389 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test Asset Exchange Besu - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - asset-exchange-besu: - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - app_contract: ["AliceERC1155", "AliceERC20", "AliceERC721"] - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 11 - uses: actions/setup-java@v3.11.0 - with: - java-version: '11' - distribution: 'adopt' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - # PROTOS - - name: Build Solidity Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-sol - - # BESU NETWORK - - name: Start Besu Network - run: | - sudo apt install -y tmux jq - wget https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.7.0/besu-22.7.0.zip - unzip besu-22.7.0.zip - export PATH="${PWD}/besu-22.7.0/bin:$PATH" - wget https://artifacts.consensys.net/public/ethsigner/raw/names/ethsigner.zip/versions/22.1.3/ethsigner-22.1.3.zip - unzip ethsigner-22.1.3.zip - export PATH="${PWD}/ethsigner-22.1.3/bin:$PATH" - make start - sleep 100 - working-directory: weaver/tests/network-setups/besu - - # Deploy contracts - - name: Deploy contracts - run: | - make deploy-contracts - working-directory: weaver/samples/besu/simpleasset - - # BESU CLI - - name: Setup BESU CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/besu/besu-cli - - - name: Setup BESU CLI init - run: | - make build - cp config.template.json tmp.json - cp config.template.json tmp.json - jq -r '.network1.tokenContract |= "../simpleasset/build/contracts/${{ matrix.app_contract }}.json"' tmp.json > config.json - cp config.json tmp.json - jq -r '.network2.tokenContract |= "../simpleasset/build/contracts/BobERC20.json"' tmp.json > config.json - rm tmp.json - working-directory: weaver/samples/besu/besu-cli - - - name: Asset Exchange Besu CLI Tests - run: | - export PATH="${PWD}/bin:$PATH" - COUNT=0 - TOTAL=10 - - # HTLC Params - timeout=1000 - hashBase64="ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs=" - preimage="secrettext" - - # issue tokens to account 1 - initAmount=10 - transferAmount=5 - tokenId=0 - # & lock 5 token for account 2 in network 1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --asset_type=ERC20 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount} " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - # Is Asset locked - besu-cli asset is-locked --network=network1 --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "in Network network1: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - besu-cli asset claim --network=network1 --recipient_account=2 --preimage=${preimage} --token_id=${tokenId} --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "Account balance of the recipient in Network network1 before claiming: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1 after claiming: ${transferAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ###### test unlock ####### - timeout=20 - initAmount=5 - recipientAmt=0 - transferAmount=2 - tokenId=1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - recipientAmt=5 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - recipientAmt=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: ${recipientAmt}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - sleep $timeout - - besu-cli asset unlock --network=network1 --lock_contract_id=$LOCK_ID --sender_account=1 --token_id=${tokenId} 1> tmp.out - cat tmp.out | grep "before unlocking: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "after unlocking: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/besu/besu-cli - - asset-exchange-besu-local: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - app_contract: ["AliceERC1155", "AliceERC20", "AliceERC721"] - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 11 - uses: actions/setup-java@v3.11.0 - with: - java-version: '11' - distribution: 'adopt' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - # PROTOS - - name: Build Solidity Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-sol - - # BESU SDK - - name: Setup BESU SDK - run: make build-local - working-directory: weaver/sdks/besu/node - - # BESU NETWORK - - name: Start Besu Network - run: | - sudo apt install -y tmux jq - wget https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.7.0/besu-22.7.0.zip - unzip besu-22.7.0.zip - export PATH="${PWD}/besu-22.7.0/bin:$PATH" - wget https://artifacts.consensys.net/public/ethsigner/raw/names/ethsigner.zip/versions/22.1.3/ethsigner-22.1.3.zip - unzip ethsigner-22.1.3.zip - export PATH="${PWD}/ethsigner-22.1.3/bin:$PATH" - make start - sleep 100 - working-directory: weaver/tests/network-setups/besu - - # Deploy contracts - - name: Deploy contracts - run: | - make deploy-contracts - working-directory: weaver/samples/besu/simpleasset - - # BESU CLI - - name: Setup BESU CLI init - run: | - make build-local - cp config.template.json tmp.json - cp config.template.json tmp.json - jq -r '.network1.tokenContract |= "../simpleasset/build/contracts/${{ matrix.app_contract }}.json"' tmp.json > config.json - cp config.json tmp.json - jq -r '.network2.tokenContract |= "../simpleasset/build/contracts/BobERC20.json"' tmp.json > config.json - rm tmp.json - working-directory: weaver/samples/besu/besu-cli - - - name: Asset Exchange Besu CLI Tests - run: | - export PATH="${PWD}/bin:$PATH" - COUNT=0 - TOTAL=10 - - # HTLC Params - timeout=1000 - hashBase64="ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs=" - preimage="secrettext" - - # issue tokens to account 1 - initAmount=10 - transferAmount=5 - tokenId=0 - # & lock 5 token for account 2 in network 1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --asset_type=ERC20 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount} " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - # Is Asset locked - besu-cli asset is-locked --network=network1 --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "in Network network1: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - besu-cli asset claim --network=network1 --recipient_account=2 --preimage=${preimage} --token_id=${tokenId} --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "Account balance of the recipient in Network network1 before claiming: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1 after claiming: ${transferAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ###### test unlock ####### - timeout=20 - initAmount=5 - recipientAmt=0 - transferAmount=2 - tokenId=1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - recipientAmt=5 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - recipientAmt=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: ${recipientAmt}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - sleep $timeout - - besu-cli asset unlock --network=network1 --lock_contract_id=$LOCK_ID --sender_account=1 --token_id=${tokenId} 1> tmp.out - cat tmp.out | grep "before unlocking: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "after unlocking: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/besu/besu-cli - diff --git a/.github/workflows/test_weaver-asset-exchange-corda.yaml b/.github/workflows/test_weaver-asset-exchange-corda.yaml deleted file mode 100644 index 937359ef95..0000000000 --- a/.github/workflows/test_weaver-asset-exchange-corda.yaml +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Asset Exchange Corda - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - asset-exchange-corda: - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - # CORDA NETWORK - - name: Start Corda Network - run: | - make start-network1 PROFILE=3-nodes - sleep 100 - docker logs corda_partya_1 - docker logs corda_partyb_1 - working-directory: weaver/tests/network-setups/corda - - # FABRIC CLI - - name: Setup Corda CLI init - run: ./scripts/initAsset.sh 1 - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Exchange Corda CLI Tests - run: | - COUNT=0 - TOTAL=5 - - # Lock 50 tokens - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 180 -r "O=PartyA,L=London,C=GB" -p t1:50 1> tmp.out - cat tmp.out | grep "HTLC Lock State created with contract ID Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - - # Is Asset locked - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients claim-asset -cid $CID -s secrettext 1> tmp.out - cat tmp.out | grep "Asset Claim Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Timeout - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 5 -r "O=PartyB,L=London,C=GB" -p t1:50 1> tmp.out - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - sleep 5 - cat tmp.out - - ## Is asset lock false - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ## Unlock asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients unlock-asset -cid $CID 1> tmp.out - cat tmp.out | grep "Asset Unlock Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - asset-exchange-corda-local: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - # CORDA NETWORK - - name: Start Corda Network - run: | - make start-network1-local PROFILE=3-nodes - sleep 100 - docker logs corda_partya_1 - docker logs corda_partyb_1 - working-directory: weaver/tests/network-setups/corda - - # FABRIC CLI - - name: Setup Corda CLI init - run: ./scripts/initAsset.sh 1 - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Exchange Corda CLI Tests - run: | - COUNT=0 - TOTAL=5 - - # Lock 50 tokens - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 180 -r "O=PartyA,L=London,C=GB" -p t1:50 1> tmp.out - cat tmp.out | grep "HTLC Lock State created with contract ID Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - - # Is Asset locked - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients claim-asset -cid $CID -s secrettext 1> tmp.out - cat tmp.out | grep "Asset Claim Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Timeout - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 5 -r "O=PartyB,L=London,C=GB" -p t1:50 1> tmp.out - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - sleep 5 - cat tmp.out - - ## Is asset lock false - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ## Unlock asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients unlock-asset -cid $CID 1> tmp.out - cat tmp.out | grep "Asset Unlock Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - house-token-exchange-corda: - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - # CORDA NETWORK - - name: Start Corda Network - run: | - make start-network1 APP_NAME=house PROFILE=3-nodes - sleep 100 - docker logs corda_partya_1 - docker logs corda_partyb_1 - docker logs corda_partyc_1 - working-directory: weaver/tests/network-setups/corda - - # CORDA CLI - - name: Build CLI - run: | - cp ../../../tests/network-setups/corda/github.properties . - make build-cli - working-directory: weaver/samples/corda/corda-simple-application - - - name: Setup Corda CLI init - run: ./scripts/initHouseToken.sh 1 - working-directory: weaver/samples/corda/corda-simple-application - - - name: House Token Exchange Corda CLI Tests - run: | - COUNT=0 - TOTAL=5 - - # Lock 50 tokens - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients house-token lock -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 180 -r "O=PartyA,L=London,C=GB" -o "O=PartyC,L=London,C=GB" -p house:10 1> tmp.out - cat tmp.out | grep "HTLC Lock State created with contract ID Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - - # Is Asset locked - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients house-token is-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token claim -cid $CID -s secrettext 1> tmp.out - cat tmp.out | grep "Asset Claim Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Timeout - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token lock -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 10 -r "O=PartyB,L=London,C=GB" -p house:20 1> tmp.out - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - sleep 10 - cat tmp.out - - ## Is asset lock false - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients house-token is-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ## Unlock asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token unlock -cid $CID 1> tmp.out - cat tmp.out | grep "Asset Unlock Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application diff --git a/.github/workflows/test_weaver-asset-exchange-fabric.yaml b/.github/workflows/test_weaver-asset-exchange-fabric.yaml deleted file mode 100644 index 0564780594..0000000000 --- a/.github/workflows/test_weaver-asset-exchange-fabric.yaml +++ /dev/null @@ -1,190 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Asset Exchange Fabric - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - asset-exchange-fabric: - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop CHAINCODE_NAME=simpleasset PROFILE="2-nodes" - working-directory: weaver/tests/network-setups/fabric/dev - - # FABRIC CLI - - name: Setup Fabric CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/fabric/fabric-cli - - name: Build Fabric CLI - run: npm install - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: ./scripts/initAsset.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Asset Exchange Fabric CLI Tests - run: | - COUNT=0 - TOTAL=1 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset exchange-all --network1=network1 --network2=network2 --secret=secrettext --timeout-duration=100 bob:bond01:a04:alice:token1:100 &> tmp.out - tail -n 2 tmp.out | grep "Asset Exchange Complete." && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - asset-exchange-fabric-local: - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - # Build Dependencies - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop-local CHAINCODE_NAME=simpleasset - working-directory: weaver/tests/network-setups/fabric/dev - - # FABRIC CLI - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: ./scripts/initAsset.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Asset Exchange Fabric CLI Tests - run: | - COUNT=0 - TOTAL=1 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset exchange-all --network1=network1 --network2=network2 --secret=secrettext --timeout-duration=100 bob:bond01:a04:alice:token1:100 &> tmp.out - tail -n 2 tmp.out | grep "Asset Exchange Complete." && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli diff --git a/.github/workflows/test_weaver-asset-transfer.yaml b/.github/workflows/test_weaver-asset-transfer.yaml deleted file mode 100644 index 9d3fa10069..0000000000 --- a/.github/workflows/test_weaver-asset-transfer.yaml +++ /dev/null @@ -1,1337 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Asset Transfer - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - asset-transfer: - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - - name: Start Corda Network - run: | - sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh" - make start &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop CHAINCODE_NAME=simpleassettransfer PROFILE='2-nodes' - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - docker logs corda_network2_partya_1 - working-directory: weaver - - # RELAY - - name: Edit Relay docker compose - run: make convert-compose-method2 - working-directory: weaver/core/relay - - - name: Start Relay for network1 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda2' - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n2 - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n1 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n2 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda' - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda2' - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/fabric/fabric-cli - - name: Build Fabric CLI - run: | - npm install --global yarn - make build - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC CLI - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set-file ./.env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - ./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE simpleassettransfer - ./bin/fabric-cli env set REMOTE_CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/remote-network-config.json - ./bin/fabric-cli env set CHAINCODE_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/chaincode.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - ./bin/fabric-cli config set network2 aclPolicyPrincipalType ca - ./bin/fabric-cli config set network1 chaincode simpleassettransfer - ./bin/fabric-cli config set network2 chaincode simpleassettransfer - cp chaincode.json.template chaincode.json - cp remote-network-config.json.template remote-network-config.json - sed -i "s#localhost:9080#relay-network1:9080#g" remote-network-config.json - sed -i "s#localhost:9081#relay-corda:9081#g" remote-network-config.json - sed -i "s#localhost:9082#relay-corda2:9082#g" remote-network-config.json - sed -i "s#localhost:9083#relay-network2:9083#g" remote-network-config.json - sed -i "s#localhost:10006#corda_partya_1:10003#g" remote-network-config.json - sed -i "s#localhost:30006#corda_network2_partya_1:10003#g" remote-network-config.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: | - ./bin/fabric-cli configure create all --local-network=network1 - ./bin/fabric-cli configure create all --local-network=network2 - ./bin/fabric-cli configure network --local-network=network1 --num-orgs=2 - ./bin/fabric-cli configure network --local-network=network2 --num-orgs=2 - ./scripts/initAssetsForTransfer.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Setup - run: | - cp remote-network-config.json.template remote-network-config.json - sed -i "s#localhost:9080#relay-network1:9080#g" remote-network-config.json - sed -i "s#localhost:9081#relay-corda:9081#g" remote-network-config.json - sed -i "s#localhost:9082#relay-corda2:9082#g" remote-network-config.json - sed -i "s#localhost:9083#relay-network2:9083#g" remote-network-config.json - sed -i "s#localhost:10006#corda_partya_1:10003#g" remote-network-config.json - sed -i "s#localhost:30006#corda_network2_partya_1:10003#g" remote-network-config.json - working-directory: weaver/samples/corda/corda-simple-application/clients/src/main/resources/config - - - name: Corda CLI Initialize Vault - run: make initialise-vault-asset-transfer-docker - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=9 - - # Issue t1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - # Pledge Asset - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim Remote Asset - NETWORK_NAME='Corda_Network2' CORDA_PORT=30006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='O=PartyA, L=London, C=GB' --transfer-category='token.corda' --export-network-id='Corda_Network' --param='t1:5' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "\[\]" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA-CORDA2 - - # Issue and Pledge t2:5 tokens - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t2 1> tmp.out - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t2:5' 1> tmp.out - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - sleep 20 - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.corda' --import-network-id='Corda_Network2' --param='t2:5' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t2 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t2, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Non-Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=bond --ref=a03 --data-file=src/data/assetsForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a03 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a03 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network2 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=bond --ref=a04 --data-file=src/data/assetsForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network1 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a04 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=token --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=token --units=100 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - # CORDA - FABRIC - - name: Corda - Fabric Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=2 - - # CORDA - FABRIC1 - # Issue and Pledge token1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='network1' --recipient='alice' --param='token1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "CF_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Corda - Fabric Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=3 - - PID=${{ env.CF_PID }} - - # CORDA - FABRIC1 - # Claim in Fabric (pledged in Corda) - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer claim --source-network='Corda_Network' --dest-network=network1 --user='alice' --owner='O=PartyA, L=London, C=GB' --type='token.corda' --pledge-id=$PID --param=token1:5 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9955\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Corda - Fabric Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - # CORDA - FABRIC1 - # Issue and Pledge token1:10 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 10 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='network1' --recipient='alice' --param='token1:10' 1> tmp.out - sleep 20 - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.fabric' --import-network-id='network1' --param='token1:10' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=10, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=1 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=3600 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "FC_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric - Corda Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=2 - - PID=${{ env.FC_PID }} - - # FABRIC - CORDA - # Claim Remote Asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='alice' --transfer-category='token.fabric' --export-network-id='network1' --param='token1:50' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=50, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=30 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9855\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - ./bin/fabric-cli asset transfer reclaim --source-network='network1' --user='alice' --type='token.corda' --pledge-id=$PID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: DEBUG Logs - corda partya - if: failure() - run: docker logs corda_partya_1 - - - name: DEBUG Logs - corda network2 partya - if: failure() - run: docker logs corda_network2_partya_1 - - - name: DEBUG Logs - fabric n1 relay - if: failure() - run: docker logs relay-network1 - - - name: DEBUG Logs - fabric n2 relay - if: failure() - run: docker logs relay-network2 - - - name: DEBUG Logs - corda relay - if: failure() - run: docker logs relay-corda - - - name: DEBUG Logs - corda2 relay - if: failure() - run: docker logs relay-corda2 - - - name: DEBUG Logs - fabric n1 driver - if: failure() - run: docker logs driver-fabric-network1 - - - name: DEBUG Logs - fabric n2 driver - if: failure() - run: docker logs driver-fabric-network2 - - - name: DEBUG Logs - corda driver - if: failure() - run: docker logs driver-corda-Corda_Network - - - name: DEBUG Logs - corda2 driver - if: failure() - run: docker logs driver-corda-Corda_Network2 - - asset-transfer-local: - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - - # PROTOS - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-local - working-directory: weaver/core/drivers/fabric-driver - - - name: Build IIN Agent - run: make build-local - working-directory: weaver/core/identity-management/iin-agent - - - name: Build Corda Driver - run: make build-local - working-directory: weaver/core/drivers/corda-driver - - # CORDA NETWORK - - name: Start Corda Network - run: | - sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh" - make start-local &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - - name: Start Fabric Network - run: make start-interop-local CHAINCODE_NAME=simpleassettransfer - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - docker logs corda_network2_partya_1 - working-directory: weaver - - # RELAY - - name: Start Relay for network1 - run: RELAY_CONFIG=config/Fabric_Relay.toml cargo run --bin server &> relay-n1.out & - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: RELAY_CONFIG=config/Fabric_Relay2.toml cargo run --bin server &> relay-n2.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: RELAY_CONFIG=config/Corda_Relay.toml cargo run --bin server &> relay-corda.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: RELAY_CONFIG=config/Corda_Relay2.toml cargo run --bin server &> relay-corda2.out & - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - cp .env.template .env - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s#path_to_connection_profile#${CCP_PATH}#g" .env - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: npm run dev &> fdriver-n1.out & - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: CONNECTION_PROFILE=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json NETWORK_NAME=network2 RELAY_ENDPOINT=localhost:9083 DRIVER_ENDPOINT=localhost:9095 npm run dev &> fdriver-n2.out & - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Config - run: | - # FABRIC CONFIG - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n1.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n1.json - cat src/fabric-ledger/config-n1.json - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n2.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n2.json - cat src/fabric-ledger/config-n2.json - # DNS CONFIG - sed -i "s#iin-agent-Org1MSP-network1#localhost#g" docker-testnet/configs/dnsconfig.json - sed -i "s#iin-agent-Org1MSP-network2#localhost#g" docker-testnet/configs/dnsconfig.json - cat docker-testnet/configs/dnsconfig.json - working-directory: weaver/core/identity-management/iin-agent - - - name: Setup Fabric IIN Env - run: | - cp .env.template .env - sed -i "s##Org1MSP#g" .env - sed -i "s#^DLT_TYPE=.*#DLT_TYPE=fabric#g" .env - sed -i "s##interop#g" .env - sed -i "s#^DNS_CONFIG_PATH=#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig.json#g" .env - sed -i "s#^SECURITY_DOMAIN_CONFIG_PATH=#SECURITY_DOMAIN_CONFIG_PATH=./docker-testnet/configs/security-domain-config.json#g" .env - sed -i "s#^CONFIG_PATH=#CONFIG_PATH=./src/fabric-ledger/config-n1.json#g" .env - sed -i "s#^AUTO_SYNC=#AUTO_SYNC=false#g" .env - cat .env - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: npm run dev &> iinagent-n1.out & - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: IIN_AGENT_ENDPOINT=localhost:9501 SECURITY_DOMAIN=network2 CONFIG_PATH=./src/fabric-ledger/config-n2.json npm run dev &> iinagent-n2.out & - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda_Network Driver - run: ./build/install/driver-corda/bin/driver-corda &> corda-driver.out & - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: DRIVER_PORT=9098 ./build/install/driver-corda/bin/driver-corda &> corda2-driver.out & - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set-file ./.env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - ./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE simpleassettransfer - ./bin/fabric-cli env set REMOTE_CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/remote-network-config.json - ./bin/fabric-cli env set CHAINCODE_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/chaincode.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - ###### Change line number in following commands if config is modified ##### - ./bin/fabric-cli config set network2 aclPolicyPrincipalType ca - ./bin/fabric-cli config set network1 chaincode simpleassettransfer - ./bin/fabric-cli config set network2 chaincode simpleassettransfer - cp chaincode.json.template chaincode.json - cp remote-network-config.json.template remote-network-config.json - working-directory: weaver/samples/fabric/fabric-cli - - - - name: Fabric CLI Init - run: | - ./bin/fabric-cli configure create all --local-network=network1 - ./bin/fabric-cli configure create all --local-network=network2 - ./bin/fabric-cli configure network --local-network=network1 - ./bin/fabric-cli configure network --local-network=network2 - ./scripts/initAssetsForTransfer.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 10 - tail -10 ../../../core/identity-management/iin-agent/iinagent-n1.out - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 10 - tail -10 ../../../core/identity-management/iin-agent/iinagent-n2.out - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Setup - run: | - cp remote-network-config.json.template remote-network-config.json - working-directory: weaver/samples/corda/corda-simple-application/clients/src/main/resources/config - - - name: Corda CLI Initialize Vault - run: make initialise-vault-asset-transfer - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=9 - - # Issue t1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - # Pledge Asset - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim Remote Asset - NETWORK_NAME='Corda_Network2' CORDA_PORT=30006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='O=PartyA, L=London, C=GB' --transfer-category='token.corda' --export-network-id='Corda_Network' --param='t1:5' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "\[\]" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA-CORDA2 - - # Issue and Pledge t2:5 tokens - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t2 1> tmp.out - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t2:5' 1> tmp.out - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - sleep 20 - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.corda' --import-network-id='Corda_Network2' --param='t2:5' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t2 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t2, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Non-Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=bond --ref=a03 --data-file=src/data/assetsForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a03 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a03 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network2 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=bond --ref=a04 --data-file=src/data/assetsForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network1 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a04 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=token --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=token --units=100 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - # CORDA - FABRIC - - name: Corda - Fabric Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=2 - - # CORDA - FABRIC1 - # Issue and Pledge token1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='network1' --recipient='alice' --param='token1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "CF_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Corda - Fabric Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=3 - - PID=${{ env.CF_PID }} - - # CORDA - FABRIC1 - # Claim in Fabric (pledged in Corda) - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer claim --source-network='Corda_Network' --dest-network=network1 --user='alice' --owner='O=PartyA, L=London, C=GB' --type='token.corda' --pledge-id=$PID --param=token1:5 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9955\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Corda - Fabric Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - # CORDA - FABRIC1 - # Issue and Pledge token1:10 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 10 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='network1' --recipient='alice' --param='token1:10' 1> tmp.out - sleep 20 - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.fabric' --import-network-id='network1' --param='token1:10' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=10, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=1 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=3600 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "FC_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric - Corda Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=2 - - PID=${{ env.FC_PID }} - - # FABRIC - CORDA - # Claim Remote Asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='alice' --transfer-category='token.fabric' --export-network-id='network1' --param='token1:50' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=50, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=30 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9855\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - ./bin/fabric-cli asset transfer reclaim --source-network='network1' --user='alice' --type='token.corda' --pledge-id=$PID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: DEBUG Logs - corda partya - if: failure() - run: docker logs corda_partya_1 - - - name: DEBUG Logs - corda network2 partya - if: failure() - run: docker logs corda_network2_partya_1 - - - name: DEBUG Logs - fabric n1 relay - if: failure() - run: cat weaver/core/relay/relay-n1.out - - - name: DEBUG Logs - fabric n2 relay - if: failure() - run: cat weaver/core/relay/relay-n2.out - - - name: DEBUG Logs - corda relay - if: failure() - run: cat weaver/core/relay/relay-corda.out - - - name: DEBUG Logs - corda2 relay - if: failure() - run: cat weaver/core/relay/relay-corda2.out - - - name: DEBUG Logs - fabric n1 driver - if: failure() - run: cat weaver/core/drivers/fabric-driver/fdriver-n1.out - - - name: DEBUG Logs - fabric n2 driver - if: failure() - run: cat weaver/core/drivers/fabric-driver/fdriver-n2.out - - - name: DEBUG Logs - corda driver - if: failure() - run: cat weaver/core/drivers/corda-driver/corda-driver.out - - - name: DEBUG Logs - corda2 driver - if: failure() - run: cat weaver/core/drivers/corda-driver/corda2-driver.out \ No newline at end of file diff --git a/.github/workflows/test_weaver-corda-interop-app.yaml b/.github/workflows/test_weaver-corda-interop-app.yaml deleted file mode 100644 index 64a8c2e6e0..0000000000 --- a/.github/workflows/test_weaver-corda-interop-app.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Unit Test Corda Interop App - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - unit_test_interop_cordapp: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Build Protos (Local) - run: make build - working-directory: weaver/common/protos-java-kt - - - name: Build Corda Interop App (Local) - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Run Tests (Local) - run: make test - working-directory: weaver/core/network/corda-interop-app diff --git a/.github/workflows/test_weaver-data-sharing.yaml b/.github/workflows/test_weaver-data-sharing.yaml deleted file mode 100644 index 7bf92f27da..0000000000 --- a/.github/workflows/test_weaver-data-sharing.yaml +++ /dev/null @@ -1,1198 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Data Sharing - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - data-sharing: - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - - name: Start Corda Network - run: | - sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh" - make start &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop PROFILE='2-nodes' - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - working-directory: weaver - - # RELAY - - name: Edit Relay docker compose - run: make convert-compose-method2 - working-directory: weaver/core/relay - - - name: Start Relay for network1 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda2' - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n2 - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n1 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n2 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda' - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda2' - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/fabric/fabric-cli - - name: Build Fabric CLI - run: | - npm install --global yarn - make build - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - sed -i "s/CHAINCODE_PATH=.*/CHAINCODE_PATH=\.\/chaincode\.json/g" .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Configure ALL - run: ./bin/fabric-cli configure all network1 network2 --num-orgs=2 - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Initialize Vault - run: make initialise-vault-docker - working-directory: weaver/samples/corda/corda-simple-application - - - name: Data Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=8 - - # CORDA-CORDA2 - ./clients/build/install/clients/bin/clients request-state localhost:9081 relay-corda2:9082/Corda_Network2/corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC1 - ./clients/build/install/clients/bin/clients request-state localhost:9081 relay-network1:9080/network1/mychannel:simplestate:Read:a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC2 - ./clients/build/install/clients/bin/clients request-state localhost:9081 relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Data Transfer Fabric CLI Tests - run: | - COUNT=0 - TOTAL=12 - - # FABRIC2 - FABRIC1 - cp chaincode.json.template chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP relay-network1:9080/network1/mychannel:simplestate:Read:a &> tmp.out - tail -n 1 tmp.out | grep "Args: a, Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["a"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"Arcturus\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus &> tmp.out - tail -n 1 tmp.out | grep "Args: Arcturus, 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - FABRIC1 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"b\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network1:9080/network1/mychannel:simplestate:Read:b &> tmp.out - tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["b"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network2:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out - tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Betelgeuse"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Arcturus"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"H\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: H, \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["H"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - name: DEBUG Logs - corda partya - if: failure() - run: docker logs corda_partya_1 - - - name: DEBUG Logs - corda network2 partya - if: failure() - run: docker logs corda_network2_partya_1 - - - name: DEBUG Logs - fabric n1 relay - if: failure() - run: docker logs relay-network1 - - - name: DEBUG Logs - fabric n2 relay - if: failure() - run: docker logs relay-network2 - - - name: DEBUG Logs - corda relay - if: failure() - run: docker logs relay-corda - - - name: DEBUG Logs - corda2 relay - if: failure() - run: docker logs relay-corda2 - - - name: DEBUG Logs - fabric n1 driver - if: failure() - run: docker logs driver-fabric-network1 - - - name: DEBUG Logs - fabric n2 driver - if: failure() - run: docker logs driver-fabric-network2 - - - name: DEBUG Logs - corda driver - if: failure() - run: docker logs driver-corda-Corda_Network - - - name: DEBUG Logs - corda2 driver - if: failure() - run: docker logs driver-corda-Corda_Network2 - - data-sharing-docker-local: - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - - # PROTOS - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make build-server-local - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-image-local - working-directory: weaver/core/drivers/fabric-driver - - - name: Build Corda Driver - run: make image-local - working-directory: weaver/core/drivers/corda-driver - - - name: Build IIN Agent - run: make build-image-local - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Corda Network - run: | - sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh" - make start-local &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop-local PROFILE='2-nodes' - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - working-directory: weaver - - # RELAY - - name: Edit Relay docker compose - run: make convert-compose-method2 - working-directory: weaver/core/relay - - - name: Start Relay for network1 - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.n1 - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.n2 - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.corda - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.corda2 - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda2' - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-fabric#g" docker-testnet-envs/.env.n1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n1 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-fabric#g" docker-testnet-envs/.env.n2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n2 - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n1 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n2 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Env - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n1.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n1.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n2.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n2.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda Driver - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-corda#g" docker-testnet-envs/.env.corda - make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda' - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-corda#g" docker-testnet-envs/.env.corda2 - make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda2' - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - sed -i "s/CHAINCODE_PATH=.*/CHAINCODE_PATH=\.\/chaincode\.json/g" .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Configure ALL - run: ./bin/fabric-cli configure all network1 network2 --num-orgs=2 - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Initialize Vault - run: make initialise-vault-docker - working-directory: weaver/samples/corda/corda-simple-application - - - name: Data Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=8 - - # CORDA-CORDA2 - ./clients/build/install/clients/bin/clients request-state --wkey=H localhost:9081 relay-corda2:9082/Corda_Network2/corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC1 - ./clients/build/install/clients/bin/clients request-state --wkey=a localhost:9081 relay-network1:9080/network1/mychannel:simplestate:Read:a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC2 - ./clients/build/install/clients/bin/clients request-state --wkey=Arcturus localhost:9081 relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Data Transfer Fabric CLI Tests - run: | - COUNT=0 - TOTAL=12 - - # FABRIC2 - FABRIC1 - cp chaincode.json.template chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP relay-network1:9080/network1/mychannel:simplestate:Read:a &> tmp.out - tail -n 1 tmp.out | grep "Args: a, Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["a"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"Arcturus\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus &> tmp.out - tail -n 1 tmp.out | grep "Args: Arcturus, 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Arcturus"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - FABRIC1 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"b\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network1:9080/network1/mychannel:simplestate:Read:b &> tmp.out - tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["b"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network2:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out - tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Betelgeuse"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"H\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: H, \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["H"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - name: DEBUG Logs - corda partya - if: failure() - run: docker logs corda_partya_1 - - - name: DEBUG Logs - corda network2 partya - if: failure() - run: docker logs corda_network2_partya_1 - - - name: DEBUG Logs - fabric n1 relay - if: failure() - run: docker logs relay-network1 - - - name: DEBUG Logs - fabric n2 relay - if: failure() - run: docker logs relay-network2 - - - name: DEBUG Logs - corda relay - if: failure() - run: docker logs relay-corda - - - name: DEBUG Logs - corda2 relay - if: failure() - run: docker logs relay-corda2 - - - name: DEBUG Logs - fabric n1 driver - if: failure() - run: docker logs driver-fabric-network1 - - - name: DEBUG Logs - fabric n2 driver - if: failure() - run: docker logs driver-fabric-network2 - - - name: DEBUG Logs - corda driver - if: failure() - run: docker logs driver-corda-Corda_Network - - - name: DEBUG Logs - corda2 driver - if: failure() - run: docker logs driver-corda-Corda_Network2 - - data-sharing-local: - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest - - # PROTOS - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-local - working-directory: weaver/core/drivers/fabric-driver - - - name: Build Corda Driver - run: make build-local - working-directory: weaver/core/drivers/corda-driver - - - name: Build IIN Agent - run: make build-local - working-directory: weaver/core/identity-management/iin-agent - - # CORDA NETWORK - - name: Start Corda Network - run: | - sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh" - make start-local &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - - name: Start Fabric Network - run: make start-interop-local - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - working-directory: weaver - - # RELAY - - name: Start Relay for network1 - run: RELAY_CONFIG=config/Fabric_Relay.toml cargo run --bin server &> relay-n1.out & - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: RELAY_CONFIG=config/Fabric_Relay2.toml cargo run --bin server &> relay-n2.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: RELAY_CONFIG=config/Corda_Relay.toml cargo run --bin server &> relay-corda.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: RELAY_CONFIG=config/Corda_Relay2.toml cargo run --bin server &> relay-corda2.out & - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - cp .env.template .env - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s#path_to_connection_profile#${CCP_PATH}#g" .env - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: npm run dev &> fdriver-n1.out & - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: CONNECTION_PROFILE=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json NETWORK_NAME=network2 RELAY_ENDPOINT=localhost:9083 DRIVER_ENDPOINT=localhost:9095 npm run dev &> fdriver-n2.out & - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Config - run: | - # FABRIC CONFIG - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n1.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n1.json - cat src/fabric-ledger/config-n1.json - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n2.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n2.json - cat src/fabric-ledger/config-n2.json - # DNS CONFIG - sed -i "s#iin-agent-Org1MSP-network1#localhost#g" docker-testnet/configs/dnsconfig.json - sed -i "s#iin-agent-Org1MSP-network2#localhost#g" docker-testnet/configs/dnsconfig.json - cat docker-testnet/configs/dnsconfig.json - working-directory: weaver/core/identity-management/iin-agent - - - name: Setup Fabric IIN Env - run: | - cp .env.template .env - sed -i "s##Org1MSP#g" .env - sed -i "s#^DLT_TYPE=.*#DLT_TYPE=fabric#g" .env - sed -i "s##interop#g" .env - sed -i "s#^DNS_CONFIG_PATH=#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig.json#g" .env - sed -i "s#^SECURITY_DOMAIN_CONFIG_PATH=#SECURITY_DOMAIN_CONFIG_PATH=./docker-testnet/configs/security-domain-config.json#g" .env - sed -i "s#^CONFIG_PATH=#CONFIG_PATH=./src/fabric-ledger/config-n1.json#g" .env - sed -i "s#^AUTO_SYNC=#AUTO_SYNC=false#g" .env - cat .env - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: npm run dev &> iinagent-n1.out & - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: IIN_AGENT_ENDPOINT=localhost:9501 SECURITY_DOMAIN=network2 CONFIG_PATH=./src/fabric-ledger/config-n2.json npm run dev &> iinagent-n2.out & - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda_Network Driver - run: ./build/install/driver-corda/bin/driver-corda &> corda-driver.out & - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: DRIVER_PORT=9098 ./build/install/driver-corda/bin/driver-corda &> corda2-driver.out & - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - sed -i "s/CHAINCODE_PATH=.*/CHAINCODE_PATH=\.\/chaincode\.json/g" .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - cp chaincode.json.template chaincode.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Configure ALL - run: ./bin/fabric-cli configure all network1 network2 - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 10 - tail -10 ../../../core/identity-management/iin-agent/iinagent-n1.out - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 10 - tail -10 ../../../core/identity-management/iin-agent/iinagent-n2.out - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Initialize Vault - run: make initialise-vault - working-directory: weaver/samples/corda/corda-simple-application - - - name: Data Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=8 - - # CORDA-CORDA2 - ./clients/build/install/clients/bin/clients request-state --wkey=H localhost:9081 localhost:9082/Corda_Network2/localhost:30006#com.cordaSimpleApplication.flow.GetStateByKey:H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC1 - ./clients/build/install/clients/bin/clients request-state --wkey=a localhost:9081 localhost:9080/network1/mychannel:simplestate:Read:a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC2 - ./clients/build/install/clients/bin/clients request-state --wkey=Arcturus localhost:9081 localhost:9083/network2/mychannel:simplestate:Read:Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Data Transfer Fabric CLI Tests - run: | - COUNT=0 - TOTAL=12 - - # FABRIC2 - FABRIC1 - cp chaincode.json.template chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP localhost:9080/network1/mychannel:simplestate:Read:a &> tmp.out - tail -n 1 tmp.out | grep "Args: a, Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["a"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - FABRIC1 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"b\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true localhost:9080/network1/mychannel:simplestate:Read:b &> tmp.out - tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["b"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Arcturus\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP localhost:9083/network2/mychannel:simplestate:Read:Arcturus &> tmp.out - tail -n 1 tmp.out | grep "Args: Arcturus, 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Arcturus"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true localhost:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out - tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Betelgeuse"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"H\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --sign=true --requesting-org=Org1MSP localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:H --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: H, \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["H"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - name: DEBUG Logs - corda partya - if: failure() - run: docker logs corda_partya_1 - - - name: DEBUG Logs - corda network2 partya - if: failure() - run: docker logs corda_network2_partya_1 - - - name: DEBUG Logs - fabric n1 relay - if: failure() - run: cat weaver/core/relay/relay-n1.out - - - name: DEBUG Logs - fabric n2 relay - if: failure() - run: cat weaver/core/relay/relay-n2.out - - - name: DEBUG Logs - corda relay - if: failure() - run: cat weaver/core/relay/relay-corda.out - - - name: DEBUG Logs - corda2 relay - if: failure() - run: cat weaver/core/relay/relay-corda2.out - - - name: DEBUG Logs - fabric n1 driver - if: failure() - run: cat weaver/core/drivers/fabric-driver/fdriver-n1.out - - - name: DEBUG Logs - fabric n2 driver - if: failure() - run: cat weaver/core/drivers/fabric-driver/fdriver-n2.out - - - name: DEBUG Logs - corda driver - if: failure() - run: cat weaver/core/drivers/corda-driver/corda-driver.out - - - name: DEBUG Logs - corda2 driver - if: failure() - run: cat weaver/core/drivers/corda-driver/corda2-driver.out diff --git a/.github/workflows/test_weaver-docker-build.yaml b/.github/workflows/test_weaver-docker-build.yaml deleted file mode 100644 index 32f88f26c0..0000000000 --- a/.github/workflows/test_weaver-docker-build.yaml +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Test All Docker Images Build - -env: - NODEJS_VERSION: v18.18.2 - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build_docker_relay: - # if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Build Image - run: make build-server-local - working-directory: weaver/core/relay - - build_docker_fabric_driver_local: - # if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build JS Protos (Local) - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Fabric Interop Node SDK (Local) - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Image (Local) - run: make build-image-local - working-directory: weaver/core/drivers/fabric-driver - - build_docker_fabric_driver_packages: - if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Setup .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/core/drivers/fabric-driver - - - name: Build Image - run: make build-image - working-directory: weaver/core/drivers/fabric-driver - - build_docker_corda_driver_local: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Build Protos (Local) - run: make build - working-directory: weaver/common/protos-java-kt - - - name: Build Corda Interop App (Local) - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK (Local) - run: make build - working-directory: weaver/sdks/corda - - - name: Build Image (Local) - run: make image-local - working-directory: weaver/core/drivers/corda-driver - - build_docker_corda_driver_packages: - if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - make build || mv github.main.properties github.properties - make clean - - cat github.properties - working-directory: weaver/core/drivers/corda-driver - - - name: Build Image - run: make image - working-directory: weaver/core/drivers/corda-driver - - build_docker_iin_agent_local: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build JS Protos (Local) - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Fabric Interop Node SDK (Local) - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Image - run: make build-image-local - working-directory: weaver/core/identity-management/iin-agent diff --git a/.github/workflows/test_weaver-go.yaml b/.github/workflows/test_weaver-go.yaml deleted file mode 100644 index c6664d3c40..0000000000 --- a/.github/workflows/test_weaver-go.yaml +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Unit Test Fabric Interop CC and Sample Chaincode - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - unit_test_interopcc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Build - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Test - run: go test -v ./... - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - unit_test_assetmgmt: - # if: ${{ false }} # disable - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Build - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Test - run: go test -v ./... - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - unit_test_simplestate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simplestate - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simplestate - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simplestate - - unit_test_simpleasset: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simpleasset - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simpleasset - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simpleasset - - unit_test_simpleassetandinterop: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simpleassetandinterop - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simpleassetandinterop - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simpleassetandinterop - - unit_test_simpleassettransfer: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simpleassettransfer - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simpleassettransfer - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simpleassettransfer diff --git a/.github/workflows/test_weaver-node-pkgs.yaml b/.github/workflows/test_weaver-node-pkgs.yaml deleted file mode 100644 index 31ff946918..0000000000 --- a/.github/workflows/test_weaver-node-pkgs.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Unit Test Weaver Node Packages - -env: - NODEJS_LTS_VERSION: v18.18.2 - NODEJS_NEXT_LTS_VERSION: v20.9.0 - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - unit_test_weaver_node_sdk_local: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [v18.18.2, v20.9.0] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3.5.2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ matrix.node-version }} - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - name: Build - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - name: Tests - run: npm run test - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - unit_test_iin_agent_local: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [v18.18.2] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v3.5.2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ matrix.node-version }} - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - name: Build - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - name: Build IIN Agent - run: make build-local - working-directory: weaver/core/identity-management/iin-agent - - name: Tests - run: npm run test - working-directory: weaver/core/identity-management/iin-agent - - build_docs: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Use Node.js ${{ env.NODEJS_LTS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_LTS_VERSION }} - - - name: NPM INSTALL - run: npm install - working-directory: weaver/docs - - - name: Build - run: npm run build - working-directory: weaver/docs diff --git a/.github/workflows/test_weaver-pre-release.yaml b/.github/workflows/test_weaver-pre-release.yaml deleted file mode 100644 index 9d2704ac49..0000000000 --- a/.github/workflows/test_weaver-pre-release.yaml +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Pre-release Test Weaver Module versions - -on: - pull_request: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_release: - outputs: - status: ${{ steps.early.outputs.status }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.2 - - - name: Ignore if not a release PR - id: early - run : | - status="skip" - if echo "${{ github.event.pull_request.title }}" | grep -q "chore(release)"; then - status="continue" - fi - echo "status=$status" >> $GITHUB_OUTPUT - - test_weaver_pre-release: - needs: check_release - if: needs.check_release.outputs.status == 'continue' - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Get release verison from PR title - run: | - # Assuming release PR follows pattern: chore(release): publish vA.B.C - # Split PR title by space, and take 3rd word - VERSION=$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 3) - # Strip "v" from version - VERSION=$(echo $VERSION | sed -e 's/^v//') - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo $VERSION - - # Gradle - - name: check weaver/common/protos-java-kt/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/common/protos-java-kt - - - name: check weaver/core/network/corda-interop-app/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/core/network/corda-interop-app - - - name: check weaver/sdks/corda/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/sdks/corda - - - name: check weaver/core/drivers/corda-driver/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/corda-driver - - # NodeJS - - name: check weaver/common/protos-js/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/common/protos-js - - - name: check weaver/sdks/fabric/interoperation-node-sdk/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: check weaver/sdks/besu/node/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/sdks/besu/node - - - name: check weaver/core/drivers/fabric-driver/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/fabric-driver - - - name: check weaver/core/identity-management/iin-agent/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/core/identity-management/iin-agent - - # Rust - - name: check weaver/common/protos-rs/pkg/Cargo.toml - run: cat Cargo.toml | grep "^version" | grep $VERSION || exit 1 - working-directory: weaver/common/protos-rs/pkg - - - name: check weaver/core/relay/Cargo.toml - run: cat Cargo.toml | grep "^version" | grep $VERSION || exit 1 - working-directory: weaver/core/relay - - # Docker - - name: check weaver/core/drivers/corda-driver/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/corda-driver - - - name: check weaver/core/drivers/fabric-driver/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/fabric-driver - - - name: check weaver/core/identity-management/iin-agent/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/identity-management/iin-agent - - - name: check weaver/core/relay/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/relay - - # GO - - name: check weaver/common/protos-go/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/common/protos-go - - - name: check weaver/core/network/fabric-interop-cc/libs/utils/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: check weaver/core/network/fabric-interop-cc/libs/assetexchange/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: check weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: check weaver/core/network/fabric-interop-cc/contracts/interop/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: check weaver/sdks/fabric/go-sdk/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/sdks/fabric/go-sdk - - test_weaver_go_pre-release: - needs: check_release - if: needs.check_release.outputs.status == 'continue' - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Get release verison from PR title - run: | - # Assuming release PR follows pattern: chore(release): publish vA.B.C - # Split PR title by space, and take 3rd word - VERSION=$(echo "${{ github.event.pull_request.title }}" | cut -d ' ' -f 3) - # Strip "v" from version - VERSION=$(echo $VERSION | sed -e 's/^v//') - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo $VERSION - - - name: Update GO Checksum - run: ./go-gen-checksum.sh $VERSION - working-directory: tools - - - name: Check if changes are committed - run: (git status | grep "nothing to commit, working tree clean") || (echo "go-gen-checksum not called before release commit" && exit 1) diff --git a/.github/workflows/test_weaver-relay.yaml b/.github/workflows/test_weaver-relay.yaml deleted file mode 100644 index 282dec4f01..0000000000 --- a/.github/workflows/test_weaver-relay.yaml +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Unit Test Relay - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - unit_test_relay_local: - # if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build Protos RS - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-rs - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay - - unit_test_relay_tls_local: - # if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build Protos RS - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-rs - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client-tls 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay - - unit_test_relay: - if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make build - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay - - unit_test_relay_tls: - if: ${{ false }} - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make build - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client-tls 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay diff --git a/.github/workflows/weaver_deploy_corda-pkgs.yml b/.github/workflows/weaver_deploy_corda-pkgs.yml deleted file mode 100644 index f37519b66b..0000000000 --- a/.github/workflows/weaver_deploy_corda-pkgs.yml +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Corda Packages - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-java-kt: - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/common/protos-java-kt - - - name: Publish - run: | - make publish > out 2> error - exitStatus=$? - cat out - cat error - (cat error | grep "Received status code 409 from server: Conflict" && exit 0) || exit $exitStatus - working-directory: weaver/common/protos-java-kt - - - publish-interop-app: - if: always() - needs: publish-protos-java-kt - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/core/network/corda-interop-app - - - name: Build - run: make build - working-directory: weaver/core/network/corda-interop-app - - - name: Publish - run: | - make publish > out 2> error - exitStatus=$? - cat out - cat error - (cat error | grep "Received status code 409 from server: Conflict" && exit 0) || exit $exitStatus - working-directory: weaver/core/network/corda-interop-app - - publish-sdk: - if: always() - needs: [publish-protos-java-kt, publish-interop-app] - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up JDK 8 - uses: actions/setup-java@v3.11.0 - with: - java-version: '8' - distribution: 'adopt' - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/sdks/corda - - - name: Build - run: make build - working-directory: weaver/sdks/corda - - - name: Publish - run: | - make publish > out 2> error - exitStatus=$? - cat out - cat error - (cat error | grep "Received status code 409 from server: Conflict" && exit 0) || exit $exitStatus - working-directory: weaver/sdks/corda - - publish-driver-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-java-kt, publish-interop-app, publish-sdk] - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/core/drivers/corda-driver - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "CORDA_DRIVER_PUSH=true" >> $GITHUB_ENV) || echo "CORDA_DRIVER_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/drivers/corda-driver - - - name: Build and Push - if: ${{ env.CORDA_DRIVER_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/drivers/corda-driver - - - name: Push latest tag - if: ${{ env.CORDA_DRIVER_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/drivers/corda-driver diff --git a/.github/workflows/weaver_deploy_go-pkgs.yml b/.github/workflows/weaver_deploy_go-pkgs.yml deleted file mode 100644 index c58630d9c1..0000000000 --- a/.github/workflows/weaver_deploy_go-pkgs.yml +++ /dev/null @@ -1,429 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Go Modules - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-go: - if: github.repository_owner == 'hyperledger' - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/common/protos-go" >> $GITHUB_ENV - echo "MODULE_DESC=GO Weaver Protos" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/common/protos-go - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/common/protos-go - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "PROTOS_GO_RELEASE=false" >> $GITHUB_ENV) || echo "PROTOS_GO_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/common/protos-go - - - name: Create Release - if: ${{ env.PROTOS_GO_RELEASE == 'true' }} - id: protos-go-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.PROTOS_GO_RELEASE == 'true' }} - run: sleep 300 - - publish-lib-utils: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: publish-protos-go - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Utils Library for Interoperation" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Build test - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "LIB_UTILS_RELEASE=false" >> $GITHUB_ENV) || echo "LIB_UTILS_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Create Release - if: ${{ env.LIB_UTILS_RELEASE == 'true' }} - id: lib-utils-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.LIB_UTILS_RELEASE == 'true' }} - run: sleep 300 - - publish-lib-asset-exchange: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: publish-protos-go - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Library for Asset Exchange" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Build test - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "LIB_ASSET_EXCHANGE_RELEASE=false" >> $GITHUB_ENV) || echo "LIB_ASSET_EXCHANGE_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Create Release - if: ${{ env.LIB_ASSET_EXCHANGE_RELEASE == 'true' }} - id: lib-asset-exchange-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.LIB_ASSET_EXCHANGE_RELEASE == 'true' }} - run: sleep 300 - - publish-interface-asset-mgmt: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go] - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Asset Management Interface" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Build test - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "INTERFACE_ASSET_MGMT_RELEASE=false" >> $GITHUB_ENV) || echo "INTERFACE_ASSET_MGMT_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Create Release - if: ${{ env.INTERFACE_ASSET_MGMT_RELEASE == 'true' }} - id: asset-mgmt-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.INTERFACE_ASSET_MGMT_RELEASE == 'true' }} - run: sleep 300 - - publish-interop-cc: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go, publish-lib-utils, publish-lib-asset-exchange] - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Interop Chaincode" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Build test - run: make build - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "INTEROPCC_RELEASE=false" >> $GITHUB_ENV) || echo "INTEROPCC_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Create Release - if: ${{ env.INTEROPCC_RELEASE == 'true' }} - id: interop-cc-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.INTEROPCC_RELEASE == 'true' }} - run: sleep 300 - - publish-go-sdk: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go] - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/sdks/fabric/go-sdk" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Weaver SDK" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/sdks/fabric/go-sdk - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/sdks/fabric/go-sdk - - - name: Build test - run: go build -v ./... - working-directory: weaver/sdks/fabric/go-sdk - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "WEAVER_FABRIC_GO_SDK=false" >> $GITHUB_ENV) || echo "WEAVER_FABRIC_GO_SDK=true" >> $GITHUB_ENV - working-directory: weaver/sdks/fabric/go-sdk - - - name: Create Release - if: ${{ env.WEAVER_FABRIC_GO_SDK == 'true' }} - id: go-sdk-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.WEAVER_FABRIC_GO_SDK == 'true' }} - run: sleep 300 - - publish-weaver-fabric-cc-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go, publish-lib-utils, publish-lib-asset-exchange] - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "WEAVER_FABRIC_CC_PUSH=true" >> $GITHUB_ENV) || echo "WEAVER_FABRIC_CC_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc - - - name: Build and Push - if: ${{ env.WEAVER_FABRIC_CC_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/network/fabric-interop-cc - - - name: Push latest tag - if: ${{ env.WEAVER_FABRIC_CC_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/network/fabric-interop-cc diff --git a/.github/workflows/weaver_deploy_node-pkgs.yml b/.github/workflows/weaver_deploy_node-pkgs.yml deleted file mode 100644 index ed99a7713d..0000000000 --- a/.github/workflows/weaver_deploy_node-pkgs.yml +++ /dev/null @@ -1,240 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Node JS Packages - -env: - NODEJS_VERSION: v18.18.2 - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-js: - if: github.repository_owner == 'hyperledger' - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/common/protos-js - - - name: Build - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Check if package already exists - run : | - PKG_NAME=$(node -p "require('./package.json').name") - PUBLISHED_VERSION=$(npm view $PKG_NAME version) - LOCAL_VERSION=$(node -p "require('./package.json').version") - if [[ "$PUBLISHED_VERSION" == "$LOCAL_VERSION" ]]; then - echo "PROTOS_JS_PUBLISH=false" >> $GITHUB_ENV - else - echo "PROTOS_JS_PUBLISH=true" >> $GITHUB_ENV - fi - working-directory: weaver/common/protos-js - - - name: Publish - if: ${{ env.PROTOS_JS_PUBLISH == 'true' }} - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make publish - working-directory: weaver/common/protos-js - - publish-fabric-sdk: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js] - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build - run: make build - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Check if package already exists - run : | - PKG_NAME=$(node -p "require('./package.json').name") - PUBLISHED_VERSION=$(npm view $PKG_NAME version) - LOCAL_VERSION=$(node -p "require('./package.json').version") - if [[ "$PUBLISHED_VERSION" == "$LOCAL_VERSION" ]]; then - echo "WEAVER_FABRIC_SDK_PUBLISH=false" >> $GITHUB_ENV - else - echo "WEAVER_FABRIC_SDK_PUBLISH=true" >> $GITHUB_ENV - fi - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Publish - if: ${{ env.WEAVER_FABRIC_SDK_PUBLISH == 'true' }} - run: make publish - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - publish-besu-sdk: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js] - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v3.6.0 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/sdks/besu/node - - - name: Build - run: make build - working-directory: weaver/sdks/besu/node - - - name: Check if package already exists - run : | - PKG_NAME=$(node -p "require('./package.json').name") - PUBLISHED_VERSION=$(npm view $PKG_NAME version) - LOCAL_VERSION=$(node -p "require('./package.json').version") - if [[ "$PUBLISHED_VERSION" == "$LOCAL_VERSION" ]]; then - echo "WEAVER_BESU_SDK_PUBLISH=false" >> $GITHUB_ENV - else - echo "WEAVER_BESU_SDK_PUBLISH=true" >> $GITHUB_ENV - fi - working-directory: weaver/sdks/besu/node - - - name: Publish - if: ${{ env.WEAVER_BESU_SDK_PUBLISH == 'true' }} - run: make publish - working-directory: weaver/sdks/besu/node - - publish-driver-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js, publish-fabric-sdk] - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/core/drivers/fabric-driver - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "FABRIC_DRIVER_PUSH=true" >> $GITHUB_ENV) || echo "FABRIC_DRIVER_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/drivers/fabric-driver - - - name: Build and Push - if: ${{ env.FABRIC_DRIVER_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/drivers/fabric-driver - - - name: Push latest tag - if: ${{ env.FABRIC_DRIVER_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/drivers/fabric-driver - - publish-iin-agent-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js, publish-fabric-sdk] - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/core/identity-management/iin-agent - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "IINAGENT_PUSH=true" >> $GITHUB_ENV) || echo "IINAGENT_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/identity-management/iin-agent - - - name: Build and Push - if: ${{ env.IINAGENT_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/identity-management/iin-agent - - - name: Push latest tag - if: ${{ env.IINAGENT_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/identity-management/iin-agent diff --git a/.github/workflows/weaver_deploy_relay-server.yml b/.github/workflows/weaver_deploy_relay-server.yml deleted file mode 100644 index a1ec4ed5da..0000000000 --- a/.github/workflows/weaver_deploy_relay-server.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Relay Docker Image - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-rs: - if: github.repository_owner == 'hyperledger' - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Publish - run: cargo publish --token ${CRATES_TOKEN} - env: - CRATES_TOKEN: ${{ secrets.CARGO_CRATES_IO_TOKEN }} - working-directory: weaver/common/protos-rs/pkg - - publish-relay-image: - if: github.repository_owner == 'hyperledger' - needs: publish-protos-rs - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.5.2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/relay - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "RELAY_PUSH=true" >> $GITHUB_ENV) || echo "RELAY_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/relay - - - name: Build and Push - if: ${{ env.RELAY_PUSH == 'true' }} - run: make push-server - working-directory: weaver/core/relay - - - name: Push latest tag - if: ${{ env.RELAY_PUSH == 'true' }} - run: (cat out | grep "exists") || make push-server-latest - working-directory: weaver/core/relay \ No newline at end of file diff --git a/.taprc b/.taprc index 3751a16fd3..a2d23fa7f9 100644 --- a/.taprc +++ b/.taprc @@ -47,7 +47,6 @@ files: - ./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/plugin-keychain-google-sm.test.ts - ./packages/cactus-test-plugin-consortium-manual/src/test/typescript/integration/plugin-consortium-manual/openapi/openapi-validation.test.ts - ./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-cactus.test.ts - - ./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts - ./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-block.test.ts - ./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/deploy-contract-from-json.test.ts - ./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-balance.test.ts diff --git a/docs/docs/weaver/getting-started/test-network/ledger-initialization.md b/docs/docs/weaver/getting-started/test-network/ledger-initialization.md index f6c6fd3b3e..b2bdc78d28 100644 --- a/docs/docs/weaver/getting-started/test-network/ledger-initialization.md +++ b/docs/docs/weaver/getting-started/test-network/ledger-initialization.md @@ -69,6 +69,7 @@ Prepare `fabric-cli` for configuration suitably as follows. ```bash ./bin/fabric-cli env set-file ./.env ``` + | Notes | |:------| | If the `CONFIG_PATH` environment variable is omitted from `.env`, then you must also run:
```./bin/fabric-cli config set-file ./config.json``` | @@ -166,6 +167,7 @@ Prepare `fabric-cli` for configuration suitably as follows. ```bash ./bin/fabric-cli env set-file ./.env ``` + | Notes | |:------| | If the `CONFIG_PATH` environment variable is omitted from `.env`, then you must also run:
```./bin/fabric-cli config set-file ./config.json``` | @@ -283,6 +285,7 @@ Prepare `fabric-cli` for configuration suitably as follows. ``` ./bin/fabric-cli env set-file ./.env ``` + | Notes | |:------| | If the `CONFIG_PATH` environment variable is omitted from `.env`, then you must also run:
```./bin/fabric-cli config set-file ./config.json``` | diff --git a/docs/docs/weaver/getting-started/test-network/setup-local-docker.md b/docs/docs/weaver/getting-started/test-network/setup-local-docker.md index 72e5e6b88f..c0475d4a8d 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-local-docker.md +++ b/docs/docs/weaver/getting-started/test-network/setup-local-docker.md @@ -49,6 +49,7 @@ Before starting, make sure you have the following software installed on your hos go install google.golang.org/protobuf/cmd/protoc-gen-go go install google.golang.org/grpc/cmd/protoc-gen-go-grpc ``` + | Notes | |:------| | The latest version at present is `3.15.6`, but you should check the above link to find the most current version before running the above steps. | @@ -273,6 +274,7 @@ make build-image-local #### Deployment Use the following steps to run Fabric IIN Agents in Docker containers: + * The `.env.n1.org1` and `.env.n1.org1.tls` files in the `docker-testnet/envs` directory contain environment variables used by the iin-agent of `org1` of `network1` at startup and runtime. Edit either of these files (depending on whether you wish to start the relay with or without TLS) as follows: - Replace `` with the absolute path of the `weaver` folder within your Cacti repository clone. - Update the following value: @@ -439,7 +441,7 @@ Navigate to the `weaver/core/relay` folder. Refer [here](#building-relay-image) ``` * The `.env.corda` and `.env.corda.tls` files in the `docker/testnet-envs` directory contain environment variables used by the `Corda_Network` relay at startup and runtime. Edit either of these files (depending on whether you wish to start the relay with or without TLS), and update the following value: ``` - DOCKER_IMAGE_NAME=weaver-relay-server + DOCKER_IMAGE_NAME=cacti-weaver-relay-server ``` * Repeat the above step for `.env.corda2` or `.env.corda2.tls` in `docker/testnet-envs` directory, which contain environment variables for the `Corda_Network2` relay. * To deploy the relay server for `Corda_Network` without TLS, run: diff --git a/docs/docs/weaver/getting-started/test-network/setup-local.md b/docs/docs/weaver/getting-started/test-network/setup-local.md index 90cdd46b72..820c724313 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-local.md +++ b/docs/docs/weaver/getting-started/test-network/setup-local.md @@ -51,6 +51,7 @@ Before starting, make sure you have the following software installed on your hos go install google.golang.org/protobuf/cmd/protoc-gen-go go install google.golang.org/grpc/cmd/protoc-gen-go-grpc ``` + | Notes | |:------| | The latest version at present is `3.15.6`, but you should check the above link to find the most current version before running the above steps. | diff --git a/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md b/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md index e7a8bb955f..ecc1dab777 100644 --- a/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md +++ b/docs/docs/weaver/getting-started/test-network/setup-packages-docker.md @@ -172,6 +172,7 @@ IIN Agent is a client of a member of a DLT network or security domain with speci #### Deployment Use the following steps to run Fabric IIN Agents in Docker containers: + * The `.env.n1.org1` and `.env.n1.org1.tls` files in the `docker-testnet/envs` directory contain environment variables used by the iin-agent of `org1` of `network1` at startup and runtime. Edit either of these files (depending on whether you wish to start the relay with or without TLS) as follows: - Replace `` with the absolute path of the `weaver` folder within your Cacti repository clone. - If Fabric network was started with 1 org, and IIN Agents are to be started with TLS enabled, update the `DNS_CONFIG_PATH` variable as: diff --git a/examples/cactus-example-cbdc-bridging-backend/src/main/typescript/odap-extension/client-helper.ts b/examples/cactus-example-cbdc-bridging-backend/src/main/typescript/odap-extension/client-helper.ts index 2377840009..62430f33f2 100644 --- a/examples/cactus-example-cbdc-bridging-backend/src/main/typescript/odap-extension/client-helper.ts +++ b/examples/cactus-example-cbdc-bridging-backend/src/main/typescript/odap-extension/client-helper.ts @@ -2,7 +2,7 @@ import { SHA256 } from "crypto-js"; import { PluginOdapGateway, TransferInitializationV1Request, - ClientGatewayHelper + ClientGatewayHelper, } from "@hyperledger/cactus-plugin-odap-hermes"; import { OdapMessageType } from "@hyperledger/cactus-plugin-odap-hermes"; import { FabricOdapGateway } from "./fabric-odap-gateway"; diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/package.json b/extensions/cactus-plugin-htlc-coordinator-besu/package.json index 8613080dfb..3febe71ea2 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/package.json +++ b/extensions/cactus-plugin-htlc-coordinator-besu/package.json @@ -46,7 +46,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "run-p generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected", + "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/", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev webpack:prod", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.gitignore b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..fbff67d6e2 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,21 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..2a172aae2e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-htlc-coordinator-besu + +Can exchange assets between networks + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-htlc-coordinator-besu "github.com/hyperledger/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**CounterpartyHtlcV1**](docs/DefaultApi.md#counterpartyhtlcv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc | Create an instance to interact with the counterparty HTLC +*DefaultApi* | [**OwnHtlcV1**](docs/DefaultApi.md#ownhtlcv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc | Create an instance to interact with the own HTLC. +*DefaultApi* | [**WithdrawCounterpartyV1**](docs/DefaultApi.md#withdrawcounterpartyv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty | Withdraw funds of the counterparty HTLC + + +## Documentation For Models + + - [CounterpartyHTLCRequest](docs/CounterpartyHTLCRequest.md) + - [HtlcPackage](docs/HtlcPackage.md) + - [OwnHTLCRequest](docs/OwnHTLCRequest.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [WithdrawCounterpartyRequest](docs/WithdrawCounterpartyRequest.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..25cd95f468 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,335 @@ +openapi: 3.0.3 +info: + description: Can exchange assets between networks + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC Coordinator + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc: + post: + operationId: ownHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OwnHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the own HTLC. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty +components: + schemas: + OwnHTLCRequest: + example: + htlcPackage: null + receiver: receiver + connectorInstanceId: connectorInstanceId + constructorArgs: + - "" + - "" + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + hashLock: hashLock + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: 5.962133916683182 + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output addreess to receive the tokens + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - constructorArgs + - expiration + - hashLock + - htlcPackage + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + CounterpartyHTLCRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + htlcId: + description: Id for the HTLC + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - web3SigningCredential + type: object + WithdrawCounterpartyRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + contractId: contractId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + secret: secret + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + contractId: + description: contractId for the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + htlcId: + description: Id for the HTLC + nullable: false + type: string + secret: + description: Counterparty HTLC secret + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - secret + - web3SigningCredential + type: object + HtlcPackage: + enum: + - BESU + - BESU_ERC20 + type: string + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..2a878130df --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,338 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiCounterpartyHtlcV1Request struct { + ctx context.Context + ApiService *DefaultApiService + counterpartyHTLCRequest *CounterpartyHTLCRequest +} + +func (r ApiCounterpartyHtlcV1Request) CounterpartyHTLCRequest(counterpartyHTLCRequest CounterpartyHTLCRequest) ApiCounterpartyHtlcV1Request { + r.counterpartyHTLCRequest = &counterpartyHTLCRequest + return r +} + +func (r ApiCounterpartyHtlcV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.CounterpartyHtlcV1Execute(r) +} + +/* +CounterpartyHtlcV1 Create an instance to interact with the counterparty HTLC + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCounterpartyHtlcV1Request +*/ +func (a *DefaultApiService) CounterpartyHtlcV1(ctx context.Context) ApiCounterpartyHtlcV1Request { + return ApiCounterpartyHtlcV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) CounterpartyHtlcV1Execute(r ApiCounterpartyHtlcV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CounterpartyHtlcV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.counterpartyHTLCRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOwnHtlcV1Request struct { + ctx context.Context + ApiService *DefaultApiService + ownHTLCRequest *OwnHTLCRequest +} + +func (r ApiOwnHtlcV1Request) OwnHTLCRequest(ownHTLCRequest OwnHTLCRequest) ApiOwnHtlcV1Request { + r.ownHTLCRequest = &ownHTLCRequest + return r +} + +func (r ApiOwnHtlcV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.OwnHtlcV1Execute(r) +} + +/* +OwnHtlcV1 Create an instance to interact with the own HTLC. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOwnHtlcV1Request +*/ +func (a *DefaultApiService) OwnHtlcV1(ctx context.Context) ApiOwnHtlcV1Request { + return ApiOwnHtlcV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) OwnHtlcV1Execute(r ApiOwnHtlcV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.OwnHtlcV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.ownHTLCRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWithdrawCounterpartyV1Request struct { + ctx context.Context + ApiService *DefaultApiService + withdrawCounterpartyRequest *WithdrawCounterpartyRequest +} + +func (r ApiWithdrawCounterpartyV1Request) WithdrawCounterpartyRequest(withdrawCounterpartyRequest WithdrawCounterpartyRequest) ApiWithdrawCounterpartyV1Request { + r.withdrawCounterpartyRequest = &withdrawCounterpartyRequest + return r +} + +func (r ApiWithdrawCounterpartyV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.WithdrawCounterpartyV1Execute(r) +} + +/* +WithdrawCounterpartyV1 Withdraw funds of the counterparty HTLC + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWithdrawCounterpartyV1Request +*/ +func (a *DefaultApiService) WithdrawCounterpartyV1(ctx context.Context) ApiWithdrawCounterpartyV1Request { + return ApiWithdrawCounterpartyV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) WithdrawCounterpartyV1Execute(r ApiWithdrawCounterpartyV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.WithdrawCounterpartyV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.withdrawCounterpartyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..ea9ac1e7db --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - HTLC Coordinator API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..c6a42a4a00 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,231 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://www.cactus.stream/{basePath}", + Description: "Public test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + { + URL: "http://localhost:4000/{basePath}", + Description: "Local test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/git_push.sh b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..e5895164cb --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..23a18c809d --- /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 0000000000..c966c8ddfd --- /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 0000000000..67fae80c12 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_counterparty_htlc_request.go @@ -0,0 +1,264 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the CounterpartyHTLCRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CounterpartyHTLCRequest{} + +// CounterpartyHTLCRequest struct for CounterpartyHTLCRequest +type CounterpartyHTLCRequest struct { + HtlcPackage HtlcPackage `json:"htlcPackage"` + // connector Instance Id for the connector plugin + ConnectorInstanceId string `json:"connectorInstanceId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + // Id for the HTLC + HtlcId string `json:"htlcId"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewCounterpartyHTLCRequest instantiates a new CounterpartyHTLCRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCounterpartyHTLCRequest(htlcPackage HtlcPackage, connectorInstanceId string, keychainId string, htlcId string, web3SigningCredential Web3SigningCredential) *CounterpartyHTLCRequest { + this := CounterpartyHTLCRequest{} + this.HtlcPackage = htlcPackage + this.ConnectorInstanceId = connectorInstanceId + this.KeychainId = keychainId + this.HtlcId = htlcId + this.Web3SigningCredential = web3SigningCredential + return &this +} + +// NewCounterpartyHTLCRequestWithDefaults instantiates a new CounterpartyHTLCRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCounterpartyHTLCRequestWithDefaults() *CounterpartyHTLCRequest { + this := CounterpartyHTLCRequest{} + return &this +} + +// GetHtlcPackage returns the HtlcPackage field value +func (o *CounterpartyHTLCRequest) GetHtlcPackage() HtlcPackage { + if o == nil { + var ret HtlcPackage + return ret + } + + return o.HtlcPackage +} + +// GetHtlcPackageOk returns a tuple with the HtlcPackage field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetHtlcPackageOk() (*HtlcPackage, bool) { + if o == nil { + return nil, false + } + return &o.HtlcPackage, true +} + +// SetHtlcPackage sets field value +func (o *CounterpartyHTLCRequest) SetHtlcPackage(v HtlcPackage) { + o.HtlcPackage = v +} + +// GetConnectorInstanceId returns the ConnectorInstanceId field value +func (o *CounterpartyHTLCRequest) GetConnectorInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorInstanceId +} + +// GetConnectorInstanceIdOk returns a tuple with the ConnectorInstanceId field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetConnectorInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorInstanceId, true +} + +// SetConnectorInstanceId sets field value +func (o *CounterpartyHTLCRequest) SetConnectorInstanceId(v string) { + o.ConnectorInstanceId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *CounterpartyHTLCRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *CounterpartyHTLCRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetHtlcId returns the HtlcId field value +func (o *CounterpartyHTLCRequest) GetHtlcId() string { + if o == nil { + var ret string + return ret + } + + return o.HtlcId +} + +// GetHtlcIdOk returns a tuple with the HtlcId field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetHtlcIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HtlcId, true +} + +// SetHtlcId sets field value +func (o *CounterpartyHTLCRequest) SetHtlcId(v string) { + o.HtlcId = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *CounterpartyHTLCRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *CounterpartyHTLCRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *CounterpartyHTLCRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *CounterpartyHTLCRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *CounterpartyHTLCRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o CounterpartyHTLCRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CounterpartyHTLCRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["htlcPackage"] = o.HtlcPackage + toSerialize["connectorInstanceId"] = o.ConnectorInstanceId + toSerialize["keychainId"] = o.KeychainId + toSerialize["htlcId"] = o.HtlcId + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableCounterpartyHTLCRequest struct { + value *CounterpartyHTLCRequest + isSet bool +} + +func (v NullableCounterpartyHTLCRequest) Get() *CounterpartyHTLCRequest { + return v.value +} + +func (v *NullableCounterpartyHTLCRequest) Set(val *CounterpartyHTLCRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCounterpartyHTLCRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterpartyHTLCRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterpartyHTLCRequest(val *CounterpartyHTLCRequest) *NullableCounterpartyHTLCRequest { + return &NullableCounterpartyHTLCRequest{value: val, isSet: true} +} + +func (v NullableCounterpartyHTLCRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterpartyHTLCRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go new file mode 100644 index 0000000000..adeccb4cda --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "fmt" +) + +// HtlcPackage the model 'HtlcPackage' +type HtlcPackage string + +// List of HtlcPackage +const ( + BESU HtlcPackage = "BESU" + BESU_ERC20 HtlcPackage = "BESU_ERC20" +) + +// All allowed values of HtlcPackage enum +var AllowedHtlcPackageEnumValues = []HtlcPackage{ + "BESU", + "BESU_ERC20", +} + +func (v *HtlcPackage) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HtlcPackage(value) + for _, existing := range AllowedHtlcPackageEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HtlcPackage", value) +} + +// NewHtlcPackageFromValue returns a pointer to a valid HtlcPackage +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHtlcPackageFromValue(v string) (*HtlcPackage, error) { + ev := HtlcPackage(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HtlcPackage: valid values are %v", v, AllowedHtlcPackageEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HtlcPackage) IsValid() bool { + for _, existing := range AllowedHtlcPackageEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HtlcPackage value +func (v HtlcPackage) Ptr() *HtlcPackage { + return &v +} + +type NullableHtlcPackage struct { + value *HtlcPackage + isSet bool +} + +func (v NullableHtlcPackage) Get() *HtlcPackage { + return v.value +} + +func (v *NullableHtlcPackage) Set(val *HtlcPackage) { + v.value = val + v.isSet = true +} + +func (v NullableHtlcPackage) IsSet() bool { + return v.isSet +} + +func (v *NullableHtlcPackage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHtlcPackage(val *HtlcPackage) *NullableHtlcPackage { + return &NullableHtlcPackage{value: val, isSet: true} +} + +func (v NullableHtlcPackage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHtlcPackage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go new file mode 100644 index 0000000000..d38473839d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go @@ -0,0 +1,487 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the OwnHTLCRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OwnHTLCRequest{} + +// OwnHTLCRequest struct for OwnHTLCRequest +type OwnHTLCRequest struct { + HtlcPackage HtlcPackage `json:"htlcPackage"` + // connector Instance Id for the connector plugin + ConnectorInstanceId string `json:"connectorInstanceId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // Input amount to lock + InputAmount float32 `json:"inputAmount"` + // Output amount to lock + OutputAmount float32 `json:"outputAmount"` + // Timestamp to expire the contract + Expiration float32 `json:"expiration"` + // Hashlock needed to refund the amount + HashLock string `json:"hashLock"` + // The token address + TokenAddress string `json:"tokenAddress"` + // The receiver address + Receiver string `json:"receiver"` + // The output network id + OutputNetwork string `json:"outputNetwork"` + // The output addreess to receive the tokens + OutputAddress string `json:"outputAddress"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewOwnHTLCRequest instantiates a new OwnHTLCRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOwnHTLCRequest(htlcPackage HtlcPackage, connectorInstanceId string, keychainId string, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential, inputAmount float32, outputAmount float32, expiration float32, hashLock string, tokenAddress string, receiver string, outputNetwork string, outputAddress string) *OwnHTLCRequest { + this := OwnHTLCRequest{} + this.HtlcPackage = htlcPackage + this.ConnectorInstanceId = connectorInstanceId + this.KeychainId = keychainId + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + this.InputAmount = inputAmount + this.OutputAmount = outputAmount + this.Expiration = expiration + this.HashLock = hashLock + this.TokenAddress = tokenAddress + this.Receiver = receiver + this.OutputNetwork = outputNetwork + this.OutputAddress = outputAddress + return &this +} + +// NewOwnHTLCRequestWithDefaults instantiates a new OwnHTLCRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOwnHTLCRequestWithDefaults() *OwnHTLCRequest { + this := OwnHTLCRequest{} + return &this +} + +// GetHtlcPackage returns the HtlcPackage field value +func (o *OwnHTLCRequest) GetHtlcPackage() HtlcPackage { + if o == nil { + var ret HtlcPackage + return ret + } + + return o.HtlcPackage +} + +// GetHtlcPackageOk returns a tuple with the HtlcPackage field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetHtlcPackageOk() (*HtlcPackage, bool) { + if o == nil { + return nil, false + } + return &o.HtlcPackage, true +} + +// SetHtlcPackage sets field value +func (o *OwnHTLCRequest) SetHtlcPackage(v HtlcPackage) { + o.HtlcPackage = v +} + +// GetConnectorInstanceId returns the ConnectorInstanceId field value +func (o *OwnHTLCRequest) GetConnectorInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorInstanceId +} + +// GetConnectorInstanceIdOk returns a tuple with the ConnectorInstanceId field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetConnectorInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorInstanceId, true +} + +// SetConnectorInstanceId sets field value +func (o *OwnHTLCRequest) SetConnectorInstanceId(v string) { + o.ConnectorInstanceId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *OwnHTLCRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *OwnHTLCRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *OwnHTLCRequest) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *OwnHTLCRequest) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *OwnHTLCRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *OwnHTLCRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInputAmount returns the InputAmount field value +func (o *OwnHTLCRequest) GetInputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.InputAmount +} + +// GetInputAmountOk returns a tuple with the InputAmount field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetInputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.InputAmount, true +} + +// SetInputAmount sets field value +func (o *OwnHTLCRequest) SetInputAmount(v float32) { + o.InputAmount = v +} + +// GetOutputAmount returns the OutputAmount field value +func (o *OwnHTLCRequest) GetOutputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.OutputAmount +} + +// GetOutputAmountOk returns a tuple with the OutputAmount field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetOutputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.OutputAmount, true +} + +// SetOutputAmount sets field value +func (o *OwnHTLCRequest) SetOutputAmount(v float32) { + o.OutputAmount = v +} + +// GetExpiration returns the Expiration field value +func (o *OwnHTLCRequest) GetExpiration() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Expiration, true +} + +// SetExpiration sets field value +func (o *OwnHTLCRequest) SetExpiration(v float32) { + o.Expiration = v +} + +// GetHashLock returns the HashLock field value +func (o *OwnHTLCRequest) GetHashLock() string { + if o == nil { + var ret string + return ret + } + + return o.HashLock +} + +// GetHashLockOk returns a tuple with the HashLock field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetHashLockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLock, true +} + +// SetHashLock sets field value +func (o *OwnHTLCRequest) SetHashLock(v string) { + o.HashLock = v +} + +// GetTokenAddress returns the TokenAddress field value +func (o *OwnHTLCRequest) GetTokenAddress() string { + if o == nil { + var ret string + return ret + } + + return o.TokenAddress +} + +// GetTokenAddressOk returns a tuple with the TokenAddress field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetTokenAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenAddress, true +} + +// SetTokenAddress sets field value +func (o *OwnHTLCRequest) SetTokenAddress(v string) { + o.TokenAddress = v +} + +// GetReceiver returns the Receiver field value +func (o *OwnHTLCRequest) GetReceiver() string { + if o == nil { + var ret string + return ret + } + + return o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetReceiverOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Receiver, true +} + +// SetReceiver sets field value +func (o *OwnHTLCRequest) SetReceiver(v string) { + o.Receiver = v +} + +// GetOutputNetwork returns the OutputNetwork field value +func (o *OwnHTLCRequest) GetOutputNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.OutputNetwork +} + +// GetOutputNetworkOk returns a tuple with the OutputNetwork field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetOutputNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputNetwork, true +} + +// SetOutputNetwork sets field value +func (o *OwnHTLCRequest) SetOutputNetwork(v string) { + o.OutputNetwork = v +} + +// GetOutputAddress returns the OutputAddress field value +func (o *OwnHTLCRequest) GetOutputAddress() string { + if o == nil { + var ret string + return ret + } + + return o.OutputAddress +} + +// GetOutputAddressOk returns a tuple with the OutputAddress field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetOutputAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputAddress, true +} + +// SetOutputAddress sets field value +func (o *OwnHTLCRequest) SetOutputAddress(v string) { + o.OutputAddress = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *OwnHTLCRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *OwnHTLCRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *OwnHTLCRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o OwnHTLCRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OwnHTLCRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["htlcPackage"] = o.HtlcPackage + toSerialize["connectorInstanceId"] = o.ConnectorInstanceId + toSerialize["keychainId"] = o.KeychainId + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["inputAmount"] = o.InputAmount + toSerialize["outputAmount"] = o.OutputAmount + toSerialize["expiration"] = o.Expiration + toSerialize["hashLock"] = o.HashLock + toSerialize["tokenAddress"] = o.TokenAddress + toSerialize["receiver"] = o.Receiver + toSerialize["outputNetwork"] = o.OutputNetwork + toSerialize["outputAddress"] = o.OutputAddress + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableOwnHTLCRequest struct { + value *OwnHTLCRequest + isSet bool +} + +func (v NullableOwnHTLCRequest) Get() *OwnHTLCRequest { + return v.value +} + +func (v *NullableOwnHTLCRequest) Set(val *OwnHTLCRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOwnHTLCRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOwnHTLCRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOwnHTLCRequest(val *OwnHTLCRequest) *NullableOwnHTLCRequest { + return &NullableOwnHTLCRequest{value: val, isSet: true} +} + +func (v NullableOwnHTLCRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOwnHTLCRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..ca4bf4dcc5 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..4f0c40bc45 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..36be4c123d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..f8b78c4525 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..e8e29b5747 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go new file mode 100644 index 0000000000..f9d2785286 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go @@ -0,0 +1,329 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the WithdrawCounterpartyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WithdrawCounterpartyRequest{} + +// WithdrawCounterpartyRequest struct for WithdrawCounterpartyRequest +type WithdrawCounterpartyRequest struct { + HtlcPackage HtlcPackage `json:"htlcPackage"` + // connector Instance Id for the connector plugin + ConnectorInstanceId string `json:"connectorInstanceId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + // contractId for the contract + ContractId *string `json:"contractId,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // Id for the HTLC + HtlcId string `json:"htlcId"` + // Counterparty HTLC secret + Secret string `json:"secret"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewWithdrawCounterpartyRequest instantiates a new WithdrawCounterpartyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWithdrawCounterpartyRequest(htlcPackage HtlcPackage, connectorInstanceId string, keychainId string, web3SigningCredential Web3SigningCredential, htlcId string, secret string) *WithdrawCounterpartyRequest { + this := WithdrawCounterpartyRequest{} + this.HtlcPackage = htlcPackage + this.ConnectorInstanceId = connectorInstanceId + this.KeychainId = keychainId + this.Web3SigningCredential = web3SigningCredential + this.HtlcId = htlcId + this.Secret = secret + return &this +} + +// NewWithdrawCounterpartyRequestWithDefaults instantiates a new WithdrawCounterpartyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWithdrawCounterpartyRequestWithDefaults() *WithdrawCounterpartyRequest { + this := WithdrawCounterpartyRequest{} + return &this +} + +// GetHtlcPackage returns the HtlcPackage field value +func (o *WithdrawCounterpartyRequest) GetHtlcPackage() HtlcPackage { + if o == nil { + var ret HtlcPackage + return ret + } + + return o.HtlcPackage +} + +// GetHtlcPackageOk returns a tuple with the HtlcPackage field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetHtlcPackageOk() (*HtlcPackage, bool) { + if o == nil { + return nil, false + } + return &o.HtlcPackage, true +} + +// SetHtlcPackage sets field value +func (o *WithdrawCounterpartyRequest) SetHtlcPackage(v HtlcPackage) { + o.HtlcPackage = v +} + +// GetConnectorInstanceId returns the ConnectorInstanceId field value +func (o *WithdrawCounterpartyRequest) GetConnectorInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorInstanceId +} + +// GetConnectorInstanceIdOk returns a tuple with the ConnectorInstanceId field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetConnectorInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorInstanceId, true +} + +// SetConnectorInstanceId sets field value +func (o *WithdrawCounterpartyRequest) SetConnectorInstanceId(v string) { + o.ConnectorInstanceId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *WithdrawCounterpartyRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *WithdrawCounterpartyRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetContractId returns the ContractId field value if set, zero value otherwise. +func (o *WithdrawCounterpartyRequest) GetContractId() string { + if o == nil || IsNil(o.ContractId) { + var ret string + return ret + } + return *o.ContractId +} + +// GetContractIdOk returns a tuple with the ContractId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetContractIdOk() (*string, bool) { + if o == nil || IsNil(o.ContractId) { + return nil, false + } + return o.ContractId, true +} + +// HasContractId returns a boolean if a field has been set. +func (o *WithdrawCounterpartyRequest) HasContractId() bool { + if o != nil && !IsNil(o.ContractId) { + return true + } + + return false +} + +// SetContractId gets a reference to the given string and assigns it to the ContractId field. +func (o *WithdrawCounterpartyRequest) SetContractId(v string) { + o.ContractId = &v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *WithdrawCounterpartyRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *WithdrawCounterpartyRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetHtlcId returns the HtlcId field value +func (o *WithdrawCounterpartyRequest) GetHtlcId() string { + if o == nil { + var ret string + return ret + } + + return o.HtlcId +} + +// GetHtlcIdOk returns a tuple with the HtlcId field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetHtlcIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HtlcId, true +} + +// SetHtlcId sets field value +func (o *WithdrawCounterpartyRequest) SetHtlcId(v string) { + o.HtlcId = v +} + +// GetSecret returns the Secret field value +func (o *WithdrawCounterpartyRequest) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *WithdrawCounterpartyRequest) SetSecret(v string) { + o.Secret = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *WithdrawCounterpartyRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *WithdrawCounterpartyRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *WithdrawCounterpartyRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o WithdrawCounterpartyRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WithdrawCounterpartyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["htlcPackage"] = o.HtlcPackage + toSerialize["connectorInstanceId"] = o.ConnectorInstanceId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.ContractId) { + toSerialize["contractId"] = o.ContractId + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["htlcId"] = o.HtlcId + toSerialize["secret"] = o.Secret + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableWithdrawCounterpartyRequest struct { + value *WithdrawCounterpartyRequest + isSet bool +} + +func (v NullableWithdrawCounterpartyRequest) Get() *WithdrawCounterpartyRequest { + return v.value +} + +func (v *NullableWithdrawCounterpartyRequest) Set(val *WithdrawCounterpartyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWithdrawCounterpartyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWithdrawCounterpartyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWithdrawCounterpartyRequest(val *WithdrawCounterpartyRequest) *NullableWithdrawCounterpartyRequest { + return &NullableWithdrawCounterpartyRequest{value: val, isSet: true} +} + +func (v NullableWithdrawCounterpartyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWithdrawCounterpartyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..ee4602e8e6 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..99a47e3316 --- /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 0000000000..c04e4c876e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..25a3aab9e9 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - HTLC Coordinator + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.gitignore b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..b2f52ccd29 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,42 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java +src/main/java/org/openapitools/client/model/HtlcPackage.java +src/main/java/org/openapitools/client/model/OwnHTLCRequest.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..8ef5e2caf9 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,148 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - HTLC Coordinator +- API version: v2.0.0-alpha.2 + - Build date: 2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata] + +Can exchange assets between networks + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + v2.0.0-alpha.2 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:v2.0.0-alpha.2" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-v2.0.0-alpha.2.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://www.cactus.stream"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + CounterpartyHTLCRequest counterpartyHTLCRequest = new CounterpartyHTLCRequest(); // CounterpartyHTLCRequest | + try { + Object result = apiInstance.counterpartyHtlcV1(counterpartyHTLCRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#counterpartyHtlcV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**counterpartyHtlcV1**](docs/DefaultApi.md#counterpartyHtlcV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc | Create an instance to interact with the counterparty HTLC +*DefaultApi* | [**ownHtlcV1**](docs/DefaultApi.md#ownHtlcV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc | Create an instance to interact with the own HTLC. +*DefaultApi* | [**withdrawCounterpartyV1**](docs/DefaultApi.md#withdrawCounterpartyV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty | Withdraw funds of the counterparty HTLC + + +## Documentation for Models + + - [CounterpartyHTLCRequest](docs/CounterpartyHTLCRequest.md) + - [HtlcPackage](docs/HtlcPackage.md) + - [OwnHTLCRequest](docs/OwnHTLCRequest.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [WithdrawCounterpartyRequest](docs/WithdrawCounterpartyRequest.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..5891f7e910 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,342 @@ +openapi: 3.0.3 +info: + description: Can exchange assets between networks + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC Coordinator + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc: + post: + operationId: ownHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OwnHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the own HTLC. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc: + post: + operationId: counterpartyHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CounterpartyHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the counterparty HTLC + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty: + post: + operationId: withdrawCounterpartyV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawCounterpartyRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Withdraw funds of the counterparty HTLC + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty + x-content-type: application/json + x-accepts: application/json +components: + schemas: + OwnHTLCRequest: + example: + htlcPackage: null + receiver: receiver + connectorInstanceId: connectorInstanceId + constructorArgs: + - "" + - "" + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + hashLock: hashLock + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: 5.962133916683182 + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output addreess to receive the tokens + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - constructorArgs + - expiration + - hashLock + - htlcPackage + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + CounterpartyHTLCRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + htlcId: + description: Id for the HTLC + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - web3SigningCredential + type: object + WithdrawCounterpartyRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + contractId: contractId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + secret: secret + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + contractId: + description: contractId for the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + htlcId: + description: Id for the HTLC + nullable: false + type: string + secret: + description: Counterparty HTLC secret + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - secret + - web3SigningCredential + type: object + HtlcPackage: + enum: + - BESU + - BESU_ERC20 + type: string + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..a810712894 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = 'v2.0.0-alpha.2' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..8e305c1da2 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "v2.0.0-alpha.2", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/git_push.sh b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradle.properties b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..adf2e46c5b --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + v2.0.0-alpha.2 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..f85866524c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..c2331d476b --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1566 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..bed20f1b61 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..90444f050c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class Configuration { + public static final String VERSION = "v2.0.0-alpha.2"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..cf5eb26102 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..b533d45bd8 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,419 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CounterpartyHTLCRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OwnHTLCRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WithdrawCounterpartyRequest.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..3e8af49b1d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..08fdc49a35 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..19de2d5586 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..db7e600391 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..3099993711 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,432 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.CounterpartyHTLCRequest; +import org.openapitools.client.model.OwnHTLCRequest; +import org.openapitools.client.model.WithdrawCounterpartyRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for counterpartyHtlcV1 + * @param counterpartyHTLCRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call counterpartyHtlcV1Call(CounterpartyHTLCRequest counterpartyHTLCRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = counterpartyHTLCRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call counterpartyHtlcV1ValidateBeforeCall(CounterpartyHTLCRequest counterpartyHTLCRequest, final ApiCallback _callback) throws ApiException { + return counterpartyHtlcV1Call(counterpartyHTLCRequest, _callback); + + } + + /** + * Create an instance to interact with the counterparty HTLC + * + * @param counterpartyHTLCRequest (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object counterpartyHtlcV1(CounterpartyHTLCRequest counterpartyHTLCRequest) throws ApiException { + ApiResponse localVarResp = counterpartyHtlcV1WithHttpInfo(counterpartyHTLCRequest); + return localVarResp.getData(); + } + + /** + * Create an instance to interact with the counterparty HTLC + * + * @param counterpartyHTLCRequest (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse counterpartyHtlcV1WithHttpInfo(CounterpartyHTLCRequest counterpartyHTLCRequest) throws ApiException { + okhttp3.Call localVarCall = counterpartyHtlcV1ValidateBeforeCall(counterpartyHTLCRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an instance to interact with the counterparty HTLC (asynchronously) + * + * @param counterpartyHTLCRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call counterpartyHtlcV1Async(CounterpartyHTLCRequest counterpartyHTLCRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = counterpartyHtlcV1ValidateBeforeCall(counterpartyHTLCRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for ownHtlcV1 + * @param ownHTLCRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call ownHtlcV1Call(OwnHTLCRequest ownHTLCRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = ownHTLCRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call ownHtlcV1ValidateBeforeCall(OwnHTLCRequest ownHTLCRequest, final ApiCallback _callback) throws ApiException { + return ownHtlcV1Call(ownHTLCRequest, _callback); + + } + + /** + * Create an instance to interact with the own HTLC. + * + * @param ownHTLCRequest (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object ownHtlcV1(OwnHTLCRequest ownHTLCRequest) throws ApiException { + ApiResponse localVarResp = ownHtlcV1WithHttpInfo(ownHTLCRequest); + return localVarResp.getData(); + } + + /** + * Create an instance to interact with the own HTLC. + * + * @param ownHTLCRequest (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse ownHtlcV1WithHttpInfo(OwnHTLCRequest ownHTLCRequest) throws ApiException { + okhttp3.Call localVarCall = ownHtlcV1ValidateBeforeCall(ownHTLCRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an instance to interact with the own HTLC. (asynchronously) + * + * @param ownHTLCRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call ownHtlcV1Async(OwnHTLCRequest ownHTLCRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = ownHtlcV1ValidateBeforeCall(ownHTLCRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for withdrawCounterpartyV1 + * @param withdrawCounterpartyRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawCounterpartyV1Call(WithdrawCounterpartyRequest withdrawCounterpartyRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = withdrawCounterpartyRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call withdrawCounterpartyV1ValidateBeforeCall(WithdrawCounterpartyRequest withdrawCounterpartyRequest, final ApiCallback _callback) throws ApiException { + return withdrawCounterpartyV1Call(withdrawCounterpartyRequest, _callback); + + } + + /** + * Withdraw funds of the counterparty HTLC + * + * @param withdrawCounterpartyRequest (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object withdrawCounterpartyV1(WithdrawCounterpartyRequest withdrawCounterpartyRequest) throws ApiException { + ApiResponse localVarResp = withdrawCounterpartyV1WithHttpInfo(withdrawCounterpartyRequest); + return localVarResp.getData(); + } + + /** + * Withdraw funds of the counterparty HTLC + * + * @param withdrawCounterpartyRequest (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse withdrawCounterpartyV1WithHttpInfo(WithdrawCounterpartyRequest withdrawCounterpartyRequest) throws ApiException { + okhttp3.Call localVarCall = withdrawCounterpartyV1ValidateBeforeCall(withdrawCounterpartyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Withdraw funds of the counterparty HTLC (asynchronously) + * + * @param withdrawCounterpartyRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawCounterpartyV1Async(WithdrawCounterpartyRequest withdrawCounterpartyRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = withdrawCounterpartyV1ValidateBeforeCall(withdrawCounterpartyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..35eeddc452 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..82efbff0a0 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..1136c110f0 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..33bd3b702c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..e65934b08d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java new file mode 100644 index 0000000000..ebd08782e4 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java @@ -0,0 +1,371 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CounterpartyHTLCRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class CounterpartyHTLCRequest { + public static final String SERIALIZED_NAME_HTLC_PACKAGE = "htlcPackage"; + @SerializedName(SERIALIZED_NAME_HTLC_PACKAGE) + private HtlcPackage htlcPackage; + + public static final String SERIALIZED_NAME_CONNECTOR_INSTANCE_ID = "connectorInstanceId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_INSTANCE_ID) + private String connectorInstanceId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_HTLC_ID = "htlcId"; + @SerializedName(SERIALIZED_NAME_HTLC_ID) + private String htlcId; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public CounterpartyHTLCRequest() { + } + + public CounterpartyHTLCRequest htlcPackage(HtlcPackage htlcPackage) { + + this.htlcPackage = htlcPackage; + return this; + } + + /** + * Get htlcPackage + * @return htlcPackage + **/ + @javax.annotation.Nonnull + public HtlcPackage getHtlcPackage() { + return htlcPackage; + } + + + public void setHtlcPackage(HtlcPackage htlcPackage) { + this.htlcPackage = htlcPackage; + } + + + public CounterpartyHTLCRequest connectorInstanceId(String connectorInstanceId) { + + this.connectorInstanceId = connectorInstanceId; + return this; + } + + /** + * connector Instance Id for the connector plugin + * @return connectorInstanceId + **/ + @javax.annotation.Nonnull + public String getConnectorInstanceId() { + return connectorInstanceId; + } + + + public void setConnectorInstanceId(String connectorInstanceId) { + this.connectorInstanceId = connectorInstanceId; + } + + + public CounterpartyHTLCRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public CounterpartyHTLCRequest htlcId(String htlcId) { + + this.htlcId = htlcId; + return this; + } + + /** + * Id for the HTLC + * @return htlcId + **/ + @javax.annotation.Nonnull + public String getHtlcId() { + return htlcId; + } + + + public void setHtlcId(String htlcId) { + this.htlcId = htlcId; + } + + + public CounterpartyHTLCRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public CounterpartyHTLCRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CounterpartyHTLCRequest counterpartyHTLCRequest = (CounterpartyHTLCRequest) o; + return Objects.equals(this.htlcPackage, counterpartyHTLCRequest.htlcPackage) && + Objects.equals(this.connectorInstanceId, counterpartyHTLCRequest.connectorInstanceId) && + Objects.equals(this.keychainId, counterpartyHTLCRequest.keychainId) && + Objects.equals(this.htlcId, counterpartyHTLCRequest.htlcId) && + Objects.equals(this.web3SigningCredential, counterpartyHTLCRequest.web3SigningCredential) && + Objects.equals(this.gas, counterpartyHTLCRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(htlcPackage, connectorInstanceId, keychainId, htlcId, web3SigningCredential, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CounterpartyHTLCRequest {\n"); + sb.append(" htlcPackage: ").append(toIndentedString(htlcPackage)).append("\n"); + sb.append(" connectorInstanceId: ").append(toIndentedString(connectorInstanceId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" htlcId: ").append(toIndentedString(htlcId)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("htlcPackage"); + openapiFields.add("connectorInstanceId"); + openapiFields.add("keychainId"); + openapiFields.add("htlcId"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("htlcPackage"); + openapiRequiredFields.add("connectorInstanceId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("htlcId"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CounterpartyHTLCRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CounterpartyHTLCRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CounterpartyHTLCRequest is not found in the empty JSON string", CounterpartyHTLCRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CounterpartyHTLCRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CounterpartyHTLCRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CounterpartyHTLCRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorInstanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorInstanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorInstanceId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("htlcId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htlcId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htlcId").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CounterpartyHTLCRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CounterpartyHTLCRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CounterpartyHTLCRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CounterpartyHTLCRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CounterpartyHTLCRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CounterpartyHTLCRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CounterpartyHTLCRequest + * @throws IOException if the JSON string is invalid with respect to CounterpartyHTLCRequest + */ + public static CounterpartyHTLCRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CounterpartyHTLCRequest.class); + } + + /** + * Convert an instance of CounterpartyHTLCRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java new file mode 100644 index 0000000000..25a191818f --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets HtlcPackage + */ +@JsonAdapter(HtlcPackage.Adapter.class) +public enum HtlcPackage { + + BESU("BESU"), + + BESU_ERC20("BESU_ERC20"); + + private String value; + + HtlcPackage(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HtlcPackage fromValue(String value) { + for (HtlcPackage b : HtlcPackage.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HtlcPackage enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HtlcPackage read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return HtlcPackage.fromValue(value); + } + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java new file mode 100644 index 0000000000..770e63bbbd --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java @@ -0,0 +1,631 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OwnHTLCRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class OwnHTLCRequest { + public static final String SERIALIZED_NAME_HTLC_PACKAGE = "htlcPackage"; + @SerializedName(SERIALIZED_NAME_HTLC_PACKAGE) + private HtlcPackage htlcPackage; + + public static final String SERIALIZED_NAME_CONNECTOR_INSTANCE_ID = "connectorInstanceId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_INSTANCE_ID) + private String connectorInstanceId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INPUT_AMOUNT = "inputAmount"; + @SerializedName(SERIALIZED_NAME_INPUT_AMOUNT) + private BigDecimal inputAmount; + + public static final String SERIALIZED_NAME_OUTPUT_AMOUNT = "outputAmount"; + @SerializedName(SERIALIZED_NAME_OUTPUT_AMOUNT) + private BigDecimal outputAmount; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private BigDecimal expiration; + + public static final String SERIALIZED_NAME_HASH_LOCK = "hashLock"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK) + private String hashLock; + + public static final String SERIALIZED_NAME_TOKEN_ADDRESS = "tokenAddress"; + @SerializedName(SERIALIZED_NAME_TOKEN_ADDRESS) + private String tokenAddress; + + public static final String SERIALIZED_NAME_RECEIVER = "receiver"; + @SerializedName(SERIALIZED_NAME_RECEIVER) + private String receiver; + + public static final String SERIALIZED_NAME_OUTPUT_NETWORK = "outputNetwork"; + @SerializedName(SERIALIZED_NAME_OUTPUT_NETWORK) + private String outputNetwork; + + public static final String SERIALIZED_NAME_OUTPUT_ADDRESS = "outputAddress"; + @SerializedName(SERIALIZED_NAME_OUTPUT_ADDRESS) + private String outputAddress; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public OwnHTLCRequest() { + } + + public OwnHTLCRequest htlcPackage(HtlcPackage htlcPackage) { + + this.htlcPackage = htlcPackage; + return this; + } + + /** + * Get htlcPackage + * @return htlcPackage + **/ + @javax.annotation.Nonnull + public HtlcPackage getHtlcPackage() { + return htlcPackage; + } + + + public void setHtlcPackage(HtlcPackage htlcPackage) { + this.htlcPackage = htlcPackage; + } + + + public OwnHTLCRequest connectorInstanceId(String connectorInstanceId) { + + this.connectorInstanceId = connectorInstanceId; + return this; + } + + /** + * connector Instance Id for the connector plugin + * @return connectorInstanceId + **/ + @javax.annotation.Nonnull + public String getConnectorInstanceId() { + return connectorInstanceId; + } + + + public void setConnectorInstanceId(String connectorInstanceId) { + this.connectorInstanceId = connectorInstanceId; + } + + + public OwnHTLCRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public OwnHTLCRequest constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public OwnHTLCRequest addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public OwnHTLCRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public OwnHTLCRequest inputAmount(BigDecimal inputAmount) { + + this.inputAmount = inputAmount; + return this; + } + + /** + * Input amount to lock + * @return inputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getInputAmount() { + return inputAmount; + } + + + public void setInputAmount(BigDecimal inputAmount) { + this.inputAmount = inputAmount; + } + + + public OwnHTLCRequest outputAmount(BigDecimal outputAmount) { + + this.outputAmount = outputAmount; + return this; + } + + /** + * Output amount to lock + * @return outputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getOutputAmount() { + return outputAmount; + } + + + public void setOutputAmount(BigDecimal outputAmount) { + this.outputAmount = outputAmount; + } + + + public OwnHTLCRequest expiration(BigDecimal expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Timestamp to expire the contract + * @return expiration + **/ + @javax.annotation.Nonnull + public BigDecimal getExpiration() { + return expiration; + } + + + public void setExpiration(BigDecimal expiration) { + this.expiration = expiration; + } + + + public OwnHTLCRequest hashLock(String hashLock) { + + this.hashLock = hashLock; + return this; + } + + /** + * Hashlock needed to refund the amount + * @return hashLock + **/ + @javax.annotation.Nonnull + public String getHashLock() { + return hashLock; + } + + + public void setHashLock(String hashLock) { + this.hashLock = hashLock; + } + + + public OwnHTLCRequest tokenAddress(String tokenAddress) { + + this.tokenAddress = tokenAddress; + return this; + } + + /** + * The token address + * @return tokenAddress + **/ + @javax.annotation.Nonnull + public String getTokenAddress() { + return tokenAddress; + } + + + public void setTokenAddress(String tokenAddress) { + this.tokenAddress = tokenAddress; + } + + + public OwnHTLCRequest receiver(String receiver) { + + this.receiver = receiver; + return this; + } + + /** + * The receiver address + * @return receiver + **/ + @javax.annotation.Nonnull + public String getReceiver() { + return receiver; + } + + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + + public OwnHTLCRequest outputNetwork(String outputNetwork) { + + this.outputNetwork = outputNetwork; + return this; + } + + /** + * The output network id + * @return outputNetwork + **/ + @javax.annotation.Nonnull + public String getOutputNetwork() { + return outputNetwork; + } + + + public void setOutputNetwork(String outputNetwork) { + this.outputNetwork = outputNetwork; + } + + + public OwnHTLCRequest outputAddress(String outputAddress) { + + this.outputAddress = outputAddress; + return this; + } + + /** + * The output addreess to receive the tokens + * @return outputAddress + **/ + @javax.annotation.Nonnull + public String getOutputAddress() { + return outputAddress; + } + + + public void setOutputAddress(String outputAddress) { + this.outputAddress = outputAddress; + } + + + public OwnHTLCRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OwnHTLCRequest ownHTLCRequest = (OwnHTLCRequest) o; + return Objects.equals(this.htlcPackage, ownHTLCRequest.htlcPackage) && + Objects.equals(this.connectorInstanceId, ownHTLCRequest.connectorInstanceId) && + Objects.equals(this.keychainId, ownHTLCRequest.keychainId) && + Objects.equals(this.constructorArgs, ownHTLCRequest.constructorArgs) && + Objects.equals(this.web3SigningCredential, ownHTLCRequest.web3SigningCredential) && + Objects.equals(this.inputAmount, ownHTLCRequest.inputAmount) && + Objects.equals(this.outputAmount, ownHTLCRequest.outputAmount) && + Objects.equals(this.expiration, ownHTLCRequest.expiration) && + Objects.equals(this.hashLock, ownHTLCRequest.hashLock) && + Objects.equals(this.tokenAddress, ownHTLCRequest.tokenAddress) && + Objects.equals(this.receiver, ownHTLCRequest.receiver) && + Objects.equals(this.outputNetwork, ownHTLCRequest.outputNetwork) && + Objects.equals(this.outputAddress, ownHTLCRequest.outputAddress) && + Objects.equals(this.gas, ownHTLCRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(htlcPackage, connectorInstanceId, keychainId, constructorArgs, web3SigningCredential, inputAmount, outputAmount, expiration, hashLock, tokenAddress, receiver, outputNetwork, outputAddress, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OwnHTLCRequest {\n"); + sb.append(" htlcPackage: ").append(toIndentedString(htlcPackage)).append("\n"); + sb.append(" connectorInstanceId: ").append(toIndentedString(connectorInstanceId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" outputAmount: ").append(toIndentedString(outputAmount)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hashLock: ").append(toIndentedString(hashLock)).append("\n"); + sb.append(" tokenAddress: ").append(toIndentedString(tokenAddress)).append("\n"); + sb.append(" receiver: ").append(toIndentedString(receiver)).append("\n"); + sb.append(" outputNetwork: ").append(toIndentedString(outputNetwork)).append("\n"); + sb.append(" outputAddress: ").append(toIndentedString(outputAddress)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("htlcPackage"); + openapiFields.add("connectorInstanceId"); + openapiFields.add("keychainId"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("inputAmount"); + openapiFields.add("outputAmount"); + openapiFields.add("expiration"); + openapiFields.add("hashLock"); + openapiFields.add("tokenAddress"); + openapiFields.add("receiver"); + openapiFields.add("outputNetwork"); + openapiFields.add("outputAddress"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("htlcPackage"); + openapiRequiredFields.add("connectorInstanceId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("inputAmount"); + openapiRequiredFields.add("outputAmount"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("hashLock"); + openapiRequiredFields.add("tokenAddress"); + openapiRequiredFields.add("receiver"); + openapiRequiredFields.add("outputNetwork"); + openapiRequiredFields.add("outputAddress"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OwnHTLCRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OwnHTLCRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OwnHTLCRequest is not found in the empty JSON string", OwnHTLCRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OwnHTLCRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OwnHTLCRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OwnHTLCRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorInstanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorInstanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorInstanceId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("hashLock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLock").toString())); + } + if (!jsonObj.get("tokenAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenAddress").toString())); + } + if (!jsonObj.get("receiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiver").toString())); + } + if (!jsonObj.get("outputNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputNetwork").toString())); + } + if (!jsonObj.get("outputAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputAddress").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OwnHTLCRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OwnHTLCRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OwnHTLCRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OwnHTLCRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OwnHTLCRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OwnHTLCRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OwnHTLCRequest + * @throws IOException if the JSON string is invalid with respect to OwnHTLCRequest + */ + public static OwnHTLCRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OwnHTLCRequest.class); + } + + /** + * Convert an instance of OwnHTLCRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..6c2c8901d0 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..d1a27dd907 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..c2baf8e734 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..465224a48d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..957e1a3b77 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java new file mode 100644 index 0000000000..9e807ad1d2 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java @@ -0,0 +1,434 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WithdrawCounterpartyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:08:44.709600333+05:30[Asia/Kolkata]") +public class WithdrawCounterpartyRequest { + public static final String SERIALIZED_NAME_HTLC_PACKAGE = "htlcPackage"; + @SerializedName(SERIALIZED_NAME_HTLC_PACKAGE) + private HtlcPackage htlcPackage; + + public static final String SERIALIZED_NAME_CONNECTOR_INSTANCE_ID = "connectorInstanceId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_INSTANCE_ID) + private String connectorInstanceId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONTRACT_ID = "contractId"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ID) + private String contractId; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_HTLC_ID = "htlcId"; + @SerializedName(SERIALIZED_NAME_HTLC_ID) + private String htlcId; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public WithdrawCounterpartyRequest() { + } + + public WithdrawCounterpartyRequest htlcPackage(HtlcPackage htlcPackage) { + + this.htlcPackage = htlcPackage; + return this; + } + + /** + * Get htlcPackage + * @return htlcPackage + **/ + @javax.annotation.Nonnull + public HtlcPackage getHtlcPackage() { + return htlcPackage; + } + + + public void setHtlcPackage(HtlcPackage htlcPackage) { + this.htlcPackage = htlcPackage; + } + + + public WithdrawCounterpartyRequest connectorInstanceId(String connectorInstanceId) { + + this.connectorInstanceId = connectorInstanceId; + return this; + } + + /** + * connector Instance Id for the connector plugin + * @return connectorInstanceId + **/ + @javax.annotation.Nonnull + public String getConnectorInstanceId() { + return connectorInstanceId; + } + + + public void setConnectorInstanceId(String connectorInstanceId) { + this.connectorInstanceId = connectorInstanceId; + } + + + public WithdrawCounterpartyRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public WithdrawCounterpartyRequest contractId(String contractId) { + + this.contractId = contractId; + return this; + } + + /** + * contractId for the contract + * @return contractId + **/ + @javax.annotation.Nullable + public String getContractId() { + return contractId; + } + + + public void setContractId(String contractId) { + this.contractId = contractId; + } + + + public WithdrawCounterpartyRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public WithdrawCounterpartyRequest htlcId(String htlcId) { + + this.htlcId = htlcId; + return this; + } + + /** + * Id for the HTLC + * @return htlcId + **/ + @javax.annotation.Nonnull + public String getHtlcId() { + return htlcId; + } + + + public void setHtlcId(String htlcId) { + this.htlcId = htlcId; + } + + + public WithdrawCounterpartyRequest secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Counterparty HTLC secret + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public WithdrawCounterpartyRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawCounterpartyRequest withdrawCounterpartyRequest = (WithdrawCounterpartyRequest) o; + return Objects.equals(this.htlcPackage, withdrawCounterpartyRequest.htlcPackage) && + Objects.equals(this.connectorInstanceId, withdrawCounterpartyRequest.connectorInstanceId) && + Objects.equals(this.keychainId, withdrawCounterpartyRequest.keychainId) && + Objects.equals(this.contractId, withdrawCounterpartyRequest.contractId) && + Objects.equals(this.web3SigningCredential, withdrawCounterpartyRequest.web3SigningCredential) && + Objects.equals(this.htlcId, withdrawCounterpartyRequest.htlcId) && + Objects.equals(this.secret, withdrawCounterpartyRequest.secret) && + Objects.equals(this.gas, withdrawCounterpartyRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(htlcPackage, connectorInstanceId, keychainId, contractId, web3SigningCredential, htlcId, secret, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawCounterpartyRequest {\n"); + sb.append(" htlcPackage: ").append(toIndentedString(htlcPackage)).append("\n"); + sb.append(" connectorInstanceId: ").append(toIndentedString(connectorInstanceId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" contractId: ").append(toIndentedString(contractId)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" htlcId: ").append(toIndentedString(htlcId)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("htlcPackage"); + openapiFields.add("connectorInstanceId"); + openapiFields.add("keychainId"); + openapiFields.add("contractId"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("htlcId"); + openapiFields.add("secret"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("htlcPackage"); + openapiRequiredFields.add("connectorInstanceId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("htlcId"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WithdrawCounterpartyRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WithdrawCounterpartyRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WithdrawCounterpartyRequest is not found in the empty JSON string", WithdrawCounterpartyRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WithdrawCounterpartyRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WithdrawCounterpartyRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WithdrawCounterpartyRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorInstanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorInstanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorInstanceId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if ((jsonObj.get("contractId") != null && !jsonObj.get("contractId").isJsonNull()) && !jsonObj.get("contractId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractId").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("htlcId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htlcId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htlcId").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WithdrawCounterpartyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WithdrawCounterpartyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WithdrawCounterpartyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WithdrawCounterpartyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WithdrawCounterpartyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WithdrawCounterpartyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WithdrawCounterpartyRequest + * @throws IOException if the JSON string is invalid with respect to WithdrawCounterpartyRequest + */ + public static WithdrawCounterpartyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WithdrawCounterpartyRequest.class); + } + + /** + * Convert an instance of WithdrawCounterpartyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..bb5f815d34 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.CounterpartyHTLCRequest; +import org.openapitools.client.model.OwnHTLCRequest; +import org.openapitools.client.model.WithdrawCounterpartyRequest; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Create an instance to interact with the counterparty HTLC + * + * @throws ApiException if the Api call fails + */ + @Test + public void counterpartyHtlcV1Test() throws ApiException { + CounterpartyHTLCRequest counterpartyHTLCRequest = null; + Object response = api.counterpartyHtlcV1(counterpartyHTLCRequest); + // TODO: test validations + } + + /** + * Create an instance to interact with the own HTLC. + * + * @throws ApiException if the Api call fails + */ + @Test + public void ownHtlcV1Test() throws ApiException { + OwnHTLCRequest ownHTLCRequest = null; + Object response = api.ownHtlcV1(ownHTLCRequest); + // TODO: test validations + } + + /** + * Withdraw funds of the counterparty HTLC + * + * @throws ApiException if the Api call fails + */ + @Test + public void withdrawCounterpartyV1Test() throws ApiException { + WithdrawCounterpartyRequest withdrawCounterpartyRequest = null; + Object response = api.withdrawCounterpartyV1(withdrawCounterpartyRequest); + // TODO: test validations + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java new file mode 100644 index 0000000000..40caa660fc --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CounterpartyHTLCRequest + */ +public class CounterpartyHTLCRequestTest { + private final CounterpartyHTLCRequest model = new CounterpartyHTLCRequest(); + + /** + * Model tests for CounterpartyHTLCRequest + */ + @Test + public void testCounterpartyHTLCRequest() { + // TODO: test CounterpartyHTLCRequest + } + + /** + * Test the property 'htlcPackage' + */ + @Test + public void htlcPackageTest() { + // TODO: test htlcPackage + } + + /** + * Test the property 'connectorInstanceId' + */ + @Test + public void connectorInstanceIdTest() { + // TODO: test connectorInstanceId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'htlcId' + */ + @Test + public void htlcIdTest() { + // TODO: test htlcId + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java new file mode 100644 index 0000000000..b17bb5943d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HtlcPackage + */ +public class HtlcPackageTest { + /** + * Model tests for HtlcPackage + */ + @Test + public void testHtlcPackage() { + // TODO: test HtlcPackage + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java new file mode 100644 index 0000000000..2705a61615 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java @@ -0,0 +1,157 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OwnHTLCRequest + */ +public class OwnHTLCRequestTest { + private final OwnHTLCRequest model = new OwnHTLCRequest(); + + /** + * Model tests for OwnHTLCRequest + */ + @Test + public void testOwnHTLCRequest() { + // TODO: test OwnHTLCRequest + } + + /** + * Test the property 'htlcPackage' + */ + @Test + public void htlcPackageTest() { + // TODO: test htlcPackage + } + + /** + * Test the property 'connectorInstanceId' + */ + @Test + public void connectorInstanceIdTest() { + // TODO: test connectorInstanceId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'inputAmount' + */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** + * Test the property 'outputAmount' + */ + @Test + public void outputAmountTest() { + // TODO: test outputAmount + } + + /** + * Test the property 'expiration' + */ + @Test + public void expirationTest() { + // TODO: test expiration + } + + /** + * Test the property 'hashLock' + */ + @Test + public void hashLockTest() { + // TODO: test hashLock + } + + /** + * Test the property 'tokenAddress' + */ + @Test + public void tokenAddressTest() { + // TODO: test tokenAddress + } + + /** + * Test the property 'receiver' + */ + @Test + public void receiverTest() { + // TODO: test receiver + } + + /** + * Test the property 'outputNetwork' + */ + @Test + public void outputNetworkTest() { + // TODO: test outputNetwork + } + + /** + * Test the property 'outputAddress' + */ + @Test + public void outputAddressTest() { + // TODO: test outputAddress + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..7cac65f410 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..a56c15934a --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..5bea50c177 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..af0f048e26 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..21c96d0645 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java new file mode 100644 index 0000000000..111d12a49b --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WithdrawCounterpartyRequest + */ +public class WithdrawCounterpartyRequestTest { + private final WithdrawCounterpartyRequest model = new WithdrawCounterpartyRequest(); + + /** + * Model tests for WithdrawCounterpartyRequest + */ + @Test + public void testWithdrawCounterpartyRequest() { + // TODO: test WithdrawCounterpartyRequest + } + + /** + * Test the property 'htlcPackage' + */ + @Test + public void htlcPackageTest() { + // TODO: test htlcPackage + } + + /** + * Test the property 'connectorInstanceId' + */ + @Test + public void connectorInstanceIdTest() { + // TODO: test connectorInstanceId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'contractId' + */ + @Test + public void contractIdTest() { + // TODO: test contractId + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'htlcId' + */ + @Test + public void htlcIdTest() { + // TODO: test htlcId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/package.json b/extensions/cactus-plugin-object-store-ipfs/package.json index 4e24d18bdf..2c5046b62b 100644 --- a/extensions/cactus-plugin-object-store-ipfs/package.json +++ b/extensions/cactus-plugin-object-store-ipfs/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected", + "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", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.gitignore b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..0716ddb297 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..120b55502f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,119 @@ +# Go API client for cactus-plugin-object-store-ipfs + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-object-store-ipfs "github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetObjectV1**](docs/DefaultApi.md#getobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object | Retrieves an object from the object store. +*DefaultApi* | [**HasObjectV1**](docs/DefaultApi.md#hasobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object | Checks the presence of an object in the object store. +*DefaultApi* | [**SetObjectV1**](docs/DefaultApi.md#setobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object | Sets an object in the object store under the specified key. + + +## Documentation For Models + + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..59cf8c2bcd --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,229 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Object Store - IPFS ' + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object: + post: + operationId: getObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_get_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + summary: Retrieves an object from the object store. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + schemas: + GetObjectRequestV1: + example: + key: key + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectRequestV1: + example: + value: value + key: key + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectRequestV1: + example: + key: key + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..c917cce407 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,350 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getObjectRequestV1 *GetObjectRequestV1 +} + +// Request body to obtain an object via its key. +func (r ApiGetObjectV1Request) GetObjectRequestV1(getObjectRequestV1 GetObjectRequestV1) ApiGetObjectV1Request { + r.getObjectRequestV1 = &getObjectRequestV1 + return r +} + +func (r ApiGetObjectV1Request) Execute() (*GetObjectResponseV1, *http.Response, error) { + return r.ApiService.GetObjectV1Execute(r) +} + +/* +GetObjectV1 Retrieves an object from the object store. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetObjectV1Request +*/ +func (a *DefaultApiService) GetObjectV1(ctx context.Context) ApiGetObjectV1Request { + return ApiGetObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetObjectResponseV1 +func (a *DefaultApiService) GetObjectV1Execute(r ApiGetObjectV1Request) (*GetObjectResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetObjectResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getObjectRequestV1 == nil { + return localVarReturnValue, nil, reportError("getObjectRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getObjectRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasObjectRequestV1 *HasObjectRequestV1 +} + +// Request body to check presence of an object under a key. +func (r ApiHasObjectV1Request) HasObjectRequestV1(hasObjectRequestV1 HasObjectRequestV1) ApiHasObjectV1Request { + r.hasObjectRequestV1 = &hasObjectRequestV1 + return r +} + +func (r ApiHasObjectV1Request) Execute() (*HasObjectResponseV1, *http.Response, error) { + return r.ApiService.HasObjectV1Execute(r) +} + +/* +HasObjectV1 Checks the presence of an object in the object store. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasObjectV1Request +*/ +func (a *DefaultApiService) HasObjectV1(ctx context.Context) ApiHasObjectV1Request { + return ApiHasObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasObjectResponseV1 +func (a *DefaultApiService) HasObjectV1Execute(r ApiHasObjectV1Request) (*HasObjectResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasObjectResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasObjectRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasObjectRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasObjectRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setObjectRequestV1 *SetObjectRequestV1 +} + +// Request body to set an object under a key. +func (r ApiSetObjectV1Request) SetObjectRequestV1(setObjectRequestV1 SetObjectRequestV1) ApiSetObjectV1Request { + r.setObjectRequestV1 = &setObjectRequestV1 + return r +} + +func (r ApiSetObjectV1Request) Execute() (*SetObjectResponseV1, *http.Response, error) { + return r.ApiService.SetObjectV1Execute(r) +} + +/* +SetObjectV1 Sets an object in the object store under the specified key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetObjectV1Request +*/ +func (a *DefaultApiService) SetObjectV1(ctx context.Context) ApiSetObjectV1Request { + return ApiSetObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetObjectResponseV1 +func (a *DefaultApiService) SetObjectV1Execute(r ApiSetObjectV1Request) (*SetObjectResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetObjectResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setObjectRequestV1 == nil { + return localVarReturnValue, nil, reportError("setObjectRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setObjectRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..342e6982f1 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Object Store - IPFS API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..7362bc081c --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,231 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://www.cactus.stream/{basePath}", + Description: "Public test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + { + URL: "http://localhost:4000/{basePath}", + Description: "Local test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/DefaultApi.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/DefaultApi.md new file mode 100644 index 0000000000..1b096dff48 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/DefaultApi.md @@ -0,0 +1,203 @@ +# \DefaultApi + +All URIs are relative to *https://www.cactus.stream* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetObjectV1**](DefaultApi.md#GetObjectV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object | Retrieves an object from the object store. +[**HasObjectV1**](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. +[**SetObjectV1**](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. + + + +## GetObjectV1 + +> GetObjectResponseV1 GetObjectV1(ctx).GetObjectRequestV1(getObjectRequestV1).Execute() + +Retrieves an object from the object store. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" +) + +func main() { + getObjectRequestV1 := *openapiclient.NewGetObjectRequestV1("Key_example") // GetObjectRequestV1 | Request body to obtain an object via its key. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetObjectV1(context.Background()).GetObjectRequestV1(getObjectRequestV1).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetObjectV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetObjectV1`: GetObjectResponseV1 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetObjectV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetObjectV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getObjectRequestV1** | [**GetObjectRequestV1**](GetObjectRequestV1.md) | Request body to obtain an object via its key. | + +### Return type + +[**GetObjectResponseV1**](GetObjectResponseV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## HasObjectV1 + +> HasObjectResponseV1 HasObjectV1(ctx).HasObjectRequestV1(hasObjectRequestV1).Execute() + +Checks the presence of an object in the object store. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" +) + +func main() { + hasObjectRequestV1 := *openapiclient.NewHasObjectRequestV1("Key_example") // HasObjectRequestV1 | Request body to check presence of an object under a key. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.HasObjectV1(context.Background()).HasObjectRequestV1(hasObjectRequestV1).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.HasObjectV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `HasObjectV1`: HasObjectResponseV1 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.HasObjectV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiHasObjectV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **hasObjectRequestV1** | [**HasObjectRequestV1**](HasObjectRequestV1.md) | Request body to check presence of an object under a key. | + +### Return type + +[**HasObjectResponseV1**](HasObjectResponseV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SetObjectV1 + +> SetObjectResponseV1 SetObjectV1(ctx).SetObjectRequestV1(setObjectRequestV1).Execute() + +Sets an object in the object store under the specified key. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" +) + +func main() { + setObjectRequestV1 := *openapiclient.NewSetObjectRequestV1("Key_example", "Value_example") // SetObjectRequestV1 | Request body to set an object under a key. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.SetObjectV1(context.Background()).SetObjectRequestV1(setObjectRequestV1).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.SetObjectV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetObjectV1`: SetObjectResponseV1 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.SetObjectV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSetObjectV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **setObjectRequestV1** | [**SetObjectRequestV1**](SetObjectRequestV1.md) | Request body to set an object under a key. | + +### Return type + +[**SetObjectResponseV1**](SetObjectResponseV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/GetObjectRequestV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/GetObjectRequestV1.md new file mode 100644 index 0000000000..8997952f37 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/GetObjectRequestV1.md @@ -0,0 +1,51 @@ +# GetObjectRequestV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | The key for the entry to get from the object store. | + +## Methods + +### NewGetObjectRequestV1 + +`func NewGetObjectRequestV1(key string, ) *GetObjectRequestV1` + +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 + +### NewGetObjectRequestV1WithDefaults + +`func NewGetObjectRequestV1WithDefaults() *GetObjectRequestV1` + +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 + +### GetKey + +`func (o *GetObjectRequestV1) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *GetObjectRequestV1) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *GetObjectRequestV1) SetKey(v string)` + +SetKey sets Key field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/GetObjectResponseV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/GetObjectResponseV1.md new file mode 100644 index 0000000000..4ede85a6bc --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/GetObjectResponseV1.md @@ -0,0 +1,72 @@ +# GetObjectResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | The key that was used to retrieve the value from the object store. | +**Value** | **string** | The value associated with the requested key in the object store as a string. | + +## Methods + +### NewGetObjectResponseV1 + +`func NewGetObjectResponseV1(key string, value string, ) *GetObjectResponseV1` + +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 + +### NewGetObjectResponseV1WithDefaults + +`func NewGetObjectResponseV1WithDefaults() *GetObjectResponseV1` + +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 + +### GetKey + +`func (o *GetObjectResponseV1) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *GetObjectResponseV1) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *GetObjectResponseV1) SetKey(v string)` + +SetKey sets Key field to given value. + + +### GetValue + +`func (o *GetObjectResponseV1) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *GetObjectResponseV1) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *GetObjectResponseV1) SetValue(v string)` + +SetValue sets Value field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/HasObjectRequestV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/HasObjectRequestV1.md new file mode 100644 index 0000000000..612dadfe05 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/HasObjectRequestV1.md @@ -0,0 +1,51 @@ +# HasObjectRequestV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | The key to check for presence in the object store. | + +## Methods + +### NewHasObjectRequestV1 + +`func NewHasObjectRequestV1(key string, ) *HasObjectRequestV1` + +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 + +### NewHasObjectRequestV1WithDefaults + +`func NewHasObjectRequestV1WithDefaults() *HasObjectRequestV1` + +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 + +### GetKey + +`func (o *HasObjectRequestV1) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *HasObjectRequestV1) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *HasObjectRequestV1) SetKey(v string)` + +SetKey sets Key field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/HasObjectResponseV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/HasObjectResponseV1.md new file mode 100644 index 0000000000..bef915357e --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/HasObjectResponseV1.md @@ -0,0 +1,93 @@ +# HasObjectResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | The key that was used to check the presence of the value in the object store. | +**CheckedAt** | **string** | Date and time encoded as JSON when the presence check was performed by the plugin backend. | +**IsPresent** | **bool** | The boolean true or false indicating the presence or absence of an object under 'key'. | + +## Methods + +### NewHasObjectResponseV1 + +`func NewHasObjectResponseV1(key string, checkedAt string, isPresent bool, ) *HasObjectResponseV1` + +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 + +### NewHasObjectResponseV1WithDefaults + +`func NewHasObjectResponseV1WithDefaults() *HasObjectResponseV1` + +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 + +### GetKey + +`func (o *HasObjectResponseV1) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *HasObjectResponseV1) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *HasObjectResponseV1) SetKey(v string)` + +SetKey sets Key field to given value. + + +### GetCheckedAt + +`func (o *HasObjectResponseV1) GetCheckedAt() string` + +GetCheckedAt returns the CheckedAt field if non-nil, zero value otherwise. + +### GetCheckedAtOk + +`func (o *HasObjectResponseV1) GetCheckedAtOk() (*string, bool)` + +GetCheckedAtOk returns a tuple with the CheckedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCheckedAt + +`func (o *HasObjectResponseV1) SetCheckedAt(v string)` + +SetCheckedAt sets CheckedAt field to given value. + + +### GetIsPresent + +`func (o *HasObjectResponseV1) GetIsPresent() bool` + +GetIsPresent returns the IsPresent field if non-nil, zero value otherwise. + +### GetIsPresentOk + +`func (o *HasObjectResponseV1) GetIsPresentOk() (*bool, bool)` + +GetIsPresentOk returns a tuple with the IsPresent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPresent + +`func (o *HasObjectResponseV1) SetIsPresent(v bool)` + +SetIsPresent sets IsPresent field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/SetObjectRequestV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/SetObjectRequestV1.md new file mode 100644 index 0000000000..143dd24b09 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/SetObjectRequestV1.md @@ -0,0 +1,72 @@ +# SetObjectRequestV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | The key for the entry to set in the object store. | +**Value** | **string** | The value that will be associated with the key in the object store. | + +## Methods + +### NewSetObjectRequestV1 + +`func NewSetObjectRequestV1(key string, value string, ) *SetObjectRequestV1` + +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 + +### NewSetObjectRequestV1WithDefaults + +`func NewSetObjectRequestV1WithDefaults() *SetObjectRequestV1` + +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 + +### GetKey + +`func (o *SetObjectRequestV1) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *SetObjectRequestV1) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *SetObjectRequestV1) SetKey(v string)` + +SetKey sets Key field to given value. + + +### GetValue + +`func (o *SetObjectRequestV1) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *SetObjectRequestV1) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *SetObjectRequestV1) SetValue(v string)` + +SetValue sets Value field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/SetObjectResponseV1.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/SetObjectResponseV1.md new file mode 100644 index 0000000000..d8ff97d274 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/docs/SetObjectResponseV1.md @@ -0,0 +1,51 @@ +# SetObjectResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | **string** | The key that was used to set the value in the object store. | + +## Methods + +### NewSetObjectResponseV1 + +`func NewSetObjectResponseV1(key string, ) *SetObjectResponseV1` + +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 + +### NewSetObjectResponseV1WithDefaults + +`func NewSetObjectResponseV1WithDefaults() *SetObjectResponseV1` + +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 + +### GetKey + +`func (o *SetObjectResponseV1) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *SetObjectResponseV1) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *SetObjectResponseV1) SetKey(v string)` + +SetKey sets Key field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/git_push.sh b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..86e7474908 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..68a273a419 --- /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 0000000000..c966c8ddfd --- /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 0000000000..b1e4f4c2ab --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the GetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectRequestV1{} + +// GetObjectRequestV1 struct for GetObjectRequestV1 +type GetObjectRequestV1 struct { + // The key for the entry to get from the object store. + Key string `json:"key"` +} + +// NewGetObjectRequestV1 instantiates a new GetObjectRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetObjectRequestV1(key string) *GetObjectRequestV1 { + this := GetObjectRequestV1{} + this.Key = key + return &this +} + +// NewGetObjectRequestV1WithDefaults instantiates a new GetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectRequestV1WithDefaults() *GetObjectRequestV1 { + this := GetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetObjectRequestV1 struct { + value *GetObjectRequestV1 + isSet bool +} + +func (v NullableGetObjectRequestV1) Get() *GetObjectRequestV1 { + return v.value +} + +func (v *NullableGetObjectRequestV1) Set(val *GetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectRequestV1(val *GetObjectRequestV1) *NullableGetObjectRequestV1 { + return &NullableGetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableGetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go new file mode 100644 index 0000000000..a120d5be90 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the GetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectResponseV1{} + +// GetObjectResponseV1 struct for GetObjectResponseV1 +type GetObjectResponseV1 struct { + // The key that was used to retrieve the value from the object store. + Key string `json:"key"` + // The value associated with the requested key in the object store as a string. + Value string `json:"value"` +} + +// NewGetObjectResponseV1 instantiates a new GetObjectResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetObjectResponseV1(key string, value string) *GetObjectResponseV1 { + this := GetObjectResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetObjectResponseV1WithDefaults instantiates a new GetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectResponseV1WithDefaults() *GetObjectResponseV1 { + this := GetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetObjectResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetObjectResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetObjectResponseV1 struct { + value *GetObjectResponseV1 + isSet bool +} + +func (v NullableGetObjectResponseV1) Get() *GetObjectResponseV1 { + return v.value +} + +func (v *NullableGetObjectResponseV1) Set(val *GetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectResponseV1(val *GetObjectResponseV1) *NullableGetObjectResponseV1 { + return &NullableGetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableGetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go new file mode 100644 index 0000000000..c38bbbc163 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the HasObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectRequestV1{} + +// HasObjectRequestV1 struct for HasObjectRequestV1 +type HasObjectRequestV1 struct { + // The key to check for presence in the object store. + Key string `json:"key"` +} + +// NewHasObjectRequestV1 instantiates a new HasObjectRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasObjectRequestV1(key string) *HasObjectRequestV1 { + this := HasObjectRequestV1{} + this.Key = key + return &this +} + +// NewHasObjectRequestV1WithDefaults instantiates a new HasObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectRequestV1WithDefaults() *HasObjectRequestV1 { + this := HasObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasObjectRequestV1 struct { + value *HasObjectRequestV1 + isSet bool +} + +func (v NullableHasObjectRequestV1) Get() *HasObjectRequestV1 { + return v.value +} + +func (v *NullableHasObjectRequestV1) Set(val *HasObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectRequestV1(val *HasObjectRequestV1) *NullableHasObjectRequestV1 { + return &NullableHasObjectRequestV1{value: val, isSet: true} +} + +func (v NullableHasObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go new file mode 100644 index 0000000000..b879f589b4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the HasObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectResponseV1{} + +// HasObjectResponseV1 struct for HasObjectResponseV1 +type HasObjectResponseV1 struct { + // The key that was used to check the presence of the value in the object store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an object under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasObjectResponseV1 instantiates a new HasObjectResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasObjectResponseV1(key string, checkedAt string, isPresent bool) *HasObjectResponseV1 { + this := HasObjectResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasObjectResponseV1WithDefaults instantiates a new HasObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectResponseV1WithDefaults() *HasObjectResponseV1 { + this := HasObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasObjectResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasObjectResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasObjectResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasObjectResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasObjectResponseV1 struct { + value *HasObjectResponseV1 + isSet bool +} + +func (v NullableHasObjectResponseV1) Get() *HasObjectResponseV1 { + return v.value +} + +func (v *NullableHasObjectResponseV1) Set(val *HasObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectResponseV1(val *HasObjectResponseV1) *NullableHasObjectResponseV1 { + return &NullableHasObjectResponseV1{value: val, isSet: true} +} + +func (v NullableHasObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go new file mode 100644 index 0000000000..5ffab6a7e4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the SetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectRequestV1{} + +// SetObjectRequestV1 struct for SetObjectRequestV1 +type SetObjectRequestV1 struct { + // The key for the entry to set in the object store. + Key string `json:"key"` + // The value that will be associated with the key in the object store. + Value string `json:"value"` +} + +// NewSetObjectRequestV1 instantiates a new SetObjectRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetObjectRequestV1(key string, value string) *SetObjectRequestV1 { + this := SetObjectRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetObjectRequestV1WithDefaults instantiates a new SetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectRequestV1WithDefaults() *SetObjectRequestV1 { + this := SetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetObjectRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetObjectRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetObjectRequestV1 struct { + value *SetObjectRequestV1 + isSet bool +} + +func (v NullableSetObjectRequestV1) Get() *SetObjectRequestV1 { + return v.value +} + +func (v *NullableSetObjectRequestV1) Set(val *SetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectRequestV1(val *SetObjectRequestV1) *NullableSetObjectRequestV1 { + return &NullableSetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableSetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go new file mode 100644 index 0000000000..f1a8fe1796 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the SetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectResponseV1{} + +// SetObjectResponseV1 struct for SetObjectResponseV1 +type SetObjectResponseV1 struct { + // The key that was used to set the value in the object store. + Key string `json:"key"` +} + +// NewSetObjectResponseV1 instantiates a new SetObjectResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetObjectResponseV1(key string) *SetObjectResponseV1 { + this := SetObjectResponseV1{} + this.Key = key + return &this +} + +// NewSetObjectResponseV1WithDefaults instantiates a new SetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectResponseV1WithDefaults() *SetObjectResponseV1 { + this := SetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetObjectResponseV1 struct { + value *SetObjectResponseV1 + isSet bool +} + +func (v NullableSetObjectResponseV1) Get() *SetObjectResponseV1 { + return v.value +} + +func (v *NullableSetObjectResponseV1) Set(val *SetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectResponseV1(val *SetObjectResponseV1) *NullableSetObjectResponseV1 { + return &NullableSetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableSetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..1c67751d5d --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/test/api_default_test.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..20e954c471 --- /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 0000000000..3a41e356d8 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..058f0a3972 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Object Store - IPFS + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.gitignore b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..2074eed3c6 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,39 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetObjectRequestV1.java +src/main/java/org/openapitools/client/model/GetObjectResponseV1.java +src/main/java/org/openapitools/client/model/HasObjectRequestV1.java +src/main/java/org/openapitools/client/model/HasObjectResponseV1.java +src/main/java/org/openapitools/client/model/SetObjectRequestV1.java +src/main/java/org/openapitools/client/model/SetObjectResponseV1.java diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..e284712d7c --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,145 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Object Store - IPFS +- API version: v2.0.0-alpha.2 + - Build date: 2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata] + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + v2.0.0-alpha.2 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:v2.0.0-alpha.2" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-v2.0.0-alpha.2.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://www.cactus.stream"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetObjectRequestV1 getObjectRequestV1 = new GetObjectRequestV1(); // GetObjectRequestV1 | Request body to obtain an object via its key. + try { + GetObjectResponseV1 result = apiInstance.getObjectV1(getObjectRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getObjectV1**](docs/DefaultApi.md#getObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object | Retrieves an object from the object store. +*DefaultApi* | [**hasObjectV1**](docs/DefaultApi.md#hasObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object | Checks the presence of an object in the object store. +*DefaultApi* | [**setObjectV1**](docs/DefaultApi.md#setObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object | Sets an object in the object store under the specified key. + + +## Documentation for Models + + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..8700fead7f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,236 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Object Store - IPFS ' + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object: + post: + operationId: getObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_get_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + summary: Retrieves an object from the object store. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object: + post: + operationId: setObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_set_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + summary: Sets an object in the object store under the specified key. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object: + post: + operationId: hasObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_has_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + summary: Checks the presence of an object in the object store. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + schemas: + GetObjectRequestV1: + example: + key: key + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectRequestV1: + example: + value: value + key: key + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectRequestV1: + example: + key: key + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..a810712894 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = 'v2.0.0-alpha.2' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..8e305c1da2 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "v2.0.0-alpha.2", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/git_push.sh b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradle.properties b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..adf2e46c5b --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + v2.0.0-alpha.2 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..123552007a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..23d46615cc --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1566 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..5ffa50a03d --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..9ccc9e33dc --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class Configuration { + public static final String VERSION = "v2.0.0-alpha.2"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..04078ad12f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..72f38b7180 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,406 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..cc24194861 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..bdef1f05c7 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..4bebf9b5f4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..ed9d2b2564 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..1071e59b4d --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,450 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.GetObjectRequestV1; +import org.openapitools.client.model.GetObjectResponseV1; +import org.openapitools.client.model.HasObjectRequestV1; +import org.openapitools.client.model.HasObjectResponseV1; +import org.openapitools.client.model.SetObjectRequestV1; +import org.openapitools.client.model.SetObjectResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getObjectV1 + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getObjectV1Call(GetObjectRequestV1 getObjectRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getObjectRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getObjectV1ValidateBeforeCall(GetObjectRequestV1 getObjectRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getObjectRequestV1' is set + if (getObjectRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getObjectRequestV1' when calling getObjectV1(Async)"); + } + + return getObjectV1Call(getObjectRequestV1, _callback); + + } + + /** + * Retrieves an object from the object store. + * + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @return GetObjectResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetObjectResponseV1 getObjectV1(GetObjectRequestV1 getObjectRequestV1) throws ApiException { + ApiResponse localVarResp = getObjectV1WithHttpInfo(getObjectRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves an object from the object store. + * + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @return ApiResponse<GetObjectResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getObjectV1WithHttpInfo(GetObjectRequestV1 getObjectRequestV1) throws ApiException { + okhttp3.Call localVarCall = getObjectV1ValidateBeforeCall(getObjectRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an object from the object store. (asynchronously) + * + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getObjectV1Async(GetObjectRequestV1 getObjectRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getObjectV1ValidateBeforeCall(getObjectRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasObjectV1 + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasObjectV1Call(HasObjectRequestV1 hasObjectRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasObjectRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasObjectV1ValidateBeforeCall(HasObjectRequestV1 hasObjectRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasObjectRequestV1' is set + if (hasObjectRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasObjectRequestV1' when calling hasObjectV1(Async)"); + } + + return hasObjectV1Call(hasObjectRequestV1, _callback); + + } + + /** + * Checks the presence of an object in the object store. + * + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @return HasObjectResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public HasObjectResponseV1 hasObjectV1(HasObjectRequestV1 hasObjectRequestV1) throws ApiException { + ApiResponse localVarResp = hasObjectV1WithHttpInfo(hasObjectRequestV1); + return localVarResp.getData(); + } + + /** + * Checks the presence of an object in the object store. + * + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @return ApiResponse<HasObjectResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse hasObjectV1WithHttpInfo(HasObjectRequestV1 hasObjectRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasObjectV1ValidateBeforeCall(hasObjectRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks the presence of an object in the object store. (asynchronously) + * + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasObjectV1Async(HasObjectRequestV1 hasObjectRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasObjectV1ValidateBeforeCall(hasObjectRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setObjectV1 + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call setObjectV1Call(SetObjectRequestV1 setObjectRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setObjectRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setObjectV1ValidateBeforeCall(SetObjectRequestV1 setObjectRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setObjectRequestV1' is set + if (setObjectRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setObjectRequestV1' when calling setObjectV1(Async)"); + } + + return setObjectV1Call(setObjectRequestV1, _callback); + + } + + /** + * Sets an object in the object store under the specified key. + * + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @return SetObjectResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public SetObjectResponseV1 setObjectV1(SetObjectRequestV1 setObjectRequestV1) throws ApiException { + ApiResponse localVarResp = setObjectV1WithHttpInfo(setObjectRequestV1); + return localVarResp.getData(); + } + + /** + * Sets an object in the object store under the specified key. + * + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @return ApiResponse<SetObjectResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse setObjectV1WithHttpInfo(SetObjectRequestV1 setObjectRequestV1) throws ApiException { + okhttp3.Call localVarCall = setObjectV1ValidateBeforeCall(setObjectRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets an object in the object store under the specified key. (asynchronously) + * + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call setObjectV1Async(SetObjectRequestV1 setObjectRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setObjectV1ValidateBeforeCall(setObjectRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..484ec2ff93 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..03c39d40d1 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..c34ed4a8a1 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..7d2b7e3247 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..08b7788722 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java new file mode 100644 index 0000000000..286dd58146 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class GetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetObjectRequestV1() { + } + + public GetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectRequestV1 getObjectRequestV1 = (GetObjectRequestV1) o; + return Objects.equals(this.key, getObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectRequestV1 is not found in the empty JSON string", GetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectRequestV1 + */ + public static GetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectRequestV1.class); + } + + /** + * Convert an instance of GetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java new file mode 100644 index 0000000000..f0488aebfa --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class GetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetObjectResponseV1() { + } + + public GetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetObjectResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key in the object store as a string. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectResponseV1 getObjectResponseV1 = (GetObjectResponseV1) o; + return Objects.equals(this.key, getObjectResponseV1.key) && + Objects.equals(this.value, getObjectResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectResponseV1 is not found in the empty JSON string", GetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectResponseV1 + */ + public static GetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectResponseV1.class); + } + + /** + * Convert an instance of GetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java new file mode 100644 index 0000000000..1270538283 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class HasObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasObjectRequestV1() { + } + + public HasObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectRequestV1 hasObjectRequestV1 = (HasObjectRequestV1) o; + return Objects.equals(this.key, hasObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectRequestV1 is not found in the empty JSON string", HasObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectRequestV1 + */ + public static HasObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectRequestV1.class); + } + + /** + * Convert an instance of HasObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java new file mode 100644 index 0000000000..9d610d0508 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class HasObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasObjectResponseV1() { + } + + public HasObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasObjectResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasObjectResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an object under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectResponseV1 hasObjectResponseV1 = (HasObjectResponseV1) o; + return Objects.equals(this.key, hasObjectResponseV1.key) && + Objects.equals(this.checkedAt, hasObjectResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasObjectResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectResponseV1 is not found in the empty JSON string", HasObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectResponseV1 + */ + public static HasObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectResponseV1.class); + } + + /** + * Convert an instance of HasObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java new file mode 100644 index 0000000000..029d539185 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class SetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetObjectRequestV1() { + } + + public SetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetObjectRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key in the object store. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectRequestV1 setObjectRequestV1 = (SetObjectRequestV1) o; + return Objects.equals(this.key, setObjectRequestV1.key) && + Objects.equals(this.value, setObjectRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectRequestV1 is not found in the empty JSON string", SetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectRequestV1 + */ + public static SetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectRequestV1.class); + } + + /** + * Convert an instance of SetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java new file mode 100644 index 0000000000..64ab6c30dd --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-09T12:07:29.787819166+05:30[Asia/Kolkata]") +public class SetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetObjectResponseV1() { + } + + public SetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectResponseV1 setObjectResponseV1 = (SetObjectResponseV1) o; + return Objects.equals(this.key, setObjectResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectResponseV1 is not found in the empty JSON string", SetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectResponseV1 + */ + public static SetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectResponseV1.class); + } + + /** + * Convert an instance of SetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..2c01e6bbd9 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.GetObjectRequestV1; +import org.openapitools.client.model.GetObjectResponseV1; +import org.openapitools.client.model.HasObjectRequestV1; +import org.openapitools.client.model.HasObjectResponseV1; +import org.openapitools.client.model.SetObjectRequestV1; +import org.openapitools.client.model.SetObjectResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Retrieves an object from the object store. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getObjectV1Test() throws ApiException { + GetObjectRequestV1 getObjectRequestV1 = null; + GetObjectResponseV1 response = api.getObjectV1(getObjectRequestV1); + // TODO: test validations + } + + /** + * Checks the presence of an object in the object store. + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasObjectV1Test() throws ApiException { + HasObjectRequestV1 hasObjectRequestV1 = null; + HasObjectResponseV1 response = api.hasObjectV1(hasObjectRequestV1); + // TODO: test validations + } + + /** + * Sets an object in the object store under the specified key. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setObjectV1Test() throws ApiException { + SetObjectRequestV1 setObjectRequestV1 = null; + SetObjectResponseV1 response = api.setObjectV1(setObjectRequestV1); + // TODO: test validations + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java new file mode 100644 index 0000000000..0a907139eb --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectRequestV1 + */ +public class GetObjectRequestV1Test { + private final GetObjectRequestV1 model = new GetObjectRequestV1(); + + /** + * Model tests for GetObjectRequestV1 + */ + @Test + public void testGetObjectRequestV1() { + // TODO: test GetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java new file mode 100644 index 0000000000..23bbaf8e06 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectResponseV1 + */ +public class GetObjectResponseV1Test { + private final GetObjectResponseV1 model = new GetObjectResponseV1(); + + /** + * Model tests for GetObjectResponseV1 + */ + @Test + public void testGetObjectResponseV1() { + // TODO: test GetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java new file mode 100644 index 0000000000..0778820f5d --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectRequestV1 + */ +public class HasObjectRequestV1Test { + private final HasObjectRequestV1 model = new HasObjectRequestV1(); + + /** + * Model tests for HasObjectRequestV1 + */ + @Test + public void testHasObjectRequestV1() { + // TODO: test HasObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java new file mode 100644 index 0000000000..c8fa15980f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectResponseV1 + */ +public class HasObjectResponseV1Test { + private final HasObjectResponseV1 model = new HasObjectResponseV1(); + + /** + * Model tests for HasObjectResponseV1 + */ + @Test + public void testHasObjectResponseV1() { + // TODO: test HasObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java new file mode 100644 index 0000000000..56fb7e1075 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectRequestV1 + */ +public class SetObjectRequestV1Test { + private final SetObjectRequestV1 model = new SetObjectRequestV1(); + + /** + * Model tests for SetObjectRequestV1 + */ + @Test + public void testSetObjectRequestV1() { + // TODO: test SetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java new file mode 100644 index 0000000000..1a864ffe63 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectResponseV1 + */ +public class SetObjectResponseV1Test { + private final SetObjectResponseV1 model = new SetObjectResponseV1(); + + /** + * Model tests for SetObjectResponseV1 + */ + @Test + public void testSetObjectResponseV1() { + // TODO: test SetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/jest.config.js b/jest.config.js index 83403a2d65..1995ded3eb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -56,7 +56,6 @@ module.exports = { `./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/plugin-keychain-google-sm.test.ts`, `./packages/cactus-test-plugin-consortium-manual/src/test/typescript/integration/plugin-consortium-manual/openapi/openapi-validation.test.ts`, `./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-cactus.test.ts`, - `./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts`, `./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-block.test.ts`, `./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/deploy-contract-from-json.test.ts`, `./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-balance.test.ts`, diff --git a/package.json b/package.json index db58d9b5a4..6e34052029 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,7 @@ "openapi-types": "12.1.3", "prettier": "3.0.3", "protoc-gen-ts": "0.8.6", + "replace": "1.2.2", "run-time-error": "1.4.0", "run-time-error-cjs": "1.4.0", "secp256k1": "4.0.3", diff --git a/packages/cactus-cmd-api-server/package.json b/packages/cactus-cmd-api-server/package.json index 1e925cb723..866dfb2ab1 100644 --- a/packages/cactus-cmd-api-server/package.json +++ b/packages/cactus-cmd-api-server/package.json @@ -47,8 +47,10 @@ "codegen:openapi": "npm run generate-sdk", "codegen:proto": "run-s proto:openapi proto:protoc-gen-ts", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "proto:openapi": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g protobuf-schema --model-name-suffix=PB --additional-properties=packageName=org.hyperledger.cactus.cmd_api_server -o ./src/main/proto/generated/openapi/ -t=./src/main/openapi-generator/templates/protobuf-schema/", "proto:protoc-gen-ts": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./src/main/typescript/generated/proto/protoc-gen-ts/ --proto_path ./src/main/proto/generated/openapi/ ./src/main/proto/generated/openapi/services/*.proto", "watch": "npm-watch", diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..49b286a3a0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..6652235c31 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,116 @@ +# Go API client for cactus-cmd-api-server + +Interact with a Cactus deployment through HTTP. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-cmd-api-server "github.com/hyperledger/cactus-cmd-api-server/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-cmd-api-server.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-cmd-api-server.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-cmd-api-server.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-cmd-api-server.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetHealthCheckV1**](docs/DefaultApi.md#gethealthcheckv1) | **Get** /api/v1/api-server/healthcheck | Can be used to verify liveness of an API server instance +*DefaultApi* | [**GetOpenApiSpecV1**](docs/DefaultApi.md#getopenapispecv1) | **Get** /api/v1/api-server/get-open-api-spec | +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/api-server/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation For Models + + - [HealthCheckResponse](docs/HealthCheckResponse.md) + - [MemoryUsage](docs/MemoryUsage.md) + - [WatchHealthcheckV1](docs/WatchHealthcheckV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..d945cf083d --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,129 @@ +openapi: 3.0.3 +info: + description: Interact with a Cactus deployment through HTTP. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/api-server/healthcheck: + get: + description: Returns the current timestamp of the API server as proof of health/liveness + operationId: getHealthCheckV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResponse' + description: OK + summary: Can be used to verify liveness of an API server instance + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..4b3aa35b03 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,318 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetHealthCheckV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetHealthCheckV1Request) Execute() (*HealthCheckResponse, *http.Response, error) { + return r.ApiService.GetHealthCheckV1Execute(r) +} + +/* +GetHealthCheckV1 Can be used to verify liveness of an API server instance + +Returns the current timestamp of the API server as proof of health/liveness + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetHealthCheckV1Request +*/ +func (a *DefaultApiService) GetHealthCheckV1(ctx context.Context) ApiGetHealthCheckV1Request { + return ApiGetHealthCheckV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HealthCheckResponse +func (a *DefaultApiService) GetHealthCheckV1Execute(r ApiGetHealthCheckV1Request) (*HealthCheckResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HealthCheckResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetHealthCheckV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/api-server/healthcheck" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetOpenApiSpecV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetOpenApiSpecV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetOpenApiSpecV1Execute(r) +} + +/* +GetOpenApiSpecV1 Method for GetOpenApiSpecV1 + +Returns the openapi.json document of specific plugin. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOpenApiSpecV1Request +*/ +func (a *DefaultApiService) GetOpenApiSpecV1(ctx context.Context) ApiGetOpenApiSpecV1Request { + return ApiGetOpenApiSpecV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetOpenApiSpecV1Execute(r ApiGetOpenApiSpecV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOpenApiSpecV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/api-server/get-open-api-spec" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/api-server/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..46db3c98dd --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..9ffd4406b1 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..abb63f6bdb --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-cmd-api-server/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..cf6f7e9b4a --- /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 0000000000..c966c8ddfd --- /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 0000000000..a38d59d4c9 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_health_check_response.go @@ -0,0 +1,180 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" +) + +// checks if the HealthCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HealthCheckResponse{} + +// HealthCheckResponse struct for HealthCheckResponse +type HealthCheckResponse struct { + Success *bool `json:"success,omitempty"` + CreatedAt string `json:"createdAt"` + MemoryUsage MemoryUsage `json:"memoryUsage"` +} + +// NewHealthCheckResponse instantiates a new HealthCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHealthCheckResponse(createdAt string, memoryUsage MemoryUsage) *HealthCheckResponse { + this := HealthCheckResponse{} + this.CreatedAt = createdAt + this.MemoryUsage = memoryUsage + return &this +} + +// NewHealthCheckResponseWithDefaults instantiates a new HealthCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHealthCheckResponseWithDefaults() *HealthCheckResponse { + this := HealthCheckResponse{} + return &this +} + +// GetSuccess returns the Success field value if set, zero value otherwise. +func (o *HealthCheckResponse) GetSuccess() bool { + if o == nil || IsNil(o.Success) { + var ret bool + return ret + } + return *o.Success +} + +// GetSuccessOk returns a tuple with the Success field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HealthCheckResponse) GetSuccessOk() (*bool, bool) { + if o == nil || IsNil(o.Success) { + return nil, false + } + return o.Success, true +} + +// HasSuccess returns a boolean if a field has been set. +func (o *HealthCheckResponse) HasSuccess() bool { + if o != nil && !IsNil(o.Success) { + return true + } + + return false +} + +// SetSuccess gets a reference to the given bool and assigns it to the Success field. +func (o *HealthCheckResponse) SetSuccess(v bool) { + o.Success = &v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *HealthCheckResponse) GetCreatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *HealthCheckResponse) GetCreatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *HealthCheckResponse) SetCreatedAt(v string) { + o.CreatedAt = v +} + +// GetMemoryUsage returns the MemoryUsage field value +func (o *HealthCheckResponse) GetMemoryUsage() MemoryUsage { + if o == nil { + var ret MemoryUsage + return ret + } + + return o.MemoryUsage +} + +// GetMemoryUsageOk returns a tuple with the MemoryUsage field value +// and a boolean to check if the value has been set. +func (o *HealthCheckResponse) GetMemoryUsageOk() (*MemoryUsage, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsage, true +} + +// SetMemoryUsage sets field value +func (o *HealthCheckResponse) SetMemoryUsage(v MemoryUsage) { + o.MemoryUsage = v +} + +func (o HealthCheckResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HealthCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Success) { + toSerialize["success"] = o.Success + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["memoryUsage"] = o.MemoryUsage + return toSerialize, nil +} + +type NullableHealthCheckResponse struct { + value *HealthCheckResponse + isSet bool +} + +func (v NullableHealthCheckResponse) Get() *HealthCheckResponse { + return v.value +} + +func (v *NullableHealthCheckResponse) Set(val *HealthCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableHealthCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableHealthCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHealthCheckResponse(val *HealthCheckResponse) *NullableHealthCheckResponse { + return &NullableHealthCheckResponse{value: val, isSet: true} +} + +func (v NullableHealthCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHealthCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go new file mode 100644 index 0000000000..e1076e0459 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go @@ -0,0 +1,270 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" +) + +// checks if the MemoryUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MemoryUsage{} + +// MemoryUsage struct for MemoryUsage +type MemoryUsage struct { + Rss *float32 `json:"rss,omitempty"` + HeapTotal *float32 `json:"heapTotal,omitempty"` + HeapUsed *float32 `json:"heapUsed,omitempty"` + External *float32 `json:"external,omitempty"` + ArrayBuffers *float32 `json:"arrayBuffers,omitempty"` +} + +// NewMemoryUsage instantiates a new MemoryUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMemoryUsage() *MemoryUsage { + this := MemoryUsage{} + return &this +} + +// NewMemoryUsageWithDefaults instantiates a new MemoryUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMemoryUsageWithDefaults() *MemoryUsage { + this := MemoryUsage{} + return &this +} + +// GetRss returns the Rss field value if set, zero value otherwise. +func (o *MemoryUsage) GetRss() float32 { + if o == nil || IsNil(o.Rss) { + var ret float32 + return ret + } + return *o.Rss +} + +// GetRssOk returns a tuple with the Rss field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetRssOk() (*float32, bool) { + if o == nil || IsNil(o.Rss) { + return nil, false + } + return o.Rss, true +} + +// HasRss returns a boolean if a field has been set. +func (o *MemoryUsage) HasRss() bool { + if o != nil && !IsNil(o.Rss) { + return true + } + + return false +} + +// SetRss gets a reference to the given float32 and assigns it to the Rss field. +func (o *MemoryUsage) SetRss(v float32) { + o.Rss = &v +} + +// GetHeapTotal returns the HeapTotal field value if set, zero value otherwise. +func (o *MemoryUsage) GetHeapTotal() float32 { + if o == nil || IsNil(o.HeapTotal) { + var ret float32 + return ret + } + return *o.HeapTotal +} + +// GetHeapTotalOk returns a tuple with the HeapTotal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetHeapTotalOk() (*float32, bool) { + if o == nil || IsNil(o.HeapTotal) { + return nil, false + } + return o.HeapTotal, true +} + +// HasHeapTotal returns a boolean if a field has been set. +func (o *MemoryUsage) HasHeapTotal() bool { + if o != nil && !IsNil(o.HeapTotal) { + return true + } + + return false +} + +// SetHeapTotal gets a reference to the given float32 and assigns it to the HeapTotal field. +func (o *MemoryUsage) SetHeapTotal(v float32) { + o.HeapTotal = &v +} + +// GetHeapUsed returns the HeapUsed field value if set, zero value otherwise. +func (o *MemoryUsage) GetHeapUsed() float32 { + if o == nil || IsNil(o.HeapUsed) { + var ret float32 + return ret + } + return *o.HeapUsed +} + +// GetHeapUsedOk returns a tuple with the HeapUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetHeapUsedOk() (*float32, bool) { + if o == nil || IsNil(o.HeapUsed) { + return nil, false + } + return o.HeapUsed, true +} + +// HasHeapUsed returns a boolean if a field has been set. +func (o *MemoryUsage) HasHeapUsed() bool { + if o != nil && !IsNil(o.HeapUsed) { + return true + } + + return false +} + +// SetHeapUsed gets a reference to the given float32 and assigns it to the HeapUsed field. +func (o *MemoryUsage) SetHeapUsed(v float32) { + o.HeapUsed = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *MemoryUsage) GetExternal() float32 { + if o == nil || IsNil(o.External) { + var ret float32 + return ret + } + return *o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetExternalOk() (*float32, bool) { + if o == nil || IsNil(o.External) { + return nil, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *MemoryUsage) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given float32 and assigns it to the External field. +func (o *MemoryUsage) SetExternal(v float32) { + o.External = &v +} + +// GetArrayBuffers returns the ArrayBuffers field value if set, zero value otherwise. +func (o *MemoryUsage) GetArrayBuffers() float32 { + if o == nil || IsNil(o.ArrayBuffers) { + var ret float32 + return ret + } + return *o.ArrayBuffers +} + +// GetArrayBuffersOk returns a tuple with the ArrayBuffers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetArrayBuffersOk() (*float32, bool) { + if o == nil || IsNil(o.ArrayBuffers) { + return nil, false + } + return o.ArrayBuffers, true +} + +// HasArrayBuffers returns a boolean if a field has been set. +func (o *MemoryUsage) HasArrayBuffers() bool { + if o != nil && !IsNil(o.ArrayBuffers) { + return true + } + + return false +} + +// SetArrayBuffers gets a reference to the given float32 and assigns it to the ArrayBuffers field. +func (o *MemoryUsage) SetArrayBuffers(v float32) { + o.ArrayBuffers = &v +} + +func (o MemoryUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MemoryUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Rss) { + toSerialize["rss"] = o.Rss + } + if !IsNil(o.HeapTotal) { + toSerialize["heapTotal"] = o.HeapTotal + } + if !IsNil(o.HeapUsed) { + toSerialize["heapUsed"] = o.HeapUsed + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + if !IsNil(o.ArrayBuffers) { + toSerialize["arrayBuffers"] = o.ArrayBuffers + } + return toSerialize, nil +} + +type NullableMemoryUsage struct { + value *MemoryUsage + isSet bool +} + +func (v NullableMemoryUsage) Get() *MemoryUsage { + return v.value +} + +func (v *NullableMemoryUsage) Set(val *MemoryUsage) { + v.value = val + v.isSet = true +} + +func (v NullableMemoryUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableMemoryUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMemoryUsage(val *MemoryUsage) *NullableMemoryUsage { + return &NullableMemoryUsage{value: val, isSet: true} +} + +func (v NullableMemoryUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMemoryUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go new file mode 100644 index 0000000000..86d9f434bf --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" + "fmt" +) + +// WatchHealthcheckV1 the model 'WatchHealthcheckV1' +type WatchHealthcheckV1 string + +// List of WatchHealthcheckV1 +const ( + Subscribe WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe" + Next WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next" + Unsubscribe WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe" + Error WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error" + Complete WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete" +) + +// All allowed values of WatchHealthcheckV1 enum +var AllowedWatchHealthcheckV1EnumValues = []WatchHealthcheckV1{ + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete", +} + +func (v *WatchHealthcheckV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchHealthcheckV1(value) + for _, existing := range AllowedWatchHealthcheckV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchHealthcheckV1", value) +} + +// NewWatchHealthcheckV1FromValue returns a pointer to a valid WatchHealthcheckV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchHealthcheckV1FromValue(v string) (*WatchHealthcheckV1, error) { + ev := WatchHealthcheckV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchHealthcheckV1: valid values are %v", v, AllowedWatchHealthcheckV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchHealthcheckV1) IsValid() bool { + for _, existing := range AllowedWatchHealthcheckV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchHealthcheckV1 value +func (v WatchHealthcheckV1) Ptr() *WatchHealthcheckV1 { + return &v +} + +type NullableWatchHealthcheckV1 struct { + value *WatchHealthcheckV1 + isSet bool +} + +func (v NullableWatchHealthcheckV1) Get() *WatchHealthcheckV1 { + return v.value +} + +func (v *NullableWatchHealthcheckV1) Set(val *WatchHealthcheckV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchHealthcheckV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchHealthcheckV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchHealthcheckV1(val *WatchHealthcheckV1) *NullableWatchHealthcheckV1 { + return &NullableWatchHealthcheckV1{value: val, isSet: true} +} + +func (v NullableWatchHealthcheckV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchHealthcheckV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..f5fa6c5059 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..6631815e84 --- /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 0000000000..40599c80fc --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..3d2648acac --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..35c30f694e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,36 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/HealthCheckResponse.java +src/main/java/org/openapitools/client/model/MemoryUsage.java +src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..2b1bb8aa63 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,140 @@ +# openapi-java-client + +Hyperledger Cactus API +- API version: v2.0.0-alpha.2 + +Interact with a Cactus deployment through HTTP. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + HealthCheckResponse result = apiInstance.getHealthCheckV1(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getHealthCheckV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getHealthCheckV1**](docs/DefaultApi.md#getHealthCheckV1) | **GET** /api/v1/api-server/healthcheck | Can be used to verify liveness of an API server instance +*DefaultApi* | [**getOpenApiSpecV1**](docs/DefaultApi.md#getOpenApiSpecV1) | **GET** /api/v1/api-server/get-open-api-spec | +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/api-server/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation for Models + + - [HealthCheckResponse](docs/HealthCheckResponse.md) + - [MemoryUsage](docs/MemoryUsage.md) + - [WatchHealthcheckV1](docs/WatchHealthcheckV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..885f5ed380 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,133 @@ +openapi: 3.0.3 +info: + description: Interact with a Cactus deployment through HTTP. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/api-server/healthcheck: + get: + description: Returns the current timestamp of the API server as proof of health/liveness + operationId: getHealthCheckV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResponse' + description: OK + summary: Can be used to verify liveness of an API server instance + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/api-server/healthcheck + x-accepts: application/json + /api/v1/api-server/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/api-server/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/api-server/get-open-api-spec: + get: + description: Returns the openapi.json document of specific plugin. + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpenApiSpecV1EndpointResponse' + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/api-server/get-open-api-spec + x-accepts: application/json +components: + schemas: + WatchHealthcheckV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + MemoryUsage: + example: + heapUsed: 1.4658129805029452 + external: 5.962133916683182 + rss: 0.8008281904610115 + heapTotal: 6.027456183070403 + arrayBuffers: 5.637376656633329 + properties: + rss: + title: Resident Set Size + type: number + heapTotal: + title: V8 memory usage - heap total + type: number + heapUsed: + title: V8 memory usage - heap used + type: number + external: + title: Memory usage of C++ objects bound to JavaScript objects managed by + V8 + type: number + arrayBuffers: + title: "Memory allocated for ArrayBuffers and SharedArrayBuffers, including\ + \ all Node.js Buffers" + type: number + type: object + HealthCheckResponse: + example: + createdAt: createdAt + memoryUsage: + heapUsed: 1.4658129805029452 + external: 5.962133916683182 + rss: 0.8008281904610115 + heapTotal: 6.027456183070403 + arrayBuffers: 5.637376656633329 + success: true + properties: + success: + type: boolean + createdAt: + type: string + memoryUsage: + $ref: '#/components/schemas/MemoryUsage' + required: + - createdAt + - memoryUsage + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetOpenApiSpecV1EndpointResponse: + nullable: false + type: string + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..2409e99e33 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3bc66600c0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..b5257a3d48 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..03c2ea5675 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..2ec42303fe --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..b3386d0e8d --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,402 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HealthCheckResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MemoryUsage.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..f7390b9cf1 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..a471d8b046 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..aa7c3668d3 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..77282310e4 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..5301efef65 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,415 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.HealthCheckResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getHealthCheckV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getHealthCheckV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/api-server/healthcheck"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHealthCheckV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getHealthCheckV1Call(_callback); + + } + + /** + * Can be used to verify liveness of an API server instance + * Returns the current timestamp of the API server as proof of health/liveness + * @return HealthCheckResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public HealthCheckResponse getHealthCheckV1() throws ApiException { + ApiResponse localVarResp = getHealthCheckV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Can be used to verify liveness of an API server instance + * Returns the current timestamp of the API server as proof of health/liveness + * @return ApiResponse<HealthCheckResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getHealthCheckV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getHealthCheckV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Can be used to verify liveness of an API server instance (asynchronously) + * Returns the current timestamp of the API server as proof of health/liveness + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getHealthCheckV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHealthCheckV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOpenApiSpecV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/api-server/get-open-api-spec"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOpenApiSpecV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOpenApiSpecV1Call(_callback); + + } + + /** + * + * Returns the openapi.json document of specific plugin. + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getOpenApiSpecV1() throws ApiException { + ApiResponse localVarResp = getOpenApiSpecV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Returns the openapi.json document of specific plugin. + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getOpenApiSpecV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns the openapi.json document of specific plugin. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/api-server/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..bf8caad49e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..1fea47cc13 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..0350d9363b --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..3c4df1037b --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..3e98421bd8 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java new file mode 100644 index 0000000000..58f7ff42bf --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java @@ -0,0 +1,276 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.MemoryUsage; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HealthCheckResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HealthCheckResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_MEMORY_USAGE = "memoryUsage"; + @SerializedName(SERIALIZED_NAME_MEMORY_USAGE) + private MemoryUsage memoryUsage; + + public HealthCheckResponse() { + } + + public HealthCheckResponse success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public HealthCheckResponse createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public HealthCheckResponse memoryUsage(MemoryUsage memoryUsage) { + + this.memoryUsage = memoryUsage; + return this; + } + + /** + * Get memoryUsage + * @return memoryUsage + **/ + @javax.annotation.Nonnull + public MemoryUsage getMemoryUsage() { + return memoryUsage; + } + + + public void setMemoryUsage(MemoryUsage memoryUsage) { + this.memoryUsage = memoryUsage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResponse healthCheckResponse = (HealthCheckResponse) o; + return Objects.equals(this.success, healthCheckResponse.success) && + Objects.equals(this.createdAt, healthCheckResponse.createdAt) && + Objects.equals(this.memoryUsage, healthCheckResponse.memoryUsage); + } + + @Override + public int hashCode() { + return Objects.hash(success, createdAt, memoryUsage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" memoryUsage: ").append(toIndentedString(memoryUsage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("createdAt"); + openapiFields.add("memoryUsage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("memoryUsage"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HealthCheckResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HealthCheckResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HealthCheckResponse is not found in the empty JSON string", HealthCheckResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HealthCheckResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HealthCheckResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HealthCheckResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); + } + // validate the required field `memoryUsage` + MemoryUsage.validateJsonObject(jsonObj.getAsJsonObject("memoryUsage")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HealthCheckResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HealthCheckResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HealthCheckResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HealthCheckResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HealthCheckResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HealthCheckResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of HealthCheckResponse + * @throws IOException if the JSON string is invalid with respect to HealthCheckResponse + */ + public static HealthCheckResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HealthCheckResponse.class); + } + + /** + * Convert an instance of HealthCheckResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java new file mode 100644 index 0000000000..d5c3e9d973 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java @@ -0,0 +1,318 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * MemoryUsage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MemoryUsage { + public static final String SERIALIZED_NAME_RSS = "rss"; + @SerializedName(SERIALIZED_NAME_RSS) + private BigDecimal rss; + + public static final String SERIALIZED_NAME_HEAP_TOTAL = "heapTotal"; + @SerializedName(SERIALIZED_NAME_HEAP_TOTAL) + private BigDecimal heapTotal; + + public static final String SERIALIZED_NAME_HEAP_USED = "heapUsed"; + @SerializedName(SERIALIZED_NAME_HEAP_USED) + private BigDecimal heapUsed; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private BigDecimal external; + + public static final String SERIALIZED_NAME_ARRAY_BUFFERS = "arrayBuffers"; + @SerializedName(SERIALIZED_NAME_ARRAY_BUFFERS) + private BigDecimal arrayBuffers; + + public MemoryUsage() { + } + + public MemoryUsage rss(BigDecimal rss) { + + this.rss = rss; + return this; + } + + /** + * Get rss + * @return rss + **/ + @javax.annotation.Nullable + public BigDecimal getRss() { + return rss; + } + + + public void setRss(BigDecimal rss) { + this.rss = rss; + } + + + public MemoryUsage heapTotal(BigDecimal heapTotal) { + + this.heapTotal = heapTotal; + return this; + } + + /** + * Get heapTotal + * @return heapTotal + **/ + @javax.annotation.Nullable + public BigDecimal getHeapTotal() { + return heapTotal; + } + + + public void setHeapTotal(BigDecimal heapTotal) { + this.heapTotal = heapTotal; + } + + + public MemoryUsage heapUsed(BigDecimal heapUsed) { + + this.heapUsed = heapUsed; + return this; + } + + /** + * Get heapUsed + * @return heapUsed + **/ + @javax.annotation.Nullable + public BigDecimal getHeapUsed() { + return heapUsed; + } + + + public void setHeapUsed(BigDecimal heapUsed) { + this.heapUsed = heapUsed; + } + + + public MemoryUsage external(BigDecimal external) { + + this.external = external; + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public BigDecimal getExternal() { + return external; + } + + + public void setExternal(BigDecimal external) { + this.external = external; + } + + + public MemoryUsage arrayBuffers(BigDecimal arrayBuffers) { + + this.arrayBuffers = arrayBuffers; + return this; + } + + /** + * Get arrayBuffers + * @return arrayBuffers + **/ + @javax.annotation.Nullable + public BigDecimal getArrayBuffers() { + return arrayBuffers; + } + + + public void setArrayBuffers(BigDecimal arrayBuffers) { + this.arrayBuffers = arrayBuffers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemoryUsage memoryUsage = (MemoryUsage) o; + return Objects.equals(this.rss, memoryUsage.rss) && + Objects.equals(this.heapTotal, memoryUsage.heapTotal) && + Objects.equals(this.heapUsed, memoryUsage.heapUsed) && + Objects.equals(this.external, memoryUsage.external) && + Objects.equals(this.arrayBuffers, memoryUsage.arrayBuffers); + } + + @Override + public int hashCode() { + return Objects.hash(rss, heapTotal, heapUsed, external, arrayBuffers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemoryUsage {\n"); + sb.append(" rss: ").append(toIndentedString(rss)).append("\n"); + sb.append(" heapTotal: ").append(toIndentedString(heapTotal)).append("\n"); + sb.append(" heapUsed: ").append(toIndentedString(heapUsed)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append(" arrayBuffers: ").append(toIndentedString(arrayBuffers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rss"); + openapiFields.add("heapTotal"); + openapiFields.add("heapUsed"); + openapiFields.add("external"); + openapiFields.add("arrayBuffers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MemoryUsage + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!MemoryUsage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MemoryUsage is not found in the empty JSON string", MemoryUsage.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MemoryUsage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MemoryUsage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MemoryUsage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MemoryUsage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MemoryUsage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MemoryUsage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MemoryUsage read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MemoryUsage given an JSON string + * + * @param jsonString JSON string + * @return An instance of MemoryUsage + * @throws IOException if the JSON string is invalid with respect to MemoryUsage + */ + public static MemoryUsage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MemoryUsage.class); + } + + /** + * Convert an instance of MemoryUsage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java new file mode 100644 index 0000000000..6d792108a8 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchHealthcheckV1 + */ +@JsonAdapter(WatchHealthcheckV1.Adapter.class) +public enum WatchHealthcheckV1 { + + Subscribe("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error"), + + Complete("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete"); + + private String value; + + WatchHealthcheckV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchHealthcheckV1 fromValue(String value) { + for (WatchHealthcheckV1 b : WatchHealthcheckV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchHealthcheckV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchHealthcheckV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchHealthcheckV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..e44dbdb6dc --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,69 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.HealthCheckResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Can be used to verify liveness of an API server instance + * + * Returns the current timestamp of the API server as proof of health/liveness + * + * @throws ApiException if the Api call fails + */ + @Test + public void getHealthCheckV1Test() throws ApiException { + HealthCheckResponse response = api.getHealthCheckV1(); + // TODO: test validations + } + + /** + * Returns the openapi.json document of specific plugin. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOpenApiSpecV1Test() throws ApiException { + String response = api.getOpenApiSpecV1(); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java new file mode 100644 index 0000000000..36900a9669 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.MemoryUsage; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HealthCheckResponse + */ +public class HealthCheckResponseTest { + private final HealthCheckResponse model = new HealthCheckResponse(); + + /** + * Model tests for HealthCheckResponse + */ + @Test + public void testHealthCheckResponse() { + // TODO: test HealthCheckResponse + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'memoryUsage' + */ + @Test + public void memoryUsageTest() { + // TODO: test memoryUsage + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java new file mode 100644 index 0000000000..3c020e7cfd --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java @@ -0,0 +1,81 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MemoryUsage + */ +public class MemoryUsageTest { + private final MemoryUsage model = new MemoryUsage(); + + /** + * Model tests for MemoryUsage + */ + @Test + public void testMemoryUsage() { + // TODO: test MemoryUsage + } + + /** + * Test the property 'rss' + */ + @Test + public void rssTest() { + // TODO: test rss + } + + /** + * Test the property 'heapTotal' + */ + @Test + public void heapTotalTest() { + // TODO: test heapTotal + } + + /** + * Test the property 'heapUsed' + */ + @Test + public void heapUsedTest() { + // TODO: test heapUsed + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + + /** + * Test the property 'arrayBuffers' + */ + @Test + public void arrayBuffersTest() { + // TODO: test arrayBuffers + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java new file mode 100644 index 0000000000..1cc95516f3 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchHealthcheckV1 + */ +public class WatchHealthcheckV1Test { + /** + * Model tests for WatchHealthcheckV1 + */ + @Test + public void testWatchHealthcheckV1() { + // TODO: test WatchHealthcheckV1 + } + +} diff --git a/packages/cactus-core-api/Cargo.lock b/packages/cactus-core-api/Cargo.lock index 09d0b49db0..3162c9fde3 100644 --- a/packages/cactus-core-api/Cargo.lock +++ b/packages/cactus-core-api/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" version = "1.0.3" @@ -36,31 +51,91 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.32", ] [[package]] name = "async-trait" -version = "0.1.52" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.85", + "syn 2.0.32", ] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" -version = "0.13.1" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bitflags" @@ -68,12 +143,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bumpalo" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" - [[package]] name = "bytes" version = "1.1.0" @@ -82,9 +151,12 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cc" -version = "1.0.72" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -169,6 +241,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "h2" version = "0.3.20" @@ -184,7 +262,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util", "tracing", ] @@ -196,18 +274,15 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "http" -version = "0.2.6" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -254,7 +329,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -303,18 +378,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" - -[[package]] -name = "js-sys" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -dependencies = [ - "wasm-bindgen", -] +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "lazy_static" @@ -324,9 +390,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "log" @@ -337,20 +403,40 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", "wasi", "windows-sys", ] @@ -361,11 +447,20 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.9.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "percent-encoding" @@ -385,29 +480,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.10" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 1.0.85", + "syn 2.0.32", ] [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -421,6 +516,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn 2.0.32", +] + [[package]] name = "proc-macro2" version = "1.0.66" @@ -432,9 +537,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.9.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -442,44 +547,45 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.9.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", + "prettyplease", "prost", "prost-types", "regex", + "syn 2.0.32", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.9.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.85", + "syn 2.0.32", ] [[package]] name = "prost-types" -version = "0.9.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ - "bytes", "prost", ] @@ -582,37 +688,66 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustls" -version = "0.19.1" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ - "base64", "log", "ring", + "rustls-webpki", "sct", - "webpki", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "sct" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -620,22 +755,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.133" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.133" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.85", + "syn 2.0.32", ] [[package]] @@ -654,34 +789,50 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "syn" -version = "1.0.85" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "syn" -version = "2.0.28" +version = "2.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "tempfile" version = "3.3.0" @@ -698,19 +849,18 @@ dependencies = [ [[package]] name = "tokio" -version = "1.19.2" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ + "backtrace", "bytes", "libc", - "memchr", "mio", - "once_cell", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio-macros", - "winapi", + "windows-sys", ] [[package]] @@ -725,24 +875,23 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.85", + "syn 2.0.32", ] [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -756,20 +905,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.3" @@ -786,16 +921,15 @@ dependencies = [ [[package]] name = "tonic" -version = "0.6.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", + "axum", "base64", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", @@ -804,28 +938,28 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "prost-derive", + "rustls", + "rustls-pemfile", "tokio", "tokio-rustls", "tokio-stream", - "tokio-util 0.6.10", "tower", "tower-layer", "tower-service", "tracing", - "tracing-futures", ] [[package]] name = "tonic-build" -version = "0.6.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ + "prettyplease", "proc-macro2", "prost-build", "quote", - "syn 1.0.85", + "syn 2.0.32", ] [[package]] @@ -842,7 +976,7 @@ dependencies = [ "rand", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -850,9 +984,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -867,7 +1001,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if", - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -881,7 +1014,7 @@ checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.85", + "syn 1.0.109", ] [[package]] @@ -893,16 +1026,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.3" @@ -915,23 +1038,11 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "want" @@ -949,80 +1060,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn 1.0.85", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.85", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" - -[[package]] -name = "web-sys" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "which" version = "4.4.0" diff --git a/packages/cactus-core-api/Cargo.toml b/packages/cactus-core-api/Cargo.toml index 958d91237f..9a6fdae0b5 100644 --- a/packages/cactus-core-api/Cargo.toml +++ b/packages/cactus-core-api/Cargo.toml @@ -2,7 +2,7 @@ name = "relay" version = "0.0.1" authors = ["Antony Targett ", "Nick Waywood "] -edition = "2018" +edition = "2021" [lib] name = "pb" @@ -10,13 +10,13 @@ path = "src/main/rust/pb.rs" [dependencies] -tonic = {version="0.6.2", features = ["tls"]} -prost = "0.9" -tokio = { version = "1.18", features = ["macros", "fs"] } -serde = {version="1.0.110", features = ["derive"]} +tonic = {version="0.10.2", features = ["tls"]} +prost = "0.12.3" +tokio = { version = "1.34.0", features = ["macros", "fs"] } +serde = {version="1.0.193", features = ["derive"]} [build-dependencies] -tonic-build = "0.6.2" +tonic-build = "0.10.2" diff --git a/packages/cactus-core-api/package.json b/packages/cactus-core-api/package.json index 88f585712e..add9ec5c3e 100644 --- a/packages/cactus-core-api/package.json +++ b/packages/cactus-core-api/package.json @@ -47,8 +47,10 @@ "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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "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/.gitignore b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..d4ea5953d5 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,43 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..64389fb309 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,141 @@ +# Go API client for cactus-core-api + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-core-api "github.com/hyperledger/cactus-core-api/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-core-api.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-core-api.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-core-api.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-core-api.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation For Models + + - [CactusNode](docs/CactusNode.md) + - [CactusNodeAllOf](docs/CactusNodeAllOf.md) + - [CactusNodeMeta](docs/CactusNodeMeta.md) + - [ConsensusAlgorithmFamiliesWithOutTxFinality](docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md) + - [ConsensusAlgorithmFamiliesWithTxFinality](docs/ConsensusAlgorithmFamiliesWithTxFinality.md) + - [ConsensusAlgorithmFamily](docs/ConsensusAlgorithmFamily.md) + - [Consortium](docs/Consortium.md) + - [ConsortiumDatabase](docs/ConsortiumDatabase.md) + - [ConsortiumMember](docs/ConsortiumMember.md) + - [Constants](docs/Constants.md) + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + - [Ledger](docs/Ledger.md) + - [LedgerType](docs/LedgerType.md) + - [PluginImport](docs/PluginImport.md) + - [PluginImportAction](docs/PluginImportAction.md) + - [PluginImportType](docs/PluginImportType.md) + - [PluginInstance](docs/PluginInstance.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..12b5808786 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,712 @@ +openapi: 3.0.3 +info: + description: "Contains/describes the core API types for Cactus. Does not describe\ + \ actual endpoints on its own as this is left to the implementing plugins who\ + \ can import and re-use commonly needed type definitions from this specification.\ + \ One example of said commonly used type definitions would be the types related\ + \ to consortium management, cactus nodes, ledgers, etc.." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Core API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + schemas: + Constants: + enum: + - /api/v1/async/socket-io/connect + type: string + x-enum-varnames: + - SocketIoConnectionPathV1 + PluginImport: + properties: + packageName: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/PluginImportType' + action: + $ref: '#/components/schemas/PluginImportAction' + options: {} + required: + - action + - packageName + - type + type: object + PluginImportType: + enum: + - org.hyperledger.cactus.plugin_import_type.LOCAL + - org.hyperledger.cactus.plugin_import_type.REMOTE + type: string + PluginImportAction: + enum: + - org.hyperledger.cactus.plugin_import_action.INSTANTIATE + - org.hyperledger.cactus.plugin_import_action.INSTALL + type: string + ConsensusAlgorithmFamily: + description: "Enumerates a list of consensus algorithm families in existence.\ + \ Does not intend to be an exhaustive list, just a practical one, meaning\ + \ that we only include items here that are relevant to Hyperledger Cactus\ + \ in fulfilling its own duties. This can be extended later as more sophisticated\ + \ features of Cactus get implemented. This enum is meant to be first and foremost\ + \ a useful abstraction for achieving practical tasks, not an encyclopedia\ + \ and therefore we ask of everyone that this to be extended only in ways that\ + \ serve a practical purpose for the runtime behavior of Cactus or Cactus plugins\ + \ in general. The bottom line is that we can accept this enum being not 100%\ + \ accurate as long as it 100% satisfies what it was designed to do." + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + ConsensusAlgorithmFamiliesWithTxFinality: + description: Enumerates a list of consensus algorithm families that provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + type: string + ConsensusAlgorithmFamiliesWithOutTxFinality: + description: Enumerates a list of consensus algorithm families that do not provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + x-enum-varnames: + - WORK + PrimaryKey: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ConsortiumMemberId: + $ref: '#/components/schemas/PrimaryKey' + CactusNodeId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumId: + $ref: '#/components/schemas/PrimaryKey' + LedgerId: + $ref: '#/components/schemas/PrimaryKey' + PluginInstanceId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumDatabase: + properties: + consortium: + default: [] + description: "A collection of Consortium entities. In practice this should\ + \ only ever contain a single consortium, but we defined it as an array\ + \ to keep the convention up with the rest of the collections defined in\ + \ the Consortium data in general. Also, if we ever decide to somehow have\ + \ some sort of consortium to consortium integration (which does not make\ + \ much sense in the current frame of mind of the author in the year 2020)\ + \ then having this as an array will have proven itself to be an excellent\ + \ long term compatibility/extensibility decision indeed." + items: + $ref: '#/components/schemas/Consortium' + maxItems: 2048 + minItems: 0 + type: array + ledger: + default: [] + description: The complete collection of all ledger entities in existence + within the consortium. + items: + $ref: '#/components/schemas/Ledger' + maxItems: 2048 + minItems: 0 + type: array + consortiumMember: + default: [] + description: The complete collection of all consortium member entities in + existence within the consortium. + items: + $ref: '#/components/schemas/ConsortiumMember' + maxItems: 2048 + minItems: 0 + type: array + cactusNode: + default: [] + description: The complete collection of all cactus nodes entities in existence + within the consortium. + items: + $ref: '#/components/schemas/CactusNode' + maxItems: 2048 + minItems: 0 + type: array + pluginInstance: + default: [] + description: The complete collection of all plugin instance entities in + existence within the consortium. + items: + $ref: '#/components/schemas/PluginInstance' + maxItems: 2048 + minItems: 0 + type: array + required: + - cactusNode + - consortium + - consortiumMember + - ledger + - pluginInstance + Ledger: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerType: + $ref: '#/components/schemas/LedgerType' + consortiumMemberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + required: + - id + - ledgerType + type: object + LedgerType: + description: "Enumerates the different ledger vendors and their major versions\ + \ encoded within the name of the LedgerType. For example \"BESU_1X\" involves\ + \ all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until,\ + \ but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further\ + \ explanation." + enum: + - BESU_1X + - BESU_2X + - BURROW_0X + - CORDA_4X + - FABRIC_14X + - FABRIC_2 + - QUORUM_2X + - SAWTOOTH_1X + type: string + Consortium: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + type: string + mainApiHost: + type: string + memberIds: + default: [] + description: The collection (array) of primary keys of consortium member + entities that belong to this Consortium. + items: + $ref: '#/components/schemas/ConsortiumMemberId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - mainApiHost + - memberIds + - name + type: object + ConsortiumMember: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + description: The human readable name a Consortium member can be referred + to while making it easy for humans to distinguish this particular consortium + member entity from any other ones. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeIds: + default: [] + items: + $ref: '#/components/schemas/CactusNodeId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - name + - nodeIds + type: object + CactusNodeMeta: + description: A Cactus node meta information + properties: + nodeApiHost: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + publicKeyPem: + description: The PEM encoded public key that was used to generate the JWS + included in the response (the jws property) + format: "Must only contain the public key, never include here the PEM that\ + \ also contains a private key. See PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - nodeApiHost + - publicKeyPem + type: object + CactusNode: + allOf: + - $ref: '#/components/schemas/CactusNodeMeta' + - $ref: '#/components/schemas/CactusNode_allOf' + description: "A Cactus node can be a single server, or a set of servers behind\ + \ a load balancer acting as one." + type: object + PluginInstance: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + packageName: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + required: + - id + - packageName + type: object + JWSCompact: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjJ9.DOCNCqEMN7CQ_z-RMndiyldljXOk6WFIZxRzNF5Ylg4 + maxLength: 65535 + minLength: 5 + pattern: "/^[a-zA-Z0-9-_]+?.[a-zA-Z0-9-_]+?.([a-zA-Z0-9-_]+)?$/" + type: string + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object + JWSGeneral: + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + GetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + HasObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + SetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + CactusNode_allOf: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + consortiumId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + memberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerIds: + default: [] + description: Stores an array of Ledger entity IDs that are reachable (routable) + via this Cactus Node. This information is used by the client side SDK + API client to figure out at runtime where to send API requests that are + specific to a certain ledger such as requests to execute transactions. + items: + $ref: '#/components/schemas/LedgerId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + pluginInstanceIds: + default: [] + items: + $ref: '#/components/schemas/PluginInstanceId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + required: + - consortiumId + - id + - ledgerIds + - memberId + - nodeApiHost + - pluginInstanceIds + - publicKeyPem + type: object + example: null diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..ec644e291c --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,653 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Core API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..398c2655a5 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..10f2827a4c --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-core-api/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..8571b08d86 --- /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 0000000000..c966c8ddfd --- /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 0000000000..40756fb619 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node.go @@ -0,0 +1,281 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the CactusNode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactusNode{} + +// CactusNode A Cactus node can be a single server, or a set of servers behind a load balancer acting as one. +type CactusNode struct { + NodeApiHost string `json:"nodeApiHost"` + // The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + PublicKeyPem string `json:"publicKeyPem"` + Id string `json:"id"` + ConsortiumId string `json:"consortiumId"` + MemberId string `json:"memberId"` + // Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + LedgerIds []string `json:"ledgerIds"` + PluginInstanceIds []string `json:"pluginInstanceIds"` +} + +// NewCactusNode instantiates a new CactusNode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactusNode(nodeApiHost string, publicKeyPem string, id string, consortiumId string, memberId string, ledgerIds []string, pluginInstanceIds []string) *CactusNode { + this := CactusNode{} + this.NodeApiHost = nodeApiHost + this.PublicKeyPem = publicKeyPem + this.Id = id + this.ConsortiumId = consortiumId + this.MemberId = memberId + this.LedgerIds = ledgerIds + this.PluginInstanceIds = pluginInstanceIds + return &this +} + +// NewCactusNodeWithDefaults instantiates a new CactusNode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactusNodeWithDefaults() *CactusNode { + this := CactusNode{} + return &this +} + +// GetNodeApiHost returns the NodeApiHost field value +func (o *CactusNode) GetNodeApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.NodeApiHost +} + +// GetNodeApiHostOk returns a tuple with the NodeApiHost field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetNodeApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeApiHost, true +} + +// SetNodeApiHost sets field value +func (o *CactusNode) SetNodeApiHost(v string) { + o.NodeApiHost = v +} + +// GetPublicKeyPem returns the PublicKeyPem field value +func (o *CactusNode) GetPublicKeyPem() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKeyPem +} + +// GetPublicKeyPemOk returns a tuple with the PublicKeyPem field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetPublicKeyPemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKeyPem, true +} + +// SetPublicKeyPem sets field value +func (o *CactusNode) SetPublicKeyPem(v string) { + o.PublicKeyPem = v +} + +// GetId returns the Id field value +func (o *CactusNode) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CactusNode) SetId(v string) { + o.Id = v +} + +// GetConsortiumId returns the ConsortiumId field value +func (o *CactusNode) GetConsortiumId() string { + if o == nil { + var ret string + return ret + } + + return o.ConsortiumId +} + +// GetConsortiumIdOk returns a tuple with the ConsortiumId field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetConsortiumIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsortiumId, true +} + +// SetConsortiumId sets field value +func (o *CactusNode) SetConsortiumId(v string) { + o.ConsortiumId = v +} + +// GetMemberId returns the MemberId field value +func (o *CactusNode) GetMemberId() string { + if o == nil { + var ret string + return ret + } + + return o.MemberId +} + +// GetMemberIdOk returns a tuple with the MemberId field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetMemberIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberId, true +} + +// SetMemberId sets field value +func (o *CactusNode) SetMemberId(v string) { + o.MemberId = v +} + +// GetLedgerIds returns the LedgerIds field value +func (o *CactusNode) GetLedgerIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.LedgerIds +} + +// GetLedgerIdsOk returns a tuple with the LedgerIds field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetLedgerIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.LedgerIds, true +} + +// SetLedgerIds sets field value +func (o *CactusNode) SetLedgerIds(v []string) { + o.LedgerIds = v +} + +// GetPluginInstanceIds returns the PluginInstanceIds field value +func (o *CactusNode) GetPluginInstanceIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.PluginInstanceIds +} + +// GetPluginInstanceIdsOk returns a tuple with the PluginInstanceIds field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetPluginInstanceIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PluginInstanceIds, true +} + +// SetPluginInstanceIds sets field value +func (o *CactusNode) SetPluginInstanceIds(v []string) { + o.PluginInstanceIds = v +} + +func (o CactusNode) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactusNode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nodeApiHost"] = o.NodeApiHost + toSerialize["publicKeyPem"] = o.PublicKeyPem + toSerialize["id"] = o.Id + toSerialize["consortiumId"] = o.ConsortiumId + toSerialize["memberId"] = o.MemberId + toSerialize["ledgerIds"] = o.LedgerIds + toSerialize["pluginInstanceIds"] = o.PluginInstanceIds + return toSerialize, nil +} + +type NullableCactusNode struct { + value *CactusNode + isSet bool +} + +func (v NullableCactusNode) Get() *CactusNode { + return v.value +} + +func (v *NullableCactusNode) Set(val *CactusNode) { + v.value = val + v.isSet = true +} + +func (v NullableCactusNode) IsSet() bool { + return v.isSet +} + +func (v *NullableCactusNode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactusNode(val *CactusNode) *NullableCactusNode { + return &NullableCactusNode{value: val, isSet: true} +} + +func (v NullableCactusNode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactusNode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go new file mode 100644 index 0000000000..a102d58ae6 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go @@ -0,0 +1,226 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the CactusNodeAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactusNodeAllOf{} + +// CactusNodeAllOf struct for CactusNodeAllOf +type CactusNodeAllOf struct { + Id string `json:"id"` + ConsortiumId string `json:"consortiumId"` + MemberId string `json:"memberId"` + // Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + LedgerIds []string `json:"ledgerIds"` + PluginInstanceIds []string `json:"pluginInstanceIds"` +} + +// NewCactusNodeAllOf instantiates a new CactusNodeAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactusNodeAllOf(id string, consortiumId string, memberId string, ledgerIds []string, pluginInstanceIds []string) *CactusNodeAllOf { + this := CactusNodeAllOf{} + this.Id = id + this.ConsortiumId = consortiumId + this.MemberId = memberId + this.LedgerIds = ledgerIds + this.PluginInstanceIds = pluginInstanceIds + return &this +} + +// NewCactusNodeAllOfWithDefaults instantiates a new CactusNodeAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactusNodeAllOfWithDefaults() *CactusNodeAllOf { + this := CactusNodeAllOf{} + return &this +} + +// GetId returns the Id field value +func (o *CactusNodeAllOf) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CactusNodeAllOf) SetId(v string) { + o.Id = v +} + +// GetConsortiumId returns the ConsortiumId field value +func (o *CactusNodeAllOf) GetConsortiumId() string { + if o == nil { + var ret string + return ret + } + + return o.ConsortiumId +} + +// GetConsortiumIdOk returns a tuple with the ConsortiumId field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetConsortiumIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsortiumId, true +} + +// SetConsortiumId sets field value +func (o *CactusNodeAllOf) SetConsortiumId(v string) { + o.ConsortiumId = v +} + +// GetMemberId returns the MemberId field value +func (o *CactusNodeAllOf) GetMemberId() string { + if o == nil { + var ret string + return ret + } + + return o.MemberId +} + +// GetMemberIdOk returns a tuple with the MemberId field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetMemberIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberId, true +} + +// SetMemberId sets field value +func (o *CactusNodeAllOf) SetMemberId(v string) { + o.MemberId = v +} + +// GetLedgerIds returns the LedgerIds field value +func (o *CactusNodeAllOf) GetLedgerIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.LedgerIds +} + +// GetLedgerIdsOk returns a tuple with the LedgerIds field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetLedgerIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.LedgerIds, true +} + +// SetLedgerIds sets field value +func (o *CactusNodeAllOf) SetLedgerIds(v []string) { + o.LedgerIds = v +} + +// GetPluginInstanceIds returns the PluginInstanceIds field value +func (o *CactusNodeAllOf) GetPluginInstanceIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.PluginInstanceIds +} + +// GetPluginInstanceIdsOk returns a tuple with the PluginInstanceIds field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetPluginInstanceIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PluginInstanceIds, true +} + +// SetPluginInstanceIds sets field value +func (o *CactusNodeAllOf) SetPluginInstanceIds(v []string) { + o.PluginInstanceIds = v +} + +func (o CactusNodeAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactusNodeAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["consortiumId"] = o.ConsortiumId + toSerialize["memberId"] = o.MemberId + toSerialize["ledgerIds"] = o.LedgerIds + toSerialize["pluginInstanceIds"] = o.PluginInstanceIds + return toSerialize, nil +} + +type NullableCactusNodeAllOf struct { + value *CactusNodeAllOf + isSet bool +} + +func (v NullableCactusNodeAllOf) Get() *CactusNodeAllOf { + return v.value +} + +func (v *NullableCactusNodeAllOf) Set(val *CactusNodeAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableCactusNodeAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableCactusNodeAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactusNodeAllOf(val *CactusNodeAllOf) *NullableCactusNodeAllOf { + return &NullableCactusNodeAllOf{value: val, isSet: true} +} + +func (v NullableCactusNodeAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactusNodeAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go new file mode 100644 index 0000000000..dc0285e20a --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go @@ -0,0 +1,145 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the CactusNodeMeta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactusNodeMeta{} + +// CactusNodeMeta A Cactus node meta information +type CactusNodeMeta struct { + NodeApiHost string `json:"nodeApiHost"` + // The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + PublicKeyPem string `json:"publicKeyPem"` +} + +// NewCactusNodeMeta instantiates a new CactusNodeMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactusNodeMeta(nodeApiHost string, publicKeyPem string) *CactusNodeMeta { + this := CactusNodeMeta{} + this.NodeApiHost = nodeApiHost + this.PublicKeyPem = publicKeyPem + return &this +} + +// NewCactusNodeMetaWithDefaults instantiates a new CactusNodeMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactusNodeMetaWithDefaults() *CactusNodeMeta { + this := CactusNodeMeta{} + return &this +} + +// GetNodeApiHost returns the NodeApiHost field value +func (o *CactusNodeMeta) GetNodeApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.NodeApiHost +} + +// GetNodeApiHostOk returns a tuple with the NodeApiHost field value +// and a boolean to check if the value has been set. +func (o *CactusNodeMeta) GetNodeApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeApiHost, true +} + +// SetNodeApiHost sets field value +func (o *CactusNodeMeta) SetNodeApiHost(v string) { + o.NodeApiHost = v +} + +// GetPublicKeyPem returns the PublicKeyPem field value +func (o *CactusNodeMeta) GetPublicKeyPem() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKeyPem +} + +// GetPublicKeyPemOk returns a tuple with the PublicKeyPem field value +// and a boolean to check if the value has been set. +func (o *CactusNodeMeta) GetPublicKeyPemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKeyPem, true +} + +// SetPublicKeyPem sets field value +func (o *CactusNodeMeta) SetPublicKeyPem(v string) { + o.PublicKeyPem = v +} + +func (o CactusNodeMeta) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactusNodeMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nodeApiHost"] = o.NodeApiHost + toSerialize["publicKeyPem"] = o.PublicKeyPem + return toSerialize, nil +} + +type NullableCactusNodeMeta struct { + value *CactusNodeMeta + isSet bool +} + +func (v NullableCactusNodeMeta) Get() *CactusNodeMeta { + return v.value +} + +func (v *NullableCactusNodeMeta) Set(val *CactusNodeMeta) { + v.value = val + v.isSet = true +} + +func (v NullableCactusNodeMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableCactusNodeMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactusNodeMeta(val *CactusNodeMeta) *NullableCactusNodeMeta { + return &NullableCactusNodeMeta{value: val, isSet: true} +} + +func (v NullableCactusNodeMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactusNodeMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go new file mode 100644 index 0000000000..e7be3f8947 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go @@ -0,0 +1,109 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// ConsensusAlgorithmFamiliesWithOutTxFinality Enumerates a list of consensus algorithm families that do not provide immediate finality +type ConsensusAlgorithmFamiliesWithOutTxFinality string + +// List of ConsensusAlgorithmFamiliesWithOutTxFinality +const ( + WORK ConsensusAlgorithmFamiliesWithOutTxFinality = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK" +) + +// All allowed values of ConsensusAlgorithmFamiliesWithOutTxFinality enum +var AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues = []ConsensusAlgorithmFamiliesWithOutTxFinality{ + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK", +} + +func (v *ConsensusAlgorithmFamiliesWithOutTxFinality) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsensusAlgorithmFamiliesWithOutTxFinality(value) + for _, existing := range AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsensusAlgorithmFamiliesWithOutTxFinality", value) +} + +// NewConsensusAlgorithmFamiliesWithOutTxFinalityFromValue returns a pointer to a valid ConsensusAlgorithmFamiliesWithOutTxFinality +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsensusAlgorithmFamiliesWithOutTxFinalityFromValue(v string) (*ConsensusAlgorithmFamiliesWithOutTxFinality, error) { + ev := ConsensusAlgorithmFamiliesWithOutTxFinality(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsensusAlgorithmFamiliesWithOutTxFinality: valid values are %v", v, AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsensusAlgorithmFamiliesWithOutTxFinality) IsValid() bool { + for _, existing := range AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsensusAlgorithmFamiliesWithOutTxFinality value +func (v ConsensusAlgorithmFamiliesWithOutTxFinality) Ptr() *ConsensusAlgorithmFamiliesWithOutTxFinality { + return &v +} + +type NullableConsensusAlgorithmFamiliesWithOutTxFinality struct { + value *ConsensusAlgorithmFamiliesWithOutTxFinality + isSet bool +} + +func (v NullableConsensusAlgorithmFamiliesWithOutTxFinality) Get() *ConsensusAlgorithmFamiliesWithOutTxFinality { + return v.value +} + +func (v *NullableConsensusAlgorithmFamiliesWithOutTxFinality) Set(val *ConsensusAlgorithmFamiliesWithOutTxFinality) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusAlgorithmFamiliesWithOutTxFinality) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusAlgorithmFamiliesWithOutTxFinality) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusAlgorithmFamiliesWithOutTxFinality(val *ConsensusAlgorithmFamiliesWithOutTxFinality) *NullableConsensusAlgorithmFamiliesWithOutTxFinality { + return &NullableConsensusAlgorithmFamiliesWithOutTxFinality{value: val, isSet: true} +} + +func (v NullableConsensusAlgorithmFamiliesWithOutTxFinality) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusAlgorithmFamiliesWithOutTxFinality) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go new file mode 100644 index 0000000000..8cafd667f9 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go @@ -0,0 +1,111 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// ConsensusAlgorithmFamiliesWithTxFinality Enumerates a list of consensus algorithm families that provide immediate finality +type ConsensusAlgorithmFamiliesWithTxFinality string + +// List of ConsensusAlgorithmFamiliesWithTxFinality +const ( + AUTHORITY ConsensusAlgorithmFamiliesWithTxFinality = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY" + STAKE ConsensusAlgorithmFamiliesWithTxFinality = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE" +) + +// All allowed values of ConsensusAlgorithmFamiliesWithTxFinality enum +var AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues = []ConsensusAlgorithmFamiliesWithTxFinality{ + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY", + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE", +} + +func (v *ConsensusAlgorithmFamiliesWithTxFinality) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsensusAlgorithmFamiliesWithTxFinality(value) + for _, existing := range AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsensusAlgorithmFamiliesWithTxFinality", value) +} + +// NewConsensusAlgorithmFamiliesWithTxFinalityFromValue returns a pointer to a valid ConsensusAlgorithmFamiliesWithTxFinality +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsensusAlgorithmFamiliesWithTxFinalityFromValue(v string) (*ConsensusAlgorithmFamiliesWithTxFinality, error) { + ev := ConsensusAlgorithmFamiliesWithTxFinality(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsensusAlgorithmFamiliesWithTxFinality: valid values are %v", v, AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsensusAlgorithmFamiliesWithTxFinality) IsValid() bool { + for _, existing := range AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsensusAlgorithmFamiliesWithTxFinality value +func (v ConsensusAlgorithmFamiliesWithTxFinality) Ptr() *ConsensusAlgorithmFamiliesWithTxFinality { + return &v +} + +type NullableConsensusAlgorithmFamiliesWithTxFinality struct { + value *ConsensusAlgorithmFamiliesWithTxFinality + isSet bool +} + +func (v NullableConsensusAlgorithmFamiliesWithTxFinality) Get() *ConsensusAlgorithmFamiliesWithTxFinality { + return v.value +} + +func (v *NullableConsensusAlgorithmFamiliesWithTxFinality) Set(val *ConsensusAlgorithmFamiliesWithTxFinality) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusAlgorithmFamiliesWithTxFinality) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusAlgorithmFamiliesWithTxFinality) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusAlgorithmFamiliesWithTxFinality(val *ConsensusAlgorithmFamiliesWithTxFinality) *NullableConsensusAlgorithmFamiliesWithTxFinality { + return &NullableConsensusAlgorithmFamiliesWithTxFinality{value: val, isSet: true} +} + +func (v NullableConsensusAlgorithmFamiliesWithTxFinality) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusAlgorithmFamiliesWithTxFinality) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go new file mode 100644 index 0000000000..f57749641d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go @@ -0,0 +1,113 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// ConsensusAlgorithmFamily Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremost a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do. +type ConsensusAlgorithmFamily string + +// List of ConsensusAlgorithmFamily +const ( + AUTHORITY ConsensusAlgorithmFamily = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY" + STAKE ConsensusAlgorithmFamily = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE" + WORK ConsensusAlgorithmFamily = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK" +) + +// All allowed values of ConsensusAlgorithmFamily enum +var AllowedConsensusAlgorithmFamilyEnumValues = []ConsensusAlgorithmFamily{ + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY", + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE", + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK", +} + +func (v *ConsensusAlgorithmFamily) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsensusAlgorithmFamily(value) + for _, existing := range AllowedConsensusAlgorithmFamilyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsensusAlgorithmFamily", value) +} + +// NewConsensusAlgorithmFamilyFromValue returns a pointer to a valid ConsensusAlgorithmFamily +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsensusAlgorithmFamilyFromValue(v string) (*ConsensusAlgorithmFamily, error) { + ev := ConsensusAlgorithmFamily(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsensusAlgorithmFamily: valid values are %v", v, AllowedConsensusAlgorithmFamilyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsensusAlgorithmFamily) IsValid() bool { + for _, existing := range AllowedConsensusAlgorithmFamilyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsensusAlgorithmFamily value +func (v ConsensusAlgorithmFamily) Ptr() *ConsensusAlgorithmFamily { + return &v +} + +type NullableConsensusAlgorithmFamily struct { + value *ConsensusAlgorithmFamily + isSet bool +} + +func (v NullableConsensusAlgorithmFamily) Get() *ConsensusAlgorithmFamily { + return v.value +} + +func (v *NullableConsensusAlgorithmFamily) Set(val *ConsensusAlgorithmFamily) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusAlgorithmFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusAlgorithmFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusAlgorithmFamily(val *ConsensusAlgorithmFamily) *NullableConsensusAlgorithmFamily { + return &NullableConsensusAlgorithmFamily{value: val, isSet: true} +} + +func (v NullableConsensusAlgorithmFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusAlgorithmFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go new file mode 100644 index 0000000000..a5bbdf4140 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go @@ -0,0 +1,199 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the Consortium type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Consortium{} + +// Consortium struct for Consortium +type Consortium struct { + Id string `json:"id"` + Name string `json:"name"` + MainApiHost string `json:"mainApiHost"` + // The collection (array) of primary keys of consortium member entities that belong to this Consortium. + MemberIds []string `json:"memberIds"` +} + +// NewConsortium instantiates a new Consortium object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsortium(id string, name string, mainApiHost string, memberIds []string) *Consortium { + this := Consortium{} + this.Id = id + this.Name = name + this.MainApiHost = mainApiHost + this.MemberIds = memberIds + return &this +} + +// NewConsortiumWithDefaults instantiates a new Consortium object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsortiumWithDefaults() *Consortium { + this := Consortium{} + return &this +} + +// GetId returns the Id field value +func (o *Consortium) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Consortium) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Consortium) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Consortium) SetName(v string) { + o.Name = v +} + +// GetMainApiHost returns the MainApiHost field value +func (o *Consortium) GetMainApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.MainApiHost +} + +// GetMainApiHostOk returns a tuple with the MainApiHost field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetMainApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MainApiHost, true +} + +// SetMainApiHost sets field value +func (o *Consortium) SetMainApiHost(v string) { + o.MainApiHost = v +} + +// GetMemberIds returns the MemberIds field value +func (o *Consortium) GetMemberIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.MemberIds +} + +// GetMemberIdsOk returns a tuple with the MemberIds field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetMemberIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.MemberIds, true +} + +// SetMemberIds sets field value +func (o *Consortium) SetMemberIds(v []string) { + o.MemberIds = v +} + +func (o Consortium) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Consortium) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["mainApiHost"] = o.MainApiHost + toSerialize["memberIds"] = o.MemberIds + return toSerialize, nil +} + +type NullableConsortium struct { + value *Consortium + isSet bool +} + +func (v NullableConsortium) Get() *Consortium { + return v.value +} + +func (v *NullableConsortium) Set(val *Consortium) { + v.value = val + v.isSet = true +} + +func (v NullableConsortium) IsSet() bool { + return v.isSet +} + +func (v *NullableConsortium) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsortium(val *Consortium) *NullableConsortium { + return &NullableConsortium{value: val, isSet: true} +} + +func (v NullableConsortium) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsortium) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go new file mode 100644 index 0000000000..6e25b01ebf --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go @@ -0,0 +1,230 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the ConsortiumDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsortiumDatabase{} + +// ConsortiumDatabase struct for ConsortiumDatabase +type ConsortiumDatabase struct { + // A collection of Consortium entities. In practice this should only ever contain a single consortium, but we defined it as an array to keep the convention up with the rest of the collections defined in the Consortium data in general. Also, if we ever decide to somehow have some sort of consortium to consortium integration (which does not make much sense in the current frame of mind of the author in the year 2020) then having this as an array will have proven itself to be an excellent long term compatibility/extensibility decision indeed. + Consortium []Consortium `json:"consortium"` + // The complete collection of all ledger entities in existence within the consortium. + Ledger []Ledger `json:"ledger"` + // The complete collection of all consortium member entities in existence within the consortium. + ConsortiumMember []ConsortiumMember `json:"consortiumMember"` + // The complete collection of all cactus nodes entities in existence within the consortium. + CactusNode []CactusNode `json:"cactusNode"` + // The complete collection of all plugin instance entities in existence within the consortium. + PluginInstance []PluginInstance `json:"pluginInstance"` +} + +// NewConsortiumDatabase instantiates a new ConsortiumDatabase object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsortiumDatabase(consortium []Consortium, ledger []Ledger, consortiumMember []ConsortiumMember, cactusNode []CactusNode, pluginInstance []PluginInstance) *ConsortiumDatabase { + this := ConsortiumDatabase{} + this.Consortium = consortium + this.Ledger = ledger + this.ConsortiumMember = consortiumMember + this.CactusNode = cactusNode + this.PluginInstance = pluginInstance + return &this +} + +// NewConsortiumDatabaseWithDefaults instantiates a new ConsortiumDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsortiumDatabaseWithDefaults() *ConsortiumDatabase { + this := ConsortiumDatabase{} + return &this +} + +// GetConsortium returns the Consortium field value +func (o *ConsortiumDatabase) GetConsortium() []Consortium { + if o == nil { + var ret []Consortium + return ret + } + + return o.Consortium +} + +// GetConsortiumOk returns a tuple with the Consortium field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetConsortiumOk() ([]Consortium, bool) { + if o == nil { + return nil, false + } + return o.Consortium, true +} + +// SetConsortium sets field value +func (o *ConsortiumDatabase) SetConsortium(v []Consortium) { + o.Consortium = v +} + +// GetLedger returns the Ledger field value +func (o *ConsortiumDatabase) GetLedger() []Ledger { + if o == nil { + var ret []Ledger + return ret + } + + return o.Ledger +} + +// GetLedgerOk returns a tuple with the Ledger field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetLedgerOk() ([]Ledger, bool) { + if o == nil { + return nil, false + } + return o.Ledger, true +} + +// SetLedger sets field value +func (o *ConsortiumDatabase) SetLedger(v []Ledger) { + o.Ledger = v +} + +// GetConsortiumMember returns the ConsortiumMember field value +func (o *ConsortiumDatabase) GetConsortiumMember() []ConsortiumMember { + if o == nil { + var ret []ConsortiumMember + return ret + } + + return o.ConsortiumMember +} + +// GetConsortiumMemberOk returns a tuple with the ConsortiumMember field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetConsortiumMemberOk() ([]ConsortiumMember, bool) { + if o == nil { + return nil, false + } + return o.ConsortiumMember, true +} + +// SetConsortiumMember sets field value +func (o *ConsortiumDatabase) SetConsortiumMember(v []ConsortiumMember) { + o.ConsortiumMember = v +} + +// GetCactusNode returns the CactusNode field value +func (o *ConsortiumDatabase) GetCactusNode() []CactusNode { + if o == nil { + var ret []CactusNode + return ret + } + + return o.CactusNode +} + +// GetCactusNodeOk returns a tuple with the CactusNode field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetCactusNodeOk() ([]CactusNode, bool) { + if o == nil { + return nil, false + } + return o.CactusNode, true +} + +// SetCactusNode sets field value +func (o *ConsortiumDatabase) SetCactusNode(v []CactusNode) { + o.CactusNode = v +} + +// GetPluginInstance returns the PluginInstance field value +func (o *ConsortiumDatabase) GetPluginInstance() []PluginInstance { + if o == nil { + var ret []PluginInstance + return ret + } + + return o.PluginInstance +} + +// GetPluginInstanceOk returns a tuple with the PluginInstance field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetPluginInstanceOk() ([]PluginInstance, bool) { + if o == nil { + return nil, false + } + return o.PluginInstance, true +} + +// SetPluginInstance sets field value +func (o *ConsortiumDatabase) SetPluginInstance(v []PluginInstance) { + o.PluginInstance = v +} + +func (o ConsortiumDatabase) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsortiumDatabase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["consortium"] = o.Consortium + toSerialize["ledger"] = o.Ledger + toSerialize["consortiumMember"] = o.ConsortiumMember + toSerialize["cactusNode"] = o.CactusNode + toSerialize["pluginInstance"] = o.PluginInstance + return toSerialize, nil +} + +type NullableConsortiumDatabase struct { + value *ConsortiumDatabase + isSet bool +} + +func (v NullableConsortiumDatabase) Get() *ConsortiumDatabase { + return v.value +} + +func (v *NullableConsortiumDatabase) Set(val *ConsortiumDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableConsortiumDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableConsortiumDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsortiumDatabase(val *ConsortiumDatabase) *NullableConsortiumDatabase { + return &NullableConsortiumDatabase{value: val, isSet: true} +} + +func (v NullableConsortiumDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsortiumDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go new file mode 100644 index 0000000000..8b457b910d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go @@ -0,0 +1,172 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the ConsortiumMember type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsortiumMember{} + +// ConsortiumMember struct for ConsortiumMember +type ConsortiumMember struct { + Id string `json:"id"` + // The human readable name a Consortium member can be referred to while making it easy for humans to distinguish this particular consortium member entity from any other ones. + Name string `json:"name"` + NodeIds []string `json:"nodeIds"` +} + +// NewConsortiumMember instantiates a new ConsortiumMember object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsortiumMember(id string, name string, nodeIds []string) *ConsortiumMember { + this := ConsortiumMember{} + this.Id = id + this.Name = name + this.NodeIds = nodeIds + return &this +} + +// NewConsortiumMemberWithDefaults instantiates a new ConsortiumMember object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsortiumMemberWithDefaults() *ConsortiumMember { + this := ConsortiumMember{} + return &this +} + +// GetId returns the Id field value +func (o *ConsortiumMember) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsortiumMember) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsortiumMember) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ConsortiumMember) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsortiumMember) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsortiumMember) SetName(v string) { + o.Name = v +} + +// GetNodeIds returns the NodeIds field value +func (o *ConsortiumMember) GetNodeIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.NodeIds +} + +// GetNodeIdsOk returns a tuple with the NodeIds field value +// and a boolean to check if the value has been set. +func (o *ConsortiumMember) GetNodeIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.NodeIds, true +} + +// SetNodeIds sets field value +func (o *ConsortiumMember) SetNodeIds(v []string) { + o.NodeIds = v +} + +func (o ConsortiumMember) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsortiumMember) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["nodeIds"] = o.NodeIds + return toSerialize, nil +} + +type NullableConsortiumMember struct { + value *ConsortiumMember + isSet bool +} + +func (v NullableConsortiumMember) Get() *ConsortiumMember { + return v.value +} + +func (v *NullableConsortiumMember) Set(val *ConsortiumMember) { + v.value = val + v.isSet = true +} + +func (v NullableConsortiumMember) IsSet() bool { + return v.isSet +} + +func (v *NullableConsortiumMember) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsortiumMember(val *ConsortiumMember) *NullableConsortiumMember { + return &NullableConsortiumMember{value: val, isSet: true} +} + +func (v NullableConsortiumMember) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsortiumMember) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go new file mode 100644 index 0000000000..977da8fea4 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go @@ -0,0 +1,109 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// Constants the model 'Constants' +type Constants string + +// List of Constants +const ( + SocketIoConnectionPathV1 Constants = "/api/v1/async/socket-io/connect" +) + +// All allowed values of Constants enum +var AllowedConstantsEnumValues = []Constants{ + "/api/v1/async/socket-io/connect", +} + +func (v *Constants) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Constants(value) + for _, existing := range AllowedConstantsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Constants", value) +} + +// NewConstantsFromValue returns a pointer to a valid Constants +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConstantsFromValue(v string) (*Constants, error) { + ev := Constants(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Constants: valid values are %v", v, AllowedConstantsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Constants) IsValid() bool { + for _, existing := range AllowedConstantsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Constants value +func (v Constants) Ptr() *Constants { + return &v +} + +type NullableConstants struct { + value *Constants + isSet bool +} + +func (v NullableConstants) Get() *Constants { + return v.value +} + +func (v *NullableConstants) Set(val *Constants) { + v.value = val + v.isSet = true +} + +func (v NullableConstants) IsSet() bool { + return v.isSet +} + +func (v *NullableConstants) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConstants(val *Constants) *NullableConstants { + return &NullableConstants{value: val, isSet: true} +} + +func (v NullableConstants) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConstants) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 0000000000..a8faaaa7ee --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 0000000000..6731447354 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 0000000000..31573563b7 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 0000000000..bebaa7db01 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go new file mode 100644 index 0000000000..119d21b600 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectRequestV1{} + +// GetObjectRequestV1 struct for GetObjectRequestV1 +type GetObjectRequestV1 struct { + // The key for the entry to get from the object store. + Key string `json:"key"` +} + +// NewGetObjectRequestV1 instantiates a new GetObjectRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetObjectRequestV1(key string) *GetObjectRequestV1 { + this := GetObjectRequestV1{} + this.Key = key + return &this +} + +// NewGetObjectRequestV1WithDefaults instantiates a new GetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectRequestV1WithDefaults() *GetObjectRequestV1 { + this := GetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetObjectRequestV1 struct { + value *GetObjectRequestV1 + isSet bool +} + +func (v NullableGetObjectRequestV1) Get() *GetObjectRequestV1 { + return v.value +} + +func (v *NullableGetObjectRequestV1) Set(val *GetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectRequestV1(val *GetObjectRequestV1) *NullableGetObjectRequestV1 { + return &NullableGetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableGetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go new file mode 100644 index 0000000000..284460c622 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectResponseV1{} + +// GetObjectResponseV1 struct for GetObjectResponseV1 +type GetObjectResponseV1 struct { + // The key that was used to retrieve the value from the object store. + Key string `json:"key"` + // The value associated with the requested key in the object store as a string. + Value string `json:"value"` +} + +// NewGetObjectResponseV1 instantiates a new GetObjectResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetObjectResponseV1(key string, value string) *GetObjectResponseV1 { + this := GetObjectResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetObjectResponseV1WithDefaults instantiates a new GetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectResponseV1WithDefaults() *GetObjectResponseV1 { + this := GetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetObjectResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetObjectResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetObjectResponseV1 struct { + value *GetObjectResponseV1 + isSet bool +} + +func (v NullableGetObjectResponseV1) Get() *GetObjectResponseV1 { + return v.value +} + +func (v *NullableGetObjectResponseV1) Set(val *GetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectResponseV1(val *GetObjectResponseV1) *NullableGetObjectResponseV1 { + return &NullableGetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableGetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 0000000000..30ac931db8 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 0000000000..7e4394e256 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go new file mode 100644 index 0000000000..01915fca99 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectRequestV1{} + +// HasObjectRequestV1 struct for HasObjectRequestV1 +type HasObjectRequestV1 struct { + // The key to check for presence in the object store. + Key string `json:"key"` +} + +// NewHasObjectRequestV1 instantiates a new HasObjectRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasObjectRequestV1(key string) *HasObjectRequestV1 { + this := HasObjectRequestV1{} + this.Key = key + return &this +} + +// NewHasObjectRequestV1WithDefaults instantiates a new HasObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectRequestV1WithDefaults() *HasObjectRequestV1 { + this := HasObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasObjectRequestV1 struct { + value *HasObjectRequestV1 + isSet bool +} + +func (v NullableHasObjectRequestV1) Get() *HasObjectRequestV1 { + return v.value +} + +func (v *NullableHasObjectRequestV1) Set(val *HasObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectRequestV1(val *HasObjectRequestV1) *NullableHasObjectRequestV1 { + return &NullableHasObjectRequestV1{value: val, isSet: true} +} + +func (v NullableHasObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go new file mode 100644 index 0000000000..d7794cf7fd --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectResponseV1{} + +// HasObjectResponseV1 struct for HasObjectResponseV1 +type HasObjectResponseV1 struct { + // The key that was used to check the presence of the value in the object store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an object under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasObjectResponseV1 instantiates a new HasObjectResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasObjectResponseV1(key string, checkedAt string, isPresent bool) *HasObjectResponseV1 { + this := HasObjectResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasObjectResponseV1WithDefaults instantiates a new HasObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectResponseV1WithDefaults() *HasObjectResponseV1 { + this := HasObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasObjectResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasObjectResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasObjectResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasObjectResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasObjectResponseV1 struct { + value *HasObjectResponseV1 + isSet bool +} + +func (v NullableHasObjectResponseV1) Get() *HasObjectResponseV1 { + return v.value +} + +func (v *NullableHasObjectResponseV1) Set(val *HasObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectResponseV1(val *HasObjectResponseV1) *NullableHasObjectResponseV1 { + return &NullableHasObjectResponseV1{value: val, isSet: true} +} + +func (v NullableHasObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go new file mode 100644 index 0000000000..fcd0b37c39 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go @@ -0,0 +1,144 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the JWSGeneral type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSGeneral{} + +// JWSGeneral struct for JWSGeneral +type JWSGeneral struct { + Payload string `json:"payload"` + Signatures []JWSRecipient `json:"signatures"` +} + +// NewJWSGeneral instantiates a new JWSGeneral object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJWSGeneral(payload string, signatures []JWSRecipient) *JWSGeneral { + this := JWSGeneral{} + this.Payload = payload + this.Signatures = signatures + return &this +} + +// NewJWSGeneralWithDefaults instantiates a new JWSGeneral object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSGeneralWithDefaults() *JWSGeneral { + this := JWSGeneral{} + return &this +} + +// GetPayload returns the Payload field value +func (o *JWSGeneral) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *JWSGeneral) SetPayload(v string) { + o.Payload = v +} + +// GetSignatures returns the Signatures field value +func (o *JWSGeneral) GetSignatures() []JWSRecipient { + if o == nil { + var ret []JWSRecipient + return ret + } + + return o.Signatures +} + +// GetSignaturesOk returns a tuple with the Signatures field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetSignaturesOk() ([]JWSRecipient, bool) { + if o == nil { + return nil, false + } + return o.Signatures, true +} + +// SetSignatures sets field value +func (o *JWSGeneral) SetSignatures(v []JWSRecipient) { + o.Signatures = v +} + +func (o JWSGeneral) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSGeneral) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + toSerialize["signatures"] = o.Signatures + return toSerialize, nil +} + +type NullableJWSGeneral struct { + value *JWSGeneral + isSet bool +} + +func (v NullableJWSGeneral) Get() *JWSGeneral { + return v.value +} + +func (v *NullableJWSGeneral) Set(val *JWSGeneral) { + v.value = val + v.isSet = true +} + +func (v NullableJWSGeneral) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSGeneral) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSGeneral(val *JWSGeneral) *NullableJWSGeneral { + return &NullableJWSGeneral{value: val, isSet: true} +} + +func (v NullableJWSGeneral) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSGeneral) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go new file mode 100644 index 0000000000..a4e375586e --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go @@ -0,0 +1,189 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the JWSRecipient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSRecipient{} + +// JWSRecipient A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. +type JWSRecipient struct { + Signature string `json:"signature"` + Protected *string `json:"protected,omitempty"` + Header map[string]interface{} `json:"header,omitempty"` +} + +// NewJWSRecipient instantiates a new JWSRecipient object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJWSRecipient(signature string) *JWSRecipient { + this := JWSRecipient{} + this.Signature = signature + return &this +} + +// NewJWSRecipientWithDefaults instantiates a new JWSRecipient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSRecipientWithDefaults() *JWSRecipient { + this := JWSRecipient{} + return &this +} + +// GetSignature returns the Signature field value +func (o *JWSRecipient) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *JWSRecipient) SetSignature(v string) { + o.Signature = v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *JWSRecipient) GetProtected() string { + if o == nil || IsNil(o.Protected) { + var ret string + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetProtectedOk() (*string, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *JWSRecipient) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given string and assigns it to the Protected field. +func (o *JWSRecipient) SetProtected(v string) { + o.Protected = &v +} + +// GetHeader returns the Header field value if set, zero value otherwise. +func (o *JWSRecipient) GetHeader() map[string]interface{} { + if o == nil || IsNil(o.Header) { + var ret map[string]interface{} + return ret + } + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetHeaderOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Header) { + return map[string]interface{}{}, false + } + return o.Header, true +} + +// HasHeader returns a boolean if a field has been set. +func (o *JWSRecipient) HasHeader() bool { + if o != nil && !IsNil(o.Header) { + return true + } + + return false +} + +// SetHeader gets a reference to the given map[string]interface{} and assigns it to the Header field. +func (o *JWSRecipient) SetHeader(v map[string]interface{}) { + o.Header = v +} + +func (o JWSRecipient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSRecipient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signature"] = o.Signature + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Header) { + toSerialize["header"] = o.Header + } + return toSerialize, nil +} + +type NullableJWSRecipient struct { + value *JWSRecipient + isSet bool +} + +func (v NullableJWSRecipient) Get() *JWSRecipient { + return v.value +} + +func (v *NullableJWSRecipient) Set(val *JWSRecipient) { + v.value = val + v.isSet = true +} + +func (v NullableJWSRecipient) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSRecipient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSRecipient(val *JWSRecipient) *NullableJWSRecipient { + return &NullableJWSRecipient{value: val, isSet: true} +} + +func (v NullableJWSRecipient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSRecipient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go new file mode 100644 index 0000000000..26791a2fdf --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go @@ -0,0 +1,180 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the Ledger type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Ledger{} + +// Ledger struct for Ledger +type Ledger struct { + Id string `json:"id"` + LedgerType LedgerType `json:"ledgerType"` + ConsortiumMemberId *string `json:"consortiumMemberId,omitempty"` +} + +// NewLedger instantiates a new Ledger object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLedger(id string, ledgerType LedgerType) *Ledger { + this := Ledger{} + this.Id = id + this.LedgerType = ledgerType + return &this +} + +// NewLedgerWithDefaults instantiates a new Ledger object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLedgerWithDefaults() *Ledger { + this := Ledger{} + return &this +} + +// GetId returns the Id field value +func (o *Ledger) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Ledger) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Ledger) SetId(v string) { + o.Id = v +} + +// GetLedgerType returns the LedgerType field value +func (o *Ledger) GetLedgerType() LedgerType { + if o == nil { + var ret LedgerType + return ret + } + + return o.LedgerType +} + +// GetLedgerTypeOk returns a tuple with the LedgerType field value +// and a boolean to check if the value has been set. +func (o *Ledger) GetLedgerTypeOk() (*LedgerType, bool) { + if o == nil { + return nil, false + } + return &o.LedgerType, true +} + +// SetLedgerType sets field value +func (o *Ledger) SetLedgerType(v LedgerType) { + o.LedgerType = v +} + +// GetConsortiumMemberId returns the ConsortiumMemberId field value if set, zero value otherwise. +func (o *Ledger) GetConsortiumMemberId() string { + if o == nil || IsNil(o.ConsortiumMemberId) { + var ret string + return ret + } + return *o.ConsortiumMemberId +} + +// GetConsortiumMemberIdOk returns a tuple with the ConsortiumMemberId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Ledger) GetConsortiumMemberIdOk() (*string, bool) { + if o == nil || IsNil(o.ConsortiumMemberId) { + return nil, false + } + return o.ConsortiumMemberId, true +} + +// HasConsortiumMemberId returns a boolean if a field has been set. +func (o *Ledger) HasConsortiumMemberId() bool { + if o != nil && !IsNil(o.ConsortiumMemberId) { + return true + } + + return false +} + +// SetConsortiumMemberId gets a reference to the given string and assigns it to the ConsortiumMemberId field. +func (o *Ledger) SetConsortiumMemberId(v string) { + o.ConsortiumMemberId = &v +} + +func (o Ledger) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Ledger) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["ledgerType"] = o.LedgerType + if !IsNil(o.ConsortiumMemberId) { + toSerialize["consortiumMemberId"] = o.ConsortiumMemberId + } + return toSerialize, nil +} + +type NullableLedger struct { + value *Ledger + isSet bool +} + +func (v NullableLedger) Get() *Ledger { + return v.value +} + +func (v *NullableLedger) Set(val *Ledger) { + v.value = val + v.isSet = true +} + +func (v NullableLedger) IsSet() bool { + return v.isSet +} + +func (v *NullableLedger) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLedger(val *Ledger) *NullableLedger { + return &NullableLedger{value: val, isSet: true} +} + +func (v NullableLedger) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLedger) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go new file mode 100644 index 0000000000..656e762843 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go @@ -0,0 +1,123 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// LedgerType Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation. +type LedgerType string + +// List of LedgerType +const ( + BESU_1_X LedgerType = "BESU_1X" + BESU_2_X LedgerType = "BESU_2X" + BURROW_0_X LedgerType = "BURROW_0X" + CORDA_4_X LedgerType = "CORDA_4X" + FABRIC_14_X LedgerType = "FABRIC_14X" + FABRIC_2 LedgerType = "FABRIC_2" + QUORUM_2_X LedgerType = "QUORUM_2X" + SAWTOOTH_1_X LedgerType = "SAWTOOTH_1X" +) + +// All allowed values of LedgerType enum +var AllowedLedgerTypeEnumValues = []LedgerType{ + "BESU_1X", + "BESU_2X", + "BURROW_0X", + "CORDA_4X", + "FABRIC_14X", + "FABRIC_2", + "QUORUM_2X", + "SAWTOOTH_1X", +} + +func (v *LedgerType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LedgerType(value) + for _, existing := range AllowedLedgerTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LedgerType", value) +} + +// NewLedgerTypeFromValue returns a pointer to a valid LedgerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLedgerTypeFromValue(v string) (*LedgerType, error) { + ev := LedgerType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LedgerType: valid values are %v", v, AllowedLedgerTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LedgerType) IsValid() bool { + for _, existing := range AllowedLedgerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LedgerType value +func (v LedgerType) Ptr() *LedgerType { + return &v +} + +type NullableLedgerType struct { + value *LedgerType + isSet bool +} + +func (v NullableLedgerType) Get() *LedgerType { + return v.value +} + +func (v *NullableLedgerType) Set(val *LedgerType) { + v.value = val + v.isSet = true +} + +func (v NullableLedgerType) IsSet() bool { + return v.isSet +} + +func (v *NullableLedgerType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLedgerType(val *LedgerType) *NullableLedgerType { + return &NullableLedgerType{value: val, isSet: true} +} + +func (v NullableLedgerType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLedgerType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go new file mode 100644 index 0000000000..ff7a60d7ba --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go @@ -0,0 +1,208 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the PluginImport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PluginImport{} + +// PluginImport struct for PluginImport +type PluginImport struct { + PackageName string `json:"packageName"` + Type PluginImportType `json:"type"` + Action PluginImportAction `json:"action"` + Options interface{} `json:"options,omitempty"` +} + +// NewPluginImport instantiates a new PluginImport object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPluginImport(packageName string, type_ PluginImportType, action PluginImportAction) *PluginImport { + this := PluginImport{} + this.PackageName = packageName + this.Type = type_ + this.Action = action + return &this +} + +// NewPluginImportWithDefaults instantiates a new PluginImport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPluginImportWithDefaults() *PluginImport { + this := PluginImport{} + return &this +} + +// GetPackageName returns the PackageName field value +func (o *PluginImport) GetPackageName() string { + if o == nil { + var ret string + return ret + } + + return o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value +// and a boolean to check if the value has been set. +func (o *PluginImport) GetPackageNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PackageName, true +} + +// SetPackageName sets field value +func (o *PluginImport) SetPackageName(v string) { + o.PackageName = v +} + +// GetType returns the Type field value +func (o *PluginImport) GetType() PluginImportType { + if o == nil { + var ret PluginImportType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PluginImport) GetTypeOk() (*PluginImportType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PluginImport) SetType(v PluginImportType) { + o.Type = v +} + +// GetAction returns the Action field value +func (o *PluginImport) GetAction() PluginImportAction { + if o == nil { + var ret PluginImportAction + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *PluginImport) GetActionOk() (*PluginImportAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *PluginImport) SetAction(v PluginImportAction) { + o.Action = v +} + +// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PluginImport) GetOptions() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PluginImport) GetOptionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return &o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *PluginImport) HasOptions() bool { + if o != nil && IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given interface{} and assigns it to the Options field. +func (o *PluginImport) SetOptions(v interface{}) { + o.Options = v +} + +func (o PluginImport) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PluginImport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["packageName"] = o.PackageName + toSerialize["type"] = o.Type + toSerialize["action"] = o.Action + if o.Options != nil { + toSerialize["options"] = o.Options + } + return toSerialize, nil +} + +type NullablePluginImport struct { + value *PluginImport + isSet bool +} + +func (v NullablePluginImport) Get() *PluginImport { + return v.value +} + +func (v *NullablePluginImport) Set(val *PluginImport) { + v.value = val + v.isSet = true +} + +func (v NullablePluginImport) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginImport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginImport(val *PluginImport) *NullablePluginImport { + return &NullablePluginImport{value: val, isSet: true} +} + +func (v NullablePluginImport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginImport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go new file mode 100644 index 0000000000..0bda1df94e --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go @@ -0,0 +1,111 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// PluginImportAction the model 'PluginImportAction' +type PluginImportAction string + +// List of PluginImportAction +const ( + INSTANTIATE PluginImportAction = "org.hyperledger.cactus.plugin_import_action.INSTANTIATE" + INSTALL PluginImportAction = "org.hyperledger.cactus.plugin_import_action.INSTALL" +) + +// All allowed values of PluginImportAction enum +var AllowedPluginImportActionEnumValues = []PluginImportAction{ + "org.hyperledger.cactus.plugin_import_action.INSTANTIATE", + "org.hyperledger.cactus.plugin_import_action.INSTALL", +} + +func (v *PluginImportAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PluginImportAction(value) + for _, existing := range AllowedPluginImportActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PluginImportAction", value) +} + +// NewPluginImportActionFromValue returns a pointer to a valid PluginImportAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPluginImportActionFromValue(v string) (*PluginImportAction, error) { + ev := PluginImportAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PluginImportAction: valid values are %v", v, AllowedPluginImportActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PluginImportAction) IsValid() bool { + for _, existing := range AllowedPluginImportActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PluginImportAction value +func (v PluginImportAction) Ptr() *PluginImportAction { + return &v +} + +type NullablePluginImportAction struct { + value *PluginImportAction + isSet bool +} + +func (v NullablePluginImportAction) Get() *PluginImportAction { + return v.value +} + +func (v *NullablePluginImportAction) Set(val *PluginImportAction) { + v.value = val + v.isSet = true +} + +func (v NullablePluginImportAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginImportAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginImportAction(val *PluginImportAction) *NullablePluginImportAction { + return &NullablePluginImportAction{value: val, isSet: true} +} + +func (v NullablePluginImportAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginImportAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go new file mode 100644 index 0000000000..057ec5b037 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// PluginImportType the model 'PluginImportType' +type PluginImportType string + +// List of PluginImportType +const ( + LOCAL PluginImportType = "org.hyperledger.cactus.plugin_import_type.LOCAL" + REMOTE PluginImportType = "org.hyperledger.cactus.plugin_import_type.REMOTE" +) + +// All allowed values of PluginImportType enum +var AllowedPluginImportTypeEnumValues = []PluginImportType{ + "org.hyperledger.cactus.plugin_import_type.LOCAL", + "org.hyperledger.cactus.plugin_import_type.REMOTE", +} + +func (v *PluginImportType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PluginImportType(value) + for _, existing := range AllowedPluginImportTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PluginImportType", value) +} + +// NewPluginImportTypeFromValue returns a pointer to a valid PluginImportType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPluginImportTypeFromValue(v string) (*PluginImportType, error) { + ev := PluginImportType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PluginImportType: valid values are %v", v, AllowedPluginImportTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PluginImportType) IsValid() bool { + for _, existing := range AllowedPluginImportTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PluginImportType value +func (v PluginImportType) Ptr() *PluginImportType { + return &v +} + +type NullablePluginImportType struct { + value *PluginImportType + isSet bool +} + +func (v NullablePluginImportType) Get() *PluginImportType { + return v.value +} + +func (v *NullablePluginImportType) Set(val *PluginImportType) { + v.value = val + v.isSet = true +} + +func (v NullablePluginImportType) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginImportType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginImportType(val *PluginImportType) *NullablePluginImportType { + return &NullablePluginImportType{value: val, isSet: true} +} + +func (v NullablePluginImportType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginImportType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go new file mode 100644 index 0000000000..008b14aced --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go @@ -0,0 +1,144 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the PluginInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PluginInstance{} + +// PluginInstance struct for PluginInstance +type PluginInstance struct { + Id string `json:"id"` + PackageName string `json:"packageName"` +} + +// NewPluginInstance instantiates a new PluginInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPluginInstance(id string, packageName string) *PluginInstance { + this := PluginInstance{} + this.Id = id + this.PackageName = packageName + return &this +} + +// NewPluginInstanceWithDefaults instantiates a new PluginInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPluginInstanceWithDefaults() *PluginInstance { + this := PluginInstance{} + return &this +} + +// GetId returns the Id field value +func (o *PluginInstance) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PluginInstance) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PluginInstance) SetId(v string) { + o.Id = v +} + +// GetPackageName returns the PackageName field value +func (o *PluginInstance) GetPackageName() string { + if o == nil { + var ret string + return ret + } + + return o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value +// and a boolean to check if the value has been set. +func (o *PluginInstance) GetPackageNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PackageName, true +} + +// SetPackageName sets field value +func (o *PluginInstance) SetPackageName(v string) { + o.PackageName = v +} + +func (o PluginInstance) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PluginInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["packageName"] = o.PackageName + return toSerialize, nil +} + +type NullablePluginInstance struct { + value *PluginInstance + isSet bool +} + +func (v NullablePluginInstance) Get() *PluginInstance { + return v.value +} + +func (v *NullablePluginInstance) Set(val *PluginInstance) { + v.value = val + v.isSet = true +} + +func (v NullablePluginInstance) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginInstance(val *PluginInstance) *NullablePluginInstance { + return &NullablePluginInstance{value: val, isSet: true} +} + +func (v NullablePluginInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 0000000000..2b235b8f2f --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 0000000000..7406c924a9 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go new file mode 100644 index 0000000000..7374fd26e2 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectRequestV1{} + +// SetObjectRequestV1 struct for SetObjectRequestV1 +type SetObjectRequestV1 struct { + // The key for the entry to set in the object store. + Key string `json:"key"` + // The value that will be associated with the key in the object store. + Value string `json:"value"` +} + +// NewSetObjectRequestV1 instantiates a new SetObjectRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetObjectRequestV1(key string, value string) *SetObjectRequestV1 { + this := SetObjectRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetObjectRequestV1WithDefaults instantiates a new SetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectRequestV1WithDefaults() *SetObjectRequestV1 { + this := SetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetObjectRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetObjectRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetObjectRequestV1 struct { + value *SetObjectRequestV1 + isSet bool +} + +func (v NullableSetObjectRequestV1) Get() *SetObjectRequestV1 { + return v.value +} + +func (v *NullableSetObjectRequestV1) Set(val *SetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectRequestV1(val *SetObjectRequestV1) *NullableSetObjectRequestV1 { + return &NullableSetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableSetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go new file mode 100644 index 0000000000..2a528b4edd --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectResponseV1{} + +// SetObjectResponseV1 struct for SetObjectResponseV1 +type SetObjectResponseV1 struct { + // The key that was used to set the value in the object store. + Key string `json:"key"` +} + +// NewSetObjectResponseV1 instantiates a new SetObjectResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetObjectResponseV1(key string) *SetObjectResponseV1 { + this := SetObjectResponseV1{} + this.Key = key + return &this +} + +// NewSetObjectResponseV1WithDefaults instantiates a new SetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectResponseV1WithDefaults() *SetObjectResponseV1 { + this := SetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetObjectResponseV1 struct { + value *SetObjectResponseV1 + isSet bool +} + +func (v NullableSetObjectResponseV1) Get() *SetObjectResponseV1 { + return v.value +} + +func (v *NullableSetObjectResponseV1) Set(val *SetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectResponseV1(val *SetObjectResponseV1) *NullableSetObjectResponseV1 { + return &NullableSetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableSetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..af7605aa62 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 0000000000..c0343cc47d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..5956bdc218 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Core API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..8fa424c1c0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,64 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/CactusNode.java +src/main/java/org/openapitools/client/model/CactusNodeAllOf.java +src/main/java/org/openapitools/client/model/CactusNodeMeta.java +src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java +src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java +src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java +src/main/java/org/openapitools/client/model/Consortium.java +src/main/java/org/openapitools/client/model/ConsortiumDatabase.java +src/main/java/org/openapitools/client/model/ConsortiumMember.java +src/main/java/org/openapitools/client/model/Constants.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetObjectRequestV1.java +src/main/java/org/openapitools/client/model/GetObjectResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasObjectRequestV1.java +src/main/java/org/openapitools/client/model/HasObjectResponseV1.java +src/main/java/org/openapitools/client/model/JWSGeneral.java +src/main/java/org/openapitools/client/model/JWSRecipient.java +src/main/java/org/openapitools/client/model/Ledger.java +src/main/java/org/openapitools/client/model/LedgerType.java +src/main/java/org/openapitools/client/model/PluginImport.java +src/main/java/org/openapitools/client/model/PluginImportAction.java +src/main/java/org/openapitools/client/model/PluginImportType.java +src/main/java/org/openapitools/client/model/PluginInstance.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetObjectRequestV1.java +src/main/java/org/openapitools/client/model/SetObjectResponseV1.java diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..6dca7bbfcd --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,139 @@ +# openapi-java-client + +Hyperledger Core API +- API version: v2.0.0-alpha.2 + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation for Models + + - [CactusNode](docs/CactusNode.md) + - [CactusNodeAllOf](docs/CactusNodeAllOf.md) + - [CactusNodeMeta](docs/CactusNodeMeta.md) + - [ConsensusAlgorithmFamiliesWithOutTxFinality](docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md) + - [ConsensusAlgorithmFamiliesWithTxFinality](docs/ConsensusAlgorithmFamiliesWithTxFinality.md) + - [ConsensusAlgorithmFamily](docs/ConsensusAlgorithmFamily.md) + - [Consortium](docs/Consortium.md) + - [ConsortiumDatabase](docs/ConsortiumDatabase.md) + - [ConsortiumMember](docs/ConsortiumMember.md) + - [Constants](docs/Constants.md) + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + - [Ledger](docs/Ledger.md) + - [LedgerType](docs/LedgerType.md) + - [PluginImport](docs/PluginImport.md) + - [PluginImportAction](docs/PluginImportAction.md) + - [PluginImportType](docs/PluginImportType.md) + - [PluginInstance](docs/PluginInstance.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..58e6619024 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,713 @@ +openapi: 3.0.3 +info: + description: "Contains/describes the core API types for Cactus. Does not describe\ + \ actual endpoints on its own as this is left to the implementing plugins who\ + \ can import and re-use commonly needed type definitions from this specification.\ + \ One example of said commonly used type definitions would be the types related\ + \ to consortium management, cactus nodes, ledgers, etc.." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Core API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + schemas: + Constants: + enum: + - /api/v1/async/socket-io/connect + type: string + x-enum-varnames: + - SocketIoConnectionPathV1 + PluginImport: + properties: + packageName: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/PluginImportType' + action: + $ref: '#/components/schemas/PluginImportAction' + options: {} + required: + - action + - packageName + - type + type: object + PluginImportType: + enum: + - org.hyperledger.cactus.plugin_import_type.LOCAL + - org.hyperledger.cactus.plugin_import_type.REMOTE + type: string + PluginImportAction: + enum: + - org.hyperledger.cactus.plugin_import_action.INSTANTIATE + - org.hyperledger.cactus.plugin_import_action.INSTALL + type: string + ConsensusAlgorithmFamily: + description: "Enumerates a list of consensus algorithm families in existence.\ + \ Does not intend to be an exhaustive list, just a practical one, meaning\ + \ that we only include items here that are relevant to Hyperledger Cactus\ + \ in fulfilling its own duties. This can be extended later as more sophisticated\ + \ features of Cactus get implemented. This enum is meant to be first and foremost\ + \ a useful abstraction for achieving practical tasks, not an encyclopedia\ + \ and therefore we ask of everyone that this to be extended only in ways that\ + \ serve a practical purpose for the runtime behavior of Cactus or Cactus plugins\ + \ in general. The bottom line is that we can accept this enum being not 100%\ + \ accurate as long as it 100% satisfies what it was designed to do." + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + ConsensusAlgorithmFamiliesWithTxFinality: + description: Enumerates a list of consensus algorithm families that provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + type: string + ConsensusAlgorithmFamiliesWithOutTxFinality: + description: Enumerates a list of consensus algorithm families that do not provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + x-enum-varnames: + - WORK + PrimaryKey: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ConsortiumMemberId: + $ref: '#/components/schemas/PrimaryKey' + CactusNodeId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumId: + $ref: '#/components/schemas/PrimaryKey' + LedgerId: + $ref: '#/components/schemas/PrimaryKey' + PluginInstanceId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumDatabase: + properties: + consortium: + default: [] + description: "A collection of Consortium entities. In practice this should\ + \ only ever contain a single consortium, but we defined it as an array\ + \ to keep the convention up with the rest of the collections defined in\ + \ the Consortium data in general. Also, if we ever decide to somehow have\ + \ some sort of consortium to consortium integration (which does not make\ + \ much sense in the current frame of mind of the author in the year 2020)\ + \ then having this as an array will have proven itself to be an excellent\ + \ long term compatibility/extensibility decision indeed." + items: + $ref: '#/components/schemas/Consortium' + maxItems: 2048 + minItems: 0 + type: array + ledger: + default: [] + description: The complete collection of all ledger entities in existence + within the consortium. + items: + $ref: '#/components/schemas/Ledger' + maxItems: 2048 + minItems: 0 + type: array + consortiumMember: + default: [] + description: The complete collection of all consortium member entities in + existence within the consortium. + items: + $ref: '#/components/schemas/ConsortiumMember' + maxItems: 2048 + minItems: 0 + type: array + cactusNode: + default: [] + description: The complete collection of all cactus nodes entities in existence + within the consortium. + items: + $ref: '#/components/schemas/CactusNode' + maxItems: 2048 + minItems: 0 + type: array + pluginInstance: + default: [] + description: The complete collection of all plugin instance entities in + existence within the consortium. + items: + $ref: '#/components/schemas/PluginInstance' + maxItems: 2048 + minItems: 0 + type: array + required: + - cactusNode + - consortium + - consortiumMember + - ledger + - pluginInstance + Ledger: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerType: + $ref: '#/components/schemas/LedgerType' + consortiumMemberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + required: + - id + - ledgerType + type: object + LedgerType: + description: "Enumerates the different ledger vendors and their major versions\ + \ encoded within the name of the LedgerType. For example \"BESU_1X\" involves\ + \ all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until,\ + \ but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further\ + \ explanation." + enum: + - BESU_1X + - BESU_2X + - BURROW_0X + - CORDA_4X + - FABRIC_14X + - FABRIC_2 + - QUORUM_2X + - SAWTOOTH_1X + type: string + Consortium: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + type: string + mainApiHost: + type: string + memberIds: + default: [] + description: The collection (array) of primary keys of consortium member + entities that belong to this Consortium. + items: + $ref: '#/components/schemas/ConsortiumMemberId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - mainApiHost + - memberIds + - name + type: object + ConsortiumMember: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + description: The human readable name a Consortium member can be referred + to while making it easy for humans to distinguish this particular consortium + member entity from any other ones. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeIds: + default: [] + items: + $ref: '#/components/schemas/CactusNodeId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - name + - nodeIds + type: object + CactusNodeMeta: + description: A Cactus node meta information + properties: + nodeApiHost: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + publicKeyPem: + description: The PEM encoded public key that was used to generate the JWS + included in the response (the jws property) + format: "Must only contain the public key, never include here the PEM that\ + \ also contains a private key. See PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - nodeApiHost + - publicKeyPem + type: object + CactusNode: + allOf: + - $ref: '#/components/schemas/CactusNodeMeta' + - $ref: '#/components/schemas/CactusNode_allOf' + description: "A Cactus node can be a single server, or a set of servers behind\ + \ a load balancer acting as one." + type: object + PluginInstance: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + packageName: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + required: + - id + - packageName + type: object + JWSCompact: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjJ9.DOCNCqEMN7CQ_z-RMndiyldljXOk6WFIZxRzNF5Ylg4 + maxLength: 65535 + minLength: 5 + pattern: "/^[a-zA-Z0-9-_]+?.[a-zA-Z0-9-_]+?.([a-zA-Z0-9-_]+)?$/" + type: string + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object + JWSGeneral: + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + GetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + HasObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + SetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + CactusNode_allOf: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + consortiumId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + memberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerIds: + default: [] + description: Stores an array of Ledger entity IDs that are reachable (routable) + via this Cactus Node. This information is used by the client side SDK + API client to figure out at runtime where to send API requests that are + specific to a certain ledger such as requests to execute transactions. + items: + $ref: '#/components/schemas/LedgerId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + pluginInstanceIds: + default: [] + items: + $ref: '#/components/schemas/PluginInstanceId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + required: + - consortiumId + - id + - ledgerIds + - memberId + - nodeApiHost + - pluginInstanceIds + - publicKeyPem + type: object + example: null + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..f8a0bc97ee --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..92a34f3575 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..b66f457f4e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..9df3a090ef --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..f5cd28bc55 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..ef9babdabe --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,425 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CactusNode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CactusNodeAllOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CactusNodeMeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Consortium.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsortiumDatabase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsortiumMember.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSGeneral.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSRecipient.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Ledger.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PluginImport.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PluginInstance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..055279b29d --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..81d888d9b1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..7f35f94d45 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..aa0a89f20d --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..7cdf43ddfc --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..40aa8c4a47 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..f38723336b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..6c44e85b45 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..6587cfbccc --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java new file mode 100644 index 0000000000..68ca63a778 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java @@ -0,0 +1,432 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A Cactus node can be a single server, or a set of servers behind a load balancer acting as one. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactusNode { + public static final String SERIALIZED_NAME_NODE_API_HOST = "nodeApiHost"; + @SerializedName(SERIALIZED_NAME_NODE_API_HOST) + private String nodeApiHost; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_PEM = "publicKeyPem"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_PEM) + private String publicKeyPem; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CONSORTIUM_ID = "consortiumId"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_ID) + private String consortiumId; + + public static final String SERIALIZED_NAME_MEMBER_ID = "memberId"; + @SerializedName(SERIALIZED_NAME_MEMBER_ID) + private String memberId; + + public static final String SERIALIZED_NAME_LEDGER_IDS = "ledgerIds"; + @SerializedName(SERIALIZED_NAME_LEDGER_IDS) + private List ledgerIds = null; + + public static final String SERIALIZED_NAME_PLUGIN_INSTANCE_IDS = "pluginInstanceIds"; + @SerializedName(SERIALIZED_NAME_PLUGIN_INSTANCE_IDS) + private List pluginInstanceIds = null; + + public CactusNode() { + } + + public CactusNode nodeApiHost(String nodeApiHost) { + + this.nodeApiHost = nodeApiHost; + return this; + } + + /** + * Get nodeApiHost + * @return nodeApiHost + **/ + @javax.annotation.Nonnull + public String getNodeApiHost() { + return nodeApiHost; + } + + + public void setNodeApiHost(String nodeApiHost) { + this.nodeApiHost = nodeApiHost; + } + + + public CactusNode publicKeyPem(String publicKeyPem) { + + this.publicKeyPem = publicKeyPem; + return this; + } + + /** + * The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + * @return publicKeyPem + **/ + @javax.annotation.Nonnull + public String getPublicKeyPem() { + return publicKeyPem; + } + + + public void setPublicKeyPem(String publicKeyPem) { + this.publicKeyPem = publicKeyPem; + } + + + public CactusNode id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CactusNode consortiumId(String consortiumId) { + + this.consortiumId = consortiumId; + return this; + } + + /** + * Get consortiumId + * @return consortiumId + **/ + @javax.annotation.Nonnull + public String getConsortiumId() { + return consortiumId; + } + + + public void setConsortiumId(String consortiumId) { + this.consortiumId = consortiumId; + } + + + public CactusNode memberId(String memberId) { + + this.memberId = memberId; + return this; + } + + /** + * Get memberId + * @return memberId + **/ + @javax.annotation.Nonnull + public String getMemberId() { + return memberId; + } + + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + public CactusNode ledgerIds(List ledgerIds) { + + this.ledgerIds = ledgerIds; + return this; + } + + public CactusNode addLedgerIdsItem(String ledgerIdsItem) { + if (this.ledgerIds == null) { + this.ledgerIds = null; + } + this.ledgerIds.add(ledgerIdsItem); + return this; + } + + /** + * Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + * @return ledgerIds + **/ + @javax.annotation.Nonnull + public List getLedgerIds() { + return ledgerIds; + } + + + public void setLedgerIds(List ledgerIds) { + this.ledgerIds = ledgerIds; + } + + + public CactusNode pluginInstanceIds(List pluginInstanceIds) { + + this.pluginInstanceIds = pluginInstanceIds; + return this; + } + + public CactusNode addPluginInstanceIdsItem(String pluginInstanceIdsItem) { + if (this.pluginInstanceIds == null) { + this.pluginInstanceIds = null; + } + this.pluginInstanceIds.add(pluginInstanceIdsItem); + return this; + } + + /** + * Get pluginInstanceIds + * @return pluginInstanceIds + **/ + @javax.annotation.Nonnull + public List getPluginInstanceIds() { + return pluginInstanceIds; + } + + + public void setPluginInstanceIds(List pluginInstanceIds) { + this.pluginInstanceIds = pluginInstanceIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactusNode cactusNode = (CactusNode) o; + return Objects.equals(this.nodeApiHost, cactusNode.nodeApiHost) && + Objects.equals(this.publicKeyPem, cactusNode.publicKeyPem) && + Objects.equals(this.id, cactusNode.id) && + Objects.equals(this.consortiumId, cactusNode.consortiumId) && + Objects.equals(this.memberId, cactusNode.memberId) && + Objects.equals(this.ledgerIds, cactusNode.ledgerIds) && + Objects.equals(this.pluginInstanceIds, cactusNode.pluginInstanceIds); + } + + @Override + public int hashCode() { + return Objects.hash(nodeApiHost, publicKeyPem, id, consortiumId, memberId, ledgerIds, pluginInstanceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactusNode {\n"); + sb.append(" nodeApiHost: ").append(toIndentedString(nodeApiHost)).append("\n"); + sb.append(" publicKeyPem: ").append(toIndentedString(publicKeyPem)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" consortiumId: ").append(toIndentedString(consortiumId)).append("\n"); + sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); + sb.append(" ledgerIds: ").append(toIndentedString(ledgerIds)).append("\n"); + sb.append(" pluginInstanceIds: ").append(toIndentedString(pluginInstanceIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeApiHost"); + openapiFields.add("publicKeyPem"); + openapiFields.add("id"); + openapiFields.add("consortiumId"); + openapiFields.add("memberId"); + openapiFields.add("ledgerIds"); + openapiFields.add("pluginInstanceIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nodeApiHost"); + openapiRequiredFields.add("publicKeyPem"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("consortiumId"); + openapiRequiredFields.add("memberId"); + openapiRequiredFields.add("ledgerIds"); + openapiRequiredFields.add("pluginInstanceIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactusNode + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactusNode.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactusNode is not found in the empty JSON string", CactusNode.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactusNode.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactusNode` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactusNode.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("nodeApiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeApiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeApiHost").toString())); + } + if (!jsonObj.get("publicKeyPem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyPem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyPem").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("consortiumId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consortiumId").toString())); + } + if (!jsonObj.get("memberId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `memberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("memberId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("ledgerIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ledgerIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerIds` to be an array in the JSON string but got `%s`", jsonObj.get("ledgerIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("pluginInstanceIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("pluginInstanceIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pluginInstanceIds` to be an array in the JSON string but got `%s`", jsonObj.get("pluginInstanceIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactusNode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactusNode' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactusNode.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactusNode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactusNode read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactusNode given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactusNode + * @throws IOException if the JSON string is invalid with respect to CactusNode + */ + public static CactusNode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactusNode.class); + } + + /** + * Convert an instance of CactusNode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java new file mode 100644 index 0000000000..12a8931119 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java @@ -0,0 +1,368 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CactusNodeAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactusNodeAllOf { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CONSORTIUM_ID = "consortiumId"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_ID) + private String consortiumId; + + public static final String SERIALIZED_NAME_MEMBER_ID = "memberId"; + @SerializedName(SERIALIZED_NAME_MEMBER_ID) + private String memberId; + + public static final String SERIALIZED_NAME_LEDGER_IDS = "ledgerIds"; + @SerializedName(SERIALIZED_NAME_LEDGER_IDS) + private List ledgerIds = null; + + public static final String SERIALIZED_NAME_PLUGIN_INSTANCE_IDS = "pluginInstanceIds"; + @SerializedName(SERIALIZED_NAME_PLUGIN_INSTANCE_IDS) + private List pluginInstanceIds = null; + + public CactusNodeAllOf() { + } + + public CactusNodeAllOf id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CactusNodeAllOf consortiumId(String consortiumId) { + + this.consortiumId = consortiumId; + return this; + } + + /** + * Get consortiumId + * @return consortiumId + **/ + @javax.annotation.Nonnull + public String getConsortiumId() { + return consortiumId; + } + + + public void setConsortiumId(String consortiumId) { + this.consortiumId = consortiumId; + } + + + public CactusNodeAllOf memberId(String memberId) { + + this.memberId = memberId; + return this; + } + + /** + * Get memberId + * @return memberId + **/ + @javax.annotation.Nonnull + public String getMemberId() { + return memberId; + } + + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + public CactusNodeAllOf ledgerIds(List ledgerIds) { + + this.ledgerIds = ledgerIds; + return this; + } + + public CactusNodeAllOf addLedgerIdsItem(String ledgerIdsItem) { + if (this.ledgerIds == null) { + this.ledgerIds = null; + } + this.ledgerIds.add(ledgerIdsItem); + return this; + } + + /** + * Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + * @return ledgerIds + **/ + @javax.annotation.Nonnull + public List getLedgerIds() { + return ledgerIds; + } + + + public void setLedgerIds(List ledgerIds) { + this.ledgerIds = ledgerIds; + } + + + public CactusNodeAllOf pluginInstanceIds(List pluginInstanceIds) { + + this.pluginInstanceIds = pluginInstanceIds; + return this; + } + + public CactusNodeAllOf addPluginInstanceIdsItem(String pluginInstanceIdsItem) { + if (this.pluginInstanceIds == null) { + this.pluginInstanceIds = null; + } + this.pluginInstanceIds.add(pluginInstanceIdsItem); + return this; + } + + /** + * Get pluginInstanceIds + * @return pluginInstanceIds + **/ + @javax.annotation.Nonnull + public List getPluginInstanceIds() { + return pluginInstanceIds; + } + + + public void setPluginInstanceIds(List pluginInstanceIds) { + this.pluginInstanceIds = pluginInstanceIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactusNodeAllOf cactusNodeAllOf = (CactusNodeAllOf) o; + return Objects.equals(this.id, cactusNodeAllOf.id) && + Objects.equals(this.consortiumId, cactusNodeAllOf.consortiumId) && + Objects.equals(this.memberId, cactusNodeAllOf.memberId) && + Objects.equals(this.ledgerIds, cactusNodeAllOf.ledgerIds) && + Objects.equals(this.pluginInstanceIds, cactusNodeAllOf.pluginInstanceIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, consortiumId, memberId, ledgerIds, pluginInstanceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactusNodeAllOf {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" consortiumId: ").append(toIndentedString(consortiumId)).append("\n"); + sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); + sb.append(" ledgerIds: ").append(toIndentedString(ledgerIds)).append("\n"); + sb.append(" pluginInstanceIds: ").append(toIndentedString(pluginInstanceIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("consortiumId"); + openapiFields.add("memberId"); + openapiFields.add("ledgerIds"); + openapiFields.add("pluginInstanceIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("consortiumId"); + openapiRequiredFields.add("memberId"); + openapiRequiredFields.add("ledgerIds"); + openapiRequiredFields.add("pluginInstanceIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactusNodeAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactusNodeAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactusNodeAllOf is not found in the empty JSON string", CactusNodeAllOf.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactusNodeAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactusNodeAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactusNodeAllOf.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("consortiumId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consortiumId").toString())); + } + if (!jsonObj.get("memberId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `memberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("memberId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("ledgerIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ledgerIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerIds` to be an array in the JSON string but got `%s`", jsonObj.get("ledgerIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("pluginInstanceIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("pluginInstanceIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pluginInstanceIds` to be an array in the JSON string but got `%s`", jsonObj.get("pluginInstanceIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactusNodeAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactusNodeAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactusNodeAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactusNodeAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactusNodeAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactusNodeAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactusNodeAllOf + * @throws IOException if the JSON string is invalid with respect to CactusNodeAllOf + */ + public static CactusNodeAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactusNodeAllOf.class); + } + + /** + * Convert an instance of CactusNodeAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java new file mode 100644 index 0000000000..37dc495808 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A Cactus node meta information + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactusNodeMeta { + public static final String SERIALIZED_NAME_NODE_API_HOST = "nodeApiHost"; + @SerializedName(SERIALIZED_NAME_NODE_API_HOST) + private String nodeApiHost; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_PEM = "publicKeyPem"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_PEM) + private String publicKeyPem; + + public CactusNodeMeta() { + } + + public CactusNodeMeta nodeApiHost(String nodeApiHost) { + + this.nodeApiHost = nodeApiHost; + return this; + } + + /** + * Get nodeApiHost + * @return nodeApiHost + **/ + @javax.annotation.Nonnull + public String getNodeApiHost() { + return nodeApiHost; + } + + + public void setNodeApiHost(String nodeApiHost) { + this.nodeApiHost = nodeApiHost; + } + + + public CactusNodeMeta publicKeyPem(String publicKeyPem) { + + this.publicKeyPem = publicKeyPem; + return this; + } + + /** + * The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + * @return publicKeyPem + **/ + @javax.annotation.Nonnull + public String getPublicKeyPem() { + return publicKeyPem; + } + + + public void setPublicKeyPem(String publicKeyPem) { + this.publicKeyPem = publicKeyPem; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactusNodeMeta cactusNodeMeta = (CactusNodeMeta) o; + return Objects.equals(this.nodeApiHost, cactusNodeMeta.nodeApiHost) && + Objects.equals(this.publicKeyPem, cactusNodeMeta.publicKeyPem); + } + + @Override + public int hashCode() { + return Objects.hash(nodeApiHost, publicKeyPem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactusNodeMeta {\n"); + sb.append(" nodeApiHost: ").append(toIndentedString(nodeApiHost)).append("\n"); + sb.append(" publicKeyPem: ").append(toIndentedString(publicKeyPem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeApiHost"); + openapiFields.add("publicKeyPem"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nodeApiHost"); + openapiRequiredFields.add("publicKeyPem"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactusNodeMeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactusNodeMeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactusNodeMeta is not found in the empty JSON string", CactusNodeMeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactusNodeMeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactusNodeMeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactusNodeMeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("nodeApiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeApiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeApiHost").toString())); + } + if (!jsonObj.get("publicKeyPem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyPem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyPem").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactusNodeMeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactusNodeMeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactusNodeMeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactusNodeMeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactusNodeMeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactusNodeMeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactusNodeMeta + * @throws IOException if the JSON string is invalid with respect to CactusNodeMeta + */ + public static CactusNodeMeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactusNodeMeta.class); + } + + /** + * Convert an instance of CactusNodeMeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java new file mode 100644 index 0000000000..90fc0cc06c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java @@ -0,0 +1,71 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates a list of consensus algorithm families that do not provide immediate finality + */ +@JsonAdapter(ConsensusAlgorithmFamiliesWithOutTxFinality.Adapter.class) +public enum ConsensusAlgorithmFamiliesWithOutTxFinality { + + WORK("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"); + + private String value; + + ConsensusAlgorithmFamiliesWithOutTxFinality(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConsensusAlgorithmFamiliesWithOutTxFinality fromValue(String value) { + for (ConsensusAlgorithmFamiliesWithOutTxFinality b : ConsensusAlgorithmFamiliesWithOutTxFinality.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConsensusAlgorithmFamiliesWithOutTxFinality enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConsensusAlgorithmFamiliesWithOutTxFinality read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConsensusAlgorithmFamiliesWithOutTxFinality.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java new file mode 100644 index 0000000000..584631444e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates a list of consensus algorithm families that provide immediate finality + */ +@JsonAdapter(ConsensusAlgorithmFamiliesWithTxFinality.Adapter.class) +public enum ConsensusAlgorithmFamiliesWithTxFinality { + + AUTHORITY("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY"), + + STAKE("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE"); + + private String value; + + ConsensusAlgorithmFamiliesWithTxFinality(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConsensusAlgorithmFamiliesWithTxFinality fromValue(String value) { + for (ConsensusAlgorithmFamiliesWithTxFinality b : ConsensusAlgorithmFamiliesWithTxFinality.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConsensusAlgorithmFamiliesWithTxFinality enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConsensusAlgorithmFamiliesWithTxFinality read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConsensusAlgorithmFamiliesWithTxFinality.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java new file mode 100644 index 0000000000..3887970def --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremost a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do. + */ +@JsonAdapter(ConsensusAlgorithmFamily.Adapter.class) +public enum ConsensusAlgorithmFamily { + + AUTHORITY("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY"), + + STAKE("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE"), + + WORK("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"); + + private String value; + + ConsensusAlgorithmFamily(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConsensusAlgorithmFamily fromValue(String value) { + for (ConsensusAlgorithmFamily b : ConsensusAlgorithmFamily.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConsensusAlgorithmFamily enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConsensusAlgorithmFamily read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConsensusAlgorithmFamily.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java new file mode 100644 index 0000000000..83e0f30b8b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Consortium + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Consortium { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MAIN_API_HOST = "mainApiHost"; + @SerializedName(SERIALIZED_NAME_MAIN_API_HOST) + private String mainApiHost; + + public static final String SERIALIZED_NAME_MEMBER_IDS = "memberIds"; + @SerializedName(SERIALIZED_NAME_MEMBER_IDS) + private List memberIds = null; + + public Consortium() { + } + + public Consortium id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Consortium name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Consortium mainApiHost(String mainApiHost) { + + this.mainApiHost = mainApiHost; + return this; + } + + /** + * Get mainApiHost + * @return mainApiHost + **/ + @javax.annotation.Nonnull + public String getMainApiHost() { + return mainApiHost; + } + + + public void setMainApiHost(String mainApiHost) { + this.mainApiHost = mainApiHost; + } + + + public Consortium memberIds(List memberIds) { + + this.memberIds = memberIds; + return this; + } + + public Consortium addMemberIdsItem(String memberIdsItem) { + if (this.memberIds == null) { + this.memberIds = null; + } + this.memberIds.add(memberIdsItem); + return this; + } + + /** + * The collection (array) of primary keys of consortium member entities that belong to this Consortium. + * @return memberIds + **/ + @javax.annotation.Nonnull + public List getMemberIds() { + return memberIds; + } + + + public void setMemberIds(List memberIds) { + this.memberIds = memberIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Consortium consortium = (Consortium) o; + return Objects.equals(this.id, consortium.id) && + Objects.equals(this.name, consortium.name) && + Objects.equals(this.mainApiHost, consortium.mainApiHost) && + Objects.equals(this.memberIds, consortium.memberIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, mainApiHost, memberIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Consortium {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" mainApiHost: ").append(toIndentedString(mainApiHost)).append("\n"); + sb.append(" memberIds: ").append(toIndentedString(memberIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("mainApiHost"); + openapiFields.add("memberIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("mainApiHost"); + openapiRequiredFields.add("memberIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Consortium + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Consortium.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Consortium is not found in the empty JSON string", Consortium.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Consortium.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Consortium` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Consortium.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("mainApiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mainApiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mainApiHost").toString())); + } + // ensure the required json array is present + if (jsonObj.get("memberIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("memberIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `memberIds` to be an array in the JSON string but got `%s`", jsonObj.get("memberIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Consortium.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Consortium' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Consortium.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Consortium value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Consortium read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Consortium given an JSON string + * + * @param jsonString JSON string + * @return An instance of Consortium + * @throws IOException if the JSON string is invalid with respect to Consortium + */ + public static Consortium fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Consortium.class); + } + + /** + * Convert an instance of Consortium to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java new file mode 100644 index 0000000000..aa6317c4ca --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CactusNode; +import org.openapitools.client.model.Consortium; +import org.openapitools.client.model.ConsortiumMember; +import org.openapitools.client.model.Ledger; +import org.openapitools.client.model.PluginInstance; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsortiumDatabase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsortiumDatabase { + public static final String SERIALIZED_NAME_CONSORTIUM = "consortium"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM) + private List consortium = null; + + public static final String SERIALIZED_NAME_LEDGER = "ledger"; + @SerializedName(SERIALIZED_NAME_LEDGER) + private List ledger = null; + + public static final String SERIALIZED_NAME_CONSORTIUM_MEMBER = "consortiumMember"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_MEMBER) + private List consortiumMember = null; + + public static final String SERIALIZED_NAME_CACTUS_NODE = "cactusNode"; + @SerializedName(SERIALIZED_NAME_CACTUS_NODE) + private List cactusNode = null; + + public static final String SERIALIZED_NAME_PLUGIN_INSTANCE = "pluginInstance"; + @SerializedName(SERIALIZED_NAME_PLUGIN_INSTANCE) + private List pluginInstance = null; + + public ConsortiumDatabase() { + } + + public ConsortiumDatabase consortium(List consortium) { + + this.consortium = consortium; + return this; + } + + public ConsortiumDatabase addConsortiumItem(Consortium consortiumItem) { + if (this.consortium == null) { + this.consortium = null; + } + this.consortium.add(consortiumItem); + return this; + } + + /** + * A collection of Consortium entities. In practice this should only ever contain a single consortium, but we defined it as an array to keep the convention up with the rest of the collections defined in the Consortium data in general. Also, if we ever decide to somehow have some sort of consortium to consortium integration (which does not make much sense in the current frame of mind of the author in the year 2020) then having this as an array will have proven itself to be an excellent long term compatibility/extensibility decision indeed. + * @return consortium + **/ + @javax.annotation.Nonnull + public List getConsortium() { + return consortium; + } + + + public void setConsortium(List consortium) { + this.consortium = consortium; + } + + + public ConsortiumDatabase ledger(List ledger) { + + this.ledger = ledger; + return this; + } + + public ConsortiumDatabase addLedgerItem(Ledger ledgerItem) { + if (this.ledger == null) { + this.ledger = null; + } + this.ledger.add(ledgerItem); + return this; + } + + /** + * The complete collection of all ledger entities in existence within the consortium. + * @return ledger + **/ + @javax.annotation.Nonnull + public List getLedger() { + return ledger; + } + + + public void setLedger(List ledger) { + this.ledger = ledger; + } + + + public ConsortiumDatabase consortiumMember(List consortiumMember) { + + this.consortiumMember = consortiumMember; + return this; + } + + public ConsortiumDatabase addConsortiumMemberItem(ConsortiumMember consortiumMemberItem) { + if (this.consortiumMember == null) { + this.consortiumMember = null; + } + this.consortiumMember.add(consortiumMemberItem); + return this; + } + + /** + * The complete collection of all consortium member entities in existence within the consortium. + * @return consortiumMember + **/ + @javax.annotation.Nonnull + public List getConsortiumMember() { + return consortiumMember; + } + + + public void setConsortiumMember(List consortiumMember) { + this.consortiumMember = consortiumMember; + } + + + public ConsortiumDatabase cactusNode(List cactusNode) { + + this.cactusNode = cactusNode; + return this; + } + + public ConsortiumDatabase addCactusNodeItem(CactusNode cactusNodeItem) { + if (this.cactusNode == null) { + this.cactusNode = null; + } + this.cactusNode.add(cactusNodeItem); + return this; + } + + /** + * The complete collection of all cactus nodes entities in existence within the consortium. + * @return cactusNode + **/ + @javax.annotation.Nonnull + public List getCactusNode() { + return cactusNode; + } + + + public void setCactusNode(List cactusNode) { + this.cactusNode = cactusNode; + } + + + public ConsortiumDatabase pluginInstance(List pluginInstance) { + + this.pluginInstance = pluginInstance; + return this; + } + + public ConsortiumDatabase addPluginInstanceItem(PluginInstance pluginInstanceItem) { + if (this.pluginInstance == null) { + this.pluginInstance = null; + } + this.pluginInstance.add(pluginInstanceItem); + return this; + } + + /** + * The complete collection of all plugin instance entities in existence within the consortium. + * @return pluginInstance + **/ + @javax.annotation.Nonnull + public List getPluginInstance() { + return pluginInstance; + } + + + public void setPluginInstance(List pluginInstance) { + this.pluginInstance = pluginInstance; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsortiumDatabase consortiumDatabase = (ConsortiumDatabase) o; + return Objects.equals(this.consortium, consortiumDatabase.consortium) && + Objects.equals(this.ledger, consortiumDatabase.ledger) && + Objects.equals(this.consortiumMember, consortiumDatabase.consortiumMember) && + Objects.equals(this.cactusNode, consortiumDatabase.cactusNode) && + Objects.equals(this.pluginInstance, consortiumDatabase.pluginInstance); + } + + @Override + public int hashCode() { + return Objects.hash(consortium, ledger, consortiumMember, cactusNode, pluginInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsortiumDatabase {\n"); + sb.append(" consortium: ").append(toIndentedString(consortium)).append("\n"); + sb.append(" ledger: ").append(toIndentedString(ledger)).append("\n"); + sb.append(" consortiumMember: ").append(toIndentedString(consortiumMember)).append("\n"); + sb.append(" cactusNode: ").append(toIndentedString(cactusNode)).append("\n"); + sb.append(" pluginInstance: ").append(toIndentedString(pluginInstance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("consortium"); + openapiFields.add("ledger"); + openapiFields.add("consortiumMember"); + openapiFields.add("cactusNode"); + openapiFields.add("pluginInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("consortium"); + openapiRequiredFields.add("ledger"); + openapiRequiredFields.add("consortiumMember"); + openapiRequiredFields.add("cactusNode"); + openapiRequiredFields.add("pluginInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsortiumDatabase + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsortiumDatabase.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsortiumDatabase is not found in the empty JSON string", ConsortiumDatabase.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsortiumDatabase.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsortiumDatabase` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsortiumDatabase.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("consortium").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consortium` to be an array in the JSON string but got `%s`", jsonObj.get("consortium").toString())); + } + + JsonArray jsonArrayconsortium = jsonObj.getAsJsonArray("consortium"); + // validate the required field `consortium` (array) + for (int i = 0; i < jsonArrayconsortium.size(); i++) { + Consortium.validateJsonObject(jsonArrayconsortium.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("ledger").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledger` to be an array in the JSON string but got `%s`", jsonObj.get("ledger").toString())); + } + + JsonArray jsonArrayledger = jsonObj.getAsJsonArray("ledger"); + // validate the required field `ledger` (array) + for (int i = 0; i < jsonArrayledger.size(); i++) { + Ledger.validateJsonObject(jsonArrayledger.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("consortiumMember").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumMember` to be an array in the JSON string but got `%s`", jsonObj.get("consortiumMember").toString())); + } + + JsonArray jsonArrayconsortiumMember = jsonObj.getAsJsonArray("consortiumMember"); + // validate the required field `consortiumMember` (array) + for (int i = 0; i < jsonArrayconsortiumMember.size(); i++) { + ConsortiumMember.validateJsonObject(jsonArrayconsortiumMember.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("cactusNode").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cactusNode` to be an array in the JSON string but got `%s`", jsonObj.get("cactusNode").toString())); + } + + JsonArray jsonArraycactusNode = jsonObj.getAsJsonArray("cactusNode"); + // validate the required field `cactusNode` (array) + for (int i = 0; i < jsonArraycactusNode.size(); i++) { + CactusNode.validateJsonObject(jsonArraycactusNode.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("pluginInstance").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pluginInstance` to be an array in the JSON string but got `%s`", jsonObj.get("pluginInstance").toString())); + } + + JsonArray jsonArraypluginInstance = jsonObj.getAsJsonArray("pluginInstance"); + // validate the required field `pluginInstance` (array) + for (int i = 0; i < jsonArraypluginInstance.size(); i++) { + PluginInstance.validateJsonObject(jsonArraypluginInstance.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsortiumDatabase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsortiumDatabase' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsortiumDatabase.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsortiumDatabase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsortiumDatabase read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsortiumDatabase given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsortiumDatabase + * @throws IOException if the JSON string is invalid with respect to ConsortiumDatabase + */ + public static ConsortiumDatabase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsortiumDatabase.class); + } + + /** + * Convert an instance of ConsortiumDatabase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java new file mode 100644 index 0000000000..148cd8c3ce --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java @@ -0,0 +1,293 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsortiumMember + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsortiumMember { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NODE_IDS = "nodeIds"; + @SerializedName(SERIALIZED_NAME_NODE_IDS) + private List nodeIds = null; + + public ConsortiumMember() { + } + + public ConsortiumMember id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public ConsortiumMember name(String name) { + + this.name = name; + return this; + } + + /** + * The human readable name a Consortium member can be referred to while making it easy for humans to distinguish this particular consortium member entity from any other ones. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ConsortiumMember nodeIds(List nodeIds) { + + this.nodeIds = nodeIds; + return this; + } + + public ConsortiumMember addNodeIdsItem(String nodeIdsItem) { + if (this.nodeIds == null) { + this.nodeIds = null; + } + this.nodeIds.add(nodeIdsItem); + return this; + } + + /** + * Get nodeIds + * @return nodeIds + **/ + @javax.annotation.Nonnull + public List getNodeIds() { + return nodeIds; + } + + + public void setNodeIds(List nodeIds) { + this.nodeIds = nodeIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsortiumMember consortiumMember = (ConsortiumMember) o; + return Objects.equals(this.id, consortiumMember.id) && + Objects.equals(this.name, consortiumMember.name) && + Objects.equals(this.nodeIds, consortiumMember.nodeIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, nodeIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsortiumMember {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeIds: ").append(toIndentedString(nodeIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("nodeIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("nodeIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsortiumMember + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsortiumMember.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsortiumMember is not found in the empty JSON string", ConsortiumMember.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsortiumMember.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsortiumMember` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsortiumMember.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the required json array is present + if (jsonObj.get("nodeIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("nodeIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeIds` to be an array in the JSON string but got `%s`", jsonObj.get("nodeIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsortiumMember.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsortiumMember' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsortiumMember.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsortiumMember value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsortiumMember read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsortiumMember given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsortiumMember + * @throws IOException if the JSON string is invalid with respect to ConsortiumMember + */ + public static ConsortiumMember fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsortiumMember.class); + } + + /** + * Convert an instance of ConsortiumMember to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java new file mode 100644 index 0000000000..682317e6be --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java @@ -0,0 +1,71 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Constants + */ +@JsonAdapter(Constants.Adapter.class) +public enum Constants { + + SocketIoConnectionPathV1("/api/v1/async/socket-io/connect"); + + private String value; + + Constants(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Constants fromValue(String value) { + for (Constants b : Constants.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Constants enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Constants read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Constants.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 0000000000..ad7f6d604c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 0000000000..8ff202ba9e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..9e2afb09aa --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..90b29a92b6 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java new file mode 100644 index 0000000000..fd6d0f95ae --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetObjectRequestV1() { + } + + public GetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectRequestV1 getObjectRequestV1 = (GetObjectRequestV1) o; + return Objects.equals(this.key, getObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectRequestV1 is not found in the empty JSON string", GetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectRequestV1 + */ + public static GetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectRequestV1.class); + } + + /** + * Convert an instance of GetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java new file mode 100644 index 0000000000..6a6d55ba3e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetObjectResponseV1() { + } + + public GetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetObjectResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key in the object store as a string. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectResponseV1 getObjectResponseV1 = (GetObjectResponseV1) o; + return Objects.equals(this.key, getObjectResponseV1.key) && + Objects.equals(this.value, getObjectResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectResponseV1 is not found in the empty JSON string", GetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectResponseV1 + */ + public static GetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectResponseV1.class); + } + + /** + * Convert an instance of GetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 0000000000..53400d8532 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 0000000000..d9fedf6298 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java new file mode 100644 index 0000000000..b8b5a4abee --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasObjectRequestV1() { + } + + public HasObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectRequestV1 hasObjectRequestV1 = (HasObjectRequestV1) o; + return Objects.equals(this.key, hasObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectRequestV1 is not found in the empty JSON string", HasObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectRequestV1 + */ + public static HasObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectRequestV1.class); + } + + /** + * Convert an instance of HasObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java new file mode 100644 index 0000000000..54fa499a59 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasObjectResponseV1() { + } + + public HasObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasObjectResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasObjectResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an object under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectResponseV1 hasObjectResponseV1 = (HasObjectResponseV1) o; + return Objects.equals(this.key, hasObjectResponseV1.key) && + Objects.equals(this.checkedAt, hasObjectResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasObjectResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectResponseV1 is not found in the empty JSON string", HasObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectResponseV1 + */ + public static HasObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectResponseV1.class); + } + + /** + * Convert an instance of HasObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java new file mode 100644 index 0000000000..b5e2902858 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java @@ -0,0 +1,266 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.JWSRecipient; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * JWSGeneral + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSGeneral { + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public static final String SERIALIZED_NAME_SIGNATURES = "signatures"; + @SerializedName(SERIALIZED_NAME_SIGNATURES) + private List signatures = new ArrayList<>(); + + public JWSGeneral() { + } + + public JWSGeneral payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + public JWSGeneral signatures(List signatures) { + + this.signatures = signatures; + return this; + } + + public JWSGeneral addSignaturesItem(JWSRecipient signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * Get signatures + * @return signatures + **/ + @javax.annotation.Nonnull + public List getSignatures() { + return signatures; + } + + + public void setSignatures(List signatures) { + this.signatures = signatures; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSGeneral jwSGeneral = (JWSGeneral) o; + return Objects.equals(this.payload, jwSGeneral.payload) && + Objects.equals(this.signatures, jwSGeneral.signatures); + } + + @Override + public int hashCode() { + return Objects.hash(payload, signatures); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSGeneral {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload"); + openapiFields.add("signatures"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("signatures"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSGeneral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSGeneral.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSGeneral is not found in the empty JSON string", JWSGeneral.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSGeneral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSGeneral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSGeneral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("signatures").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signatures` to be an array in the JSON string but got `%s`", jsonObj.get("signatures").toString())); + } + + JsonArray jsonArraysignatures = jsonObj.getAsJsonArray("signatures"); + // validate the required field `signatures` (array) + for (int i = 0; i < jsonArraysignatures.size(); i++) { + JWSRecipient.validateJsonObject(jsonArraysignatures.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSGeneral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSGeneral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSGeneral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSGeneral value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSGeneral read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSGeneral given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSGeneral + * @throws IOException if the JSON string is invalid with respect to JWSGeneral + */ + public static JWSGeneral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSGeneral.class); + } + + /** + * Convert an instance of JWSGeneral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java new file mode 100644 index 0000000000..9ee8d91ad1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSRecipient { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + @SerializedName(SERIALIZED_NAME_PROTECTED) + private String protected; + + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private Map header = new HashMap<>(); + + public JWSRecipient() { + } + + public JWSRecipient signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public JWSRecipient protected(String protected) { + + this.protected = protected; + return this; + } + + /** + * Get protected + * @return protected + **/ + @javax.annotation.Nullable + public String getProtected() { + return protected; + } + + + public void setProtected(String protected) { + this.protected = protected; + } + + + public JWSRecipient header(Map header) { + + this.header = header; + return this; + } + + public JWSRecipient putHeaderItem(String key, Object headerItem) { + if (this.header == null) { + this.header = new HashMap<>(); + } + this.header.put(key, headerItem); + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nullable + public Map getHeader() { + return header; + } + + + public void setHeader(Map header) { + this.header = header; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSRecipient jwSRecipient = (JWSRecipient) o; + return Objects.equals(this.signature, jwSRecipient.signature) && + Objects.equals(this.protected, jwSRecipient.protected) && + Objects.equals(this.header, jwSRecipient.header); + } + + @Override + public int hashCode() { + return Objects.hash(signature, protected, header); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSRecipient {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" protected: ").append(toIndentedString(protected)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signature"); + openapiFields.add("protected"); + openapiFields.add("header"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSRecipient + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSRecipient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSRecipient is not found in the empty JSON string", JWSRecipient.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSRecipient.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSRecipient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSRecipient.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if ((jsonObj.get("protected") != null && !jsonObj.get("protected").isJsonNull()) && !jsonObj.get("protected").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `protected` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protected").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSRecipient.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSRecipient' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSRecipient.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSRecipient value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSRecipient read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSRecipient given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSRecipient + * @throws IOException if the JSON string is invalid with respect to JWSRecipient + */ + public static JWSRecipient fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSRecipient.class); + } + + /** + * Convert an instance of JWSRecipient to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java new file mode 100644 index 0000000000..71e4461fe6 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.LedgerType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Ledger + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Ledger { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_LEDGER_TYPE = "ledgerType"; + @SerializedName(SERIALIZED_NAME_LEDGER_TYPE) + private LedgerType ledgerType; + + public static final String SERIALIZED_NAME_CONSORTIUM_MEMBER_ID = "consortiumMemberId"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_MEMBER_ID) + private String consortiumMemberId; + + public Ledger() { + } + + public Ledger id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Ledger ledgerType(LedgerType ledgerType) { + + this.ledgerType = ledgerType; + return this; + } + + /** + * Get ledgerType + * @return ledgerType + **/ + @javax.annotation.Nonnull + public LedgerType getLedgerType() { + return ledgerType; + } + + + public void setLedgerType(LedgerType ledgerType) { + this.ledgerType = ledgerType; + } + + + public Ledger consortiumMemberId(String consortiumMemberId) { + + this.consortiumMemberId = consortiumMemberId; + return this; + } + + /** + * Get consortiumMemberId + * @return consortiumMemberId + **/ + @javax.annotation.Nullable + public String getConsortiumMemberId() { + return consortiumMemberId; + } + + + public void setConsortiumMemberId(String consortiumMemberId) { + this.consortiumMemberId = consortiumMemberId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Ledger ledger = (Ledger) o; + return Objects.equals(this.id, ledger.id) && + Objects.equals(this.ledgerType, ledger.ledgerType) && + Objects.equals(this.consortiumMemberId, ledger.consortiumMemberId); + } + + @Override + public int hashCode() { + return Objects.hash(id, ledgerType, consortiumMemberId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Ledger {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ledgerType: ").append(toIndentedString(ledgerType)).append("\n"); + sb.append(" consortiumMemberId: ").append(toIndentedString(consortiumMemberId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("ledgerType"); + openapiFields.add("consortiumMemberId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("ledgerType"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Ledger + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Ledger.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Ledger is not found in the empty JSON string", Ledger.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Ledger.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Ledger` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Ledger.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("consortiumMemberId") != null && !jsonObj.get("consortiumMemberId").isJsonNull()) && !jsonObj.get("consortiumMemberId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumMemberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consortiumMemberId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Ledger.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Ledger' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Ledger.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Ledger value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Ledger read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Ledger given an JSON string + * + * @param jsonString JSON string + * @return An instance of Ledger + * @throws IOException if the JSON string is invalid with respect to Ledger + */ + public static Ledger fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Ledger.class); + } + + /** + * Convert an instance of Ledger to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java new file mode 100644 index 0000000000..ea31441dda --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation. + */ +@JsonAdapter(LedgerType.Adapter.class) +public enum LedgerType { + + BESU_1X("BESU_1X"), + + BESU_2X("BESU_2X"), + + BURROW_0X("BURROW_0X"), + + CORDA_4X("CORDA_4X"), + + FABRIC_14X("FABRIC_14X"), + + FABRIC_2("FABRIC_2"), + + QUORUM_2X("QUORUM_2X"), + + SAWTOOTH_1X("SAWTOOTH_1X"); + + private String value; + + LedgerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LedgerType fromValue(String value) { + for (LedgerType b : LedgerType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LedgerType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LedgerType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LedgerType.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java new file mode 100644 index 0000000000..d4251a203e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java @@ -0,0 +1,316 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.PluginImportAction; +import org.openapitools.client.model.PluginImportType; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PluginImport + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PluginImport { + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private PluginImportType type; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private PluginImportAction action; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + @SerializedName(SERIALIZED_NAME_OPTIONS) + private Object options = null; + + public PluginImport() { + } + + public PluginImport packageName(String packageName) { + + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public PluginImport type(PluginImportType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public PluginImportType getType() { + return type; + } + + + public void setType(PluginImportType type) { + this.type = type; + } + + + public PluginImport action(PluginImportAction action) { + + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nonnull + public PluginImportAction getAction() { + return action; + } + + + public void setAction(PluginImportAction action) { + this.action = action; + } + + + public PluginImport options(Object options) { + + this.options = options; + return this; + } + + /** + * Get options + * @return options + **/ + @javax.annotation.Nullable + public Object getOptions() { + return options; + } + + + public void setOptions(Object options) { + this.options = options; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginImport pluginImport = (PluginImport) o; + return Objects.equals(this.packageName, pluginImport.packageName) && + Objects.equals(this.type, pluginImport.type) && + Objects.equals(this.action, pluginImport.action) && + Objects.equals(this.options, pluginImport.options); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(packageName, type, action, options); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginImport {\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("packageName"); + openapiFields.add("type"); + openapiFields.add("action"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PluginImport + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PluginImport.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PluginImport is not found in the empty JSON string", PluginImport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PluginImport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PluginImport` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PluginImport.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PluginImport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PluginImport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PluginImport.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PluginImport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PluginImport read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PluginImport given an JSON string + * + * @param jsonString JSON string + * @return An instance of PluginImport + * @throws IOException if the JSON string is invalid with respect to PluginImport + */ + public static PluginImport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PluginImport.class); + } + + /** + * Convert an instance of PluginImport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java new file mode 100644 index 0000000000..8426680490 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets PluginImportAction + */ +@JsonAdapter(PluginImportAction.Adapter.class) +public enum PluginImportAction { + + INSTANTIATE("org.hyperledger.cactus.plugin_import_action.INSTANTIATE"), + + INSTALL("org.hyperledger.cactus.plugin_import_action.INSTALL"); + + private String value; + + PluginImportAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PluginImportAction fromValue(String value) { + for (PluginImportAction b : PluginImportAction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PluginImportAction enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PluginImportAction read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PluginImportAction.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java new file mode 100644 index 0000000000..374e800b4b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets PluginImportType + */ +@JsonAdapter(PluginImportType.Adapter.class) +public enum PluginImportType { + + LOCAL("org.hyperledger.cactus.plugin_import_type.LOCAL"), + + REMOTE("org.hyperledger.cactus.plugin_import_type.REMOTE"); + + private String value; + + PluginImportType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PluginImportType fromValue(String value) { + for (PluginImportType b : PluginImportType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PluginImportType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PluginImportType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PluginImportType.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java new file mode 100644 index 0000000000..3b89bf2a12 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PluginInstance + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PluginInstance { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public PluginInstance() { + } + + public PluginInstance id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PluginInstance packageName(String packageName) { + + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInstance pluginInstance = (PluginInstance) o; + return Objects.equals(this.id, pluginInstance.id) && + Objects.equals(this.packageName, pluginInstance.packageName); + } + + @Override + public int hashCode() { + return Objects.hash(id, packageName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInstance {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("packageName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("packageName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PluginInstance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PluginInstance.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PluginInstance is not found in the empty JSON string", PluginInstance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PluginInstance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PluginInstance` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PluginInstance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PluginInstance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PluginInstance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PluginInstance.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PluginInstance value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PluginInstance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PluginInstance given an JSON string + * + * @param jsonString JSON string + * @return An instance of PluginInstance + * @throws IOException if the JSON string is invalid with respect to PluginInstance + */ + public static PluginInstance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PluginInstance.class); + } + + /** + * Convert an instance of PluginInstance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..17a4beac2f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..01673dbd79 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java new file mode 100644 index 0000000000..e9d9c5887c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetObjectRequestV1() { + } + + public SetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetObjectRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key in the object store. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectRequestV1 setObjectRequestV1 = (SetObjectRequestV1) o; + return Objects.equals(this.key, setObjectRequestV1.key) && + Objects.equals(this.value, setObjectRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectRequestV1 is not found in the empty JSON string", SetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectRequestV1 + */ + public static SetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectRequestV1.class); + } + + /** + * Convert an instance of SetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java new file mode 100644 index 0000000000..27e9bfe36f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetObjectResponseV1() { + } + + public SetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectResponseV1 setObjectResponseV1 = (SetObjectResponseV1) o; + return Objects.equals(this.key, setObjectResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectResponseV1 is not found in the empty JSON string", SetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectResponseV1 + */ + public static SetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectResponseV1.class); + } + + /** + * Convert an instance of SetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java new file mode 100644 index 0000000000..fafba1c56b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactusNodeAllOf + */ +public class CactusNodeAllOfTest { + private final CactusNodeAllOf model = new CactusNodeAllOf(); + + /** + * Model tests for CactusNodeAllOf + */ + @Test + public void testCactusNodeAllOf() { + // TODO: test CactusNodeAllOf + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'consortiumId' + */ + @Test + public void consortiumIdTest() { + // TODO: test consortiumId + } + + /** + * Test the property 'memberId' + */ + @Test + public void memberIdTest() { + // TODO: test memberId + } + + /** + * Test the property 'ledgerIds' + */ + @Test + public void ledgerIdsTest() { + // TODO: test ledgerIds + } + + /** + * Test the property 'pluginInstanceIds' + */ + @Test + public void pluginInstanceIdsTest() { + // TODO: test pluginInstanceIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java new file mode 100644 index 0000000000..7f268b110c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactusNodeMeta + */ +public class CactusNodeMetaTest { + private final CactusNodeMeta model = new CactusNodeMeta(); + + /** + * Model tests for CactusNodeMeta + */ + @Test + public void testCactusNodeMeta() { + // TODO: test CactusNodeMeta + } + + /** + * Test the property 'nodeApiHost' + */ + @Test + public void nodeApiHostTest() { + // TODO: test nodeApiHost + } + + /** + * Test the property 'publicKeyPem' + */ + @Test + public void publicKeyPemTest() { + // TODO: test publicKeyPem + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java new file mode 100644 index 0000000000..bbaff3d5ec --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java @@ -0,0 +1,98 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactusNode + */ +public class CactusNodeTest { + private final CactusNode model = new CactusNode(); + + /** + * Model tests for CactusNode + */ + @Test + public void testCactusNode() { + // TODO: test CactusNode + } + + /** + * Test the property 'nodeApiHost' + */ + @Test + public void nodeApiHostTest() { + // TODO: test nodeApiHost + } + + /** + * Test the property 'publicKeyPem' + */ + @Test + public void publicKeyPemTest() { + // TODO: test publicKeyPem + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'consortiumId' + */ + @Test + public void consortiumIdTest() { + // TODO: test consortiumId + } + + /** + * Test the property 'memberId' + */ + @Test + public void memberIdTest() { + // TODO: test memberId + } + + /** + * Test the property 'ledgerIds' + */ + @Test + public void ledgerIdsTest() { + // TODO: test ledgerIds + } + + /** + * Test the property 'pluginInstanceIds' + */ + @Test + public void pluginInstanceIdsTest() { + // TODO: test pluginInstanceIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java new file mode 100644 index 0000000000..0108af550c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsensusAlgorithmFamiliesWithOutTxFinality + */ +public class ConsensusAlgorithmFamiliesWithOutTxFinalityTest { + /** + * Model tests for ConsensusAlgorithmFamiliesWithOutTxFinality + */ + @Test + public void testConsensusAlgorithmFamiliesWithOutTxFinality() { + // TODO: test ConsensusAlgorithmFamiliesWithOutTxFinality + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java new file mode 100644 index 0000000000..af47f74fab --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsensusAlgorithmFamiliesWithTxFinality + */ +public class ConsensusAlgorithmFamiliesWithTxFinalityTest { + /** + * Model tests for ConsensusAlgorithmFamiliesWithTxFinality + */ + @Test + public void testConsensusAlgorithmFamiliesWithTxFinality() { + // TODO: test ConsensusAlgorithmFamiliesWithTxFinality + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java new file mode 100644 index 0000000000..8a51484ad0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsensusAlgorithmFamily + */ +public class ConsensusAlgorithmFamilyTest { + /** + * Model tests for ConsensusAlgorithmFamily + */ + @Test + public void testConsensusAlgorithmFamily() { + // TODO: test ConsensusAlgorithmFamily + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java new file mode 100644 index 0000000000..f0f2363f62 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java @@ -0,0 +1,87 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CactusNode; +import org.openapitools.client.model.Consortium; +import org.openapitools.client.model.ConsortiumMember; +import org.openapitools.client.model.Ledger; +import org.openapitools.client.model.PluginInstance; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsortiumDatabase + */ +public class ConsortiumDatabaseTest { + private final ConsortiumDatabase model = new ConsortiumDatabase(); + + /** + * Model tests for ConsortiumDatabase + */ + @Test + public void testConsortiumDatabase() { + // TODO: test ConsortiumDatabase + } + + /** + * Test the property 'consortium' + */ + @Test + public void consortiumTest() { + // TODO: test consortium + } + + /** + * Test the property 'ledger' + */ + @Test + public void ledgerTest() { + // TODO: test ledger + } + + /** + * Test the property 'consortiumMember' + */ + @Test + public void consortiumMemberTest() { + // TODO: test consortiumMember + } + + /** + * Test the property 'cactusNode' + */ + @Test + public void cactusNodeTest() { + // TODO: test cactusNode + } + + /** + * Test the property 'pluginInstance' + */ + @Test + public void pluginInstanceTest() { + // TODO: test pluginInstance + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java new file mode 100644 index 0000000000..961b68e686 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsortiumMember + */ +public class ConsortiumMemberTest { + private final ConsortiumMember model = new ConsortiumMember(); + + /** + * Model tests for ConsortiumMember + */ + @Test + public void testConsortiumMember() { + // TODO: test ConsortiumMember + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'nodeIds' + */ + @Test + public void nodeIdsTest() { + // TODO: test nodeIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java new file mode 100644 index 0000000000..e94000af90 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Consortium + */ +public class ConsortiumTest { + private final Consortium model = new Consortium(); + + /** + * Model tests for Consortium + */ + @Test + public void testConsortium() { + // TODO: test Consortium + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'mainApiHost' + */ + @Test + public void mainApiHostTest() { + // TODO: test mainApiHost + } + + /** + * Test the property 'memberIds' + */ + @Test + public void memberIdsTest() { + // TODO: test memberIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java new file mode 100644 index 0000000000..5ba933d3d7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Constants + */ +public class ConstantsTest { + /** + * Model tests for Constants + */ + @Test + public void testConstants() { + // TODO: test Constants + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..f00bb1d666 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..fbb8e128cc --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..ca40f69c98 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..60b624a0a3 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java new file mode 100644 index 0000000000..a01d8f127f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectRequestV1 + */ +public class GetObjectRequestV1Test { + private final GetObjectRequestV1 model = new GetObjectRequestV1(); + + /** + * Model tests for GetObjectRequestV1 + */ + @Test + public void testGetObjectRequestV1() { + // TODO: test GetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java new file mode 100644 index 0000000000..d2fe5aefd4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectResponseV1 + */ +public class GetObjectResponseV1Test { + private final GetObjectResponseV1 model = new GetObjectResponseV1(); + + /** + * Model tests for GetObjectResponseV1 + */ + @Test + public void testGetObjectResponseV1() { + // TODO: test GetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..4b7c03f275 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..1785a2e021 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java new file mode 100644 index 0000000000..d9066e39de --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectRequestV1 + */ +public class HasObjectRequestV1Test { + private final HasObjectRequestV1 model = new HasObjectRequestV1(); + + /** + * Model tests for HasObjectRequestV1 + */ + @Test + public void testHasObjectRequestV1() { + // TODO: test HasObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java new file mode 100644 index 0000000000..cbd1abcac1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectResponseV1 + */ +public class HasObjectResponseV1Test { + private final HasObjectResponseV1 model = new HasObjectResponseV1(); + + /** + * Model tests for HasObjectResponseV1 + */ + @Test + public void testHasObjectResponseV1() { + // TODO: test HasObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java new file mode 100644 index 0000000000..12d7df1777 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.JWSRecipient; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSGeneral + */ +public class JWSGeneralTest { + private final JWSGeneral model = new JWSGeneral(); + + /** + * Model tests for JWSGeneral + */ + @Test + public void testJWSGeneral() { + // TODO: test JWSGeneral + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'signatures' + */ + @Test + public void signaturesTest() { + // TODO: test signatures + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java new file mode 100644 index 0000000000..ecf122dfcc --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSRecipient + */ +public class JWSRecipientTest { + private final JWSRecipient model = new JWSRecipient(); + + /** + * Model tests for JWSRecipient + */ + @Test + public void testJWSRecipient() { + // TODO: test JWSRecipient + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'protected' + */ + @Test + public void protectedTest() { + // TODO: test protected + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java new file mode 100644 index 0000000000..c93d93652f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.LedgerType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Ledger + */ +public class LedgerTest { + private final Ledger model = new Ledger(); + + /** + * Model tests for Ledger + */ + @Test + public void testLedger() { + // TODO: test Ledger + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'ledgerType' + */ + @Test + public void ledgerTypeTest() { + // TODO: test ledgerType + } + + /** + * Test the property 'consortiumMemberId' + */ + @Test + public void consortiumMemberIdTest() { + // TODO: test consortiumMemberId + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java new file mode 100644 index 0000000000..827ddce424 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for LedgerType + */ +public class LedgerTypeTest { + /** + * Model tests for LedgerType + */ + @Test + public void testLedgerType() { + // TODO: test LedgerType + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java new file mode 100644 index 0000000000..e6055b0f7f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginImportAction + */ +public class PluginImportActionTest { + /** + * Model tests for PluginImportAction + */ + @Test + public void testPluginImportAction() { + // TODO: test PluginImportAction + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java new file mode 100644 index 0000000000..ad3690db1f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.PluginImportAction; +import org.openapitools.client.model.PluginImportType; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginImport + */ +public class PluginImportTest { + private final PluginImport model = new PluginImport(); + + /** + * Model tests for PluginImport + */ + @Test + public void testPluginImport() { + // TODO: test PluginImport + } + + /** + * Test the property 'packageName' + */ + @Test + public void packageNameTest() { + // TODO: test packageName + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + + /** + * Test the property 'options' + */ + @Test + public void optionsTest() { + // TODO: test options + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java new file mode 100644 index 0000000000..48fe4bc7a1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginImportType + */ +public class PluginImportTypeTest { + /** + * Model tests for PluginImportType + */ + @Test + public void testPluginImportType() { + // TODO: test PluginImportType + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java new file mode 100644 index 0000000000..67a80f32ed --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginInstance + */ +public class PluginInstanceTest { + private final PluginInstance model = new PluginInstance(); + + /** + * Model tests for PluginInstance + */ + @Test + public void testPluginInstance() { + // TODO: test PluginInstance + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'packageName' + */ + @Test + public void packageNameTest() { + // TODO: test packageName + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..e8e4c061ee --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..3b0e1eaffc --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java new file mode 100644 index 0000000000..4ab90b0efe --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectRequestV1 + */ +public class SetObjectRequestV1Test { + private final SetObjectRequestV1 model = new SetObjectRequestV1(); + + /** + * Model tests for SetObjectRequestV1 + */ + @Test + public void testSetObjectRequestV1() { + // TODO: test SetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java new file mode 100644 index 0000000000..260ec35474 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectResponseV1 + */ +public class SetObjectResponseV1Test { + private final SetObjectResponseV1 model = new SetObjectResponseV1(); + + /** + * Model tests for SetObjectResponseV1 + */ + @Test + public void testSetObjectResponseV1() { + // TODO: test SetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.ack.rs b/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.ack.rs index 276e5d5851..08185356b2 100644 --- a/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.ack.rs +++ b/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.ack.rs @@ -1,6 +1,8 @@ /// This message respresents "ACKs" sent between relay-relay, /// relay-driver and relay-network -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Ack { #[prost(enumeration = "ack::Status", tag = "2")] pub status: i32, @@ -13,9 +15,8 @@ pub struct Ack { } /// Nested message and enum types in `Ack`. pub mod ack { + #[derive(serde::Serialize, serde::Deserialize)] #[derive( - serde::Serialize, - serde::Deserialize, Clone, Copy, Debug, @@ -24,11 +25,31 @@ pub mod ack { Hash, PartialOrd, Ord, - ::prost::Enumeration, + ::prost::Enumeration )] #[repr(i32)] pub enum Status { Ok = 0, Error = 1, } + impl Status { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Status::Ok => "OK", + Status::Error => "ERROR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "OK" => Some(Self::Ok), + "ERROR" => Some(Self::Error), + _ => None, + } + } + } } diff --git a/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.query.rs b/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.query.rs index e00d2bc2e1..08fd3a903e 100644 --- a/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.query.rs +++ b/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.query.rs @@ -1,5 +1,7 @@ /// the payload to define the data that is being requested -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Query { #[prost(string, repeated, tag = "1")] pub policy: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, diff --git a/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.state.rs b/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.state.rs index e29407b55b..36c9c5e757 100644 --- a/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.state.rs +++ b/packages/cactus-core-api/src/main/rust/generated/proto-rs/common.state.rs @@ -1,5 +1,7 @@ /// Metadata for a View -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Meta { /// Underlying distributed ledger protocol. #[prost(enumeration = "meta::Protocol", tag = "1")] @@ -18,9 +20,8 @@ pub struct Meta { } /// Nested message and enum types in `Meta`. pub mod meta { + #[derive(serde::Serialize, serde::Deserialize)] #[derive( - serde::Serialize, - serde::Deserialize, Clone, Copy, Debug, @@ -29,7 +30,7 @@ pub mod meta { Hash, PartialOrd, Ord, - ::prost::Enumeration, + ::prost::Enumeration )] #[repr(i32)] pub enum Protocol { @@ -38,8 +39,34 @@ pub mod meta { Fabric = 3, Corda = 4, } + impl Protocol { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Protocol::Bitcoin => "BITCOIN", + Protocol::Ethereum => "ETHEREUM", + Protocol::Fabric => "FABRIC", + Protocol::Corda => "CORDA", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BITCOIN" => Some(Self::Bitcoin), + "ETHEREUM" => Some(Self::Ethereum), + "FABRIC" => Some(Self::Fabric), + "CORDA" => Some(Self::Corda), + _ => None, + } + } + } } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct View { #[prost(message, optional, tag = "1")] pub meta: ::core::option::Option, @@ -50,7 +77,9 @@ pub struct View { pub data: ::prost::alloc::vec::Vec, } /// View represents the response from a remote network -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ViewPayload { #[prost(string, tag = "1")] pub request_id: ::prost::alloc::string::String, @@ -59,7 +88,9 @@ pub struct ViewPayload { } /// Nested message and enum types in `ViewPayload`. pub mod view_payload { - #[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Oneof)] + #[derive(serde::Serialize, serde::Deserialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum State { #[prost(message, tag = "2")] View(super::View), @@ -69,7 +100,9 @@ pub mod view_payload { } /// the payload that is used for the communication between the requesting relay /// and its network -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestState { #[prost(string, tag = "1")] pub request_id: ::prost::alloc::string::String, @@ -80,9 +113,8 @@ pub struct RequestState { } /// Nested message and enum types in `RequestState`. pub mod request_state { + #[derive(serde::Serialize, serde::Deserialize)] #[derive( - serde::Serialize, - serde::Deserialize, Clone, Copy, Debug, @@ -91,7 +123,7 @@ pub mod request_state { Hash, PartialOrd, Ord, - ::prost::Enumeration, + ::prost::Enumeration )] #[repr(i32)] pub enum Status { @@ -102,7 +134,33 @@ pub mod request_state { Error = 2, Completed = 3, } - #[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Oneof)] + impl Status { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Status::PendingAck => "PENDING_ACK", + Status::Pending => "PENDING", + Status::Error => "ERROR", + Status::Completed => "COMPLETED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PENDING_ACK" => Some(Self::PendingAck), + "PENDING" => Some(Self::Pending), + "ERROR" => Some(Self::Error), + "COMPLETED" => Some(Self::Completed), + _ => None, + } + } + } + #[derive(serde::Serialize, serde::Deserialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum State { #[prost(message, tag = "3")] View(super::View), diff --git a/packages/cactus-core-api/src/main/rust/generated/proto-rs/driver.driver.rs b/packages/cactus-core-api/src/main/rust/generated/proto-rs/driver.driver.rs index 7ce3c55d9c..4e48aac084 100644 --- a/packages/cactus-core-api/src/main/rust/generated/proto-rs/driver.driver.rs +++ b/packages/cactus-core-api/src/main/rust/generated/proto-rs/driver.driver.rs @@ -1,16 +1,17 @@ -#[doc = r" Generated client implementations."] +/// Generated client implementations. pub mod driver_communication_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; + use tonic::codegen::http::Uri; #[derive(Debug, Clone)] pub struct DriverCommunicationClient { inner: tonic::client::Grpc, } impl DriverCommunicationClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] + /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -20,101 +21,179 @@ pub mod driver_communication_client { impl DriverCommunicationClient where T: tonic::client::GrpcService, - T::ResponseBody: Body + Send + 'static, T::Error: Into, + T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } pub fn with_interceptor( inner: T, interceptor: F, ) -> DriverCommunicationClient> where F: tonic::service::Interceptor, + T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, - >>::Error: - Into + Send + Sync, + , + >>::Error: Into + Send + Sync, { DriverCommunicationClient::new(InterceptedService::new(inner, interceptor)) } - #[doc = r" Compress requests with `gzip`."] - #[doc = r""] - #[doc = r" This requires the server to support it otherwise it might respond with an"] - #[doc = r" error."] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); self } - #[doc = r" Enable decompressing responses with `gzip`."] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); self } - #[doc = " the remote relay sends a RequestDriverState request to its driver with a"] - #[doc = " query defining the data it wants to receive"] + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// the remote relay sends a RequestDriverState request to its driver with a + /// query defining the data it wants to receive pub async fn request_driver_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/driver.driver.DriverCommunication/RequestDriverState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "driver.driver.DriverCommunication", + "RequestDriverState", + ), + ); + self.inner.unary(req, path, codec).await } } } -#[doc = r" Generated server implementations."] +/// Generated server implementations. pub mod driver_communication_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - #[doc = "Generated trait containing gRPC methods that should be implemented for use with DriverCommunicationServer."] + /// Generated trait containing gRPC methods that should be implemented for use with DriverCommunicationServer. #[async_trait] pub trait DriverCommunication: Send + Sync + 'static { - #[doc = " the remote relay sends a RequestDriverState request to its driver with a"] - #[doc = " query defining the data it wants to receive"] + /// the remote relay sends a RequestDriverState request to its driver with a + /// query defining the data it wants to receive async fn request_driver_state( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct DriverCommunicationServer { inner: _Inner, - accept_compression_encodings: (), - send_compression_encodings: (), + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl DriverCommunicationServer { pub fn new(inner: T) -> Self { - let inner = Arc::new(inner); + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for DriverCommunicationServer where @@ -123,9 +202,12 @@ pub mod driver_communication_server { B::Error: Into + Send + 'static, { type Response = http::Response; - type Error = Never; + type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -134,45 +216,68 @@ pub mod driver_communication_server { "/driver.driver.DriverCommunication/RequestDriverState" => { #[allow(non_camel_case_types)] struct RequestDriverStateSvc(pub Arc); - impl - tonic::server::UnaryService - for RequestDriverStateSvc - { + impl< + T: DriverCommunication, + > tonic::server::UnaryService< + super::super::super::common::query::Query, + > for RequestDriverStateSvc { type Response = super::super::super::common::ack::Ack; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::common::query::Query, + >, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).request_driver_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::request_driver_state( + &inner, + request, + ) + .await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = RequestDriverStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } } } } @@ -183,12 +288,14 @@ pub mod driver_communication_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { @@ -196,7 +303,8 @@ pub mod driver_communication_server { write!(f, "{:?}", self.0) } } - impl tonic::transport::NamedService for DriverCommunicationServer { + impl tonic::server::NamedService + for DriverCommunicationServer { const NAME: &'static str = "driver.driver.DriverCommunication"; } } diff --git a/packages/cactus-core-api/src/main/rust/generated/proto-rs/networks.networks.rs b/packages/cactus-core-api/src/main/rust/generated/proto-rs/networks.networks.rs index aac94f8adc..6bcd31e062 100644 --- a/packages/cactus-core-api/src/main/rust/generated/proto-rs/networks.networks.rs +++ b/packages/cactus-core-api/src/main/rust/generated/proto-rs/networks.networks.rs @@ -1,20 +1,30 @@ -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DbName { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct RelayDatabase { #[prost(map = "string, string", tag = "1")] - pub pairs: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, + pub pairs: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct GetStateMessage { #[prost(string, tag = "1")] pub request_id: ::prost::alloc::string::String, } -#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, ::prost::Message)] +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct NetworkQuery { #[prost(string, repeated, tag = "1")] pub policy: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, @@ -33,21 +43,22 @@ pub struct NetworkQuery { #[prost(string, tag = "8")] pub requesting_org: ::prost::alloc::string::String, } -#[doc = r" Generated client implementations."] +/// Generated client implementations. pub mod network_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - #[doc = " This service is the interface for how the network communicates with"] - #[doc = " its relay."] + use tonic::codegen::http::Uri; + /// This service is the interface for how the network communicates with + /// its relay. #[derive(Debug, Clone)] pub struct NetworkClient { inner: tonic::client::Grpc, } impl NetworkClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] + /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -57,142 +68,236 @@ pub mod network_client { impl NetworkClient where T: tonic::client::GrpcService, - T::ResponseBody: Body + Send + 'static, T::Error: Into, + T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } pub fn with_interceptor( inner: T, interceptor: F, ) -> NetworkClient> where F: tonic::service::Interceptor, + T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, - >>::Error: - Into + Send + Sync, + , + >>::Error: Into + Send + Sync, { NetworkClient::new(InterceptedService::new(inner, interceptor)) } - #[doc = r" Compress requests with `gzip`."] - #[doc = r""] - #[doc = r" This requires the server to support it otherwise it might respond with an"] - #[doc = r" error."] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); self } - #[doc = r" Enable decompressing responses with `gzip`."] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); self } - #[doc = " endpoint for a network to request remote relay state via local relay"] + /// endpoint for a network to request remote relay state via local relay pub async fn request_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/networks.networks.Network/RequestState"); - self.inner.unary(request.into_request(), path, codec).await + let path = http::uri::PathAndQuery::from_static( + "/networks.networks.Network/RequestState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "RequestState")); + self.inner.unary(req, path, codec).await } - #[doc = " This rpc endpooint is for polling the local relay for request state."] + /// This rpc endpooint is for polling the local relay for request state. pub async fn get_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/networks.networks.Network/GetState"); - self.inner.unary(request.into_request(), path, codec).await + let path = http::uri::PathAndQuery::from_static( + "/networks.networks.Network/GetState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "GetState")); + self.inner.unary(req, path, codec).await } - #[doc = " NOTE: This rpc is just for debugging."] + /// NOTE: This rpc is just for debugging. pub async fn request_database( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/networks.networks.Network/RequestDatabase"); - self.inner.unary(request.into_request(), path, codec).await + let path = http::uri::PathAndQuery::from_static( + "/networks.networks.Network/RequestDatabase", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "RequestDatabase")); + self.inner.unary(req, path, codec).await } } } -#[doc = r" Generated server implementations."] +/// Generated server implementations. pub mod network_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - #[doc = "Generated trait containing gRPC methods that should be implemented for use with NetworkServer."] + /// Generated trait containing gRPC methods that should be implemented for use with NetworkServer. #[async_trait] pub trait Network: Send + Sync + 'static { - #[doc = " endpoint for a network to request remote relay state via local relay"] + /// endpoint for a network to request remote relay state via local relay async fn request_state( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - #[doc = " This rpc endpooint is for polling the local relay for request state."] + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// This rpc endpooint is for polling the local relay for request state. async fn get_state( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - #[doc = " NOTE: This rpc is just for debugging."] + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// NOTE: This rpc is just for debugging. async fn request_database( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; } - #[doc = " This service is the interface for how the network communicates with"] - #[doc = " its relay."] + /// This service is the interface for how the network communicates with + /// its relay. #[derive(Debug)] pub struct NetworkServer { inner: _Inner, - accept_compression_encodings: (), - send_compression_encodings: (), + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl NetworkServer { pub fn new(inner: T) -> Self { - let inner = Arc::new(inner); + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for NetworkServer where @@ -201,9 +306,12 @@ pub mod network_server { B::Error: Into + Send + 'static, { type Response = http::Response; - type Error = Never; + type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -212,29 +320,42 @@ pub mod network_server { "/networks.networks.Network/RequestState" => { #[allow(non_camel_case_types)] struct RequestStateSvc(pub Arc); - impl tonic::server::UnaryService for RequestStateSvc { + impl tonic::server::UnaryService + for RequestStateSvc { type Response = super::super::super::common::ack::Ack; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).request_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::request_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = RequestStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -243,29 +364,42 @@ pub mod network_server { "/networks.networks.Network/GetState" => { #[allow(non_camel_case_types)] struct GetStateSvc(pub Arc); - impl tonic::server::UnaryService for GetStateSvc { + impl tonic::server::UnaryService + for GetStateSvc { type Response = super::super::super::common::state::RequestState; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).get_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = GetStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -274,39 +408,59 @@ pub mod network_server { "/networks.networks.Network/RequestDatabase" => { #[allow(non_camel_case_types)] struct RequestDatabaseSvc(pub Arc); - impl tonic::server::UnaryService for RequestDatabaseSvc { + impl tonic::server::UnaryService + for RequestDatabaseSvc { type Response = super::RelayDatabase; - type Future = BoxFuture, tonic::Status>; - fn call(&mut self, request: tonic::Request) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).request_database(request).await }; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::request_database(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = RequestDatabaseSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } } } } @@ -317,12 +471,14 @@ pub mod network_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { @@ -330,7 +486,7 @@ pub mod network_server { write!(f, "{:?}", self.0) } } - impl tonic::transport::NamedService for NetworkServer { + impl tonic::server::NamedService for NetworkServer { const NAME: &'static str = "networks.networks.Network"; } } diff --git a/packages/cactus-core-api/src/main/rust/generated/proto-rs/relay.datatransfer.rs b/packages/cactus-core-api/src/main/rust/generated/proto-rs/relay.datatransfer.rs index 293b1b37ba..40cbb20690 100644 --- a/packages/cactus-core-api/src/main/rust/generated/proto-rs/relay.datatransfer.rs +++ b/packages/cactus-core-api/src/main/rust/generated/proto-rs/relay.datatransfer.rs @@ -1,17 +1,18 @@ -#[doc = r" Generated client implementations."] +/// Generated client implementations. pub mod data_transfer_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - #[doc = " definitions of all messages used in the datatransfer protocol"] + use tonic::codegen::http::Uri; + /// definitions of all messages used in the datatransfer protocol #[derive(Debug, Clone)] pub struct DataTransferClient { inner: tonic::client::Grpc, } impl DataTransferClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] + /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -21,147 +22,253 @@ pub mod data_transfer_client { impl DataTransferClient where T: tonic::client::GrpcService, - T::ResponseBody: Body + Send + 'static, T::Error: Into, + T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } pub fn with_interceptor( inner: T, interceptor: F, ) -> DataTransferClient> where F: tonic::service::Interceptor, + T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, - >>::Error: - Into + Send + Sync, + , + >>::Error: Into + Send + Sync, { DataTransferClient::new(InterceptedService::new(inner, interceptor)) } - #[doc = r" Compress requests with `gzip`."] - #[doc = r""] - #[doc = r" This requires the server to support it otherwise it might respond with an"] - #[doc = r" error."] - pub fn send_gzip(mut self) -> Self { - self.inner = self.inner.send_gzip(); + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); self } - #[doc = r" Enable decompressing responses with `gzip`."] - pub fn accept_gzip(mut self) -> Self { - self.inner = self.inner.accept_gzip(); + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); self } - #[doc = " the requesting relay sends a RequestState request to the remote relay with a"] - #[doc = " query defining the data it wants to receive"] + /// the requesting relay sends a RequestState request to the remote relay with a + /// query defining the data it wants to receive pub async fn request_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/relay.datatransfer.DataTransfer/RequestState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("relay.datatransfer.DataTransfer", "RequestState"), + ); + self.inner.unary(req, path, codec).await } - #[doc = " the remote relay asynchronously sends back the requested data with"] - #[doc = " SendState"] + /// the remote relay asynchronously sends back the requested data with + /// SendState pub async fn send_state( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + request: impl tonic::IntoRequest< + super::super::super::common::state::ViewPayload, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/relay.datatransfer.DataTransfer/SendState"); - self.inner.unary(request.into_request(), path, codec).await + let path = http::uri::PathAndQuery::from_static( + "/relay.datatransfer.DataTransfer/SendState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("relay.datatransfer.DataTransfer", "SendState")); + self.inner.unary(req, path, codec).await } - #[doc = " Handling state sent from the driver."] + /// Handling state sent from the driver. pub async fn send_driver_state( &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + request: impl tonic::IntoRequest< + super::super::super::common::state::ViewPayload, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/relay.datatransfer.DataTransfer/SendDriverState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("relay.datatransfer.DataTransfer", "SendDriverState"), + ); + self.inner.unary(req, path, codec).await } } } -#[doc = r" Generated server implementations."] +/// Generated server implementations. pub mod data_transfer_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - #[doc = "Generated trait containing gRPC methods that should be implemented for use with DataTransferServer."] + /// Generated trait containing gRPC methods that should be implemented for use with DataTransferServer. #[async_trait] pub trait DataTransfer: Send + Sync + 'static { - #[doc = " the requesting relay sends a RequestState request to the remote relay with a"] - #[doc = " query defining the data it wants to receive"] + /// the requesting relay sends a RequestState request to the remote relay with a + /// query defining the data it wants to receive async fn request_state( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - #[doc = " the remote relay asynchronously sends back the requested data with"] - #[doc = " SendState"] + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// the remote relay asynchronously sends back the requested data with + /// SendState async fn send_state( &self, request: tonic::Request, - ) -> Result, tonic::Status>; - #[doc = " Handling state sent from the driver."] + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Handling state sent from the driver. async fn send_driver_state( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } - #[doc = " definitions of all messages used in the datatransfer protocol"] + /// definitions of all messages used in the datatransfer protocol #[derive(Debug)] pub struct DataTransferServer { inner: _Inner, - accept_compression_encodings: (), - send_compression_encodings: (), + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl DataTransferServer { pub fn new(inner: T) -> Self { - let inner = Arc::new(inner); + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } - pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for DataTransferServer where @@ -170,9 +277,12 @@ pub mod data_transfer_server { B::Error: Into + Send + 'static, { type Response = http::Response; - type Error = Never; + type Error = std::convert::Infallible; type Future = BoxFuture; - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -181,32 +291,47 @@ pub mod data_transfer_server { "/relay.datatransfer.DataTransfer/RequestState" => { #[allow(non_camel_case_types)] struct RequestStateSvc(pub Arc); - impl - tonic::server::UnaryService - for RequestStateSvc - { + impl< + T: DataTransfer, + > tonic::server::UnaryService< + super::super::super::common::query::Query, + > for RequestStateSvc { type Response = super::super::super::common::ack::Ack; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::super::super::common::query::Query, + >, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).request_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::request_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = RequestStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -215,34 +340,47 @@ pub mod data_transfer_server { "/relay.datatransfer.DataTransfer/SendState" => { #[allow(non_camel_case_types)] struct SendStateSvc(pub Arc); - impl - tonic::server::UnaryService - for SendStateSvc - { + impl< + T: DataTransfer, + > tonic::server::UnaryService< + super::super::super::common::state::ViewPayload, + > for SendStateSvc { type Response = super::super::super::common::ack::Ack; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< super::super::super::common::state::ViewPayload, >, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).send_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::send_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = SendStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; @@ -251,47 +389,65 @@ pub mod data_transfer_server { "/relay.datatransfer.DataTransfer/SendDriverState" => { #[allow(non_camel_case_types)] struct SendDriverStateSvc(pub Arc); - impl - tonic::server::UnaryService - for SendDriverStateSvc - { + impl< + T: DataTransfer, + > tonic::server::UnaryService< + super::super::super::common::state::ViewPayload, + > for SendDriverStateSvc { type Response = super::super::super::common::ack::Ack; - type Future = BoxFuture, tonic::Status>; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; fn call( &mut self, request: tonic::Request< super::super::super::common::state::ViewPayload, >, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).send_driver_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::send_driver_state(&inner, request) + .await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = SendDriverStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } - _ => Box::pin(async move { - Ok(http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap()) - }), + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } } } } @@ -302,12 +458,14 @@ pub mod data_transfer_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { @@ -315,7 +473,7 @@ pub mod data_transfer_server { write!(f, "{:?}", self.0) } } - impl tonic::transport::NamedService for DataTransferServer { + impl tonic::server::NamedService for DataTransferServer { const NAME: &'static str = "relay.datatransfer.DataTransfer"; } } diff --git a/packages/cactus-plugin-consortium-manual/package.json b/packages/cactus-plugin-consortium-manual/package.json index a390919712..58b44b6111 100644 --- a/packages/cactus-plugin-consortium-manual/package.json +++ b/packages/cactus-plugin-consortium-manual/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..6a0ff245b9 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,16 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..6b3ced8e5e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,117 @@ +# Go API client for cactus-plugin-consortium-manual + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-consortium-manual "github.com/hyperledger/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetConsortiumJwsV1**](docs/DefaultApi.md#getconsortiumjwsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws | Retrieves a consortium JWS +*DefaultApi* | [**GetNodeJwsV1**](docs/DefaultApi.md#getnodejwsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws | Retrieves the JWT of a Cactus Node +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation For Models + + - [GetConsortiumJwsResponse](docs/GetConsortiumJwsResponse.md) + - [GetNodeJwsResponse](docs/GetNodeJwsResponse.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..7d6e294041 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,166 @@ +openapi: 3.0.3 +info: + description: Manage a Cactus consortium through the APIs. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Consortium Web Service + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws: + post: + description: The JWS asserting the consortium metadata (pub keys and hosts of + nodes) + operationId: getConsortiumJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsResponse' + description: OK + summary: Retrieves a consortium JWS + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics +components: + schemas: + GetNodeJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + GetConsortiumJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetNodeJwsRequest: + additionalProperties: false + properties: {} + type: object + GetConsortiumJwsRequest: + additionalProperties: false + properties: {} + type: object + JWSGeneral: + example: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: + protected: protected + signature: signature + header: + key: "" + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..e24f82767b --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,332 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetConsortiumJwsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + body *map[string]interface{} +} + +func (r ApiGetConsortiumJwsV1Request) Body(body map[string]interface{}) ApiGetConsortiumJwsV1Request { + r.body = &body + return r +} + +func (r ApiGetConsortiumJwsV1Request) Execute() (*GetConsortiumJwsResponse, *http.Response, error) { + return r.ApiService.GetConsortiumJwsV1Execute(r) +} + +/* +GetConsortiumJwsV1 Retrieves a consortium JWS + +The JWS asserting the consortium metadata (pub keys and hosts of nodes) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConsortiumJwsV1Request +*/ +func (a *DefaultApiService) GetConsortiumJwsV1(ctx context.Context) ApiGetConsortiumJwsV1Request { + return ApiGetConsortiumJwsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetConsortiumJwsResponse +func (a *DefaultApiService) GetConsortiumJwsV1Execute(r ApiGetConsortiumJwsV1Request) (*GetConsortiumJwsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetConsortiumJwsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetConsortiumJwsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetNodeJwsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + body *map[string]interface{} +} + +func (r ApiGetNodeJwsV1Request) Body(body map[string]interface{}) ApiGetNodeJwsV1Request { + r.body = &body + return r +} + +func (r ApiGetNodeJwsV1Request) Execute() (*GetNodeJwsResponse, *http.Response, error) { + return r.ApiService.GetNodeJwsV1Execute(r) +} + +/* +GetNodeJwsV1 Retrieves the JWT of a Cactus Node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetNodeJwsV1Request +*/ +func (a *DefaultApiService) GetNodeJwsV1(ctx context.Context) ApiGetNodeJwsV1Request { + return ApiGetNodeJwsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetNodeJwsResponse +func (a *DefaultApiService) GetNodeJwsV1Execute(r ApiGetNodeJwsV1Request) (*GetNodeJwsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetNodeJwsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNodeJwsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..df8a7b3291 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Consortium Web Service API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..0735777cd4 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..b86cf09bce --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..cdf237b0ea --- /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 0000000000..c966c8ddfd --- /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 0000000000..b31d978975 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_consortium_jws_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the GetConsortiumJwsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetConsortiumJwsResponse{} + +// GetConsortiumJwsResponse struct for GetConsortiumJwsResponse +type GetConsortiumJwsResponse struct { + Jws JWSGeneral `json:"jws"` +} + +// NewGetConsortiumJwsResponse instantiates a new GetConsortiumJwsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetConsortiumJwsResponse(jws JWSGeneral) *GetConsortiumJwsResponse { + this := GetConsortiumJwsResponse{} + this.Jws = jws + return &this +} + +// NewGetConsortiumJwsResponseWithDefaults instantiates a new GetConsortiumJwsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetConsortiumJwsResponseWithDefaults() *GetConsortiumJwsResponse { + this := GetConsortiumJwsResponse{} + return &this +} + +// GetJws returns the Jws field value +func (o *GetConsortiumJwsResponse) GetJws() JWSGeneral { + if o == nil { + var ret JWSGeneral + return ret + } + + return o.Jws +} + +// GetJwsOk returns a tuple with the Jws field value +// and a boolean to check if the value has been set. +func (o *GetConsortiumJwsResponse) GetJwsOk() (*JWSGeneral, bool) { + if o == nil { + return nil, false + } + return &o.Jws, true +} + +// SetJws sets field value +func (o *GetConsortiumJwsResponse) SetJws(v JWSGeneral) { + o.Jws = v +} + +func (o GetConsortiumJwsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetConsortiumJwsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jws"] = o.Jws + return toSerialize, nil +} + +type NullableGetConsortiumJwsResponse struct { + value *GetConsortiumJwsResponse + isSet bool +} + +func (v NullableGetConsortiumJwsResponse) Get() *GetConsortiumJwsResponse { + return v.value +} + +func (v *NullableGetConsortiumJwsResponse) Set(val *GetConsortiumJwsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetConsortiumJwsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetConsortiumJwsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetConsortiumJwsResponse(val *GetConsortiumJwsResponse) *NullableGetConsortiumJwsResponse { + return &NullableGetConsortiumJwsResponse{value: val, isSet: true} +} + +func (v NullableGetConsortiumJwsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetConsortiumJwsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go new file mode 100644 index 0000000000..677ca3bc1f --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the GetNodeJwsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetNodeJwsResponse{} + +// GetNodeJwsResponse struct for GetNodeJwsResponse +type GetNodeJwsResponse struct { + Jws JWSGeneral `json:"jws"` +} + +// NewGetNodeJwsResponse instantiates a new GetNodeJwsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetNodeJwsResponse(jws JWSGeneral) *GetNodeJwsResponse { + this := GetNodeJwsResponse{} + this.Jws = jws + return &this +} + +// NewGetNodeJwsResponseWithDefaults instantiates a new GetNodeJwsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetNodeJwsResponseWithDefaults() *GetNodeJwsResponse { + this := GetNodeJwsResponse{} + return &this +} + +// GetJws returns the Jws field value +func (o *GetNodeJwsResponse) GetJws() JWSGeneral { + if o == nil { + var ret JWSGeneral + return ret + } + + return o.Jws +} + +// GetJwsOk returns a tuple with the Jws field value +// and a boolean to check if the value has been set. +func (o *GetNodeJwsResponse) GetJwsOk() (*JWSGeneral, bool) { + if o == nil { + return nil, false + } + return &o.Jws, true +} + +// SetJws sets field value +func (o *GetNodeJwsResponse) SetJws(v JWSGeneral) { + o.Jws = v +} + +func (o GetNodeJwsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetNodeJwsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jws"] = o.Jws + return toSerialize, nil +} + +type NullableGetNodeJwsResponse struct { + value *GetNodeJwsResponse + isSet bool +} + +func (v NullableGetNodeJwsResponse) Get() *GetNodeJwsResponse { + return v.value +} + +func (v *NullableGetNodeJwsResponse) Set(val *GetNodeJwsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetNodeJwsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetNodeJwsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetNodeJwsResponse(val *GetNodeJwsResponse) *NullableGetNodeJwsResponse { + return &NullableGetNodeJwsResponse{value: val, isSet: true} +} + +func (v NullableGetNodeJwsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetNodeJwsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go new file mode 100644 index 0000000000..e7601bfc78 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the JWSGeneral type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSGeneral{} + +// JWSGeneral struct for JWSGeneral +type JWSGeneral struct { + Payload string `json:"payload"` + Signatures []JWSRecipient `json:"signatures"` +} + +// NewJWSGeneral instantiates a new JWSGeneral object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJWSGeneral(payload string, signatures []JWSRecipient) *JWSGeneral { + this := JWSGeneral{} + this.Payload = payload + this.Signatures = signatures + return &this +} + +// NewJWSGeneralWithDefaults instantiates a new JWSGeneral object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSGeneralWithDefaults() *JWSGeneral { + this := JWSGeneral{} + return &this +} + +// GetPayload returns the Payload field value +func (o *JWSGeneral) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *JWSGeneral) SetPayload(v string) { + o.Payload = v +} + +// GetSignatures returns the Signatures field value +func (o *JWSGeneral) GetSignatures() []JWSRecipient { + if o == nil { + var ret []JWSRecipient + return ret + } + + return o.Signatures +} + +// GetSignaturesOk returns a tuple with the Signatures field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetSignaturesOk() ([]JWSRecipient, bool) { + if o == nil { + return nil, false + } + return o.Signatures, true +} + +// SetSignatures sets field value +func (o *JWSGeneral) SetSignatures(v []JWSRecipient) { + o.Signatures = v +} + +func (o JWSGeneral) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSGeneral) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + toSerialize["signatures"] = o.Signatures + return toSerialize, nil +} + +type NullableJWSGeneral struct { + value *JWSGeneral + isSet bool +} + +func (v NullableJWSGeneral) Get() *JWSGeneral { + return v.value +} + +func (v *NullableJWSGeneral) Set(val *JWSGeneral) { + v.value = val + v.isSet = true +} + +func (v NullableJWSGeneral) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSGeneral) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSGeneral(val *JWSGeneral) *NullableJWSGeneral { + return &NullableJWSGeneral{value: val, isSet: true} +} + +func (v NullableJWSGeneral) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSGeneral) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go new file mode 100644 index 0000000000..2eb0409465 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the JWSRecipient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSRecipient{} + +// JWSRecipient A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. +type JWSRecipient struct { + Signature string `json:"signature"` + Protected *string `json:"protected,omitempty"` + Header map[string]interface{} `json:"header,omitempty"` +} + +// NewJWSRecipient instantiates a new JWSRecipient object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJWSRecipient(signature string) *JWSRecipient { + this := JWSRecipient{} + this.Signature = signature + return &this +} + +// NewJWSRecipientWithDefaults instantiates a new JWSRecipient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSRecipientWithDefaults() *JWSRecipient { + this := JWSRecipient{} + return &this +} + +// GetSignature returns the Signature field value +func (o *JWSRecipient) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *JWSRecipient) SetSignature(v string) { + o.Signature = v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *JWSRecipient) GetProtected() string { + if o == nil || IsNil(o.Protected) { + var ret string + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetProtectedOk() (*string, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *JWSRecipient) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given string and assigns it to the Protected field. +func (o *JWSRecipient) SetProtected(v string) { + o.Protected = &v +} + +// GetHeader returns the Header field value if set, zero value otherwise. +func (o *JWSRecipient) GetHeader() map[string]interface{} { + if o == nil || IsNil(o.Header) { + var ret map[string]interface{} + return ret + } + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetHeaderOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Header) { + return map[string]interface{}{}, false + } + return o.Header, true +} + +// HasHeader returns a boolean if a field has been set. +func (o *JWSRecipient) HasHeader() bool { + if o != nil && !IsNil(o.Header) { + return true + } + + return false +} + +// SetHeader gets a reference to the given map[string]interface{} and assigns it to the Header field. +func (o *JWSRecipient) SetHeader(v map[string]interface{}) { + o.Header = v +} + +func (o JWSRecipient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSRecipient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signature"] = o.Signature + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Header) { + toSerialize["header"] = o.Header + } + return toSerialize, nil +} + +type NullableJWSRecipient struct { + value *JWSRecipient + isSet bool +} + +func (v NullableJWSRecipient) Get() *JWSRecipient { + return v.value +} + +func (v *NullableJWSRecipient) Set(val *JWSRecipient) { + v.value = val + v.isSet = true +} + +func (v NullableJWSRecipient) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSRecipient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSRecipient(val *JWSRecipient) *NullableJWSRecipient { + return &NullableJWSRecipient{value: val, isSet: true} +} + +func (v NullableJWSRecipient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSRecipient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..1de463fdce --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..7d4d058051 --- /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 0000000000..e49e8872bf --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..efc24373da --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Consortium Web Service + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..7d1bae49e2 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,37 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java +src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java +src/main/java/org/openapitools/client/model/JWSGeneral.java +src/main/java/org/openapitools/client/model/JWSRecipient.java diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..697071987a --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,142 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Consortium Web Service +- API version: v2.0.0-alpha.2 + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + Object body = null; // Object | + try { + GetConsortiumJwsResponse result = apiInstance.getConsortiumJwsV1(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getConsortiumJwsV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getConsortiumJwsV1**](docs/DefaultApi.md#getConsortiumJwsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws | Retrieves a consortium JWS +*DefaultApi* | [**getNodeJwsV1**](docs/DefaultApi.md#getNodeJwsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws | Retrieves the JWT of a Cactus Node +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation for Models + + - [GetConsortiumJwsResponse](docs/GetConsortiumJwsResponse.md) + - [GetNodeJwsResponse](docs/GetNodeJwsResponse.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..2f3c0c3afe --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,172 @@ +openapi: 3.0.3 +info: + description: Manage a Cactus consortium through the APIs. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Consortium Web Service + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws: + post: + description: The JWS asserting the consortium metadata (pub keys and hosts of + nodes) + operationId: getConsortiumJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsResponse' + description: OK + summary: Retrieves a consortium JWS + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws: + post: + operationId: getNodeJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodeJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodeJwsResponse' + description: OK + summary: Retrieves the JWT of a Cactus Node + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + GetNodeJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + GetConsortiumJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetNodeJwsRequest: + additionalProperties: false + properties: {} + type: object + GetConsortiumJwsRequest: + additionalProperties: false + properties: {} + type: object + JWSGeneral: + example: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: + protected: protected + signature: signature + header: + key: "" + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..d8b7dd8854 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..7fb63b907b --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..0d41d587b1 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..4d5d3cf9ae --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..48e540a43f --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..29dd398b74 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,404 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetConsortiumJwsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetNodeJwsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSGeneral.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSRecipient.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..99e2790b60 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..45b49fe6f2 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..1970e4c3d2 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..1e283bd3ea --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..3435b3614e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.GetConsortiumJwsResponse; +import org.openapitools.client.model.GetNodeJwsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getConsortiumJwsV1 + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getConsortiumJwsV1Call(Object body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConsortiumJwsV1ValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException { + return getConsortiumJwsV1Call(body, _callback); + + } + + /** + * Retrieves a consortium JWS + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @return GetConsortiumJwsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetConsortiumJwsResponse getConsortiumJwsV1(Object body) throws ApiException { + ApiResponse localVarResp = getConsortiumJwsV1WithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * Retrieves a consortium JWS + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @return ApiResponse<GetConsortiumJwsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getConsortiumJwsV1WithHttpInfo(Object body) throws ApiException { + okhttp3.Call localVarCall = getConsortiumJwsV1ValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves a consortium JWS (asynchronously) + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getConsortiumJwsV1Async(Object body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getConsortiumJwsV1ValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNodeJwsV1 + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getNodeJwsV1Call(Object body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNodeJwsV1ValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException { + return getNodeJwsV1Call(body, _callback); + + } + + /** + * Retrieves the JWT of a Cactus Node + * + * @param body (optional) + * @return GetNodeJwsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetNodeJwsResponse getNodeJwsV1(Object body) throws ApiException { + ApiResponse localVarResp = getNodeJwsV1WithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * Retrieves the JWT of a Cactus Node + * + * @param body (optional) + * @return ApiResponse<GetNodeJwsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getNodeJwsV1WithHttpInfo(Object body) throws ApiException { + okhttp3.Call localVarCall = getNodeJwsV1ValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the JWT of a Cactus Node (asynchronously) + * + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getNodeJwsV1Async(Object body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNodeJwsV1ValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..49cf82fd78 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..9f77145504 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..113551d074 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..730ec8e8f4 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..d76ab94e6c --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java new file mode 100644 index 0000000000..a809df9afe --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JWSGeneral; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetConsortiumJwsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetConsortiumJwsResponse { + public static final String SERIALIZED_NAME_JWS = "jws"; + @SerializedName(SERIALIZED_NAME_JWS) + private JWSGeneral jws; + + public GetConsortiumJwsResponse() { + } + + public GetConsortiumJwsResponse jws(JWSGeneral jws) { + + this.jws = jws; + return this; + } + + /** + * Get jws + * @return jws + **/ + @javax.annotation.Nonnull + public JWSGeneral getJws() { + return jws; + } + + + public void setJws(JWSGeneral jws) { + this.jws = jws; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetConsortiumJwsResponse getConsortiumJwsResponse = (GetConsortiumJwsResponse) o; + return Objects.equals(this.jws, getConsortiumJwsResponse.jws); + } + + @Override + public int hashCode() { + return Objects.hash(jws); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetConsortiumJwsResponse {\n"); + sb.append(" jws: ").append(toIndentedString(jws)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jws"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jws"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetConsortiumJwsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetConsortiumJwsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetConsortiumJwsResponse is not found in the empty JSON string", GetConsortiumJwsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetConsortiumJwsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetConsortiumJwsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetConsortiumJwsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `jws` + JWSGeneral.validateJsonObject(jsonObj.getAsJsonObject("jws")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetConsortiumJwsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetConsortiumJwsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetConsortiumJwsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetConsortiumJwsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetConsortiumJwsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetConsortiumJwsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetConsortiumJwsResponse + * @throws IOException if the JSON string is invalid with respect to GetConsortiumJwsResponse + */ + public static GetConsortiumJwsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetConsortiumJwsResponse.class); + } + + /** + * Convert an instance of GetConsortiumJwsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java new file mode 100644 index 0000000000..458542af72 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JWSGeneral; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetNodeJwsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetNodeJwsResponse { + public static final String SERIALIZED_NAME_JWS = "jws"; + @SerializedName(SERIALIZED_NAME_JWS) + private JWSGeneral jws; + + public GetNodeJwsResponse() { + } + + public GetNodeJwsResponse jws(JWSGeneral jws) { + + this.jws = jws; + return this; + } + + /** + * Get jws + * @return jws + **/ + @javax.annotation.Nonnull + public JWSGeneral getJws() { + return jws; + } + + + public void setJws(JWSGeneral jws) { + this.jws = jws; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetNodeJwsResponse getNodeJwsResponse = (GetNodeJwsResponse) o; + return Objects.equals(this.jws, getNodeJwsResponse.jws); + } + + @Override + public int hashCode() { + return Objects.hash(jws); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetNodeJwsResponse {\n"); + sb.append(" jws: ").append(toIndentedString(jws)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jws"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jws"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetNodeJwsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetNodeJwsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetNodeJwsResponse is not found in the empty JSON string", GetNodeJwsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetNodeJwsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetNodeJwsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetNodeJwsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `jws` + JWSGeneral.validateJsonObject(jsonObj.getAsJsonObject("jws")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetNodeJwsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetNodeJwsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetNodeJwsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetNodeJwsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetNodeJwsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetNodeJwsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetNodeJwsResponse + * @throws IOException if the JSON string is invalid with respect to GetNodeJwsResponse + */ + public static GetNodeJwsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetNodeJwsResponse.class); + } + + /** + * Convert an instance of GetNodeJwsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java new file mode 100644 index 0000000000..3b21d1e315 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java @@ -0,0 +1,266 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.JWSRecipient; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * JWSGeneral + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSGeneral { + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public static final String SERIALIZED_NAME_SIGNATURES = "signatures"; + @SerializedName(SERIALIZED_NAME_SIGNATURES) + private List signatures = new ArrayList<>(); + + public JWSGeneral() { + } + + public JWSGeneral payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + public JWSGeneral signatures(List signatures) { + + this.signatures = signatures; + return this; + } + + public JWSGeneral addSignaturesItem(JWSRecipient signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * Get signatures + * @return signatures + **/ + @javax.annotation.Nonnull + public List getSignatures() { + return signatures; + } + + + public void setSignatures(List signatures) { + this.signatures = signatures; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSGeneral jwSGeneral = (JWSGeneral) o; + return Objects.equals(this.payload, jwSGeneral.payload) && + Objects.equals(this.signatures, jwSGeneral.signatures); + } + + @Override + public int hashCode() { + return Objects.hash(payload, signatures); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSGeneral {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload"); + openapiFields.add("signatures"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("signatures"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSGeneral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSGeneral.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSGeneral is not found in the empty JSON string", JWSGeneral.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSGeneral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSGeneral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSGeneral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("signatures").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signatures` to be an array in the JSON string but got `%s`", jsonObj.get("signatures").toString())); + } + + JsonArray jsonArraysignatures = jsonObj.getAsJsonArray("signatures"); + // validate the required field `signatures` (array) + for (int i = 0; i < jsonArraysignatures.size(); i++) { + JWSRecipient.validateJsonObject(jsonArraysignatures.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSGeneral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSGeneral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSGeneral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSGeneral value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSGeneral read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSGeneral given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSGeneral + * @throws IOException if the JSON string is invalid with respect to JWSGeneral + */ + public static JWSGeneral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSGeneral.class); + } + + /** + * Convert an instance of JWSGeneral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java new file mode 100644 index 0000000000..1bd501d557 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSRecipient { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + @SerializedName(SERIALIZED_NAME_PROTECTED) + private String protected; + + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private Map header = new HashMap<>(); + + public JWSRecipient() { + } + + public JWSRecipient signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public JWSRecipient protected(String protected) { + + this.protected = protected; + return this; + } + + /** + * Get protected + * @return protected + **/ + @javax.annotation.Nullable + public String getProtected() { + return protected; + } + + + public void setProtected(String protected) { + this.protected = protected; + } + + + public JWSRecipient header(Map header) { + + this.header = header; + return this; + } + + public JWSRecipient putHeaderItem(String key, Object headerItem) { + if (this.header == null) { + this.header = new HashMap<>(); + } + this.header.put(key, headerItem); + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nullable + public Map getHeader() { + return header; + } + + + public void setHeader(Map header) { + this.header = header; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSRecipient jwSRecipient = (JWSRecipient) o; + return Objects.equals(this.signature, jwSRecipient.signature) && + Objects.equals(this.protected, jwSRecipient.protected) && + Objects.equals(this.header, jwSRecipient.header); + } + + @Override + public int hashCode() { + return Objects.hash(signature, protected, header); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSRecipient {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" protected: ").append(toIndentedString(protected)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signature"); + openapiFields.add("protected"); + openapiFields.add("header"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSRecipient + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSRecipient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSRecipient is not found in the empty JSON string", JWSRecipient.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSRecipient.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSRecipient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSRecipient.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if ((jsonObj.get("protected") != null && !jsonObj.get("protected").isJsonNull()) && !jsonObj.get("protected").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `protected` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protected").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSRecipient.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSRecipient' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSRecipient.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSRecipient value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSRecipient read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSRecipient given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSRecipient + * @throws IOException if the JSON string is invalid with respect to JWSRecipient + */ + public static JWSRecipient fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSRecipient.class); + } + + /** + * Convert an instance of JWSRecipient to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..1122658ca0 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.GetConsortiumJwsResponse; +import org.openapitools.client.model.GetNodeJwsResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Retrieves a consortium JWS + * + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * + * @throws ApiException if the Api call fails + */ + @Test + public void getConsortiumJwsV1Test() throws ApiException { + Object body = null; + GetConsortiumJwsResponse response = api.getConsortiumJwsV1(body); + // TODO: test validations + } + + /** + * Retrieves the JWT of a Cactus Node + * + * @throws ApiException if the Api call fails + */ + @Test + public void getNodeJwsV1Test() throws ApiException { + Object body = null; + GetNodeJwsResponse response = api.getNodeJwsV1(body); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java new file mode 100644 index 0000000000..f255cf8afb --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JWSGeneral; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetConsortiumJwsResponse + */ +public class GetConsortiumJwsResponseTest { + private final GetConsortiumJwsResponse model = new GetConsortiumJwsResponse(); + + /** + * Model tests for GetConsortiumJwsResponse + */ + @Test + public void testGetConsortiumJwsResponse() { + // TODO: test GetConsortiumJwsResponse + } + + /** + * Test the property 'jws' + */ + @Test + public void jwsTest() { + // TODO: test jws + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java new file mode 100644 index 0000000000..806ecd968d --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JWSGeneral; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetNodeJwsResponse + */ +public class GetNodeJwsResponseTest { + private final GetNodeJwsResponse model = new GetNodeJwsResponse(); + + /** + * Model tests for GetNodeJwsResponse + */ + @Test + public void testGetNodeJwsResponse() { + // TODO: test GetNodeJwsResponse + } + + /** + * Test the property 'jws' + */ + @Test + public void jwsTest() { + // TODO: test jws + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java new file mode 100644 index 0000000000..b9c6075425 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.JWSRecipient; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSGeneral + */ +public class JWSGeneralTest { + private final JWSGeneral model = new JWSGeneral(); + + /** + * Model tests for JWSGeneral + */ + @Test + public void testJWSGeneral() { + // TODO: test JWSGeneral + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'signatures' + */ + @Test + public void signaturesTest() { + // TODO: test signatures + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java new file mode 100644 index 0000000000..8aec24d931 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSRecipient + */ +public class JWSRecipientTest { + private final JWSRecipient model = new JWSRecipient(); + + /** + * Model tests for JWSRecipient + */ + @Test + public void testJWSRecipient() { + // TODO: test JWSRecipient + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'protected' + */ + @Test + public void protectedTest() { + // TODO: test protected + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/package.json b/packages/cactus-plugin-htlc-eth-besu-erc20/package.json index 73f1ca3d52..b17e36b14c 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/package.json +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/package.json @@ -51,8 +51,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..7e1ed0950c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,27 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..443488ca2e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,131 @@ +# Go API client for cactus-plugin-htlc-eth-besu-erc20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-htlc-eth-besu-erc20 "github.com/hyperledger/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetSingleStatusV1**](docs/DefaultApi.md#getsinglestatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status | +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status | +*DefaultApi* | [**InitializeV1**](docs/DefaultApi.md#initializev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize | Initialize contract +*DefaultApi* | [**NewContractV1**](docs/DefaultApi.md#newcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract | Create a new hashtimelock contract +*DefaultApi* | [**RefundV1**](docs/DefaultApi.md#refundv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund | Refund a hashtimelock contract +*DefaultApi* | [**WithdrawV1**](docs/DefaultApi.md#withdrawv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw | Withdraw a hashtimelock contract + + +## Documentation For Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractRequest](docs/NewContractRequest.md) + - [NewContractRequestGas](docs/NewContractRequestGas.md) + - [RefundRequest](docs/RefundRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawRequest](docs/WithdrawRequest.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..e683dba687 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,575 @@ +openapi: 3.0.3 +info: + description: Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize: + post: + operationId: initializeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Initialize contract + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractRequest: + additionalProperties: false + example: + receiver: receiver + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + contractAddress: contractAddress + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: null + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output address to receive the tokens + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + RefundRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractRequest_gas: + oneOf: + - type: string + - type: number diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..6d027dedf1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,653 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetSingleStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getSingleStatusRequest *GetSingleStatusRequest +} + +func (r ApiGetSingleStatusV1Request) GetSingleStatusRequest(getSingleStatusRequest GetSingleStatusRequest) ApiGetSingleStatusV1Request { + r.getSingleStatusRequest = &getSingleStatusRequest + return r +} + +func (r ApiGetSingleStatusV1Request) Execute() (int32, *http.Response, error) { + return r.ApiService.GetSingleStatusV1Execute(r) +} + +/* +GetSingleStatusV1 Method for GetSingleStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSingleStatusV1Request +*/ +func (a *DefaultApiService) GetSingleStatusV1(ctx context.Context) ApiGetSingleStatusV1Request { + return ApiGetSingleStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return int32 +func (a *DefaultApiService) GetSingleStatusV1Execute(r ApiGetSingleStatusV1Request) (int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSingleStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getSingleStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getStatusRequest *GetStatusRequest +} + +func (r ApiGetStatusV1Request) GetStatusRequest(getStatusRequest GetStatusRequest) ApiGetStatusV1Request { + r.getStatusRequest = &getStatusRequest + return r +} + +func (r ApiGetStatusV1Request) Execute() ([]int32, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Method for GetStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []int32 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) ([]int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInitializeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + initializeRequest *InitializeRequest +} + +func (r ApiInitializeV1Request) InitializeRequest(initializeRequest InitializeRequest) ApiInitializeV1Request { + r.initializeRequest = &initializeRequest + return r +} + +func (r ApiInitializeV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.InitializeV1Execute(r) +} + +/* +InitializeV1 Initialize contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInitializeV1Request +*/ +func (a *DefaultApiService) InitializeV1(ctx context.Context) ApiInitializeV1Request { + return ApiInitializeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) InitializeV1Execute(r ApiInitializeV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InitializeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.initializeRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiNewContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + newContractRequest *NewContractRequest +} + +func (r ApiNewContractV1Request) NewContractRequest(newContractRequest NewContractRequest) ApiNewContractV1Request { + r.newContractRequest = &newContractRequest + return r +} + +func (r ApiNewContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.NewContractV1Execute(r) +} + +/* +NewContractV1 Create a new hashtimelock contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNewContractV1Request +*/ +func (a *DefaultApiService) NewContractV1(ctx context.Context) ApiNewContractV1Request { + return ApiNewContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) NewContractV1Execute(r ApiNewContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.NewContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.newContractRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRefundV1Request struct { + ctx context.Context + ApiService *DefaultApiService + refundRequest *RefundRequest +} + +func (r ApiRefundV1Request) RefundRequest(refundRequest RefundRequest) ApiRefundV1Request { + r.refundRequest = &refundRequest + return r +} + +func (r ApiRefundV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.RefundV1Execute(r) +} + +/* +RefundV1 Refund a hashtimelock contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRefundV1Request +*/ +func (a *DefaultApiService) RefundV1(ctx context.Context) ApiRefundV1Request { + return ApiRefundV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) RefundV1Execute(r ApiRefundV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RefundV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.refundRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWithdrawV1Request struct { + ctx context.Context + ApiService *DefaultApiService + withdrawRequest *WithdrawRequest +} + +func (r ApiWithdrawV1Request) WithdrawRequest(withdrawRequest WithdrawRequest) ApiWithdrawV1Request { + r.withdrawRequest = &withdrawRequest + return r +} + +func (r ApiWithdrawV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.WithdrawV1Execute(r) +} + +/* +WithdrawV1 Withdraw a hashtimelock contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWithdrawV1Request +*/ +func (a *DefaultApiService) WithdrawV1(ctx context.Context) ApiWithdrawV1Request { + return ApiWithdrawV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) WithdrawV1Execute(r ApiWithdrawV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.WithdrawV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.withdrawRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..dd65d0c35b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..70ab904d70 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..acf95b87a0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..08190890c0 --- /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 0000000000..c966c8ddfd --- /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 0000000000..d71a6398e6 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_single_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the GetSingleStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSingleStatusRequest{} + +// GetSingleStatusRequest Defines the parameters for retrieving the single status of the HTLC swap. +type GetSingleStatusRequest struct { + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetSingleStatusRequest instantiates a new GetSingleStatusRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetSingleStatusRequest(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetSingleStatusRequestWithDefaults instantiates a new GetSingleStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetSingleStatusRequestWithDefaults() *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + return &this +} + +// GetId returns the Id field value +func (o *GetSingleStatusRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetSingleStatusRequest) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetSingleStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetSingleStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetSingleStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetSingleStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetSingleStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetSingleStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetSingleStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSingleStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetSingleStatusRequest struct { + value *GetSingleStatusRequest + isSet bool +} + +func (v NullableGetSingleStatusRequest) Get() *GetSingleStatusRequest { + return v.value +} + +func (v *NullableGetSingleStatusRequest) Set(val *GetSingleStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetSingleStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSingleStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSingleStatusRequest(val *GetSingleStatusRequest) *NullableGetSingleStatusRequest { + return &NullableGetSingleStatusRequest{value: val, isSet: true} +} + +func (v NullableGetSingleStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSingleStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go new file mode 100644 index 0000000000..87ea63e115 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the GetStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatusRequest{} + +// GetStatusRequest Defines the parameters for retrieving the status of the HTLC swap. +type GetStatusRequest struct { + Ids []string `json:"ids"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetStatusRequest instantiates a new GetStatusRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetStatusRequest(ids []string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetStatusRequest { + this := GetStatusRequest{} + this.Ids = ids + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetStatusRequestWithDefaults instantiates a new GetStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetStatusRequestWithDefaults() *GetStatusRequest { + this := GetStatusRequest{} + return &this +} + +// GetIds returns the Ids field value +func (o *GetStatusRequest) GetIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.Ids +} + +// GetIdsOk returns a tuple with the Ids field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Ids, true +} + +// SetIds sets field value +func (o *GetStatusRequest) SetIds(v []string) { + o.Ids = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ids"] = o.Ids + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetStatusRequest struct { + value *GetStatusRequest + isSet bool +} + +func (v NullableGetStatusRequest) Get() *GetStatusRequest { + return v.value +} + +func (v *NullableGetStatusRequest) Set(val *GetStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatusRequest(val *GetStatusRequest) *NullableGetStatusRequest { + return &NullableGetStatusRequest{value: val, isSet: true} +} + +func (v NullableGetStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go new file mode 100644 index 0000000000..ebf5ac7163 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go @@ -0,0 +1,236 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the InitializeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InitializeRequest{} + +// InitializeRequest struct for InitializeRequest +type InitializeRequest struct { + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewInitializeRequest instantiates a new InitializeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInitializeRequest(connectorId string, keychainId string, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential) *InitializeRequest { + this := InitializeRequest{} + this.ConnectorId = connectorId + this.KeychainId = keychainId + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + return &this +} + +// NewInitializeRequestWithDefaults instantiates a new InitializeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInitializeRequestWithDefaults() *InitializeRequest { + this := InitializeRequest{} + return &this +} + +// GetConnectorId returns the ConnectorId field value +func (o *InitializeRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *InitializeRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *InitializeRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InitializeRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *InitializeRequest) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *InitializeRequest) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InitializeRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InitializeRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InitializeRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InitializeRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *InitializeRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o InitializeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InitializeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableInitializeRequest struct { + value *InitializeRequest + isSet bool +} + +func (v NullableInitializeRequest) Get() *InitializeRequest { + return v.value +} + +func (v *NullableInitializeRequest) Set(val *InitializeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInitializeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInitializeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInitializeRequest(val *InitializeRequest) *NullableInitializeRequest { + return &NullableInitializeRequest{value: val, isSet: true} +} + +func (v NullableInitializeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInitializeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 0000000000..934b9ee31b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go new file mode 100644 index 0000000000..e1b85e5e93 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go @@ -0,0 +1,461 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the NewContractRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NewContractRequest{} + +// NewContractRequest struct for NewContractRequest +type NewContractRequest struct { + // Contract address + ContractAddress string `json:"contractAddress"` + // Input amount to lock + InputAmount float32 `json:"inputAmount"` + // Output amount to lock + OutputAmount float32 `json:"outputAmount"` + // Timestamp to expire the contract + Expiration float32 `json:"expiration"` + // Hashlock needed to refund the amount + HashLock string `json:"hashLock"` + // The token address + TokenAddress string `json:"tokenAddress"` + // The receiver address + Receiver string `json:"receiver"` + // The output network id + OutputNetwork string `json:"outputNetwork"` + // The output address to receive the tokens + OutputAddress string `json:"outputAddress"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychian plugin + KeychainId string `json:"keychainId"` + Gas *NewContractRequestGas `json:"gas,omitempty"` +} + +// NewNewContractRequest instantiates a new NewContractRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNewContractRequest(contractAddress string, inputAmount float32, outputAmount float32, expiration float32, hashLock string, tokenAddress string, receiver string, outputNetwork string, outputAddress string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *NewContractRequest { + this := NewContractRequest{} + this.ContractAddress = contractAddress + this.InputAmount = inputAmount + this.OutputAmount = outputAmount + this.Expiration = expiration + this.HashLock = hashLock + this.TokenAddress = tokenAddress + this.Receiver = receiver + this.OutputNetwork = outputNetwork + this.OutputAddress = outputAddress + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewNewContractRequestWithDefaults instantiates a new NewContractRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNewContractRequestWithDefaults() *NewContractRequest { + this := NewContractRequest{} + return &this +} + +// GetContractAddress returns the ContractAddress field value +func (o *NewContractRequest) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *NewContractRequest) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetInputAmount returns the InputAmount field value +func (o *NewContractRequest) GetInputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.InputAmount +} + +// GetInputAmountOk returns a tuple with the InputAmount field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetInputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.InputAmount, true +} + +// SetInputAmount sets field value +func (o *NewContractRequest) SetInputAmount(v float32) { + o.InputAmount = v +} + +// GetOutputAmount returns the OutputAmount field value +func (o *NewContractRequest) GetOutputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.OutputAmount +} + +// GetOutputAmountOk returns a tuple with the OutputAmount field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetOutputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.OutputAmount, true +} + +// SetOutputAmount sets field value +func (o *NewContractRequest) SetOutputAmount(v float32) { + o.OutputAmount = v +} + +// GetExpiration returns the Expiration field value +func (o *NewContractRequest) GetExpiration() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Expiration, true +} + +// SetExpiration sets field value +func (o *NewContractRequest) SetExpiration(v float32) { + o.Expiration = v +} + +// GetHashLock returns the HashLock field value +func (o *NewContractRequest) GetHashLock() string { + if o == nil { + var ret string + return ret + } + + return o.HashLock +} + +// GetHashLockOk returns a tuple with the HashLock field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetHashLockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLock, true +} + +// SetHashLock sets field value +func (o *NewContractRequest) SetHashLock(v string) { + o.HashLock = v +} + +// GetTokenAddress returns the TokenAddress field value +func (o *NewContractRequest) GetTokenAddress() string { + if o == nil { + var ret string + return ret + } + + return o.TokenAddress +} + +// GetTokenAddressOk returns a tuple with the TokenAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetTokenAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenAddress, true +} + +// SetTokenAddress sets field value +func (o *NewContractRequest) SetTokenAddress(v string) { + o.TokenAddress = v +} + +// GetReceiver returns the Receiver field value +func (o *NewContractRequest) GetReceiver() string { + if o == nil { + var ret string + return ret + } + + return o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetReceiverOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Receiver, true +} + +// SetReceiver sets field value +func (o *NewContractRequest) SetReceiver(v string) { + o.Receiver = v +} + +// GetOutputNetwork returns the OutputNetwork field value +func (o *NewContractRequest) GetOutputNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.OutputNetwork +} + +// GetOutputNetworkOk returns a tuple with the OutputNetwork field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetOutputNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputNetwork, true +} + +// SetOutputNetwork sets field value +func (o *NewContractRequest) SetOutputNetwork(v string) { + o.OutputNetwork = v +} + +// GetOutputAddress returns the OutputAddress field value +func (o *NewContractRequest) GetOutputAddress() string { + if o == nil { + var ret string + return ret + } + + return o.OutputAddress +} + +// GetOutputAddressOk returns a tuple with the OutputAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetOutputAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputAddress, true +} + +// SetOutputAddress sets field value +func (o *NewContractRequest) SetOutputAddress(v string) { + o.OutputAddress = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *NewContractRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *NewContractRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *NewContractRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *NewContractRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *NewContractRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *NewContractRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *NewContractRequest) GetGas() NewContractRequestGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractRequestGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetGasOk() (*NewContractRequestGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *NewContractRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractRequestGas and assigns it to the Gas field. +func (o *NewContractRequest) SetGas(v NewContractRequestGas) { + o.Gas = &v +} + +func (o NewContractRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NewContractRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractAddress"] = o.ContractAddress + toSerialize["inputAmount"] = o.InputAmount + toSerialize["outputAmount"] = o.OutputAmount + toSerialize["expiration"] = o.Expiration + toSerialize["hashLock"] = o.HashLock + toSerialize["tokenAddress"] = o.TokenAddress + toSerialize["receiver"] = o.Receiver + toSerialize["outputNetwork"] = o.OutputNetwork + toSerialize["outputAddress"] = o.OutputAddress + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableNewContractRequest struct { + value *NewContractRequest + isSet bool +} + +func (v NullableNewContractRequest) Get() *NewContractRequest { + return v.value +} + +func (v *NullableNewContractRequest) Set(val *NewContractRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractRequest(val *NewContractRequest) *NullableNewContractRequest { + return &NullableNewContractRequest{value: val, isSet: true} +} + +func (v NullableNewContractRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go new file mode 100644 index 0000000000..2720105627 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "fmt" +) + +// NewContractRequestGas - struct for NewContractRequestGas +type NewContractRequestGas struct { + Float32 *float32 + String *string +} + +// float32AsNewContractRequestGas is a convenience function that returns float32 wrapped in NewContractRequestGas +func Float32AsNewContractRequestGas(v *float32) NewContractRequestGas { + return NewContractRequestGas{ + Float32: v, + } +} + +// stringAsNewContractRequestGas is a convenience function that returns string wrapped in NewContractRequestGas +func StringAsNewContractRequestGas(v *string) NewContractRequestGas { + return NewContractRequestGas{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *NewContractRequestGas) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(NewContractRequestGas)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(NewContractRequestGas)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src NewContractRequestGas) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *NewContractRequestGas) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableNewContractRequestGas struct { + value *NewContractRequestGas + isSet bool +} + +func (v NullableNewContractRequestGas) Get() *NewContractRequestGas { + return v.value +} + +func (v *NullableNewContractRequestGas) Set(val *NewContractRequestGas) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractRequestGas) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractRequestGas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractRequestGas(val *NewContractRequestGas) *NullableNewContractRequestGas { + return &NullableNewContractRequestGas{value: val, isSet: true} +} + +func (v NullableNewContractRequestGas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractRequestGas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go new file mode 100644 index 0000000000..73e087e490 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go @@ -0,0 +1,237 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the RefundRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RefundRequest{} + +// RefundRequest struct for RefundRequest +type RefundRequest struct { + // Contract htlc id for refund + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractRequestGas `json:"gas,omitempty"` +} + +// NewRefundRequest instantiates a new RefundRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRefundRequest(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *RefundRequest { + this := RefundRequest{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewRefundRequestWithDefaults instantiates a new RefundRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundRequestWithDefaults() *RefundRequest { + this := RefundRequest{} + return &this +} + +// GetId returns the Id field value +func (o *RefundRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RefundRequest) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RefundRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RefundRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *RefundRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *RefundRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *RefundRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *RefundRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *RefundRequest) GetGas() NewContractRequestGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractRequestGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetGasOk() (*NewContractRequestGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *RefundRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractRequestGas and assigns it to the Gas field. +func (o *RefundRequest) SetGas(v NewContractRequestGas) { + o.Gas = &v +} + +func (o RefundRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableRefundRequest struct { + value *RefundRequest + isSet bool +} + +func (v NullableRefundRequest) Get() *RefundRequest { + return v.value +} + +func (v *NullableRefundRequest) Set(val *RefundRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRefundRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundRequest(val *RefundRequest) *NullableRefundRequest { + return &NullableRefundRequest{value: val, isSet: true} +} + +func (v NullableRefundRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 0000000000..9fc98f030e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..415867dc9b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..ea955ed805 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..d424a07d62 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..298a53bd64 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..05d7180035 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 0000000000..eea7877e0e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go new file mode 100644 index 0000000000..30164b4688 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go @@ -0,0 +1,265 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the WithdrawRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WithdrawRequest{} + +// WithdrawRequest struct for WithdrawRequest +type WithdrawRequest struct { + // Contract locked id + Id string `json:"id"` + // Secret need to unlock the contract + Secret string `json:"secret"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractRequestGas `json:"gas,omitempty"` +} + +// NewWithdrawRequest instantiates a new WithdrawRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWithdrawRequest(id string, secret string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *WithdrawRequest { + this := WithdrawRequest{} + this.Id = id + this.Secret = secret + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewWithdrawRequestWithDefaults instantiates a new WithdrawRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWithdrawRequestWithDefaults() *WithdrawRequest { + this := WithdrawRequest{} + return &this +} + +// GetId returns the Id field value +func (o *WithdrawRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WithdrawRequest) SetId(v string) { + o.Id = v +} + +// GetSecret returns the Secret field value +func (o *WithdrawRequest) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *WithdrawRequest) SetSecret(v string) { + o.Secret = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *WithdrawRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *WithdrawRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *WithdrawRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *WithdrawRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *WithdrawRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *WithdrawRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *WithdrawRequest) GetGas() NewContractRequestGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractRequestGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetGasOk() (*NewContractRequestGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *WithdrawRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractRequestGas and assigns it to the Gas field. +func (o *WithdrawRequest) SetGas(v NewContractRequestGas) { + o.Gas = &v +} + +func (o WithdrawRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WithdrawRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["secret"] = o.Secret + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableWithdrawRequest struct { + value *WithdrawRequest + isSet bool +} + +func (v NullableWithdrawRequest) Get() *WithdrawRequest { + return v.value +} + +func (v *NullableWithdrawRequest) Set(val *WithdrawRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWithdrawRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWithdrawRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWithdrawRequest(val *WithdrawRequest) *NullableWithdrawRequest { + return &NullableWithdrawRequest{value: val, isSet: true} +} + +func (v NullableWithdrawRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWithdrawRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..86fc5c2e15 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..917ea3ad32 --- /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 0000000000..06580af40d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..a0b92e0303 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..b0dcc34a1a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java +src/main/java/org/openapitools/client/model/GetStatusRequest.java +src/main/java/org/openapitools/client/model/InitializeRequest.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/NewContractRequest.java +src/main/java/org/openapitools/client/model/NewContractRequestGas.java +src/main/java/org/openapitools/client/model/RefundRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/main/java/org/openapitools/client/model/WithdrawRequest.java diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..41e48d6ac8 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,156 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 +- API version: v2.0.0-alpha.2 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetSingleStatusRequest getSingleStatusRequest = new GetSingleStatusRequest(); // GetSingleStatusRequest | + try { + Integer result = apiInstance.getSingleStatusV1(getSingleStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getSingleStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getSingleStatusV1**](docs/DefaultApi.md#getSingleStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status | +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status | +*DefaultApi* | [**initializeV1**](docs/DefaultApi.md#initializeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize | Initialize contract +*DefaultApi* | [**newContractV1**](docs/DefaultApi.md#newContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract | Create a new hashtimelock contract +*DefaultApi* | [**refundV1**](docs/DefaultApi.md#refundV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund | Refund a hashtimelock contract +*DefaultApi* | [**withdrawV1**](docs/DefaultApi.md#withdrawV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw | Withdraw a hashtimelock contract + + +## Documentation for Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractRequest](docs/NewContractRequest.md) + - [NewContractRequestGas](docs/NewContractRequestGas.md) + - [RefundRequest](docs/RefundRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawRequest](docs/WithdrawRequest.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..9ee5ff6d78 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,588 @@ +openapi: 3.0.3 +info: + description: Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize: + post: + operationId: initializeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Initialize contract + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw: + post: + operationId: withdrawV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Withdraw a hashtimelock contract + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status: + post: + operationId: getStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatusRequest' + responses: + "200": + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status: + post: + operationId: getSingleStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetSingleStatusRequest' + responses: + "200": + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund: + post: + operationId: refundV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefundRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Refund a hashtimelock contract + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract: + post: + operationId: newContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Create a new hashtimelock contract + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract + x-content-type: application/json + x-accepts: application/json +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractRequest: + additionalProperties: false + example: + receiver: receiver + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + contractAddress: contractAddress + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: null + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output address to receive the tokens + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + RefundRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractRequest_gas: + oneOf: + - type: string + - type: number + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..b99e9f77a7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..6b66af2745 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..b40d00e087 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..7a7e81d1bc --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..759eb4c324 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..0acbc93c44 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetSingleStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InitializeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractRequestGas.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RefundRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WithdrawRequest.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..afc60ff460 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..61e894e88b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..e41170310c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..0baaec6ee8 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..30e9cc0fcb --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,791 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractRequest; +import org.openapitools.client.model.RefundRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSingleStatusV1 + * @param getSingleStatusRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Call(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getSingleStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSingleStatusV1ValidateBeforeCall(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + return getSingleStatusV1Call(getSingleStatusRequest, _callback); + + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return Integer + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public Integer getSingleStatusV1(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + ApiResponse localVarResp = getSingleStatusV1WithHttpInfo(getSingleStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return ApiResponse<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public ApiResponse getSingleStatusV1WithHttpInfo(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getSingleStatusRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Async(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getStatusV1 + * @param getStatusRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Call(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStatusV1ValidateBeforeCall(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + return getStatusV1Call(getStatusRequest, _callback); + + } + + /** + * + * + * @param getStatusRequest (optional) + * @return List<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public List getStatusV1(GetStatusRequest getStatusRequest) throws ApiException { + ApiResponse> localVarResp = getStatusV1WithHttpInfo(getStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getStatusRequest (optional) + * @return ApiResponse<List<Integer>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public ApiResponse> getStatusV1WithHttpInfo(GetStatusRequest getStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getStatusRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Async(GetStatusRequest getStatusRequest, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for initializeV1 + * @param initializeRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Call(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = initializeRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call initializeV1ValidateBeforeCall(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + return initializeV1Call(initializeRequest, _callback); + + } + + /** + * Initialize contract + * + * @param initializeRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse initializeV1(InitializeRequest initializeRequest) throws ApiException { + ApiResponse localVarResp = initializeV1WithHttpInfo(initializeRequest); + return localVarResp.getData(); + } + + /** + * Initialize contract + * + * @param initializeRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse initializeV1WithHttpInfo(InitializeRequest initializeRequest) throws ApiException { + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initialize contract (asynchronously) + * + * @param initializeRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Async(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for newContractV1 + * @param newContractRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Call(NewContractRequest newContractRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newContractRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call newContractV1ValidateBeforeCall(NewContractRequest newContractRequest, final ApiCallback _callback) throws ApiException { + return newContractV1Call(newContractRequest, _callback); + + } + + /** + * Create a new hashtimelock contract + * + * @param newContractRequest (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response newContractV1(NewContractRequest newContractRequest) throws ApiException { + ApiResponse localVarResp = newContractV1WithHttpInfo(newContractRequest); + return localVarResp.getData(); + } + + /** + * Create a new hashtimelock contract + * + * @param newContractRequest (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse newContractV1WithHttpInfo(NewContractRequest newContractRequest) throws ApiException { + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new hashtimelock contract (asynchronously) + * + * @param newContractRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Async(NewContractRequest newContractRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for refundV1 + * @param refundRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Call(RefundRequest refundRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = refundRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call refundV1ValidateBeforeCall(RefundRequest refundRequest, final ApiCallback _callback) throws ApiException { + return refundV1Call(refundRequest, _callback); + + } + + /** + * Refund a hashtimelock contract + * + * @param refundRequest (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response refundV1(RefundRequest refundRequest) throws ApiException { + ApiResponse localVarResp = refundV1WithHttpInfo(refundRequest); + return localVarResp.getData(); + } + + /** + * Refund a hashtimelock contract + * + * @param refundRequest (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse refundV1WithHttpInfo(RefundRequest refundRequest) throws ApiException { + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Refund a hashtimelock contract (asynchronously) + * + * @param refundRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Async(RefundRequest refundRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for withdrawV1 + * @param withdrawRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Call(WithdrawRequest withdrawRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = withdrawRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call withdrawV1ValidateBeforeCall(WithdrawRequest withdrawRequest, final ApiCallback _callback) throws ApiException { + return withdrawV1Call(withdrawRequest, _callback); + + } + + /** + * Withdraw a hashtimelock contract + * + * @param withdrawRequest (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response withdrawV1(WithdrawRequest withdrawRequest) throws ApiException { + ApiResponse localVarResp = withdrawV1WithHttpInfo(withdrawRequest); + return localVarResp.getData(); + } + + /** + * Withdraw a hashtimelock contract + * + * @param withdrawRequest (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse withdrawV1WithHttpInfo(WithdrawRequest withdrawRequest) throws ApiException { + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Withdraw a hashtimelock contract (asynchronously) + * + * @param withdrawRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Async(WithdrawRequest withdrawRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..07130f5ff2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..3e75f81b31 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..aac4589d2a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..969901cc7b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..9374353e5e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java new file mode 100644 index 0000000000..c21ca85cfe --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java @@ -0,0 +1,312 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the single status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSingleStatusRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetSingleStatusRequest() { + } + + public GetSingleStatusRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GetSingleStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetSingleStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetSingleStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSingleStatusRequest getSingleStatusRequest = (GetSingleStatusRequest) o; + return Objects.equals(this.id, getSingleStatusRequest.id) && + Objects.equals(this.web3SigningCredential, getSingleStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getSingleStatusRequest.connectorId) && + Objects.equals(this.keychainId, getSingleStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSingleStatusRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSingleStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSingleStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSingleStatusRequest is not found in the empty JSON string", GetSingleStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSingleStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSingleStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSingleStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSingleStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSingleStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSingleStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSingleStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSingleStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSingleStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSingleStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetSingleStatusRequest + */ + public static GetSingleStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSingleStatusRequest.class); + } + + /** + * Convert an instance of GetSingleStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java new file mode 100644 index 0000000000..a52dbe1bb7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetStatusRequest { + public static final String SERIALIZED_NAME_IDS = "ids"; + @SerializedName(SERIALIZED_NAME_IDS) + private List ids = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetStatusRequest() { + } + + public GetStatusRequest ids(List ids) { + + this.ids = ids; + return this; + } + + public GetStatusRequest addIdsItem(String idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Get ids + * @return ids + **/ + @javax.annotation.Nonnull + public List getIds() { + return ids; + } + + + public void setIds(List ids) { + this.ids = ids; + } + + + public GetStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatusRequest getStatusRequest = (GetStatusRequest) o; + return Objects.equals(this.ids, getStatusRequest.ids) && + Objects.equals(this.web3SigningCredential, getStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getStatusRequest.connectorId) && + Objects.equals(this.keychainId, getStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(ids, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStatusRequest {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ids"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ids"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetStatusRequest is not found in the empty JSON string", GetStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ids` to be an array in the JSON string but got `%s`", jsonObj.get("ids").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetStatusRequest + */ + public static GetStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStatusRequest.class); + } + + /** + * Convert an instance of GetStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java new file mode 100644 index 0000000000..dcf8d2a632 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java @@ -0,0 +1,354 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InitializeRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InitializeRequest { + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public InitializeRequest() { + } + + public InitializeRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public InitializeRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public InitializeRequest constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public InitializeRequest addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public InitializeRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InitializeRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitializeRequest initializeRequest = (InitializeRequest) o; + return Objects.equals(this.connectorId, initializeRequest.connectorId) && + Objects.equals(this.keychainId, initializeRequest.keychainId) && + Objects.equals(this.constructorArgs, initializeRequest.constructorArgs) && + Objects.equals(this.web3SigningCredential, initializeRequest.web3SigningCredential) && + Objects.equals(this.gas, initializeRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(connectorId, keychainId, constructorArgs, web3SigningCredential, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InitializeRequest {\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InitializeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InitializeRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InitializeRequest is not found in the empty JSON string", InitializeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InitializeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InitializeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InitializeRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InitializeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InitializeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InitializeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InitializeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InitializeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InitializeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InitializeRequest + * @throws IOException if the JSON string is invalid with respect to InitializeRequest + */ + public static InitializeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InitializeRequest.class); + } + + /** + * Convert an instance of InitializeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..2fc100b2fa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java new file mode 100644 index 0000000000..b99ca63642 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java @@ -0,0 +1,593 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NewContractRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractRequest { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_INPUT_AMOUNT = "inputAmount"; + @SerializedName(SERIALIZED_NAME_INPUT_AMOUNT) + private BigDecimal inputAmount; + + public static final String SERIALIZED_NAME_OUTPUT_AMOUNT = "outputAmount"; + @SerializedName(SERIALIZED_NAME_OUTPUT_AMOUNT) + private BigDecimal outputAmount; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private BigDecimal expiration; + + public static final String SERIALIZED_NAME_HASH_LOCK = "hashLock"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK) + private String hashLock; + + public static final String SERIALIZED_NAME_TOKEN_ADDRESS = "tokenAddress"; + @SerializedName(SERIALIZED_NAME_TOKEN_ADDRESS) + private String tokenAddress; + + public static final String SERIALIZED_NAME_RECEIVER = "receiver"; + @SerializedName(SERIALIZED_NAME_RECEIVER) + private String receiver; + + public static final String SERIALIZED_NAME_OUTPUT_NETWORK = "outputNetwork"; + @SerializedName(SERIALIZED_NAME_OUTPUT_NETWORK) + private String outputNetwork; + + public static final String SERIALIZED_NAME_OUTPUT_ADDRESS = "outputAddress"; + @SerializedName(SERIALIZED_NAME_OUTPUT_ADDRESS) + private String outputAddress; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractRequestGas gas; + + public NewContractRequest() { + } + + public NewContractRequest contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Contract address + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public NewContractRequest inputAmount(BigDecimal inputAmount) { + + this.inputAmount = inputAmount; + return this; + } + + /** + * Input amount to lock + * @return inputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getInputAmount() { + return inputAmount; + } + + + public void setInputAmount(BigDecimal inputAmount) { + this.inputAmount = inputAmount; + } + + + public NewContractRequest outputAmount(BigDecimal outputAmount) { + + this.outputAmount = outputAmount; + return this; + } + + /** + * Output amount to lock + * @return outputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getOutputAmount() { + return outputAmount; + } + + + public void setOutputAmount(BigDecimal outputAmount) { + this.outputAmount = outputAmount; + } + + + public NewContractRequest expiration(BigDecimal expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Timestamp to expire the contract + * @return expiration + **/ + @javax.annotation.Nonnull + public BigDecimal getExpiration() { + return expiration; + } + + + public void setExpiration(BigDecimal expiration) { + this.expiration = expiration; + } + + + public NewContractRequest hashLock(String hashLock) { + + this.hashLock = hashLock; + return this; + } + + /** + * Hashlock needed to refund the amount + * @return hashLock + **/ + @javax.annotation.Nonnull + public String getHashLock() { + return hashLock; + } + + + public void setHashLock(String hashLock) { + this.hashLock = hashLock; + } + + + public NewContractRequest tokenAddress(String tokenAddress) { + + this.tokenAddress = tokenAddress; + return this; + } + + /** + * The token address + * @return tokenAddress + **/ + @javax.annotation.Nonnull + public String getTokenAddress() { + return tokenAddress; + } + + + public void setTokenAddress(String tokenAddress) { + this.tokenAddress = tokenAddress; + } + + + public NewContractRequest receiver(String receiver) { + + this.receiver = receiver; + return this; + } + + /** + * The receiver address + * @return receiver + **/ + @javax.annotation.Nonnull + public String getReceiver() { + return receiver; + } + + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + + public NewContractRequest outputNetwork(String outputNetwork) { + + this.outputNetwork = outputNetwork; + return this; + } + + /** + * The output network id + * @return outputNetwork + **/ + @javax.annotation.Nonnull + public String getOutputNetwork() { + return outputNetwork; + } + + + public void setOutputNetwork(String outputNetwork) { + this.outputNetwork = outputNetwork; + } + + + public NewContractRequest outputAddress(String outputAddress) { + + this.outputAddress = outputAddress; + return this; + } + + /** + * The output address to receive the tokens + * @return outputAddress + **/ + @javax.annotation.Nonnull + public String getOutputAddress() { + return outputAddress; + } + + + public void setOutputAddress(String outputAddress) { + this.outputAddress = outputAddress; + } + + + public NewContractRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public NewContractRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public NewContractRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychian plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public NewContractRequest gas(NewContractRequestGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractRequestGas getGas() { + return gas; + } + + + public void setGas(NewContractRequestGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewContractRequest newContractRequest = (NewContractRequest) o; + return Objects.equals(this.contractAddress, newContractRequest.contractAddress) && + Objects.equals(this.inputAmount, newContractRequest.inputAmount) && + Objects.equals(this.outputAmount, newContractRequest.outputAmount) && + Objects.equals(this.expiration, newContractRequest.expiration) && + Objects.equals(this.hashLock, newContractRequest.hashLock) && + Objects.equals(this.tokenAddress, newContractRequest.tokenAddress) && + Objects.equals(this.receiver, newContractRequest.receiver) && + Objects.equals(this.outputNetwork, newContractRequest.outputNetwork) && + Objects.equals(this.outputAddress, newContractRequest.outputAddress) && + Objects.equals(this.web3SigningCredential, newContractRequest.web3SigningCredential) && + Objects.equals(this.connectorId, newContractRequest.connectorId) && + Objects.equals(this.keychainId, newContractRequest.keychainId) && + Objects.equals(this.gas, newContractRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, inputAmount, outputAmount, expiration, hashLock, tokenAddress, receiver, outputNetwork, outputAddress, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewContractRequest {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" outputAmount: ").append(toIndentedString(outputAmount)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hashLock: ").append(toIndentedString(hashLock)).append("\n"); + sb.append(" tokenAddress: ").append(toIndentedString(tokenAddress)).append("\n"); + sb.append(" receiver: ").append(toIndentedString(receiver)).append("\n"); + sb.append(" outputNetwork: ").append(toIndentedString(outputNetwork)).append("\n"); + sb.append(" outputAddress: ").append(toIndentedString(outputAddress)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractAddress"); + openapiFields.add("inputAmount"); + openapiFields.add("outputAmount"); + openapiFields.add("expiration"); + openapiFields.add("hashLock"); + openapiFields.add("tokenAddress"); + openapiFields.add("receiver"); + openapiFields.add("outputNetwork"); + openapiFields.add("outputAddress"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("inputAmount"); + openapiRequiredFields.add("outputAmount"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("hashLock"); + openapiRequiredFields.add("tokenAddress"); + openapiRequiredFields.add("receiver"); + openapiRequiredFields.add("outputNetwork"); + openapiRequiredFields.add("outputAddress"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NewContractRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewContractRequest is not found in the empty JSON string", NewContractRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NewContractRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewContractRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewContractRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("hashLock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLock").toString())); + } + if (!jsonObj.get("tokenAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenAddress").toString())); + } + if (!jsonObj.get("receiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiver").toString())); + } + if (!jsonObj.get("outputNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputNetwork").toString())); + } + if (!jsonObj.get("outputAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputAddress").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractRequestGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewContractRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewContractRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewContractRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractRequest + * @throws IOException if the JSON string is invalid with respect to NewContractRequest + */ + public static NewContractRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractRequest.class); + } + + /** + * Convert an instance of NewContractRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java new file mode 100644 index 0000000000..a784ac856e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractRequestGas extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NewContractRequestGas.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractRequestGas.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractRequestGas' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractRequestGas value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public NewContractRequestGas read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + NewContractRequestGas ret = new NewContractRequestGas(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for NewContractRequestGas: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public NewContractRequestGas() { + super("oneOf", Boolean.FALSE); + } + + public NewContractRequestGas(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public NewContractRequestGas(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return NewContractRequestGas.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractRequestGas + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NewContractRequestGas with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of NewContractRequestGas given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractRequestGas + * @throws IOException if the JSON string is invalid with respect to NewContractRequestGas + */ + public static NewContractRequestGas fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractRequestGas.class); + } + + /** + * Convert an instance of NewContractRequestGas to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java new file mode 100644 index 0000000000..9e0218cd21 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java @@ -0,0 +1,345 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RefundRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefundRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractRequestGas gas; + + public RefundRequest() { + } + + public RefundRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Contract htlc id for refund + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public RefundRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RefundRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public RefundRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public RefundRequest gas(NewContractRequestGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractRequestGas getGas() { + return gas; + } + + + public void setGas(NewContractRequestGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefundRequest refundRequest = (RefundRequest) o; + return Objects.equals(this.id, refundRequest.id) && + Objects.equals(this.web3SigningCredential, refundRequest.web3SigningCredential) && + Objects.equals(this.connectorId, refundRequest.connectorId) && + Objects.equals(this.keychainId, refundRequest.keychainId) && + Objects.equals(this.gas, refundRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefundRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RefundRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RefundRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RefundRequest is not found in the empty JSON string", RefundRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RefundRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RefundRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RefundRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractRequestGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RefundRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefundRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefundRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefundRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RefundRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefundRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefundRequest + * @throws IOException if the JSON string is invalid with respect to RefundRequest + */ + public static RefundRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefundRequest.class); + } + + /** + * Convert an instance of RefundRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..823866c3a4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..8ae8ada589 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..0220b7c010 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..9d2f768501 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..4a09810493 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..277db11bfa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 0000000000..06ee8dfbfc --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java new file mode 100644 index 0000000000..babddadf0c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WithdrawRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WithdrawRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractRequestGas gas; + + public WithdrawRequest() { + } + + public WithdrawRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Contract locked id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public WithdrawRequest secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Secret need to unlock the contract + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public WithdrawRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public WithdrawRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public WithdrawRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public WithdrawRequest gas(NewContractRequestGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractRequestGas getGas() { + return gas; + } + + + public void setGas(NewContractRequestGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawRequest withdrawRequest = (WithdrawRequest) o; + return Objects.equals(this.id, withdrawRequest.id) && + Objects.equals(this.secret, withdrawRequest.secret) && + Objects.equals(this.web3SigningCredential, withdrawRequest.web3SigningCredential) && + Objects.equals(this.connectorId, withdrawRequest.connectorId) && + Objects.equals(this.keychainId, withdrawRequest.keychainId) && + Objects.equals(this.gas, withdrawRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, secret, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("secret"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WithdrawRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WithdrawRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WithdrawRequest is not found in the empty JSON string", WithdrawRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WithdrawRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WithdrawRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WithdrawRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractRequestGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WithdrawRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WithdrawRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WithdrawRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WithdrawRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WithdrawRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WithdrawRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WithdrawRequest + * @throws IOException if the JSON string is invalid with respect to WithdrawRequest + */ + public static WithdrawRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WithdrawRequest.class); + } + + /** + * Convert an instance of WithdrawRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..7653dad88e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,109 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractRequest; +import org.openapitools.client.model.RefundRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawRequest; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getSingleStatusV1Test() throws ApiException { + GetSingleStatusRequest getSingleStatusRequest = null; + Integer response = api.getSingleStatusV1(getSingleStatusRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + GetStatusRequest getStatusRequest = null; + List response = api.getStatusV1(getStatusRequest); + // TODO: test validations + } + + /** + * Initialize contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void initializeV1Test() throws ApiException { + InitializeRequest initializeRequest = null; + RunTransactionResponse response = api.initializeV1(initializeRequest); + // TODO: test validations + } + + /** + * Create a new hashtimelock contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void newContractV1Test() throws ApiException { + NewContractRequest newContractRequest = null; + InvokeContractV1Response response = api.newContractV1(newContractRequest); + // TODO: test validations + } + + /** + * Refund a hashtimelock contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void refundV1Test() throws ApiException { + RefundRequest refundRequest = null; + InvokeContractV1Response response = api.refundV1(refundRequest); + // TODO: test validations + } + + /** + * Withdraw a hashtimelock contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void withdrawV1Test() throws ApiException { + WithdrawRequest withdrawRequest = null; + InvokeContractV1Response response = api.withdrawV1(withdrawRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java new file mode 100644 index 0000000000..710b20d3ee --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetSingleStatusRequest + */ +public class GetSingleStatusRequestTest { + private final GetSingleStatusRequest model = new GetSingleStatusRequest(); + + /** + * Model tests for GetSingleStatusRequest + */ + @Test + public void testGetSingleStatusRequest() { + // TODO: test GetSingleStatusRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java new file mode 100644 index 0000000000..9287326754 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetStatusRequest + */ +public class GetStatusRequestTest { + private final GetStatusRequest model = new GetStatusRequest(); + + /** + * Model tests for GetStatusRequest + */ + @Test + public void testGetStatusRequest() { + // TODO: test GetStatusRequest + } + + /** + * Test the property 'ids' + */ + @Test + public void idsTest() { + // TODO: test ids + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java new file mode 100644 index 0000000000..17c53e2311 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InitializeRequest + */ +public class InitializeRequestTest { + private final InitializeRequest model = new InitializeRequest(); + + /** + * Model tests for InitializeRequest + */ + @Test + public void testInitializeRequest() { + // TODO: test InitializeRequest + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..779e5dad54 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java new file mode 100644 index 0000000000..d92c1200d0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractRequestGas + */ +public class NewContractRequestGasTest { + private final NewContractRequestGas model = new NewContractRequestGas(); + + /** + * Model tests for NewContractRequestGas + */ + @Test + public void testNewContractRequestGas() { + // TODO: test NewContractRequestGas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java new file mode 100644 index 0000000000..feb6d566bb --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java @@ -0,0 +1,147 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractRequest + */ +public class NewContractRequestTest { + private final NewContractRequest model = new NewContractRequest(); + + /** + * Model tests for NewContractRequest + */ + @Test + public void testNewContractRequest() { + // TODO: test NewContractRequest + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'inputAmount' + */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** + * Test the property 'outputAmount' + */ + @Test + public void outputAmountTest() { + // TODO: test outputAmount + } + + /** + * Test the property 'expiration' + */ + @Test + public void expirationTest() { + // TODO: test expiration + } + + /** + * Test the property 'hashLock' + */ + @Test + public void hashLockTest() { + // TODO: test hashLock + } + + /** + * Test the property 'tokenAddress' + */ + @Test + public void tokenAddressTest() { + // TODO: test tokenAddress + } + + /** + * Test the property 'receiver' + */ + @Test + public void receiverTest() { + // TODO: test receiver + } + + /** + * Test the property 'outputNetwork' + */ + @Test + public void outputNetworkTest() { + // TODO: test outputNetwork + } + + /** + * Test the property 'outputAddress' + */ + @Test + public void outputAddressTest() { + // TODO: test outputAddress + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java new file mode 100644 index 0000000000..2849e5fea7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RefundRequest + */ +public class RefundRequestTest { + private final RefundRequest model = new RefundRequest(); + + /** + * Model tests for RefundRequest + */ + @Test + public void testRefundRequest() { + // TODO: test RefundRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..de30d78d77 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..c2c8b10dad --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..1a118e27e7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..680de58787 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..f191781fc6 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..cb655de079 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 0000000000..f8a2d1e8e0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java new file mode 100644 index 0000000000..cc3d2b0c59 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WithdrawRequest + */ +public class WithdrawRequestTest { + private final WithdrawRequest model = new WithdrawRequest(); + + /** + * Model tests for WithdrawRequest + */ + @Test + public void testWithdrawRequest() { + // TODO: test WithdrawRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/package.json b/packages/cactus-plugin-htlc-eth-besu/package.json index 04d5cad101..37fb333f3a 100644 --- a/packages/cactus-plugin-htlc-eth-besu/package.json +++ b/packages/cactus-plugin-htlc-eth-besu/package.json @@ -57,7 +57,9 @@ "codegen:openapi": "npm run generate-sdk", "compile-contracts": "forge build", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "lint": "solhint --fix", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..36770f9a34 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,27 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..51a4694ddf --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,131 @@ +# Go API client for cactus-plugin-htlc-eth-besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-htlc-eth-besu "github.com/hyperledger/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetSingleStatusV1**](docs/DefaultApi.md#getsinglestatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status | +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status | +*DefaultApi* | [**InitializeV1**](docs/DefaultApi.md#initializev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize | +*DefaultApi* | [**NewContractV1**](docs/DefaultApi.md#newcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract | +*DefaultApi* | [**RefundV1**](docs/DefaultApi.md#refundv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund | +*DefaultApi* | [**WithdrawV1**](docs/DefaultApi.md#withdrawv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw | + + +## Documentation For Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractObj](docs/NewContractObj.md) + - [NewContractObjGas](docs/NewContractObjGas.md) + - [RefundReq](docs/RefundReq.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawReq](docs/WithdrawReq.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..6bc8f1fcca --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,547 @@ +openapi: 3.0.3 +info: + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC-ETH Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract: + post: + operationId: newContractV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractObj' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractObj: + additionalProperties: false + example: + outputAddress: outputAddress + receiver: receiver + keychainId: keychainId + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + gas: null + contractAddress: contractAddress + web3SigningCredential: + type: null + inputAmount: 0.8008281904610115 + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + type: number + outputAmount: + type: number + expiration: + type: number + hashLock: + type: string + receiver: + type: string + outputNetwork: + nullable: false + type: string + outputAddress: + nullable: false + type: string + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - web3SigningCredential + type: object + RefundReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractObj_gas: + oneOf: + - type: string + - type: number diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..faee24d23e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,653 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetSingleStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getSingleStatusRequest *GetSingleStatusRequest +} + +func (r ApiGetSingleStatusV1Request) GetSingleStatusRequest(getSingleStatusRequest GetSingleStatusRequest) ApiGetSingleStatusV1Request { + r.getSingleStatusRequest = &getSingleStatusRequest + return r +} + +func (r ApiGetSingleStatusV1Request) Execute() (int32, *http.Response, error) { + return r.ApiService.GetSingleStatusV1Execute(r) +} + +/* +GetSingleStatusV1 Method for GetSingleStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSingleStatusV1Request +*/ +func (a *DefaultApiService) GetSingleStatusV1(ctx context.Context) ApiGetSingleStatusV1Request { + return ApiGetSingleStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return int32 +func (a *DefaultApiService) GetSingleStatusV1Execute(r ApiGetSingleStatusV1Request) (int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSingleStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getSingleStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getStatusRequest *GetStatusRequest +} + +func (r ApiGetStatusV1Request) GetStatusRequest(getStatusRequest GetStatusRequest) ApiGetStatusV1Request { + r.getStatusRequest = &getStatusRequest + return r +} + +func (r ApiGetStatusV1Request) Execute() ([]int32, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Method for GetStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []int32 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) ([]int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInitializeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + initializeRequest *InitializeRequest +} + +func (r ApiInitializeV1Request) InitializeRequest(initializeRequest InitializeRequest) ApiInitializeV1Request { + r.initializeRequest = &initializeRequest + return r +} + +func (r ApiInitializeV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.InitializeV1Execute(r) +} + +/* +InitializeV1 Method for InitializeV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInitializeV1Request +*/ +func (a *DefaultApiService) InitializeV1(ctx context.Context) ApiInitializeV1Request { + return ApiInitializeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) InitializeV1Execute(r ApiInitializeV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InitializeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.initializeRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiNewContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + newContractObj *NewContractObj +} + +func (r ApiNewContractV1Request) NewContractObj(newContractObj NewContractObj) ApiNewContractV1Request { + r.newContractObj = &newContractObj + return r +} + +func (r ApiNewContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.NewContractV1Execute(r) +} + +/* +NewContractV1 Method for NewContractV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNewContractV1Request +*/ +func (a *DefaultApiService) NewContractV1(ctx context.Context) ApiNewContractV1Request { + return ApiNewContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) NewContractV1Execute(r ApiNewContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.NewContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.newContractObj + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRefundV1Request struct { + ctx context.Context + ApiService *DefaultApiService + refundReq *RefundReq +} + +func (r ApiRefundV1Request) RefundReq(refundReq RefundReq) ApiRefundV1Request { + r.refundReq = &refundReq + return r +} + +func (r ApiRefundV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.RefundV1Execute(r) +} + +/* +RefundV1 Method for RefundV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRefundV1Request +*/ +func (a *DefaultApiService) RefundV1(ctx context.Context) ApiRefundV1Request { + return ApiRefundV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) RefundV1Execute(r ApiRefundV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RefundV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.refundReq + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWithdrawV1Request struct { + ctx context.Context + ApiService *DefaultApiService + withdrawReq *WithdrawReq +} + +func (r ApiWithdrawV1Request) WithdrawReq(withdrawReq WithdrawReq) ApiWithdrawV1Request { + r.withdrawReq = &withdrawReq + return r +} + +func (r ApiWithdrawV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.WithdrawV1Execute(r) +} + +/* +WithdrawV1 Method for WithdrawV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWithdrawV1Request +*/ +func (a *DefaultApiService) WithdrawV1(ctx context.Context) ApiWithdrawV1Request { + return ApiWithdrawV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) WithdrawV1Execute(r ApiWithdrawV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.WithdrawV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.withdrawReq + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..31b70bf194 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - HTLC-ETH Besu API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..8b7461c906 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..16fd21c1b7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..cb2f3464ec --- /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 0000000000..c966c8ddfd --- /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 0000000000..f0129c8c44 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_single_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the GetSingleStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSingleStatusRequest{} + +// GetSingleStatusRequest Defines the parameters for retrieving the single status of the HTLC swap. +type GetSingleStatusRequest struct { + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetSingleStatusRequest instantiates a new GetSingleStatusRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetSingleStatusRequest(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetSingleStatusRequestWithDefaults instantiates a new GetSingleStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetSingleStatusRequestWithDefaults() *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + return &this +} + +// GetId returns the Id field value +func (o *GetSingleStatusRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetSingleStatusRequest) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetSingleStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetSingleStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetSingleStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetSingleStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetSingleStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetSingleStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetSingleStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSingleStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetSingleStatusRequest struct { + value *GetSingleStatusRequest + isSet bool +} + +func (v NullableGetSingleStatusRequest) Get() *GetSingleStatusRequest { + return v.value +} + +func (v *NullableGetSingleStatusRequest) Set(val *GetSingleStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetSingleStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSingleStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSingleStatusRequest(val *GetSingleStatusRequest) *NullableGetSingleStatusRequest { + return &NullableGetSingleStatusRequest{value: val, isSet: true} +} + +func (v NullableGetSingleStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSingleStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go new file mode 100644 index 0000000000..1f070d100b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the GetStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatusRequest{} + +// GetStatusRequest Defines the parameters for retrieving the status of the HTLC swap. +type GetStatusRequest struct { + Ids []string `json:"ids"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetStatusRequest instantiates a new GetStatusRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetStatusRequest(ids []string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetStatusRequest { + this := GetStatusRequest{} + this.Ids = ids + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetStatusRequestWithDefaults instantiates a new GetStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetStatusRequestWithDefaults() *GetStatusRequest { + this := GetStatusRequest{} + return &this +} + +// GetIds returns the Ids field value +func (o *GetStatusRequest) GetIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.Ids +} + +// GetIdsOk returns a tuple with the Ids field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Ids, true +} + +// SetIds sets field value +func (o *GetStatusRequest) SetIds(v []string) { + o.Ids = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ids"] = o.Ids + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetStatusRequest struct { + value *GetStatusRequest + isSet bool +} + +func (v NullableGetStatusRequest) Get() *GetStatusRequest { + return v.value +} + +func (v *NullableGetStatusRequest) Set(val *GetStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatusRequest(val *GetStatusRequest) *NullableGetStatusRequest { + return &NullableGetStatusRequest{value: val, isSet: true} +} + +func (v NullableGetStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go new file mode 100644 index 0000000000..40144a6e67 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go @@ -0,0 +1,236 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the InitializeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InitializeRequest{} + +// InitializeRequest struct for InitializeRequest +type InitializeRequest struct { + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewInitializeRequest instantiates a new InitializeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInitializeRequest(connectorId string, keychainId string, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential) *InitializeRequest { + this := InitializeRequest{} + this.ConnectorId = connectorId + this.KeychainId = keychainId + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + return &this +} + +// NewInitializeRequestWithDefaults instantiates a new InitializeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInitializeRequestWithDefaults() *InitializeRequest { + this := InitializeRequest{} + return &this +} + +// GetConnectorId returns the ConnectorId field value +func (o *InitializeRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *InitializeRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *InitializeRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InitializeRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *InitializeRequest) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *InitializeRequest) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InitializeRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InitializeRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InitializeRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InitializeRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *InitializeRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o InitializeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InitializeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableInitializeRequest struct { + value *InitializeRequest + isSet bool +} + +func (v NullableInitializeRequest) Get() *InitializeRequest { + return v.value +} + +func (v *NullableInitializeRequest) Set(val *InitializeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInitializeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInitializeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInitializeRequest(val *InitializeRequest) *NullableInitializeRequest { + return &NullableInitializeRequest{value: val, isSet: true} +} + +func (v NullableInitializeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInitializeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 0000000000..1331aa5753 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go new file mode 100644 index 0000000000..3314eb6155 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go @@ -0,0 +1,444 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the NewContractObj type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NewContractObj{} + +// NewContractObj struct for NewContractObj +type NewContractObj struct { + // Contract address + ContractAddress string `json:"contractAddress"` + InputAmount *float32 `json:"inputAmount,omitempty"` + OutputAmount float32 `json:"outputAmount"` + Expiration float32 `json:"expiration"` + HashLock string `json:"hashLock"` + Receiver *string `json:"receiver,omitempty"` + OutputNetwork string `json:"outputNetwork"` + OutputAddress string `json:"outputAddress"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // keychainId for the keychian plugin + KeychainId string `json:"keychainId"` + Gas *NewContractObjGas `json:"gas,omitempty"` +} + +// NewNewContractObj instantiates a new NewContractObj object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNewContractObj(contractAddress string, outputAmount float32, expiration float32, hashLock string, outputNetwork string, outputAddress string, connectorId string, web3SigningCredential Web3SigningCredential, keychainId string) *NewContractObj { + this := NewContractObj{} + this.ContractAddress = contractAddress + this.OutputAmount = outputAmount + this.Expiration = expiration + this.HashLock = hashLock + this.OutputNetwork = outputNetwork + this.OutputAddress = outputAddress + this.ConnectorId = connectorId + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + return &this +} + +// NewNewContractObjWithDefaults instantiates a new NewContractObj object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNewContractObjWithDefaults() *NewContractObj { + this := NewContractObj{} + return &this +} + +// GetContractAddress returns the ContractAddress field value +func (o *NewContractObj) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *NewContractObj) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetInputAmount returns the InputAmount field value if set, zero value otherwise. +func (o *NewContractObj) GetInputAmount() float32 { + if o == nil || IsNil(o.InputAmount) { + var ret float32 + return ret + } + return *o.InputAmount +} + +// GetInputAmountOk returns a tuple with the InputAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetInputAmountOk() (*float32, bool) { + if o == nil || IsNil(o.InputAmount) { + return nil, false + } + return o.InputAmount, true +} + +// HasInputAmount returns a boolean if a field has been set. +func (o *NewContractObj) HasInputAmount() bool { + if o != nil && !IsNil(o.InputAmount) { + return true + } + + return false +} + +// SetInputAmount gets a reference to the given float32 and assigns it to the InputAmount field. +func (o *NewContractObj) SetInputAmount(v float32) { + o.InputAmount = &v +} + +// GetOutputAmount returns the OutputAmount field value +func (o *NewContractObj) GetOutputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.OutputAmount +} + +// GetOutputAmountOk returns a tuple with the OutputAmount field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetOutputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.OutputAmount, true +} + +// SetOutputAmount sets field value +func (o *NewContractObj) SetOutputAmount(v float32) { + o.OutputAmount = v +} + +// GetExpiration returns the Expiration field value +func (o *NewContractObj) GetExpiration() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Expiration, true +} + +// SetExpiration sets field value +func (o *NewContractObj) SetExpiration(v float32) { + o.Expiration = v +} + +// GetHashLock returns the HashLock field value +func (o *NewContractObj) GetHashLock() string { + if o == nil { + var ret string + return ret + } + + return o.HashLock +} + +// GetHashLockOk returns a tuple with the HashLock field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetHashLockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLock, true +} + +// SetHashLock sets field value +func (o *NewContractObj) SetHashLock(v string) { + o.HashLock = v +} + +// GetReceiver returns the Receiver field value if set, zero value otherwise. +func (o *NewContractObj) GetReceiver() string { + if o == nil || IsNil(o.Receiver) { + var ret string + return ret + } + return *o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetReceiverOk() (*string, bool) { + if o == nil || IsNil(o.Receiver) { + return nil, false + } + return o.Receiver, true +} + +// HasReceiver returns a boolean if a field has been set. +func (o *NewContractObj) HasReceiver() bool { + if o != nil && !IsNil(o.Receiver) { + return true + } + + return false +} + +// SetReceiver gets a reference to the given string and assigns it to the Receiver field. +func (o *NewContractObj) SetReceiver(v string) { + o.Receiver = &v +} + +// GetOutputNetwork returns the OutputNetwork field value +func (o *NewContractObj) GetOutputNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.OutputNetwork +} + +// GetOutputNetworkOk returns a tuple with the OutputNetwork field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetOutputNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputNetwork, true +} + +// SetOutputNetwork sets field value +func (o *NewContractObj) SetOutputNetwork(v string) { + o.OutputNetwork = v +} + +// GetOutputAddress returns the OutputAddress field value +func (o *NewContractObj) GetOutputAddress() string { + if o == nil { + var ret string + return ret + } + + return o.OutputAddress +} + +// GetOutputAddressOk returns a tuple with the OutputAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetOutputAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputAddress, true +} + +// SetOutputAddress sets field value +func (o *NewContractObj) SetOutputAddress(v string) { + o.OutputAddress = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *NewContractObj) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *NewContractObj) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *NewContractObj) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *NewContractObj) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetKeychainId returns the KeychainId field value +func (o *NewContractObj) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *NewContractObj) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *NewContractObj) GetGas() NewContractObjGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractObjGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetGasOk() (*NewContractObjGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *NewContractObj) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractObjGas and assigns it to the Gas field. +func (o *NewContractObj) SetGas(v NewContractObjGas) { + o.Gas = &v +} + +func (o NewContractObj) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NewContractObj) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractAddress"] = o.ContractAddress + if !IsNil(o.InputAmount) { + toSerialize["inputAmount"] = o.InputAmount + } + toSerialize["outputAmount"] = o.OutputAmount + toSerialize["expiration"] = o.Expiration + toSerialize["hashLock"] = o.HashLock + if !IsNil(o.Receiver) { + toSerialize["receiver"] = o.Receiver + } + toSerialize["outputNetwork"] = o.OutputNetwork + toSerialize["outputAddress"] = o.OutputAddress + toSerialize["connectorId"] = o.ConnectorId + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableNewContractObj struct { + value *NewContractObj + isSet bool +} + +func (v NullableNewContractObj) Get() *NewContractObj { + return v.value +} + +func (v *NullableNewContractObj) Set(val *NewContractObj) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractObj) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractObj) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractObj(val *NewContractObj) *NullableNewContractObj { + return &NullableNewContractObj{value: val, isSet: true} +} + +func (v NullableNewContractObj) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractObj) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go new file mode 100644 index 0000000000..70a08c0e8e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "fmt" +) + +// NewContractObjGas - struct for NewContractObjGas +type NewContractObjGas struct { + Float32 *float32 + String *string +} + +// float32AsNewContractObjGas is a convenience function that returns float32 wrapped in NewContractObjGas +func Float32AsNewContractObjGas(v *float32) NewContractObjGas { + return NewContractObjGas{ + Float32: v, + } +} + +// stringAsNewContractObjGas is a convenience function that returns string wrapped in NewContractObjGas +func StringAsNewContractObjGas(v *string) NewContractObjGas { + return NewContractObjGas{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *NewContractObjGas) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(NewContractObjGas)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(NewContractObjGas)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src NewContractObjGas) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *NewContractObjGas) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableNewContractObjGas struct { + value *NewContractObjGas + isSet bool +} + +func (v NullableNewContractObjGas) Get() *NewContractObjGas { + return v.value +} + +func (v *NullableNewContractObjGas) Set(val *NewContractObjGas) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractObjGas) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractObjGas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractObjGas(val *NewContractObjGas) *NullableNewContractObjGas { + return &NullableNewContractObjGas{value: val, isSet: true} +} + +func (v NullableNewContractObjGas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractObjGas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go new file mode 100644 index 0000000000..55c623587c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go @@ -0,0 +1,237 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the RefundReq type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RefundReq{} + +// RefundReq struct for RefundReq +type RefundReq struct { + // Contract htlc id for refund + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractObjGas `json:"gas,omitempty"` +} + +// NewRefundReq instantiates a new RefundReq object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRefundReq(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *RefundReq { + this := RefundReq{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewRefundReqWithDefaults instantiates a new RefundReq object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundReqWithDefaults() *RefundReq { + this := RefundReq{} + return &this +} + +// GetId returns the Id field value +func (o *RefundReq) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RefundReq) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RefundReq) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RefundReq) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *RefundReq) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *RefundReq) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *RefundReq) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *RefundReq) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *RefundReq) GetGas() NewContractObjGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractObjGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RefundReq) GetGasOk() (*NewContractObjGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *RefundReq) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractObjGas and assigns it to the Gas field. +func (o *RefundReq) SetGas(v NewContractObjGas) { + o.Gas = &v +} + +func (o RefundReq) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundReq) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableRefundReq struct { + value *RefundReq + isSet bool +} + +func (v NullableRefundReq) Get() *RefundReq { + return v.value +} + +func (v *NullableRefundReq) Set(val *RefundReq) { + v.value = val + v.isSet = true +} + +func (v NullableRefundReq) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundReq(val *RefundReq) *NullableRefundReq { + return &NullableRefundReq{value: val, isSet: true} +} + +func (v NullableRefundReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 0000000000..febbca74a2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..06850f15b7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..b7de5d309c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..5c362c5fd5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..d995cb9b5a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..0a9060e1bb --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 0000000000..2c919e39b9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go new file mode 100644 index 0000000000..0e8e98dc08 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go @@ -0,0 +1,265 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the WithdrawReq type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WithdrawReq{} + +// WithdrawReq struct for WithdrawReq +type WithdrawReq struct { + // Contract locked id + Id string `json:"id"` + // Secret need to unlock the contract + Secret string `json:"secret"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractObjGas `json:"gas,omitempty"` +} + +// NewWithdrawReq instantiates a new WithdrawReq object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWithdrawReq(id string, secret string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *WithdrawReq { + this := WithdrawReq{} + this.Id = id + this.Secret = secret + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewWithdrawReqWithDefaults instantiates a new WithdrawReq object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWithdrawReqWithDefaults() *WithdrawReq { + this := WithdrawReq{} + return &this +} + +// GetId returns the Id field value +func (o *WithdrawReq) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WithdrawReq) SetId(v string) { + o.Id = v +} + +// GetSecret returns the Secret field value +func (o *WithdrawReq) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *WithdrawReq) SetSecret(v string) { + o.Secret = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *WithdrawReq) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *WithdrawReq) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *WithdrawReq) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *WithdrawReq) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *WithdrawReq) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *WithdrawReq) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *WithdrawReq) GetGas() NewContractObjGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractObjGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetGasOk() (*NewContractObjGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *WithdrawReq) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractObjGas and assigns it to the Gas field. +func (o *WithdrawReq) SetGas(v NewContractObjGas) { + o.Gas = &v +} + +func (o WithdrawReq) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WithdrawReq) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["secret"] = o.Secret + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableWithdrawReq struct { + value *WithdrawReq + isSet bool +} + +func (v NullableWithdrawReq) Get() *WithdrawReq { + return v.value +} + +func (v *NullableWithdrawReq) Set(val *WithdrawReq) { + v.value = val + v.isSet = true +} + +func (v NullableWithdrawReq) IsSet() bool { + return v.isSet +} + +func (v *NullableWithdrawReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWithdrawReq(val *WithdrawReq) *NullableWithdrawReq { + return &NullableWithdrawReq{value: val, isSet: true} +} + +func (v NullableWithdrawReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWithdrawReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..63adb80e44 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..48d38b538b --- /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 0000000000..ae20fb237f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..23404d4bf1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - HTLC-ETH Besu + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..dc8eb4671b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java +src/main/java/org/openapitools/client/model/GetStatusRequest.java +src/main/java/org/openapitools/client/model/InitializeRequest.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/NewContractObj.java +src/main/java/org/openapitools/client/model/NewContractObjGas.java +src/main/java/org/openapitools/client/model/RefundReq.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/main/java/org/openapitools/client/model/WithdrawReq.java diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..ac146f6724 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,156 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - HTLC-ETH Besu +- API version: v2.0.0-alpha.2 + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetSingleStatusRequest getSingleStatusRequest = new GetSingleStatusRequest(); // GetSingleStatusRequest | + try { + Integer result = apiInstance.getSingleStatusV1(getSingleStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getSingleStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getSingleStatusV1**](docs/DefaultApi.md#getSingleStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status | +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status | +*DefaultApi* | [**initializeV1**](docs/DefaultApi.md#initializeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize | +*DefaultApi* | [**newContractV1**](docs/DefaultApi.md#newContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract | +*DefaultApi* | [**refundV1**](docs/DefaultApi.md#refundV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund | +*DefaultApi* | [**withdrawV1**](docs/DefaultApi.md#withdrawV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw | + + +## Documentation for Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractObj](docs/NewContractObj.md) + - [NewContractObjGas](docs/NewContractObjGas.md) + - [RefundReq](docs/RefundReq.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawReq](docs/WithdrawReq.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..dc734d7a1d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,560 @@ +openapi: 3.0.3 +info: + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC-ETH Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract: + post: + operationId: newContractV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractObj' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw: + post: + operationId: withdrawV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawReq' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund: + post: + operationId: refundV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefundReq' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status: + post: + operationId: getStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatusRequest' + responses: + "200": + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status: + post: + operationId: getSingleStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetSingleStatusRequest' + responses: + "200": + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize: + post: + operationId: initializeV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize + x-content-type: application/json + x-accepts: application/json +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractObj: + additionalProperties: false + example: + outputAddress: outputAddress + receiver: receiver + keychainId: keychainId + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + gas: null + contractAddress: contractAddress + web3SigningCredential: + type: null + inputAmount: 0.8008281904610115 + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + type: number + outputAmount: + type: number + expiration: + type: number + hashLock: + type: string + receiver: + type: string + outputNetwork: + nullable: false + type: string + outputAddress: + nullable: false + type: string + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - web3SigningCredential + type: object + RefundReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractObj_gas: + oneOf: + - type: string + - type: number + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..ed15be7a4d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..bc4d3521d9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..1379eda1f5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..fa3a86e1d0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..f63b385533 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..da459fd560 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetSingleStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InitializeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractObj.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractObjGas.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RefundReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WithdrawReq.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..13128c1078 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..88c48cc39d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..c9f238d31f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..f549a0fa86 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..d103171846 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,791 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractObj; +import org.openapitools.client.model.RefundReq; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getSingleStatusV1 + * @param getSingleStatusRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Call(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getSingleStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSingleStatusV1ValidateBeforeCall(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + return getSingleStatusV1Call(getSingleStatusRequest, _callback); + + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return Integer + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public Integer getSingleStatusV1(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + ApiResponse localVarResp = getSingleStatusV1WithHttpInfo(getSingleStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return ApiResponse<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public ApiResponse getSingleStatusV1WithHttpInfo(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getSingleStatusRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Async(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getStatusV1 + * @param getStatusRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Call(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStatusV1ValidateBeforeCall(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + return getStatusV1Call(getStatusRequest, _callback); + + } + + /** + * + * + * @param getStatusRequest (optional) + * @return List<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public List getStatusV1(GetStatusRequest getStatusRequest) throws ApiException { + ApiResponse> localVarResp = getStatusV1WithHttpInfo(getStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getStatusRequest (optional) + * @return ApiResponse<List<Integer>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public ApiResponse> getStatusV1WithHttpInfo(GetStatusRequest getStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getStatusRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Async(GetStatusRequest getStatusRequest, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for initializeV1 + * @param initializeRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Call(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = initializeRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call initializeV1ValidateBeforeCall(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + return initializeV1Call(initializeRequest, _callback); + + } + + /** + * + * + * @param initializeRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse initializeV1(InitializeRequest initializeRequest) throws ApiException { + ApiResponse localVarResp = initializeV1WithHttpInfo(initializeRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param initializeRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse initializeV1WithHttpInfo(InitializeRequest initializeRequest) throws ApiException { + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param initializeRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Async(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for newContractV1 + * @param newContractObj (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Call(NewContractObj newContractObj, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newContractObj; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call newContractV1ValidateBeforeCall(NewContractObj newContractObj, final ApiCallback _callback) throws ApiException { + return newContractV1Call(newContractObj, _callback); + + } + + /** + * + * + * @param newContractObj (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response newContractV1(NewContractObj newContractObj) throws ApiException { + ApiResponse localVarResp = newContractV1WithHttpInfo(newContractObj); + return localVarResp.getData(); + } + + /** + * + * + * @param newContractObj (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse newContractV1WithHttpInfo(NewContractObj newContractObj) throws ApiException { + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractObj, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param newContractObj (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Async(NewContractObj newContractObj, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractObj, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for refundV1 + * @param refundReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Call(RefundReq refundReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = refundReq; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call refundV1ValidateBeforeCall(RefundReq refundReq, final ApiCallback _callback) throws ApiException { + return refundV1Call(refundReq, _callback); + + } + + /** + * + * + * @param refundReq (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response refundV1(RefundReq refundReq) throws ApiException { + ApiResponse localVarResp = refundV1WithHttpInfo(refundReq); + return localVarResp.getData(); + } + + /** + * + * + * @param refundReq (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse refundV1WithHttpInfo(RefundReq refundReq) throws ApiException { + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param refundReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Async(RefundReq refundReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for withdrawV1 + * @param withdrawReq (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Call(WithdrawReq withdrawReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = withdrawReq; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call withdrawV1ValidateBeforeCall(WithdrawReq withdrawReq, final ApiCallback _callback) throws ApiException { + return withdrawV1Call(withdrawReq, _callback); + + } + + /** + * + * + * @param withdrawReq (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response withdrawV1(WithdrawReq withdrawReq) throws ApiException { + ApiResponse localVarResp = withdrawV1WithHttpInfo(withdrawReq); + return localVarResp.getData(); + } + + /** + * + * + * @param withdrawReq (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse withdrawV1WithHttpInfo(WithdrawReq withdrawReq) throws ApiException { + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param withdrawReq (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Async(WithdrawReq withdrawReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..716cf0c84d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..aff0dc0670 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..354620285a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..74d93fdf77 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..c79db2a5e4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java new file mode 100644 index 0000000000..fae8a243ba --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java @@ -0,0 +1,312 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the single status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSingleStatusRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetSingleStatusRequest() { + } + + public GetSingleStatusRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GetSingleStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetSingleStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetSingleStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSingleStatusRequest getSingleStatusRequest = (GetSingleStatusRequest) o; + return Objects.equals(this.id, getSingleStatusRequest.id) && + Objects.equals(this.web3SigningCredential, getSingleStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getSingleStatusRequest.connectorId) && + Objects.equals(this.keychainId, getSingleStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSingleStatusRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSingleStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSingleStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSingleStatusRequest is not found in the empty JSON string", GetSingleStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSingleStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSingleStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSingleStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSingleStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSingleStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSingleStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSingleStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSingleStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSingleStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSingleStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetSingleStatusRequest + */ + public static GetSingleStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSingleStatusRequest.class); + } + + /** + * Convert an instance of GetSingleStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java new file mode 100644 index 0000000000..3e60dfa5d5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetStatusRequest { + public static final String SERIALIZED_NAME_IDS = "ids"; + @SerializedName(SERIALIZED_NAME_IDS) + private List ids = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetStatusRequest() { + } + + public GetStatusRequest ids(List ids) { + + this.ids = ids; + return this; + } + + public GetStatusRequest addIdsItem(String idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Get ids + * @return ids + **/ + @javax.annotation.Nonnull + public List getIds() { + return ids; + } + + + public void setIds(List ids) { + this.ids = ids; + } + + + public GetStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatusRequest getStatusRequest = (GetStatusRequest) o; + return Objects.equals(this.ids, getStatusRequest.ids) && + Objects.equals(this.web3SigningCredential, getStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getStatusRequest.connectorId) && + Objects.equals(this.keychainId, getStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(ids, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStatusRequest {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ids"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ids"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetStatusRequest is not found in the empty JSON string", GetStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ids` to be an array in the JSON string but got `%s`", jsonObj.get("ids").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetStatusRequest + */ + public static GetStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStatusRequest.class); + } + + /** + * Convert an instance of GetStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java new file mode 100644 index 0000000000..c134a971b5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java @@ -0,0 +1,354 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InitializeRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InitializeRequest { + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public InitializeRequest() { + } + + public InitializeRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public InitializeRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public InitializeRequest constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public InitializeRequest addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public InitializeRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InitializeRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitializeRequest initializeRequest = (InitializeRequest) o; + return Objects.equals(this.connectorId, initializeRequest.connectorId) && + Objects.equals(this.keychainId, initializeRequest.keychainId) && + Objects.equals(this.constructorArgs, initializeRequest.constructorArgs) && + Objects.equals(this.web3SigningCredential, initializeRequest.web3SigningCredential) && + Objects.equals(this.gas, initializeRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(connectorId, keychainId, constructorArgs, web3SigningCredential, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InitializeRequest {\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InitializeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InitializeRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InitializeRequest is not found in the empty JSON string", InitializeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InitializeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InitializeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InitializeRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InitializeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InitializeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InitializeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InitializeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InitializeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InitializeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InitializeRequest + * @throws IOException if the JSON string is invalid with respect to InitializeRequest + */ + public static InitializeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InitializeRequest.class); + } + + /** + * Convert an instance of InitializeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..6cbd42c0ab --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java new file mode 100644 index 0000000000..6c81bfa3d9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java @@ -0,0 +1,559 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NewContractObj + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractObj { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_INPUT_AMOUNT = "inputAmount"; + @SerializedName(SERIALIZED_NAME_INPUT_AMOUNT) + private BigDecimal inputAmount; + + public static final String SERIALIZED_NAME_OUTPUT_AMOUNT = "outputAmount"; + @SerializedName(SERIALIZED_NAME_OUTPUT_AMOUNT) + private BigDecimal outputAmount; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private BigDecimal expiration; + + public static final String SERIALIZED_NAME_HASH_LOCK = "hashLock"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK) + private String hashLock; + + public static final String SERIALIZED_NAME_RECEIVER = "receiver"; + @SerializedName(SERIALIZED_NAME_RECEIVER) + private String receiver; + + public static final String SERIALIZED_NAME_OUTPUT_NETWORK = "outputNetwork"; + @SerializedName(SERIALIZED_NAME_OUTPUT_NETWORK) + private String outputNetwork; + + public static final String SERIALIZED_NAME_OUTPUT_ADDRESS = "outputAddress"; + @SerializedName(SERIALIZED_NAME_OUTPUT_ADDRESS) + private String outputAddress; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractObjGas gas; + + public NewContractObj() { + } + + public NewContractObj contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Contract address + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public NewContractObj inputAmount(BigDecimal inputAmount) { + + this.inputAmount = inputAmount; + return this; + } + + /** + * Get inputAmount + * @return inputAmount + **/ + @javax.annotation.Nullable + public BigDecimal getInputAmount() { + return inputAmount; + } + + + public void setInputAmount(BigDecimal inputAmount) { + this.inputAmount = inputAmount; + } + + + public NewContractObj outputAmount(BigDecimal outputAmount) { + + this.outputAmount = outputAmount; + return this; + } + + /** + * Get outputAmount + * @return outputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getOutputAmount() { + return outputAmount; + } + + + public void setOutputAmount(BigDecimal outputAmount) { + this.outputAmount = outputAmount; + } + + + public NewContractObj expiration(BigDecimal expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + **/ + @javax.annotation.Nonnull + public BigDecimal getExpiration() { + return expiration; + } + + + public void setExpiration(BigDecimal expiration) { + this.expiration = expiration; + } + + + public NewContractObj hashLock(String hashLock) { + + this.hashLock = hashLock; + return this; + } + + /** + * Get hashLock + * @return hashLock + **/ + @javax.annotation.Nonnull + public String getHashLock() { + return hashLock; + } + + + public void setHashLock(String hashLock) { + this.hashLock = hashLock; + } + + + public NewContractObj receiver(String receiver) { + + this.receiver = receiver; + return this; + } + + /** + * Get receiver + * @return receiver + **/ + @javax.annotation.Nullable + public String getReceiver() { + return receiver; + } + + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + + public NewContractObj outputNetwork(String outputNetwork) { + + this.outputNetwork = outputNetwork; + return this; + } + + /** + * Get outputNetwork + * @return outputNetwork + **/ + @javax.annotation.Nonnull + public String getOutputNetwork() { + return outputNetwork; + } + + + public void setOutputNetwork(String outputNetwork) { + this.outputNetwork = outputNetwork; + } + + + public NewContractObj outputAddress(String outputAddress) { + + this.outputAddress = outputAddress; + return this; + } + + /** + * Get outputAddress + * @return outputAddress + **/ + @javax.annotation.Nonnull + public String getOutputAddress() { + return outputAddress; + } + + + public void setOutputAddress(String outputAddress) { + this.outputAddress = outputAddress; + } + + + public NewContractObj connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public NewContractObj web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public NewContractObj keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychian plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public NewContractObj gas(NewContractObjGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractObjGas getGas() { + return gas; + } + + + public void setGas(NewContractObjGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewContractObj newContractObj = (NewContractObj) o; + return Objects.equals(this.contractAddress, newContractObj.contractAddress) && + Objects.equals(this.inputAmount, newContractObj.inputAmount) && + Objects.equals(this.outputAmount, newContractObj.outputAmount) && + Objects.equals(this.expiration, newContractObj.expiration) && + Objects.equals(this.hashLock, newContractObj.hashLock) && + Objects.equals(this.receiver, newContractObj.receiver) && + Objects.equals(this.outputNetwork, newContractObj.outputNetwork) && + Objects.equals(this.outputAddress, newContractObj.outputAddress) && + Objects.equals(this.connectorId, newContractObj.connectorId) && + Objects.equals(this.web3SigningCredential, newContractObj.web3SigningCredential) && + Objects.equals(this.keychainId, newContractObj.keychainId) && + Objects.equals(this.gas, newContractObj.gas); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, inputAmount, outputAmount, expiration, hashLock, receiver, outputNetwork, outputAddress, connectorId, web3SigningCredential, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewContractObj {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" outputAmount: ").append(toIndentedString(outputAmount)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hashLock: ").append(toIndentedString(hashLock)).append("\n"); + sb.append(" receiver: ").append(toIndentedString(receiver)).append("\n"); + sb.append(" outputNetwork: ").append(toIndentedString(outputNetwork)).append("\n"); + sb.append(" outputAddress: ").append(toIndentedString(outputAddress)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractAddress"); + openapiFields.add("inputAmount"); + openapiFields.add("outputAmount"); + openapiFields.add("expiration"); + openapiFields.add("hashLock"); + openapiFields.add("receiver"); + openapiFields.add("outputNetwork"); + openapiFields.add("outputAddress"); + openapiFields.add("connectorId"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("outputAmount"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("hashLock"); + openapiRequiredFields.add("outputNetwork"); + openapiRequiredFields.add("outputAddress"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractObj + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NewContractObj.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewContractObj is not found in the empty JSON string", NewContractObj.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NewContractObj.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewContractObj` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewContractObj.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("hashLock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLock").toString())); + } + if ((jsonObj.get("receiver") != null && !jsonObj.get("receiver").isJsonNull()) && !jsonObj.get("receiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiver").toString())); + } + if (!jsonObj.get("outputNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputNetwork").toString())); + } + if (!jsonObj.get("outputAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputAddress").toString())); + } + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractObjGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractObj.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractObj' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewContractObj.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractObj value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewContractObj read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewContractObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractObj + * @throws IOException if the JSON string is invalid with respect to NewContractObj + */ + public static NewContractObj fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractObj.class); + } + + /** + * Convert an instance of NewContractObj to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java new file mode 100644 index 0000000000..9f3004204c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractObjGas extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NewContractObjGas.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractObjGas.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractObjGas' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractObjGas value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public NewContractObjGas read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + NewContractObjGas ret = new NewContractObjGas(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for NewContractObjGas: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public NewContractObjGas() { + super("oneOf", Boolean.FALSE); + } + + public NewContractObjGas(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public NewContractObjGas(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return NewContractObjGas.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractObjGas + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NewContractObjGas with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of NewContractObjGas given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractObjGas + * @throws IOException if the JSON string is invalid with respect to NewContractObjGas + */ + public static NewContractObjGas fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractObjGas.class); + } + + /** + * Convert an instance of NewContractObjGas to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java new file mode 100644 index 0000000000..ed7dd5368e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java @@ -0,0 +1,345 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RefundReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefundReq { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractObjGas gas; + + public RefundReq() { + } + + public RefundReq id(String id) { + + this.id = id; + return this; + } + + /** + * Contract htlc id for refund + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public RefundReq web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RefundReq connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public RefundReq keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public RefundReq gas(NewContractObjGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractObjGas getGas() { + return gas; + } + + + public void setGas(NewContractObjGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefundReq refundReq = (RefundReq) o; + return Objects.equals(this.id, refundReq.id) && + Objects.equals(this.web3SigningCredential, refundReq.web3SigningCredential) && + Objects.equals(this.connectorId, refundReq.connectorId) && + Objects.equals(this.keychainId, refundReq.keychainId) && + Objects.equals(this.gas, refundReq.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefundReq {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RefundReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RefundReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RefundReq is not found in the empty JSON string", RefundReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RefundReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RefundReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RefundReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractObjGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RefundReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefundReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefundReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefundReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RefundReq read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefundReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefundReq + * @throws IOException if the JSON string is invalid with respect to RefundReq + */ + public static RefundReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefundReq.class); + } + + /** + * Convert an instance of RefundReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..9796f13102 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..3da30279fd --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..b68050d018 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..0cf17d076e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..108fa1cc3e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..1c53841c19 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 0000000000..70856f30b7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java new file mode 100644 index 0000000000..6c6c5faa00 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WithdrawReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WithdrawReq { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractObjGas gas; + + public WithdrawReq() { + } + + public WithdrawReq id(String id) { + + this.id = id; + return this; + } + + /** + * Contract locked id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public WithdrawReq secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Secret need to unlock the contract + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public WithdrawReq web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public WithdrawReq connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public WithdrawReq keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public WithdrawReq gas(NewContractObjGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractObjGas getGas() { + return gas; + } + + + public void setGas(NewContractObjGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawReq withdrawReq = (WithdrawReq) o; + return Objects.equals(this.id, withdrawReq.id) && + Objects.equals(this.secret, withdrawReq.secret) && + Objects.equals(this.web3SigningCredential, withdrawReq.web3SigningCredential) && + Objects.equals(this.connectorId, withdrawReq.connectorId) && + Objects.equals(this.keychainId, withdrawReq.keychainId) && + Objects.equals(this.gas, withdrawReq.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, secret, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawReq {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("secret"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WithdrawReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WithdrawReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WithdrawReq is not found in the empty JSON string", WithdrawReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WithdrawReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WithdrawReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WithdrawReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractObjGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WithdrawReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WithdrawReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WithdrawReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WithdrawReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WithdrawReq read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WithdrawReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WithdrawReq + * @throws IOException if the JSON string is invalid with respect to WithdrawReq + */ + public static WithdrawReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WithdrawReq.class); + } + + /** + * Convert an instance of WithdrawReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..d1d8a4f24d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,101 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractObj; +import org.openapitools.client.model.RefundReq; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawReq; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getSingleStatusV1Test() throws ApiException { + GetSingleStatusRequest getSingleStatusRequest = null; + Integer response = api.getSingleStatusV1(getSingleStatusRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + GetStatusRequest getStatusRequest = null; + List response = api.getStatusV1(getStatusRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void initializeV1Test() throws ApiException { + InitializeRequest initializeRequest = null; + RunTransactionResponse response = api.initializeV1(initializeRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void newContractV1Test() throws ApiException { + NewContractObj newContractObj = null; + InvokeContractV1Response response = api.newContractV1(newContractObj); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void refundV1Test() throws ApiException { + RefundReq refundReq = null; + InvokeContractV1Response response = api.refundV1(refundReq); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void withdrawV1Test() throws ApiException { + WithdrawReq withdrawReq = null; + InvokeContractV1Response response = api.withdrawV1(withdrawReq); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java new file mode 100644 index 0000000000..c1a56b3702 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetSingleStatusRequest + */ +public class GetSingleStatusRequestTest { + private final GetSingleStatusRequest model = new GetSingleStatusRequest(); + + /** + * Model tests for GetSingleStatusRequest + */ + @Test + public void testGetSingleStatusRequest() { + // TODO: test GetSingleStatusRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java new file mode 100644 index 0000000000..26b45ad20d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetStatusRequest + */ +public class GetStatusRequestTest { + private final GetStatusRequest model = new GetStatusRequest(); + + /** + * Model tests for GetStatusRequest + */ + @Test + public void testGetStatusRequest() { + // TODO: test GetStatusRequest + } + + /** + * Test the property 'ids' + */ + @Test + public void idsTest() { + // TODO: test ids + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java new file mode 100644 index 0000000000..bf8ccad0b4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InitializeRequest + */ +public class InitializeRequestTest { + private final InitializeRequest model = new InitializeRequest(); + + /** + * Model tests for InitializeRequest + */ + @Test + public void testInitializeRequest() { + // TODO: test InitializeRequest + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..d5c3e8beb5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java new file mode 100644 index 0000000000..1426db340e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractObjGas + */ +public class NewContractObjGasTest { + private final NewContractObjGas model = new NewContractObjGas(); + + /** + * Model tests for NewContractObjGas + */ + @Test + public void testNewContractObjGas() { + // TODO: test NewContractObjGas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java new file mode 100644 index 0000000000..34a57755ca --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java @@ -0,0 +1,139 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractObj + */ +public class NewContractObjTest { + private final NewContractObj model = new NewContractObj(); + + /** + * Model tests for NewContractObj + */ + @Test + public void testNewContractObj() { + // TODO: test NewContractObj + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'inputAmount' + */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** + * Test the property 'outputAmount' + */ + @Test + public void outputAmountTest() { + // TODO: test outputAmount + } + + /** + * Test the property 'expiration' + */ + @Test + public void expirationTest() { + // TODO: test expiration + } + + /** + * Test the property 'hashLock' + */ + @Test + public void hashLockTest() { + // TODO: test hashLock + } + + /** + * Test the property 'receiver' + */ + @Test + public void receiverTest() { + // TODO: test receiver + } + + /** + * Test the property 'outputNetwork' + */ + @Test + public void outputNetworkTest() { + // TODO: test outputNetwork + } + + /** + * Test the property 'outputAddress' + */ + @Test + public void outputAddressTest() { + // TODO: test outputAddress + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java new file mode 100644 index 0000000000..f76e5fb6fa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RefundReq + */ +public class RefundReqTest { + private final RefundReq model = new RefundReq(); + + /** + * Model tests for RefundReq + */ + @Test + public void testRefundReq() { + // TODO: test RefundReq + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..f07c07fe28 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..f39217be05 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..a66547f011 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..1cf255f539 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..7971f03f7a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..a3c2a386bd --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 0000000000..8a52f1496e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java new file mode 100644 index 0000000000..817ccb6dc2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WithdrawReq + */ +public class WithdrawReqTest { + private final WithdrawReq model = new WithdrawReq(); + + /** + * Model tests for WithdrawReq + */ + @Test + public void testWithdrawReq() { + // TODO: test WithdrawReq + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/package.json b/packages/cactus-plugin-keychain-aws-sm/package.json index 91f162e940..b3b64484d5 100644 --- a/packages/cactus-plugin-keychain-aws-sm/package.json +++ b/packages/cactus-plugin-keychain-aws-sm/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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/", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..96898a8524 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..fa8a1b3ba9 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,123 @@ +# Go API client for cactus-plugin-keychain-aws-sm + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-aws-sm "github.com/hyperledger/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..6700d8b898 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,364 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..e6052dd242 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,556 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..38c12362cb --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..d2f3294ea9 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..5f4250c2ad --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..df401e5802 --- /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 0000000000..c966c8ddfd --- /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 0000000000..4ec8aa0839 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 0000000000..e1accb5598 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 0000000000..86010fd14b --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 0000000000..05c07d2971 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 0000000000..0db19b9bdf --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 0000000000..213d5e3783 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 0000000000..bd3f1994b1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 0000000000..a7955dd8dd --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..efd9ffbcf4 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..01cebac953 --- /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 0000000000..c6f9390b04 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..a155899a35 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..74ea39223c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..c26d926ece --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,148 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..e7569e3211 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,374 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetSecretRequest: + additionalProperties: false + nullable: false + type: object + GetSecretResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..ae229a5371 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3dffbd1bcb --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..c4cc8894bc --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..680d06d26b --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..a47c9598eb --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..41e529ec03 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..beeba650d5 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..a7b7758800 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..36a03a4ac8 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..7c133060d8 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..174a1fe7fb --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,740 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..9d478953d9 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..2896c25c21 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..660312a6f5 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..07bda43db1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..506c3d798e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 0000000000..d98aa2c197 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 0000000000..7ab3d70338 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..697c441d6f --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..42041c9907 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 0000000000..25e02ce289 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 0000000000..336e1b7c96 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..2c57c8999c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..b0cde0e9aa --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..9b17d8c37e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..b0c7d282ab --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..f98990e923 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..3aea03e4b2 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..924129a8e4 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..13af36da99 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..4a16e54884 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..c22df8e448 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..2812e4a6ec --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/package.json b/packages/cactus-plugin-keychain-azure-kv/package.json index d36e6cb5c0..e81d66cc8a 100644 --- a/packages/cactus-plugin-keychain-azure-kv/package.json +++ b/packages/cactus-plugin-keychain-azure-kv/package.json @@ -51,8 +51,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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/", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..96898a8524 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..e8918c6da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-keychain-azure-kv + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-azure-kv "github.com/hyperledger/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry | Deletes a value under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..9f793f31bf --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,344 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..1466671c68 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,459 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..4222e31ca3 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..ce8fd529d3 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..e63ba7b3e8 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..f3e39b75dc --- /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 0000000000..c966c8ddfd --- /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 0000000000..10cb26833a --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 0000000000..25704ef700 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 0000000000..e828232161 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 0000000000..e7587fcf5e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 0000000000..3cf2080bd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 0000000000..4d4cc5c483 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 0000000000..688f9631c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 0000000000..1a6ea4d792 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..b16f744b48 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..6933479ebb --- /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 0000000000..ad78b8e849 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..a155899a35 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..74ea39223c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..9ef341bddf --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry | Deletes a value under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..dd9aa61e32 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,353 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes a value under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetSecretRequest: + nullable: false + type: string + GetSecretResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..ae229a5371 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3dffbd1bcb --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..c4cc8894bc --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..680d06d26b --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..a47c9598eb --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..41e529ec03 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..beeba650d5 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..a7b7758800 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..36a03a4ac8 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..7c133060d8 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..8d1f4ffff5 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,627 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes a value under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes a value under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes a value under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..9d478953d9 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..2896c25c21 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..660312a6f5 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..07bda43db1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..506c3d798e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 0000000000..d98aa2c197 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 0000000000..7ab3d70338 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..697c441d6f --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..42041c9907 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 0000000000..25e02ce289 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 0000000000..336e1b7c96 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..2c57c8999c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..b0cde0e9aa --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..7facd3bb47 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,89 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..b0c7d282ab --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..f98990e923 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..3aea03e4b2 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..924129a8e4 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..13af36da99 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..4a16e54884 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..c22df8e448 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..2812e4a6ec --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/package.json b/packages/cactus-plugin-keychain-google-sm/package.json index cb45324ddb..89dbd5f8c2 100644 --- a/packages/cactus-plugin-keychain-google-sm/package.json +++ b/packages/cactus-plugin-keychain-google-sm/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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/", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..96898a8524 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..97156ab4a2 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-keychain-google-sm + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-google-sm "github.com/hyperledger/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend. +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..8ab25d26cd --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,324 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..56cbaa1401 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,459 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..77fb3c3e24 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..d5be72e2e5 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..d19a50c699 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..e0709f18c1 --- /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 0000000000..c966c8ddfd --- /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 0000000000..ef9761f5c0 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 0000000000..e59e64f97a --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 0000000000..8b127a1721 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 0000000000..8080317b97 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 0000000000..f3e80c64c3 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 0000000000..670e2041c3 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 0000000000..45f6253542 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 0000000000..2b97496348 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..3a2add7097 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..5d94c59dec --- /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 0000000000..df15f376c0 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..a155899a35 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..74ea39223c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..e221a1954f --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend. +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..5e0869cb26 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,333 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..ae229a5371 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3dffbd1bcb --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..c4cc8894bc --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..680d06d26b --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..a47c9598eb --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..41e529ec03 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..beeba650d5 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..a7b7758800 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..36a03a4ac8 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..7c133060d8 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..d9d1f26f55 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,615 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend. + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend. + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend. (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..9d478953d9 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..2896c25c21 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..660312a6f5 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..07bda43db1 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..506c3d798e --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 0000000000..d98aa2c197 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 0000000000..7ab3d70338 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..697c441d6f --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..42041c9907 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 0000000000..25e02ce289 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 0000000000..336e1b7c96 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..2c57c8999c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..b0cde0e9aa --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..c94129a61a --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,89 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..b0c7d282ab --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..f98990e923 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..3aea03e4b2 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..924129a8e4 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..13af36da99 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..4a16e54884 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..c22df8e448 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..2812e4a6ec --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/package.json b/packages/cactus-plugin-keychain-memory-wasm/package.json index b60e973c68..9b9179aad4 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/package.json +++ b/packages/cactus-plugin-keychain-memory-wasm/package.json @@ -49,8 +49,10 @@ "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:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "wasm-pack": "CARGO_TARGET_DIR=${PWD}/dist/target-rustc/ wasm-pack build src/main/rust/cactus-plugin-keychain-memory-wasm/ --release --scope=hyperledger --target=nodejs --out-dir=../../../../src/main/typescript/generated/wasm-pack/", "postwasm-pack": "run-s del-wasm-pack-project-files copy-wasm-bg", "watch": "npm-watch", diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..96898a8524 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..2f2ccb3fd5 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-keychain-memory-wasm + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-memory-wasm "github.com/hyperledger/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..964fabc374 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,340 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin + which is designed to help with testing and development and is implemented in Rust + instead of Typescript. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Keychain Memory WASM + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..a283b63b99 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,459 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..8869f654a0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Keychain Memory WASM API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..add58054a8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..602359656e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..2d7bbd85dc --- /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 0000000000..c966c8ddfd --- /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 0000000000..31ab7c7c1a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 0000000000..6c5916d0b9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 0000000000..408b729c24 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 0000000000..462deda898 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 0000000000..3901bc8c89 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 0000000000..afccdadcb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 0000000000..f50a829332 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 0000000000..1070d8c9bf --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..751a2daffc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..6cc6dd021e --- /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 0000000000..28bcc5999e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..3a20cb8a35 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Keychain Memory WASM + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..74ea39223c --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..8f2bc935d3 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Keychain Memory WASM +- API version: v2.0.0-alpha.2 + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..ade9759df4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,349 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin + which is designed to help with testing and development and is implemented in Rust + instead of Typescript. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Keychain Memory WASM + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..f8653f60fc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..d778f1ffe2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..a2e75283aa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..853bd510ec --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..c0d94dcddc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..42ea1a7d5e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..f842db5f5a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..15ae926aa2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..ee97573b83 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..67258f9f07 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..6fe19d82cb --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,627 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..b357a10177 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..ca934681bc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..a195e48a0d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..db7ea904f5 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..4650c609e5 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 0000000000..75d6e73891 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 0000000000..a44d2aa057 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..1355cf4e0d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..f7e4e814e4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 0000000000..0d1ed02364 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 0000000000..646298da1b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..88ff79491a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..e7fcfc20b6 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..9b3aad0aae --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,89 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..38c8f4bcda --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..ff60425770 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..b8cb44a624 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..c1fbc58ad2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..3cf8d86fc7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..cf4042646e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..c42c41a67d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..7d62d8a8a9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/package.json b/packages/cactus-plugin-keychain-memory/package.json index ff555c4a6a..5d6252cc45 100644 --- a/packages/cactus-plugin-keychain-memory/package.json +++ b/packages/cactus-plugin-keychain-memory/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..a7e9ec46f6 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,16 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_get_keychain_entry_request.go +model_get_keychain_entry_response.go +model_set_keychain_entry_request.go +model_set_keychain_entry_response.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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..d54c9fe122 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,115 @@ +# Go API client for cactus-plugin-keychain-memory + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-memory "github.com/hyperledger/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation For Models + + - [GetKeychainEntryRequest](docs/GetKeychainEntryRequest.md) + - [GetKeychainEntryResponse](docs/GetKeychainEntryResponse.md) + - [SetKeychainEntryRequest](docs/SetKeychainEntryRequest.md) + - [SetKeychainEntryResponse](docs/SetKeychainEntryResponse.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 0000000000..e49e642092 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,136 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Keychain Memory plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Keychain Memory ' + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-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-cactus: + 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/GetKeychainEntryRequest' + 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/SetKeychainEntryRequest' + 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/GetKeychainEntryResponse' + 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/SetKeychainEntryResponse' + 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: + GetKeychainEntryRequest: + 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 + GetKeychainEntryResponse: + 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 + SetKeychainEntryRequest: + 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 + SetKeychainEntryResponse: + 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 + PrometheusExporterMetricsResponse: + nullable: false + type: string 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 0000000000..e81f91e6e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,120 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type 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 +} 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 0000000000..0126d9e10e --- /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 Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Keychain Memory API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..eb7cb482e6 --- /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 Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..b80c18619d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..00a696dcdd --- /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 0000000000..c966c8ddfd --- /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_get_keychain_entry_request.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request.go new file mode 100644 index 0000000000..faacde10f9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequest{} + +// GetKeychainEntryRequest struct for GetKeychainEntryRequest +type GetKeychainEntryRequest struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequest instantiates a new GetKeychainEntryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequest(key string) *GetKeychainEntryRequest { + this := GetKeychainEntryRequest{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestWithDefaults instantiates a new GetKeychainEntryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestWithDefaults() *GetKeychainEntryRequest { + this := GetKeychainEntryRequest{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequest) 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 *GetKeychainEntryRequest) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequest) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequest struct { + value *GetKeychainEntryRequest + isSet bool +} + +func (v NullableGetKeychainEntryRequest) Get() *GetKeychainEntryRequest { + return v.value +} + +func (v *NullableGetKeychainEntryRequest) Set(val *GetKeychainEntryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequest(val *GetKeychainEntryRequest) *NullableGetKeychainEntryRequest { + return &NullableGetKeychainEntryRequest{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequest) 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.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response.go new file mode 100644 index 0000000000..0cb86481a0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponse{} + +// GetKeychainEntryResponse struct for GetKeychainEntryResponse +type GetKeychainEntryResponse 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"` +} + +// NewGetKeychainEntryResponse instantiates a new GetKeychainEntryResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponse(key string, value string) *GetKeychainEntryResponse { + this := GetKeychainEntryResponse{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseWithDefaults instantiates a new GetKeychainEntryResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseWithDefaults() *GetKeychainEntryResponse { + this := GetKeychainEntryResponse{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponse) 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 *GetKeychainEntryResponse) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponse) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponse) 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 *GetKeychainEntryResponse) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponse) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponse struct { + value *GetKeychainEntryResponse + isSet bool +} + +func (v NullableGetKeychainEntryResponse) Get() *GetKeychainEntryResponse { + return v.value +} + +func (v *NullableGetKeychainEntryResponse) Set(val *GetKeychainEntryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponse(val *GetKeychainEntryResponse) *NullableGetKeychainEntryResponse { + return &NullableGetKeychainEntryResponse{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponse) 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.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request.go new file mode 100644 index 0000000000..b96c2b0b8e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequest{} + +// SetKeychainEntryRequest struct for SetKeychainEntryRequest +type SetKeychainEntryRequest 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"` +} + +// NewSetKeychainEntryRequest instantiates a new SetKeychainEntryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequest(key string, value string) *SetKeychainEntryRequest { + this := SetKeychainEntryRequest{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestWithDefaults instantiates a new SetKeychainEntryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestWithDefaults() *SetKeychainEntryRequest { + this := SetKeychainEntryRequest{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequest) 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 *SetKeychainEntryRequest) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequest) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequest) 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 *SetKeychainEntryRequest) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequest) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequest struct { + value *SetKeychainEntryRequest + isSet bool +} + +func (v NullableSetKeychainEntryRequest) Get() *SetKeychainEntryRequest { + return v.value +} + +func (v *NullableSetKeychainEntryRequest) Set(val *SetKeychainEntryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequest(val *SetKeychainEntryRequest) *NullableSetKeychainEntryRequest { + return &NullableSetKeychainEntryRequest{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequest) 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.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response.go new file mode 100644 index 0000000000..75a051ef4f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponse{} + +// SetKeychainEntryResponse struct for SetKeychainEntryResponse +type SetKeychainEntryResponse struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponse instantiates a new SetKeychainEntryResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponse(key string) *SetKeychainEntryResponse { + this := SetKeychainEntryResponse{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseWithDefaults instantiates a new SetKeychainEntryResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseWithDefaults() *SetKeychainEntryResponse { + this := SetKeychainEntryResponse{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponse) 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 *SetKeychainEntryResponse) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponse) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponse struct { + value *SetKeychainEntryResponse + isSet bool +} + +func (v NullableSetKeychainEntryResponse) Get() *SetKeychainEntryResponse { + return v.value +} + +func (v *NullableSetKeychainEntryResponse) Set(val *SetKeychainEntryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponse(val *SetKeychainEntryResponse) *NullableSetKeychainEntryResponse { + return &NullableSetKeychainEntryResponse{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponse) 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 0000000000..0442eb675a --- /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 Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..80c4617ab8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,37 @@ +/* +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 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-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 0000000000..9f4dca8f74 --- /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 Cactus Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..26e642136d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Keychain Memory + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..0ca35f9a6b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,37 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequest.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponse.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequest.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponse.java diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..1a1b065831 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,139 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Keychain Memory +- API version: v2.0.0-alpha.2 + +Contains/describes the Hyperledger Cactus Keychain Memory plugin. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + String result = apiInstance.getPrometheusMetricsV1(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getPrometheusMetricsV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation for Models + + - [GetKeychainEntryRequest](docs/GetKeychainEntryRequest.md) + - [GetKeychainEntryResponse](docs/GetKeychainEntryResponse.md) + - [SetKeychainEntryRequest](docs/SetKeychainEntryRequest.md) + - [SetKeychainEntryResponse](docs/SetKeychainEntryResponse.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..97a6e7f485 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,138 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Keychain Memory plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Keychain Memory ' + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-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-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequest' + 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/SetKeychainEntryRequest' + 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/GetKeychainEntryResponse' + 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/SetKeychainEntryResponse' + 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: + GetKeychainEntryRequest: + 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 + GetKeychainEntryResponse: + 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 + SetKeychainEntryRequest: + 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 + SetKeychainEntryResponse: + 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 + PrometheusExporterMetricsResponse: + nullable: false + type: string + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..4b63a5b24f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..c1b95a89ac --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..9c9d88803e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..6250e73a9b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..f58d091545 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..bcccb74de7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,404 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..55f7220c7f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..890c42b518 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..76460fd36a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..321e9a8a8b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..8f40d615d0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,188 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..0450a5db9b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..8f61a02317 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..77eb72532f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..04491f5346 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..51b9477a03 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequest.java new file mode 100644 index 0000000000..2e1244fb24 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequest.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequest { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequest() { + } + + public GetKeychainEntryRequest key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequest getKeychainEntryRequest = (GetKeychainEntryRequest) o; + return Objects.equals(this.key, getKeychainEntryRequest.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequest {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequest is not found in the empty JSON string", GetKeychainEntryRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequest + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequest + */ + public static GetKeychainEntryRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequest.class); + } + + /** + * Convert an instance of GetKeychainEntryRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponse.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponse.java new file mode 100644 index 0000000000..4b4a7cc165 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponse.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponse { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponse() { + } + + public GetKeychainEntryResponse key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponse value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponse getKeychainEntryResponse = (GetKeychainEntryResponse) o; + return Objects.equals(this.key, getKeychainEntryResponse.key) && + Objects.equals(this.value, getKeychainEntryResponse.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponse {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponse is not found in the empty JSON string", GetKeychainEntryResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponse + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponse + */ + public static GetKeychainEntryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponse.class); + } + + /** + * Convert an instance of GetKeychainEntryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequest.java new file mode 100644 index 0000000000..a8aa52f8e9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequest.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequest { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequest() { + } + + public SetKeychainEntryRequest key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequest value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequest setKeychainEntryRequest = (SetKeychainEntryRequest) o; + return Objects.equals(this.key, setKeychainEntryRequest.key) && + Objects.equals(this.value, setKeychainEntryRequest.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequest {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequest is not found in the empty JSON string", SetKeychainEntryRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequest + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequest + */ + public static SetKeychainEntryRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequest.class); + } + + /** + * Convert an instance of SetKeychainEntryRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponse.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponse.java new file mode 100644 index 0000000000..e1888a4580 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponse { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponse() { + } + + public SetKeychainEntryResponse key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponse setKeychainEntryResponse = (SetKeychainEntryResponse) o; + return Objects.equals(this.key, setKeychainEntryResponse.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponse {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponse is not found in the empty JSON string", SetKeychainEntryResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponse + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponse + */ + public static SetKeychainEntryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponse.class); + } + + /** + * Convert an instance of SetKeychainEntryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..2b0bb16bc1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,44 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestTest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestTest.java new file mode 100644 index 0000000000..118c1b062d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequest + */ +public class GetKeychainEntryRequestTest { + private final GetKeychainEntryRequest model = new GetKeychainEntryRequest(); + + /** + * Model tests for GetKeychainEntryRequest + */ + @Test + public void testGetKeychainEntryRequest() { + // TODO: test GetKeychainEntryRequest + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseTest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseTest.java new file mode 100644 index 0000000000..bf71d8cd47 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponse + */ +public class GetKeychainEntryResponseTest { + private final GetKeychainEntryResponse model = new GetKeychainEntryResponse(); + + /** + * Model tests for GetKeychainEntryResponse + */ + @Test + public void testGetKeychainEntryResponse() { + // TODO: test GetKeychainEntryResponse + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestTest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestTest.java new file mode 100644 index 0000000000..474eaae672 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequest + */ +public class SetKeychainEntryRequestTest { + private final SetKeychainEntryRequest model = new SetKeychainEntryRequest(); + + /** + * Model tests for SetKeychainEntryRequest + */ + @Test + public void testSetKeychainEntryRequest() { + // TODO: test SetKeychainEntryRequest + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseTest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseTest.java new file mode 100644 index 0000000000..1b958fb7e2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cactus Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponse + */ +public class SetKeychainEntryResponseTest { + private final SetKeychainEntryResponse model = new SetKeychainEntryResponse(); + + /** + * Model tests for SetKeychainEntryResponse + */ + @Test + public void testSetKeychainEntryResponse() { + // TODO: test SetKeychainEntryResponse + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt deleted file mode 100644 index e40ba72fb5..0000000000 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryRequest.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * - * - * @param key The key for the entry to get from the keychain. - */ - - -data class GetKeychainEntryRequest ( - - /* The key for the entry to get from the keychain. */ - @Json(name = "key") - val key: kotlin.String - -) - diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt deleted file mode 100644 index 91b92b3f6d..0000000000 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/GetKeychainEntryResponse.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * - * - * @param key The key that was used to retrieve the value from the keychain. - * @param `value` The value associated with the requested key on the keychain. - */ - - -data class GetKeychainEntryResponse ( - - /* The key that was used to retrieve the value from the keychain. */ - @Json(name = "key") - val key: kotlin.String, - - /* The value associated with the requested key on the keychain. */ - @Json(name = "value") - val `value`: kotlin.String - -) - diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt deleted file mode 100644 index b0b685e857..0000000000 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryRequest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * - * - * @param key The key for the entry to set on the keychain. - * @param `value` The value that will be associated with the key on the keychain. - */ - - -data class SetKeychainEntryRequest ( - - /* The key for the entry to set on the keychain. */ - @Json(name = "key") - val key: kotlin.String, - - /* The value that will be associated with the key on the keychain. */ - @Json(name = "value") - val `value`: kotlin.String - -) - diff --git a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt b/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt deleted file mode 100644 index 329b850d2e..0000000000 --- a/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/SetKeychainEntryResponse.kt +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * - * - * @param key The key that was used to set the value on the keychain. - */ - - -data class SetKeychainEntryResponse ( - - /* The key that was used to set the value on the keychain. */ - @Json(name = "key") - val key: kotlin.String - -) - diff --git a/packages/cactus-plugin-keychain-vault/package.json b/packages/cactus-plugin-keychain-vault/package.json index 14a45bcf84..29cd606275 100644 --- a/packages/cactus-plugin-keychain-vault/package.json +++ b/packages/cactus-plugin-keychain-vault/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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/", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..96898a8524 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..1c35d99692 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,123 @@ +# Go API client for cactus-plugin-keychain-vault + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-vault "github.com/hyperledger/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry | Deletes an entry from the keychain stored under the provided key. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry | Retrieves the information regarding a key being present on the keychain or not. +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..f77007dfbc --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,310 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..1f0766578d --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,548 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry from the keychain stored under the provided key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Retrieves the information regarding a key being present on the keychain or not. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..e4d95c6610 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..6915584e46 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..4dd58bf077 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..ea23cb8260 --- /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 0000000000..c966c8ddfd --- /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 0000000000..805dc1c760 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key of the entry to delete from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 0000000000..77aecb3225 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key of the entry that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 0000000000..45c8381107 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 0000000000..3bcef9072e --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 0000000000..ce08595611 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 0000000000..ae67581f2d --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the keychain. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 0000000000..f0818d5863 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 0000000000..fb6dea7a80 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..3809276044 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..9406f12e36 --- /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 0000000000..b056566c39 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..a155899a35 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..74ea39223c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..7f276f3786 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,148 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry | Deletes an entry from the keychain stored under the provided key. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry | Retrieves the information regarding a key being present on the keychain or not. +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..07b1466246 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,320 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + summary: Deletes an entry from the keychain stored under the provided key. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + summary: Retrieves the information regarding a key being present on the keychain + or not. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key of the entry to delete from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key of the entry that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..ae229a5371 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3dffbd1bcb --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..c4cc8894bc --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..680d06d26b --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..a47c9598eb --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..41e529ec03 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..beeba650d5 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..a7b7758800 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..36a03a4ac8 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..7c133060d8 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..4aed56103d --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,706 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry from the keychain stored under the provided key. + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry from the keychain stored under the provided key. + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry from the keychain stored under the provided key. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. + * + * @param hasKeychainEntryRequestV1 (optional) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. + * + * @param hasKeychainEntryRequestV1 (optional) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. (asynchronously) + * + * @param hasKeychainEntryRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..9d478953d9 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..2896c25c21 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..660312a6f5 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..07bda43db1 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..506c3d798e --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 0000000000..0eb0853c1a --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry to delete from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 0000000000..640a111cac --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..697c441d6f --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..42041c9907 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 0000000000..25e02ce289 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 0000000000..3710edd38f --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 0000000000..2c57c8999c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 0000000000..b0cde0e9aa --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..9ce9839004 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry from the keychain stored under the provided key. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..b0c7d282ab --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..f98990e923 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..3aea03e4b2 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..924129a8e4 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..13af36da99 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..4a16e54884 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 0000000000..c22df8e448 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 0000000000..2812e4a6ec --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/package.json b/packages/cactus-plugin-ledger-connector-besu/package.json index 11e461ad2a..60e5bb7d9a 100644 --- a/packages/cactus-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-plugin-ledger-connector-besu/package.json @@ -46,7 +46,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md 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 0000000000..1855f5cec9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,95 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +docs/BesuPrivateTransactionConfig.md +docs/BesuTransactionConfig.md +docs/BesuTransactionConfigTo.md +docs/ConsistencyStrategy.md +docs/DefaultApi.md +docs/DeployContractSolidityBytecodeV1Request.md +docs/DeployContractSolidityBytecodeV1Response.md +docs/EthContractInvocationType.md +docs/EvmBlock.md +docs/EvmLog.md +docs/EvmTransaction.md +docs/GetBalanceV1Request.md +docs/GetBalanceV1Response.md +docs/GetBesuRecordV1Request.md +docs/GetBesuRecordV1Response.md +docs/GetBlockV1Request.md +docs/GetBlockV1Response.md +docs/GetPastLogsV1Request.md +docs/GetPastLogsV1Response.md +docs/GetTransactionV1Request.md +docs/GetTransactionV1Response.md +docs/InvokeContractV1Request.md +docs/InvokeContractV1Response.md +docs/ReceiptType.md +docs/RunTransactionRequest.md +docs/RunTransactionResponse.md +docs/SignTransactionRequest.md +docs/SignTransactionResponse.md +docs/SolidityContractJsonArtifact.md +docs/SolidityContractJsonArtifactCompiler.md +docs/SolidityContractJsonArtifactGasEstimates.md +docs/SolidityContractJsonArtifactGasEstimatesCreation.md +docs/WatchBlocksV1.md +docs/WatchBlocksV1Progress.md +docs/Web3BlockHeader.md +docs/Web3BlockHeaderTimestamp.md +docs/Web3SigningCredential.md +docs/Web3SigningCredentialCactusKeychainRef.md +docs/Web3SigningCredentialNone.md +docs/Web3SigningCredentialPrivateKeyHex.md +docs/Web3SigningCredentialType.md +docs/Web3TransactionReceipt.md +git_push.sh +go.mod +go.sum +model_besu_private_transaction_config.go +model_besu_transaction_config.go +model_besu_transaction_config_to.go +model_consistency_strategy.go +model_deploy_contract_solidity_bytecode_v1_request.go +model_deploy_contract_solidity_bytecode_v1_response.go +model_eth_contract_invocation_type.go +model_evm_block.go +model_evm_log.go +model_evm_transaction.go +model_get_balance_v1_request.go +model_get_balance_v1_response.go +model_get_besu_record_v1_request.go +model_get_besu_record_v1_response.go +model_get_block_v1_request.go +model_get_block_v1_response.go +model_get_past_logs_v1_request.go +model_get_past_logs_v1_response.go +model_get_transaction_v1_request.go +model_get_transaction_v1_response.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_receipt_type.go +model_run_transaction_request.go +model_run_transaction_response.go +model_sign_transaction_request.go +model_sign_transaction_response.go +model_solidity_contract_json_artifact.go +model_solidity_contract_json_artifact_compiler.go +model_solidity_contract_json_artifact_gas_estimates.go +model_solidity_contract_json_artifact_gas_estimates_creation.go +model_watch_blocks_v1.go +model_watch_blocks_v1_progress.go +model_web3_block_header.go +model_web3_block_header_timestamp.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction_receipt.go +response.go +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..54c5ca022c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,162 @@ +# Go API client for cactus-plugin-ledger-connector-besu + +Can perform basic tasks on a Besu ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-besu "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractSolBytecodeV1**](docs/DefaultApi.md#deploycontractsolbytecodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**GetBalanceV1**](docs/DefaultApi.md#getbalancev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance | Return balance of an address of a given block +*DefaultApi* | [**GetBesuRecordV1**](docs/DefaultApi.md#getbesurecordv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record | Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. +*DefaultApi* | [**GetBlockV1**](docs/DefaultApi.md#getblockv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block | Returns a block matching the block +*DefaultApi* | [**GetOpenApiSpecV1**](docs/DefaultApi.md#getopenapispecv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec | Retrieves the .json file that contains the OpenAPI specification for the plugin. +*DefaultApi* | [**GetPastLogsV1**](docs/DefaultApi.md#getpastlogsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs | Gets past logs, matching the given options. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**GetTransactionV1**](docs/DefaultApi.md#gettransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**SignTransactionV1**](docs/DefaultApi.md#signtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction | Obtain signatures of ledger from the corresponding transaction hash. + + +## Documentation For Models + + - [BesuPrivateTransactionConfig](docs/BesuPrivateTransactionConfig.md) + - [BesuTransactionConfig](docs/BesuTransactionConfig.md) + - [BesuTransactionConfigTo](docs/BesuTransactionConfigTo.md) + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EvmBlock](docs/EvmBlock.md) + - [EvmLog](docs/EvmLog.md) + - [EvmTransaction](docs/EvmTransaction.md) + - [GetBalanceV1Request](docs/GetBalanceV1Request.md) + - [GetBalanceV1Response](docs/GetBalanceV1Response.md) + - [GetBesuRecordV1Request](docs/GetBesuRecordV1Request.md) + - [GetBesuRecordV1Response](docs/GetBesuRecordV1Response.md) + - [GetBlockV1Request](docs/GetBlockV1Request.md) + - [GetBlockV1Response](docs/GetBlockV1Response.md) + - [GetPastLogsV1Request](docs/GetPastLogsV1Request.md) + - [GetPastLogsV1Response](docs/GetPastLogsV1Response.md) + - [GetTransactionV1Request](docs/GetTransactionV1Request.md) + - [GetTransactionV1Response](docs/GetTransactionV1Response.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SignTransactionRequest](docs/SignTransactionRequest.md) + - [SignTransactionResponse](docs/SignTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3BlockHeaderTimestamp](docs/Web3BlockHeaderTimestamp.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..122f5e39d0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1228 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Besu ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec: + get: + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + type: string + description: OK + summary: Retrieves the .json file that contains the OpenAPI specification for + the plugin. + x-hyperledger-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance: + post: + operationId: getBalanceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Response' + description: OK + summary: Return balance of an address of a given block + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record +components: + schemas: + GetBalanceV1Response: + example: + balance: balance + properties: + balance: + type: string + required: + - balance + type: object + GetBalanceV1Request: + additionalProperties: false + example: + address: address + defaultBlock: "" + properties: + address: + type: string + defaultBlock: {} + required: + - address + type: object + EvmBlock: + example: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + miner: + type: string + difficulty: + type: number + totalDifficulty: + type: number + extraData: + type: string + size: + type: number + gasLimit: + type: number + gasUsed: + type: number + timestamp: {} + transactions: + items: {} + type: array + uncles: + items: {} + type: array + type: object + GetBlockV1Response: + example: + block: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + block: + $ref: '#/components/schemas/EvmBlock' + required: + - block + type: object + EvmTransaction: + example: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + hash: + type: string + nonce: + type: number + blockHash: {} + blockNumber: {} + transactionIndex: {} + from: + type: string + to: {} + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + type: object + GetTransactionV1Response: + example: + transaction: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + transaction: + $ref: '#/components/schemas/EvmTransaction' + required: + - transaction + type: object + GetTransactionV1Request: + additionalProperties: false + example: + transactionHash: transactionHash + properties: + transactionHash: + type: string + required: + - transactionHash + type: object + GetPastLogsV1Response: + example: + logs: + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + logs: + items: + $ref: '#/components/schemas/EvmLog' + type: array + required: + - logs + type: object + GetPastLogsV1Request: + additionalProperties: false + example: + fromBlock: "" + toBlock: "" + address: "" + topics: + - "" + - "" + properties: + toBlock: {} + fromBlock: {} + address: {} + topics: + items: {} + type: array + type: object + EvmLog: + example: + blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + address: + type: string + data: + type: string + blockHash: + type: string + transactionHash: + type: string + topics: + items: + type: string + type: array + logIndex: + type: number + transactionIndex: + type: number + blockNumber: + type: number + required: + - address + - blockHash + - blockNumber + - data + - logIndex + - topics + - transactionHash + - transactionIndex + type: object + GetBlockV1Request: + additionalProperties: false + example: + blockHashOrBlockNumber: "" + properties: + blockHashOrBlockNumber: {} + required: + - blockHashOrBlockNumber + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionRoot: + type: string + stateRoot: + type: string + receiptRoot: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + required: + - blockHeader + type: object + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + BesuTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + to: + $ref: '#/components/schemas/BesuTransactionConfig_to' + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + data: + $ref: '#/components/schemas/BesuTransactionConfig_to' + type: object + BesuPrivateTransactionConfig: + example: + privateFrom: privateFrom + privateFor: + - "" + - "" + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + required: + - privateFor + - privateFrom + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/BesuTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - bytecode + - constructorArgs + - contractAbi + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + properties: + contractName: + nullable: false + type: string + signingCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAbi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + contractAddress: + description: "Address of the solidity contract, optional parameter" + nullable: false + type: string + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + SignTransactionRequest: + additionalProperties: false + example: + keychainId: keychainId + keychainRef: keychainRef + transactionHash: transactionHash + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + transactionHash: + description: The transaction hash of ledger will be used to fetch the contain. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - keychainId + - keychainRef + - transactionHash + type: object + SignTransactionResponse: + example: + signature: signature + properties: + signature: + description: The signatures of ledger from the corresponding transaction + hash. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - signature + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetBesuRecordV1Request: + additionalProperties: false + example: + invokeCall: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + transactionHash: transactionHash + properties: + invokeCall: + $ref: '#/components/schemas/InvokeContractV1Request' + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + type: object + GetBesuRecordV1Response: + properties: + ledgerId: + type: string + stateContract: + type: string + transactionInputData: {} + callOutput: {} + type: object + Web3BlockHeader_timestamp: + oneOf: + - type: string + - type: number + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + BesuTransactionConfig_to: + oneOf: + - type: string diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..997df0bf8b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1167 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractSolBytecodeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeV1Request *DeployContractSolidityBytecodeV1Request +} + +func (r ApiDeployContractSolBytecodeV1Request) DeployContractSolidityBytecodeV1Request(deployContractSolidityBytecodeV1Request DeployContractSolidityBytecodeV1Request) ApiDeployContractSolBytecodeV1Request { + r.deployContractSolidityBytecodeV1Request = &deployContractSolidityBytecodeV1Request + return r +} + +func (r ApiDeployContractSolBytecodeV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeV1Execute(r) +} + +/* +DeployContractSolBytecodeV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeV1(ctx context.Context) ApiDeployContractSolBytecodeV1Request { + return ApiDeployContractSolBytecodeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeV1Execute(r ApiDeployContractSolBytecodeV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBalanceV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBalanceV1Request *GetBalanceV1Request +} + +func (r ApiGetBalanceV1Request) GetBalanceV1Request(getBalanceV1Request GetBalanceV1Request) ApiGetBalanceV1Request { + r.getBalanceV1Request = &getBalanceV1Request + return r +} + +func (r ApiGetBalanceV1Request) Execute() (*GetBalanceV1Response, *http.Response, error) { + return r.ApiService.GetBalanceV1Execute(r) +} + +/* +GetBalanceV1 Return balance of an address of a given block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBalanceV1Request +*/ +func (a *DefaultApiService) GetBalanceV1(ctx context.Context) ApiGetBalanceV1Request { + return ApiGetBalanceV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBalanceV1Response +func (a *DefaultApiService) GetBalanceV1Execute(r ApiGetBalanceV1Request) (*GetBalanceV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBalanceV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBalanceV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBalanceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBesuRecordV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBesuRecordV1Request *GetBesuRecordV1Request +} + +func (r ApiGetBesuRecordV1Request) GetBesuRecordV1Request(getBesuRecordV1Request GetBesuRecordV1Request) ApiGetBesuRecordV1Request { + r.getBesuRecordV1Request = &getBesuRecordV1Request + return r +} + +func (r ApiGetBesuRecordV1Request) Execute() (*GetBesuRecordV1Response, *http.Response, error) { + return r.ApiService.GetBesuRecordV1Execute(r) +} + +/* +GetBesuRecordV1 Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBesuRecordV1Request +*/ +func (a *DefaultApiService) GetBesuRecordV1(ctx context.Context) ApiGetBesuRecordV1Request { + return ApiGetBesuRecordV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBesuRecordV1Response +func (a *DefaultApiService) GetBesuRecordV1Execute(r ApiGetBesuRecordV1Request) (*GetBesuRecordV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBesuRecordV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBesuRecordV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBesuRecordV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBlockV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBlockV1Request *GetBlockV1Request +} + +func (r ApiGetBlockV1Request) GetBlockV1Request(getBlockV1Request GetBlockV1Request) ApiGetBlockV1Request { + r.getBlockV1Request = &getBlockV1Request + return r +} + +func (r ApiGetBlockV1Request) Execute() (*GetBlockV1Response, *http.Response, error) { + return r.ApiService.GetBlockV1Execute(r) +} + +/* +GetBlockV1 Returns a block matching the block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBlockV1Request +*/ +func (a *DefaultApiService) GetBlockV1(ctx context.Context) ApiGetBlockV1Request { + return ApiGetBlockV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBlockV1Response +func (a *DefaultApiService) GetBlockV1Execute(r ApiGetBlockV1Request) (*GetBlockV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBlockV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBlockV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBlockV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetOpenApiSpecV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetOpenApiSpecV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetOpenApiSpecV1Execute(r) +} + +/* +GetOpenApiSpecV1 Retrieves the .json file that contains the OpenAPI specification for the plugin. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOpenApiSpecV1Request +*/ +func (a *DefaultApiService) GetOpenApiSpecV1(ctx context.Context) ApiGetOpenApiSpecV1Request { + return ApiGetOpenApiSpecV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetOpenApiSpecV1Execute(r ApiGetOpenApiSpecV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOpenApiSpecV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPastLogsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getPastLogsV1Request *GetPastLogsV1Request +} + +func (r ApiGetPastLogsV1Request) GetPastLogsV1Request(getPastLogsV1Request GetPastLogsV1Request) ApiGetPastLogsV1Request { + r.getPastLogsV1Request = &getPastLogsV1Request + return r +} + +func (r ApiGetPastLogsV1Request) Execute() (*GetPastLogsV1Response, *http.Response, error) { + return r.ApiService.GetPastLogsV1Execute(r) +} + +/* +GetPastLogsV1 Gets past logs, matching the given options. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPastLogsV1Request +*/ +func (a *DefaultApiService) GetPastLogsV1(ctx context.Context) ApiGetPastLogsV1Request { + return ApiGetPastLogsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetPastLogsV1Response +func (a *DefaultApiService) GetPastLogsV1Execute(r ApiGetPastLogsV1Request) (*GetPastLogsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetPastLogsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPastLogsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getPastLogsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getTransactionV1Request *GetTransactionV1Request +} + +func (r ApiGetTransactionV1Request) GetTransactionV1Request(getTransactionV1Request GetTransactionV1Request) ApiGetTransactionV1Request { + r.getTransactionV1Request = &getTransactionV1Request + return r +} + +func (r ApiGetTransactionV1Request) Execute() (*GetTransactionV1Response, *http.Response, error) { + return r.ApiService.GetTransactionV1Execute(r) +} + +/* +GetTransactionV1 Executes a transaction on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionV1Request +*/ +func (a *DefaultApiService) GetTransactionV1(ctx context.Context) ApiGetTransactionV1Request { + return ApiGetTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetTransactionV1Response +func (a *DefaultApiService) GetTransactionV1Execute(r ApiGetTransactionV1Request) (*GetTransactionV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetTransactionV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getTransactionV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSignTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + signTransactionRequest *SignTransactionRequest +} + +func (r ApiSignTransactionV1Request) SignTransactionRequest(signTransactionRequest SignTransactionRequest) ApiSignTransactionV1Request { + r.signTransactionRequest = &signTransactionRequest + return r +} + +func (r ApiSignTransactionV1Request) Execute() (*SignTransactionResponse, *http.Response, error) { + return r.ApiService.SignTransactionV1Execute(r) +} + +/* +SignTransactionV1 Obtain signatures of ledger from the corresponding transaction hash. + +Obtain signatures of ledger from the corresponding transaction hash. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSignTransactionV1Request +*/ +func (a *DefaultApiService) SignTransactionV1(ctx context.Context) ApiSignTransactionV1Request { + return ApiSignTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SignTransactionResponse +func (a *DefaultApiService) SignTransactionV1Execute(r ApiSignTransactionV1Request) (*SignTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SignTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SignTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.signTransactionRequest == nil { + return localVarReturnValue, nil, reportError("signTransactionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.signTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..49c08cba0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Besu API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..8c2917f44d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuPrivateTransactionConfig.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuPrivateTransactionConfig.md new file mode 100644 index 0000000000..713e3b52bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuPrivateTransactionConfig.md @@ -0,0 +1,72 @@ +# BesuPrivateTransactionConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PrivateFrom** | **string** | | +**PrivateFor** | **[]interface{}** | | [default to []] + +## Methods + +### NewBesuPrivateTransactionConfig + +`func NewBesuPrivateTransactionConfig(privateFrom string, privateFor []interface{}, ) *BesuPrivateTransactionConfig` + +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 + +### NewBesuPrivateTransactionConfigWithDefaults + +`func NewBesuPrivateTransactionConfigWithDefaults() *BesuPrivateTransactionConfig` + +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 + +### GetPrivateFrom + +`func (o *BesuPrivateTransactionConfig) GetPrivateFrom() string` + +GetPrivateFrom returns the PrivateFrom field if non-nil, zero value otherwise. + +### GetPrivateFromOk + +`func (o *BesuPrivateTransactionConfig) GetPrivateFromOk() (*string, bool)` + +GetPrivateFromOk returns a tuple with the PrivateFrom field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateFrom + +`func (o *BesuPrivateTransactionConfig) SetPrivateFrom(v string)` + +SetPrivateFrom sets PrivateFrom field to given value. + + +### GetPrivateFor + +`func (o *BesuPrivateTransactionConfig) GetPrivateFor() []interface{}` + +GetPrivateFor returns the PrivateFor field if non-nil, zero value otherwise. + +### GetPrivateForOk + +`func (o *BesuPrivateTransactionConfig) GetPrivateForOk() (*[]interface{}, bool)` + +GetPrivateForOk returns a tuple with the PrivateFor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateFor + +`func (o *BesuPrivateTransactionConfig) SetPrivateFor(v []interface{})` + +SetPrivateFor sets PrivateFor field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuTransactionConfig.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuTransactionConfig.md new file mode 100644 index 0000000000..0a74b890bd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuTransactionConfig.md @@ -0,0 +1,238 @@ +# BesuTransactionConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RawTransaction** | Pointer to **string** | | [optional] +**From** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**To** | Pointer to [**BesuTransactionConfigTo**](BesuTransactionConfigTo.md) | | [optional] +**Value** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**Gas** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**GasPrice** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**Nonce** | Pointer to **float32** | | [optional] +**Data** | Pointer to [**BesuTransactionConfigTo**](BesuTransactionConfigTo.md) | | [optional] + +## Methods + +### NewBesuTransactionConfig + +`func NewBesuTransactionConfig() *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 + +### NewBesuTransactionConfigWithDefaults + +`func NewBesuTransactionConfigWithDefaults() *BesuTransactionConfig` + +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 + +### GetRawTransaction + +`func (o *BesuTransactionConfig) GetRawTransaction() string` + +GetRawTransaction returns the RawTransaction field if non-nil, zero value otherwise. + +### GetRawTransactionOk + +`func (o *BesuTransactionConfig) GetRawTransactionOk() (*string, bool)` + +GetRawTransactionOk returns a tuple with the RawTransaction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRawTransaction + +`func (o *BesuTransactionConfig) SetRawTransaction(v string)` + +SetRawTransaction sets RawTransaction field to given value. + +### HasRawTransaction + +`func (o *BesuTransactionConfig) HasRawTransaction() bool` + +HasRawTransaction returns a boolean if a field has been set. + +### GetFrom + +`func (o *BesuTransactionConfig) GetFrom() Web3BlockHeaderTimestamp` + +GetFrom returns the From field if non-nil, zero value otherwise. + +### GetFromOk + +`func (o *BesuTransactionConfig) GetFromOk() (*Web3BlockHeaderTimestamp, bool)` + +GetFromOk returns a tuple with the From field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFrom + +`func (o *BesuTransactionConfig) SetFrom(v Web3BlockHeaderTimestamp)` + +SetFrom sets From field to given value. + +### HasFrom + +`func (o *BesuTransactionConfig) HasFrom() bool` + +HasFrom returns a boolean if a field has been set. + +### GetTo + +`func (o *BesuTransactionConfig) GetTo() BesuTransactionConfigTo` + +GetTo returns the To field if non-nil, zero value otherwise. + +### GetToOk + +`func (o *BesuTransactionConfig) GetToOk() (*BesuTransactionConfigTo, bool)` + +GetToOk returns a tuple with the To field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTo + +`func (o *BesuTransactionConfig) SetTo(v BesuTransactionConfigTo)` + +SetTo sets To field to given value. + +### HasTo + +`func (o *BesuTransactionConfig) HasTo() bool` + +HasTo returns a boolean if a field has been set. + +### GetValue + +`func (o *BesuTransactionConfig) GetValue() Web3BlockHeaderTimestamp` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *BesuTransactionConfig) GetValueOk() (*Web3BlockHeaderTimestamp, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *BesuTransactionConfig) SetValue(v Web3BlockHeaderTimestamp)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *BesuTransactionConfig) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetGas + +`func (o *BesuTransactionConfig) GetGas() Web3BlockHeaderTimestamp` + +GetGas returns the Gas field if non-nil, zero value otherwise. + +### GetGasOk + +`func (o *BesuTransactionConfig) GetGasOk() (*Web3BlockHeaderTimestamp, bool)` + +GetGasOk returns a tuple with the Gas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGas + +`func (o *BesuTransactionConfig) SetGas(v Web3BlockHeaderTimestamp)` + +SetGas sets Gas field to given value. + +### HasGas + +`func (o *BesuTransactionConfig) HasGas() bool` + +HasGas returns a boolean if a field has been set. + +### GetGasPrice + +`func (o *BesuTransactionConfig) GetGasPrice() Web3BlockHeaderTimestamp` + +GetGasPrice returns the GasPrice field if non-nil, zero value otherwise. + +### GetGasPriceOk + +`func (o *BesuTransactionConfig) GetGasPriceOk() (*Web3BlockHeaderTimestamp, bool)` + +GetGasPriceOk returns a tuple with the GasPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasPrice + +`func (o *BesuTransactionConfig) SetGasPrice(v Web3BlockHeaderTimestamp)` + +SetGasPrice sets GasPrice field to given value. + +### HasGasPrice + +`func (o *BesuTransactionConfig) HasGasPrice() bool` + +HasGasPrice returns a boolean if a field has been set. + +### GetNonce + +`func (o *BesuTransactionConfig) GetNonce() float32` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *BesuTransactionConfig) GetNonceOk() (*float32, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *BesuTransactionConfig) SetNonce(v float32)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *BesuTransactionConfig) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + +### GetData + +`func (o *BesuTransactionConfig) GetData() BesuTransactionConfigTo` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *BesuTransactionConfig) GetDataOk() (*BesuTransactionConfigTo, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *BesuTransactionConfig) SetData(v BesuTransactionConfigTo)` + +SetData sets Data field to given value. + +### HasData + +`func (o *BesuTransactionConfig) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuTransactionConfigTo.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuTransactionConfigTo.md new file mode 100644 index 0000000000..9d69f9ae39 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/BesuTransactionConfigTo.md @@ -0,0 +1,30 @@ +# BesuTransactionConfigTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewBesuTransactionConfigTo + +`func NewBesuTransactionConfigTo() *BesuTransactionConfigTo` + +NewBesuTransactionConfigTo instantiates a new BesuTransactionConfigTo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBesuTransactionConfigToWithDefaults + +`func NewBesuTransactionConfigToWithDefaults() *BesuTransactionConfigTo` + +NewBesuTransactionConfigToWithDefaults instantiates a new BesuTransactionConfigTo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/ConsistencyStrategy.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/ConsistencyStrategy.md new file mode 100644 index 0000000000..2cfa57f069 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/ConsistencyStrategy.md @@ -0,0 +1,98 @@ +# ConsistencyStrategy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ReceiptType** | [**ReceiptType**](ReceiptType.md) | | +**TimeoutMs** | Pointer to **int32** | 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. | [optional] +**BlockConfirmations** | **int32** | 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. | + +## Methods + +### NewConsistencyStrategy + +`func NewConsistencyStrategy(receiptType ReceiptType, blockConfirmations int32, ) *ConsistencyStrategy` + +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 + +### NewConsistencyStrategyWithDefaults + +`func NewConsistencyStrategyWithDefaults() *ConsistencyStrategy` + +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 + +### GetReceiptType + +`func (o *ConsistencyStrategy) GetReceiptType() ReceiptType` + +GetReceiptType returns the ReceiptType field if non-nil, zero value otherwise. + +### GetReceiptTypeOk + +`func (o *ConsistencyStrategy) GetReceiptTypeOk() (*ReceiptType, bool)` + +GetReceiptTypeOk returns a tuple with the ReceiptType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiptType + +`func (o *ConsistencyStrategy) SetReceiptType(v ReceiptType)` + +SetReceiptType sets ReceiptType field to given value. + + +### GetTimeoutMs + +`func (o *ConsistencyStrategy) GetTimeoutMs() int32` + +GetTimeoutMs returns the TimeoutMs field if non-nil, zero value otherwise. + +### GetTimeoutMsOk + +`func (o *ConsistencyStrategy) GetTimeoutMsOk() (*int32, bool)` + +GetTimeoutMsOk returns a tuple with the TimeoutMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutMs + +`func (o *ConsistencyStrategy) SetTimeoutMs(v int32)` + +SetTimeoutMs sets TimeoutMs field to given value. + +### HasTimeoutMs + +`func (o *ConsistencyStrategy) HasTimeoutMs() bool` + +HasTimeoutMs returns a boolean if a field has been set. + +### GetBlockConfirmations + +`func (o *ConsistencyStrategy) GetBlockConfirmations() int32` + +GetBlockConfirmations returns the BlockConfirmations field if non-nil, zero value otherwise. + +### GetBlockConfirmationsOk + +`func (o *ConsistencyStrategy) GetBlockConfirmationsOk() (*int32, bool)` + +GetBlockConfirmationsOk returns a tuple with the BlockConfirmations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockConfirmations + +`func (o *ConsistencyStrategy) SetBlockConfirmations(v int32)` + +SetBlockConfirmations sets BlockConfirmations field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DefaultApi.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DefaultApi.md new file mode 100644 index 0000000000..ddfc854a6d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DefaultApi.md @@ -0,0 +1,715 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeployContractSolBytecodeV1**](DefaultApi.md#DeployContractSolBytecodeV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +[**GetBalanceV1**](DefaultApi.md#GetBalanceV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance | Return balance of an address of a given block +[**GetBesuRecordV1**](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. +[**GetBlockV1**](DefaultApi.md#GetBlockV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block | Returns a block matching the block +[**GetOpenApiSpecV1**](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. +[**GetPastLogsV1**](DefaultApi.md#GetPastLogsV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs | Gets past logs, matching the given options. +[**GetPrometheusMetricsV1**](DefaultApi.md#GetPrometheusMetricsV1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics | Get the Prometheus Metrics +[**GetTransactionV1**](DefaultApi.md#GetTransactionV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction | Executes a transaction on a besu ledger +[**InvokeContractV1**](DefaultApi.md#InvokeContractV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract | Invokes a contract on a besu ledger +[**RunTransactionV1**](DefaultApi.md#RunTransactionV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction | Executes a transaction on a besu ledger +[**SignTransactionV1**](DefaultApi.md#SignTransactionV1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction | Obtain signatures of ledger from the corresponding transaction hash. + + + +## DeployContractSolBytecodeV1 + +> DeployContractSolidityBytecodeV1Response DeployContractSolBytecodeV1(ctx).DeployContractSolidityBytecodeV1Request(deployContractSolidityBytecodeV1Request).Execute() + +Deploys the bytecode of a Solidity contract. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + deployContractSolidityBytecodeV1Request := *openapiclient.NewDeployContractSolidityBytecodeV1Request("ContractName_example", []interface{}{nil}, []interface{}{nil}, openapiclient.Web3SigningCredential{Web3SigningCredentialCactusKeychainRef: openapiclient.NewWeb3SigningCredentialCactusKeychainRef(openapiclient.Web3SigningCredentialType("CACTUS_KEYCHAIN_REF"), "EthAccount_example", "KeychainEntryKey_example", "KeychainId_example")}, "Bytecode_example", "KeychainId_example") // DeployContractSolidityBytecodeV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.DeployContractSolBytecodeV1(context.Background()).DeployContractSolidityBytecodeV1Request(deployContractSolidityBytecodeV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeployContractSolBytecodeV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeployContractSolBytecodeV1`: DeployContractSolidityBytecodeV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.DeployContractSolBytecodeV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeployContractSolBytecodeV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deployContractSolidityBytecodeV1Request** | [**DeployContractSolidityBytecodeV1Request**](DeployContractSolidityBytecodeV1Request.md) | | + +### Return type + +[**DeployContractSolidityBytecodeV1Response**](DeployContractSolidityBytecodeV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetBalanceV1 + +> GetBalanceV1Response GetBalanceV1(ctx).GetBalanceV1Request(getBalanceV1Request).Execute() + +Return balance of an address of a given block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + getBalanceV1Request := *openapiclient.NewGetBalanceV1Request("Address_example") // GetBalanceV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetBalanceV1(context.Background()).GetBalanceV1Request(getBalanceV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetBalanceV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBalanceV1`: GetBalanceV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetBalanceV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBalanceV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getBalanceV1Request** | [**GetBalanceV1Request**](GetBalanceV1Request.md) | | + +### Return type + +[**GetBalanceV1Response**](GetBalanceV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetBesuRecordV1 + +> GetBesuRecordV1Response GetBesuRecordV1(ctx).GetBesuRecordV1Request(getBesuRecordV1Request).Execute() + +Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + getBesuRecordV1Request := *openapiclient.NewGetBesuRecordV1Request() // GetBesuRecordV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetBesuRecordV1(context.Background()).GetBesuRecordV1Request(getBesuRecordV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetBesuRecordV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBesuRecordV1`: GetBesuRecordV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetBesuRecordV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBesuRecordV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getBesuRecordV1Request** | [**GetBesuRecordV1Request**](GetBesuRecordV1Request.md) | | + +### Return type + +[**GetBesuRecordV1Response**](GetBesuRecordV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetBlockV1 + +> GetBlockV1Response GetBlockV1(ctx).GetBlockV1Request(getBlockV1Request).Execute() + +Returns a block matching the block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + getBlockV1Request := *openapiclient.NewGetBlockV1Request(interface{}(123)) // GetBlockV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetBlockV1(context.Background()).GetBlockV1Request(getBlockV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetBlockV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBlockV1`: GetBlockV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetBlockV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBlockV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getBlockV1Request** | [**GetBlockV1Request**](GetBlockV1Request.md) | | + +### Return type + +[**GetBlockV1Response**](GetBlockV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetOpenApiSpecV1 + +> string GetOpenApiSpecV1(ctx).Execute() + +Retrieves the .json file that contains the OpenAPI specification for the plugin. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetOpenApiSpecV1(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetOpenApiSpecV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOpenApiSpecV1`: string + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetOpenApiSpecV1`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetOpenApiSpecV1Request struct via the builder pattern + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPastLogsV1 + +> GetPastLogsV1Response GetPastLogsV1(ctx).GetPastLogsV1Request(getPastLogsV1Request).Execute() + +Gets past logs, matching the given options. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + getPastLogsV1Request := *openapiclient.NewGetPastLogsV1Request() // GetPastLogsV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetPastLogsV1(context.Background()).GetPastLogsV1Request(getPastLogsV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPastLogsV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPastLogsV1`: GetPastLogsV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetPastLogsV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPastLogsV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getPastLogsV1Request** | [**GetPastLogsV1Request**](GetPastLogsV1Request.md) | | + +### Return type + +[**GetPastLogsV1Response**](GetPastLogsV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPrometheusMetricsV1 + +> string GetPrometheusMetricsV1(ctx).Execute() + +Get the Prometheus Metrics + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetPrometheusMetricsV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPrometheusMetricsV1`: string + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetPrometheusMetricsV1`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPrometheusMetricsV1Request struct via the builder pattern + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetTransactionV1 + +> GetTransactionV1Response GetTransactionV1(ctx).GetTransactionV1Request(getTransactionV1Request).Execute() + +Executes a transaction on a besu ledger + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + getTransactionV1Request := *openapiclient.NewGetTransactionV1Request("TransactionHash_example") // GetTransactionV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetTransactionV1(context.Background()).GetTransactionV1Request(getTransactionV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetTransactionV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTransactionV1`: GetTransactionV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetTransactionV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTransactionV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getTransactionV1Request** | [**GetTransactionV1Request**](GetTransactionV1Request.md) | | + +### Return type + +[**GetTransactionV1Response**](GetTransactionV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## InvokeContractV1 + +> InvokeContractV1Response InvokeContractV1(ctx).InvokeContractV1Request(invokeContractV1Request).Execute() + +Invokes a contract on a besu ledger + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + invokeContractV1Request := *openapiclient.NewInvokeContractV1Request("ContractName_example", openapiclient.Web3SigningCredential{Web3SigningCredentialCactusKeychainRef: openapiclient.NewWeb3SigningCredentialCactusKeychainRef(openapiclient.Web3SigningCredentialType("CACTUS_KEYCHAIN_REF"), "EthAccount_example", "KeychainEntryKey_example", "KeychainId_example")}, openapiclient.EthContractInvocationType("SEND"), "MethodName_example", []interface{}{nil}) // InvokeContractV1Request | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).InvokeContractV1Request(invokeContractV1Request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.InvokeContractV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InvokeContractV1`: InvokeContractV1Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.InvokeContractV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiInvokeContractV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **invokeContractV1Request** | [**InvokeContractV1Request**](InvokeContractV1Request.md) | | + +### Return type + +[**InvokeContractV1Response**](InvokeContractV1Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RunTransactionV1 + +> RunTransactionResponse RunTransactionV1(ctx).RunTransactionRequest(runTransactionRequest).Execute() + +Executes a transaction on a besu ledger + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + runTransactionRequest := *openapiclient.NewRunTransactionRequest(openapiclient.Web3SigningCredential{Web3SigningCredentialCactusKeychainRef: openapiclient.NewWeb3SigningCredentialCactusKeychainRef(openapiclient.Web3SigningCredentialType("CACTUS_KEYCHAIN_REF"), "EthAccount_example", "KeychainEntryKey_example", "KeychainId_example")}, *openapiclient.NewBesuTransactionConfig(), *openapiclient.NewConsistencyStrategy(openapiclient.ReceiptType("NODE_TX_POOL_ACK"), int32(123))) // RunTransactionRequest | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).RunTransactionRequest(runTransactionRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.RunTransactionV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RunTransactionV1`: RunTransactionResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.RunTransactionV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiRunTransactionV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **runTransactionRequest** | [**RunTransactionRequest**](RunTransactionRequest.md) | | + +### Return type + +[**RunTransactionResponse**](RunTransactionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SignTransactionV1 + +> SignTransactionResponse SignTransactionV1(ctx).SignTransactionRequest(signTransactionRequest).Execute() + +Obtain signatures of ledger from the corresponding transaction hash. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func main() { + signTransactionRequest := *openapiclient.NewSignTransactionRequest("KeychainId_example", "KeychainRef_example", "TransactionHash_example") // SignTransactionRequest | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.SignTransactionV1(context.Background()).SignTransactionRequest(signTransactionRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.SignTransactionV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SignTransactionV1`: SignTransactionResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.SignTransactionV1`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSignTransactionV1Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **signTransactionRequest** | [**SignTransactionRequest**](SignTransactionRequest.md) | | + +### Return type + +[**SignTransactionResponse**](SignTransactionResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DeployContractSolidityBytecodeV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DeployContractSolidityBytecodeV1Request.md new file mode 100644 index 0000000000..5ae228f39e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DeployContractSolidityBytecodeV1Request.md @@ -0,0 +1,260 @@ +# DeployContractSolidityBytecodeV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContractName** | **string** | The contract name for retrieve the contracts json on the keychain. | +**ContractAbi** | **[]interface{}** | The application binary interface of the solidity contract | +**ConstructorArgs** | **[]interface{}** | | [default to []] +**Web3SigningCredential** | [**Web3SigningCredential**](Web3SigningCredential.md) | | +**Bytecode** | **string** | See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode | +**KeychainId** | **string** | The keychainId for retrieve the contracts json. | +**Gas** | Pointer to **float32** | | [optional] +**GasPrice** | Pointer to **string** | | [optional] +**TimeoutMs** | Pointer to **float32** | The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. | [optional] [default to 60000] +**PrivateTransactionConfig** | Pointer to [**BesuPrivateTransactionConfig**](BesuPrivateTransactionConfig.md) | | [optional] + +## Methods + +### NewDeployContractSolidityBytecodeV1Request + +`func NewDeployContractSolidityBytecodeV1Request(contractName string, contractAbi []interface{}, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential, bytecode string, keychainId string, ) *DeployContractSolidityBytecodeV1Request` + +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 + +### NewDeployContractSolidityBytecodeV1RequestWithDefaults + +`func NewDeployContractSolidityBytecodeV1RequestWithDefaults() *DeployContractSolidityBytecodeV1Request` + +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 + +### GetContractName + +`func (o *DeployContractSolidityBytecodeV1Request) GetContractName() string` + +GetContractName returns the ContractName field if non-nil, zero value otherwise. + +### GetContractNameOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetContractNameOk() (*string, bool)` + +GetContractNameOk returns a tuple with the ContractName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractName + +`func (o *DeployContractSolidityBytecodeV1Request) SetContractName(v string)` + +SetContractName sets ContractName field to given value. + + +### GetContractAbi + +`func (o *DeployContractSolidityBytecodeV1Request) GetContractAbi() []interface{}` + +GetContractAbi returns the ContractAbi field if non-nil, zero value otherwise. + +### GetContractAbiOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetContractAbiOk() (*[]interface{}, bool)` + +GetContractAbiOk returns a tuple with the ContractAbi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractAbi + +`func (o *DeployContractSolidityBytecodeV1Request) SetContractAbi(v []interface{})` + +SetContractAbi sets ContractAbi field to given value. + + +### GetConstructorArgs + +`func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgs() []interface{}` + +GetConstructorArgs returns the ConstructorArgs field if non-nil, zero value otherwise. + +### GetConstructorArgsOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgsOk() (*[]interface{}, bool)` + +GetConstructorArgsOk returns a tuple with the ConstructorArgs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConstructorArgs + +`func (o *DeployContractSolidityBytecodeV1Request) SetConstructorArgs(v []interface{})` + +SetConstructorArgs sets ConstructorArgs field to given value. + + +### GetWeb3SigningCredential + +`func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredential() Web3SigningCredential` + +GetWeb3SigningCredential returns the Web3SigningCredential field if non-nil, zero value otherwise. + +### GetWeb3SigningCredentialOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool)` + +GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWeb3SigningCredential + +`func (o *DeployContractSolidityBytecodeV1Request) SetWeb3SigningCredential(v Web3SigningCredential)` + +SetWeb3SigningCredential sets Web3SigningCredential field to given value. + + +### GetBytecode + +`func (o *DeployContractSolidityBytecodeV1Request) GetBytecode() string` + +GetBytecode returns the Bytecode field if non-nil, zero value otherwise. + +### GetBytecodeOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetBytecodeOk() (*string, bool)` + +GetBytecodeOk returns a tuple with the Bytecode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBytecode + +`func (o *DeployContractSolidityBytecodeV1Request) SetBytecode(v string)` + +SetBytecode sets Bytecode field to given value. + + +### GetKeychainId + +`func (o *DeployContractSolidityBytecodeV1Request) GetKeychainId() string` + +GetKeychainId returns the KeychainId field if non-nil, zero value otherwise. + +### GetKeychainIdOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetKeychainIdOk() (*string, bool)` + +GetKeychainIdOk returns a tuple with the KeychainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainId + +`func (o *DeployContractSolidityBytecodeV1Request) SetKeychainId(v string)` + +SetKeychainId sets KeychainId field to given value. + + +### GetGas + +`func (o *DeployContractSolidityBytecodeV1Request) GetGas() float32` + +GetGas returns the Gas field if non-nil, zero value otherwise. + +### GetGasOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetGasOk() (*float32, bool)` + +GetGasOk returns a tuple with the Gas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGas + +`func (o *DeployContractSolidityBytecodeV1Request) SetGas(v float32)` + +SetGas sets Gas field to given value. + +### HasGas + +`func (o *DeployContractSolidityBytecodeV1Request) HasGas() bool` + +HasGas returns a boolean if a field has been set. + +### GetGasPrice + +`func (o *DeployContractSolidityBytecodeV1Request) GetGasPrice() string` + +GetGasPrice returns the GasPrice field if non-nil, zero value otherwise. + +### GetGasPriceOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetGasPriceOk() (*string, bool)` + +GetGasPriceOk returns a tuple with the GasPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasPrice + +`func (o *DeployContractSolidityBytecodeV1Request) SetGasPrice(v string)` + +SetGasPrice sets GasPrice field to given value. + +### HasGasPrice + +`func (o *DeployContractSolidityBytecodeV1Request) HasGasPrice() bool` + +HasGasPrice returns a boolean if a field has been set. + +### GetTimeoutMs + +`func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMs() float32` + +GetTimeoutMs returns the TimeoutMs field if non-nil, zero value otherwise. + +### GetTimeoutMsOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMsOk() (*float32, bool)` + +GetTimeoutMsOk returns a tuple with the TimeoutMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutMs + +`func (o *DeployContractSolidityBytecodeV1Request) SetTimeoutMs(v float32)` + +SetTimeoutMs sets TimeoutMs field to given value. + +### HasTimeoutMs + +`func (o *DeployContractSolidityBytecodeV1Request) HasTimeoutMs() bool` + +HasTimeoutMs returns a boolean if a field has been set. + +### GetPrivateTransactionConfig + +`func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfig() BesuPrivateTransactionConfig` + +GetPrivateTransactionConfig returns the PrivateTransactionConfig field if non-nil, zero value otherwise. + +### GetPrivateTransactionConfigOk + +`func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool)` + +GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateTransactionConfig + +`func (o *DeployContractSolidityBytecodeV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig)` + +SetPrivateTransactionConfig sets PrivateTransactionConfig field to given value. + +### HasPrivateTransactionConfig + +`func (o *DeployContractSolidityBytecodeV1Request) HasPrivateTransactionConfig() bool` + +HasPrivateTransactionConfig returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DeployContractSolidityBytecodeV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DeployContractSolidityBytecodeV1Response.md new file mode 100644 index 0000000000..6bbfeb0052 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/DeployContractSolidityBytecodeV1Response.md @@ -0,0 +1,51 @@ +# DeployContractSolidityBytecodeV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TransactionReceipt** | [**Web3TransactionReceipt**](Web3TransactionReceipt.md) | | + +## Methods + +### NewDeployContractSolidityBytecodeV1Response + +`func NewDeployContractSolidityBytecodeV1Response(transactionReceipt Web3TransactionReceipt, ) *DeployContractSolidityBytecodeV1Response` + +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 + +### NewDeployContractSolidityBytecodeV1ResponseWithDefaults + +`func NewDeployContractSolidityBytecodeV1ResponseWithDefaults() *DeployContractSolidityBytecodeV1Response` + +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 + +### GetTransactionReceipt + +`func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceipt() Web3TransactionReceipt` + +GetTransactionReceipt returns the TransactionReceipt field if non-nil, zero value otherwise. + +### GetTransactionReceiptOk + +`func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool)` + +GetTransactionReceiptOk returns a tuple with the TransactionReceipt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionReceipt + +`func (o *DeployContractSolidityBytecodeV1Response) SetTransactionReceipt(v Web3TransactionReceipt)` + +SetTransactionReceipt sets TransactionReceipt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EthContractInvocationType.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EthContractInvocationType.md new file mode 100644 index 0000000000..6345c6e4cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EthContractInvocationType.md @@ -0,0 +1,13 @@ +# EthContractInvocationType + +## Enum + + +* `SEND` (value: `"SEND"`) + +* `CALL` (value: `"CALL"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmBlock.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmBlock.md new file mode 100644 index 0000000000..85fe656188 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmBlock.md @@ -0,0 +1,508 @@ +# EvmBlock + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | Pointer to **float32** | | [optional] +**Hash** | Pointer to **string** | | [optional] +**ParentHash** | Pointer to **string** | | [optional] +**Nonce** | Pointer to **string** | | [optional] +**Sha3Uncles** | Pointer to **string** | | [optional] +**LogsBloom** | Pointer to **string** | | [optional] +**TransactionsRoot** | Pointer to **string** | | [optional] +**StateRoot** | Pointer to **string** | | [optional] +**Miner** | Pointer to **string** | | [optional] +**Difficulty** | Pointer to **float32** | | [optional] +**TotalDifficulty** | Pointer to **float32** | | [optional] +**ExtraData** | Pointer to **string** | | [optional] +**Size** | Pointer to **float32** | | [optional] +**GasLimit** | Pointer to **float32** | | [optional] +**GasUsed** | Pointer to **float32** | | [optional] +**Timestamp** | Pointer to **interface{}** | | [optional] +**Transactions** | Pointer to **[]interface{}** | | [optional] +**Uncles** | Pointer to **[]interface{}** | | [optional] + +## Methods + +### NewEvmBlock + +`func NewEvmBlock() *EvmBlock` + +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 + +### NewEvmBlockWithDefaults + +`func NewEvmBlockWithDefaults() *EvmBlock` + +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 + +### GetNumber + +`func (o *EvmBlock) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *EvmBlock) GetNumberOk() (*float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *EvmBlock) SetNumber(v float32)` + +SetNumber sets Number field to given value. + +### HasNumber + +`func (o *EvmBlock) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### GetHash + +`func (o *EvmBlock) GetHash() string` + +GetHash returns the Hash field if non-nil, zero value otherwise. + +### GetHashOk + +`func (o *EvmBlock) GetHashOk() (*string, bool)` + +GetHashOk returns a tuple with the Hash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHash + +`func (o *EvmBlock) SetHash(v string)` + +SetHash sets Hash field to given value. + +### HasHash + +`func (o *EvmBlock) HasHash() bool` + +HasHash returns a boolean if a field has been set. + +### GetParentHash + +`func (o *EvmBlock) GetParentHash() string` + +GetParentHash returns the ParentHash field if non-nil, zero value otherwise. + +### GetParentHashOk + +`func (o *EvmBlock) GetParentHashOk() (*string, bool)` + +GetParentHashOk returns a tuple with the ParentHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentHash + +`func (o *EvmBlock) SetParentHash(v string)` + +SetParentHash sets ParentHash field to given value. + +### HasParentHash + +`func (o *EvmBlock) HasParentHash() bool` + +HasParentHash returns a boolean if a field has been set. + +### GetNonce + +`func (o *EvmBlock) GetNonce() string` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *EvmBlock) GetNonceOk() (*string, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *EvmBlock) SetNonce(v string)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *EvmBlock) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + +### GetSha3Uncles + +`func (o *EvmBlock) GetSha3Uncles() string` + +GetSha3Uncles returns the Sha3Uncles field if non-nil, zero value otherwise. + +### GetSha3UnclesOk + +`func (o *EvmBlock) GetSha3UnclesOk() (*string, bool)` + +GetSha3UnclesOk returns a tuple with the Sha3Uncles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSha3Uncles + +`func (o *EvmBlock) SetSha3Uncles(v string)` + +SetSha3Uncles sets Sha3Uncles field to given value. + +### HasSha3Uncles + +`func (o *EvmBlock) HasSha3Uncles() bool` + +HasSha3Uncles returns a boolean if a field has been set. + +### GetLogsBloom + +`func (o *EvmBlock) GetLogsBloom() string` + +GetLogsBloom returns the LogsBloom field if non-nil, zero value otherwise. + +### GetLogsBloomOk + +`func (o *EvmBlock) GetLogsBloomOk() (*string, bool)` + +GetLogsBloomOk returns a tuple with the LogsBloom field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogsBloom + +`func (o *EvmBlock) SetLogsBloom(v string)` + +SetLogsBloom sets LogsBloom field to given value. + +### HasLogsBloom + +`func (o *EvmBlock) HasLogsBloom() bool` + +HasLogsBloom returns a boolean if a field has been set. + +### GetTransactionsRoot + +`func (o *EvmBlock) GetTransactionsRoot() string` + +GetTransactionsRoot returns the TransactionsRoot field if non-nil, zero value otherwise. + +### GetTransactionsRootOk + +`func (o *EvmBlock) GetTransactionsRootOk() (*string, bool)` + +GetTransactionsRootOk returns a tuple with the TransactionsRoot field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionsRoot + +`func (o *EvmBlock) SetTransactionsRoot(v string)` + +SetTransactionsRoot sets TransactionsRoot field to given value. + +### HasTransactionsRoot + +`func (o *EvmBlock) HasTransactionsRoot() bool` + +HasTransactionsRoot returns a boolean if a field has been set. + +### GetStateRoot + +`func (o *EvmBlock) GetStateRoot() string` + +GetStateRoot returns the StateRoot field if non-nil, zero value otherwise. + +### GetStateRootOk + +`func (o *EvmBlock) GetStateRootOk() (*string, bool)` + +GetStateRootOk returns a tuple with the StateRoot field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateRoot + +`func (o *EvmBlock) SetStateRoot(v string)` + +SetStateRoot sets StateRoot field to given value. + +### HasStateRoot + +`func (o *EvmBlock) HasStateRoot() bool` + +HasStateRoot returns a boolean if a field has been set. + +### GetMiner + +`func (o *EvmBlock) GetMiner() string` + +GetMiner returns the Miner field if non-nil, zero value otherwise. + +### GetMinerOk + +`func (o *EvmBlock) GetMinerOk() (*string, bool)` + +GetMinerOk returns a tuple with the Miner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMiner + +`func (o *EvmBlock) SetMiner(v string)` + +SetMiner sets Miner field to given value. + +### HasMiner + +`func (o *EvmBlock) HasMiner() bool` + +HasMiner returns a boolean if a field has been set. + +### GetDifficulty + +`func (o *EvmBlock) GetDifficulty() float32` + +GetDifficulty returns the Difficulty field if non-nil, zero value otherwise. + +### GetDifficultyOk + +`func (o *EvmBlock) GetDifficultyOk() (*float32, bool)` + +GetDifficultyOk returns a tuple with the Difficulty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDifficulty + +`func (o *EvmBlock) SetDifficulty(v float32)` + +SetDifficulty sets Difficulty field to given value. + +### HasDifficulty + +`func (o *EvmBlock) HasDifficulty() bool` + +HasDifficulty returns a boolean if a field has been set. + +### GetTotalDifficulty + +`func (o *EvmBlock) GetTotalDifficulty() float32` + +GetTotalDifficulty returns the TotalDifficulty field if non-nil, zero value otherwise. + +### GetTotalDifficultyOk + +`func (o *EvmBlock) GetTotalDifficultyOk() (*float32, bool)` + +GetTotalDifficultyOk returns a tuple with the TotalDifficulty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalDifficulty + +`func (o *EvmBlock) SetTotalDifficulty(v float32)` + +SetTotalDifficulty sets TotalDifficulty field to given value. + +### HasTotalDifficulty + +`func (o *EvmBlock) HasTotalDifficulty() bool` + +HasTotalDifficulty returns a boolean if a field has been set. + +### GetExtraData + +`func (o *EvmBlock) GetExtraData() string` + +GetExtraData returns the ExtraData field if non-nil, zero value otherwise. + +### GetExtraDataOk + +`func (o *EvmBlock) GetExtraDataOk() (*string, bool)` + +GetExtraDataOk returns a tuple with the ExtraData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExtraData + +`func (o *EvmBlock) SetExtraData(v string)` + +SetExtraData sets ExtraData field to given value. + +### HasExtraData + +`func (o *EvmBlock) HasExtraData() bool` + +HasExtraData returns a boolean if a field has been set. + +### GetSize + +`func (o *EvmBlock) GetSize() float32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *EvmBlock) GetSizeOk() (*float32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *EvmBlock) SetSize(v float32)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *EvmBlock) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetGasLimit + +`func (o *EvmBlock) GetGasLimit() float32` + +GetGasLimit returns the GasLimit field if non-nil, zero value otherwise. + +### GetGasLimitOk + +`func (o *EvmBlock) GetGasLimitOk() (*float32, bool)` + +GetGasLimitOk returns a tuple with the GasLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasLimit + +`func (o *EvmBlock) SetGasLimit(v float32)` + +SetGasLimit sets GasLimit field to given value. + +### HasGasLimit + +`func (o *EvmBlock) HasGasLimit() bool` + +HasGasLimit returns a boolean if a field has been set. + +### GetGasUsed + +`func (o *EvmBlock) GetGasUsed() float32` + +GetGasUsed returns the GasUsed field if non-nil, zero value otherwise. + +### GetGasUsedOk + +`func (o *EvmBlock) GetGasUsedOk() (*float32, bool)` + +GetGasUsedOk returns a tuple with the GasUsed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasUsed + +`func (o *EvmBlock) SetGasUsed(v float32)` + +SetGasUsed sets GasUsed field to given value. + +### HasGasUsed + +`func (o *EvmBlock) HasGasUsed() bool` + +HasGasUsed returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *EvmBlock) GetTimestamp() interface{}` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *EvmBlock) GetTimestampOk() (*interface{}, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *EvmBlock) SetTimestamp(v interface{})` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *EvmBlock) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + +### SetTimestampNil + +`func (o *EvmBlock) SetTimestampNil(b bool)` + + SetTimestampNil sets the value for Timestamp to be an explicit nil + +### UnsetTimestamp +`func (o *EvmBlock) UnsetTimestamp()` + +UnsetTimestamp ensures that no value is present for Timestamp, not even an explicit nil +### GetTransactions + +`func (o *EvmBlock) GetTransactions() []interface{}` + +GetTransactions returns the Transactions field if non-nil, zero value otherwise. + +### GetTransactionsOk + +`func (o *EvmBlock) GetTransactionsOk() (*[]interface{}, bool)` + +GetTransactionsOk returns a tuple with the Transactions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactions + +`func (o *EvmBlock) SetTransactions(v []interface{})` + +SetTransactions sets Transactions field to given value. + +### HasTransactions + +`func (o *EvmBlock) HasTransactions() bool` + +HasTransactions returns a boolean if a field has been set. + +### GetUncles + +`func (o *EvmBlock) GetUncles() []interface{}` + +GetUncles returns the Uncles field if non-nil, zero value otherwise. + +### GetUnclesOk + +`func (o *EvmBlock) GetUnclesOk() (*[]interface{}, bool)` + +GetUnclesOk returns a tuple with the Uncles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUncles + +`func (o *EvmBlock) SetUncles(v []interface{})` + +SetUncles sets Uncles field to given value. + +### HasUncles + +`func (o *EvmBlock) HasUncles() bool` + +HasUncles returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmLog.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmLog.md new file mode 100644 index 0000000000..831e6894bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmLog.md @@ -0,0 +1,198 @@ +# EvmLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**Data** | **string** | | +**BlockHash** | **string** | | +**TransactionHash** | **string** | | +**Topics** | **[]string** | | +**LogIndex** | **float32** | | +**TransactionIndex** | **float32** | | +**BlockNumber** | **float32** | | + +## Methods + +### NewEvmLog + +`func NewEvmLog(address string, data string, blockHash string, transactionHash string, topics []string, logIndex float32, transactionIndex float32, blockNumber float32, ) *EvmLog` + +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 + +### NewEvmLogWithDefaults + +`func NewEvmLogWithDefaults() *EvmLog` + +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 + +### GetAddress + +`func (o *EvmLog) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *EvmLog) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *EvmLog) SetAddress(v string)` + +SetAddress sets Address field to given value. + + +### GetData + +`func (o *EvmLog) GetData() string` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *EvmLog) GetDataOk() (*string, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *EvmLog) SetData(v string)` + +SetData sets Data field to given value. + + +### GetBlockHash + +`func (o *EvmLog) GetBlockHash() string` + +GetBlockHash returns the BlockHash field if non-nil, zero value otherwise. + +### GetBlockHashOk + +`func (o *EvmLog) GetBlockHashOk() (*string, bool)` + +GetBlockHashOk returns a tuple with the BlockHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockHash + +`func (o *EvmLog) SetBlockHash(v string)` + +SetBlockHash sets BlockHash field to given value. + + +### GetTransactionHash + +`func (o *EvmLog) GetTransactionHash() string` + +GetTransactionHash returns the TransactionHash field if non-nil, zero value otherwise. + +### GetTransactionHashOk + +`func (o *EvmLog) GetTransactionHashOk() (*string, bool)` + +GetTransactionHashOk returns a tuple with the TransactionHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionHash + +`func (o *EvmLog) SetTransactionHash(v string)` + +SetTransactionHash sets TransactionHash field to given value. + + +### GetTopics + +`func (o *EvmLog) GetTopics() []string` + +GetTopics returns the Topics field if non-nil, zero value otherwise. + +### GetTopicsOk + +`func (o *EvmLog) GetTopicsOk() (*[]string, bool)` + +GetTopicsOk returns a tuple with the Topics field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTopics + +`func (o *EvmLog) SetTopics(v []string)` + +SetTopics sets Topics field to given value. + + +### GetLogIndex + +`func (o *EvmLog) GetLogIndex() float32` + +GetLogIndex returns the LogIndex field if non-nil, zero value otherwise. + +### GetLogIndexOk + +`func (o *EvmLog) GetLogIndexOk() (*float32, bool)` + +GetLogIndexOk returns a tuple with the LogIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogIndex + +`func (o *EvmLog) SetLogIndex(v float32)` + +SetLogIndex sets LogIndex field to given value. + + +### GetTransactionIndex + +`func (o *EvmLog) GetTransactionIndex() float32` + +GetTransactionIndex returns the TransactionIndex field if non-nil, zero value otherwise. + +### GetTransactionIndexOk + +`func (o *EvmLog) GetTransactionIndexOk() (*float32, bool)` + +GetTransactionIndexOk returns a tuple with the TransactionIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionIndex + +`func (o *EvmLog) SetTransactionIndex(v float32)` + +SetTransactionIndex sets TransactionIndex field to given value. + + +### GetBlockNumber + +`func (o *EvmLog) GetBlockNumber() float32` + +GetBlockNumber returns the BlockNumber field if non-nil, zero value otherwise. + +### GetBlockNumberOk + +`func (o *EvmLog) GetBlockNumberOk() (*float32, bool)` + +GetBlockNumberOk returns a tuple with the BlockNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockNumber + +`func (o *EvmLog) SetBlockNumber(v float32)` + +SetBlockNumber sets BlockNumber field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmTransaction.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmTransaction.md new file mode 100644 index 0000000000..1de5a313fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/EvmTransaction.md @@ -0,0 +1,356 @@ +# EvmTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Hash** | Pointer to **string** | | [optional] +**Nonce** | Pointer to **float32** | | [optional] +**BlockHash** | Pointer to **interface{}** | | [optional] +**BlockNumber** | Pointer to **interface{}** | | [optional] +**TransactionIndex** | Pointer to **interface{}** | | [optional] +**From** | Pointer to **string** | | [optional] +**To** | Pointer to **interface{}** | | [optional] +**Value** | Pointer to **string** | | [optional] +**GasPrice** | Pointer to **string** | | [optional] +**Gas** | Pointer to **float32** | | [optional] +**Input** | Pointer to **string** | | [optional] + +## Methods + +### NewEvmTransaction + +`func NewEvmTransaction() *EvmTransaction` + +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 + +### NewEvmTransactionWithDefaults + +`func NewEvmTransactionWithDefaults() *EvmTransaction` + +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 + +### GetHash + +`func (o *EvmTransaction) GetHash() string` + +GetHash returns the Hash field if non-nil, zero value otherwise. + +### GetHashOk + +`func (o *EvmTransaction) GetHashOk() (*string, bool)` + +GetHashOk returns a tuple with the Hash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHash + +`func (o *EvmTransaction) SetHash(v string)` + +SetHash sets Hash field to given value. + +### HasHash + +`func (o *EvmTransaction) HasHash() bool` + +HasHash returns a boolean if a field has been set. + +### GetNonce + +`func (o *EvmTransaction) GetNonce() float32` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *EvmTransaction) GetNonceOk() (*float32, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *EvmTransaction) SetNonce(v float32)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *EvmTransaction) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + +### GetBlockHash + +`func (o *EvmTransaction) GetBlockHash() interface{}` + +GetBlockHash returns the BlockHash field if non-nil, zero value otherwise. + +### GetBlockHashOk + +`func (o *EvmTransaction) GetBlockHashOk() (*interface{}, bool)` + +GetBlockHashOk returns a tuple with the BlockHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockHash + +`func (o *EvmTransaction) SetBlockHash(v interface{})` + +SetBlockHash sets BlockHash field to given value. + +### HasBlockHash + +`func (o *EvmTransaction) HasBlockHash() bool` + +HasBlockHash returns a boolean if a field has been set. + +### SetBlockHashNil + +`func (o *EvmTransaction) SetBlockHashNil(b bool)` + + SetBlockHashNil sets the value for BlockHash to be an explicit nil + +### UnsetBlockHash +`func (o *EvmTransaction) UnsetBlockHash()` + +UnsetBlockHash ensures that no value is present for BlockHash, not even an explicit nil +### GetBlockNumber + +`func (o *EvmTransaction) GetBlockNumber() interface{}` + +GetBlockNumber returns the BlockNumber field if non-nil, zero value otherwise. + +### GetBlockNumberOk + +`func (o *EvmTransaction) GetBlockNumberOk() (*interface{}, bool)` + +GetBlockNumberOk returns a tuple with the BlockNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockNumber + +`func (o *EvmTransaction) SetBlockNumber(v interface{})` + +SetBlockNumber sets BlockNumber field to given value. + +### HasBlockNumber + +`func (o *EvmTransaction) HasBlockNumber() bool` + +HasBlockNumber returns a boolean if a field has been set. + +### SetBlockNumberNil + +`func (o *EvmTransaction) SetBlockNumberNil(b bool)` + + SetBlockNumberNil sets the value for BlockNumber to be an explicit nil + +### UnsetBlockNumber +`func (o *EvmTransaction) UnsetBlockNumber()` + +UnsetBlockNumber ensures that no value is present for BlockNumber, not even an explicit nil +### GetTransactionIndex + +`func (o *EvmTransaction) GetTransactionIndex() interface{}` + +GetTransactionIndex returns the TransactionIndex field if non-nil, zero value otherwise. + +### GetTransactionIndexOk + +`func (o *EvmTransaction) GetTransactionIndexOk() (*interface{}, bool)` + +GetTransactionIndexOk returns a tuple with the TransactionIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionIndex + +`func (o *EvmTransaction) SetTransactionIndex(v interface{})` + +SetTransactionIndex sets TransactionIndex field to given value. + +### HasTransactionIndex + +`func (o *EvmTransaction) HasTransactionIndex() bool` + +HasTransactionIndex returns a boolean if a field has been set. + +### SetTransactionIndexNil + +`func (o *EvmTransaction) SetTransactionIndexNil(b bool)` + + SetTransactionIndexNil sets the value for TransactionIndex to be an explicit nil + +### UnsetTransactionIndex +`func (o *EvmTransaction) UnsetTransactionIndex()` + +UnsetTransactionIndex ensures that no value is present for TransactionIndex, not even an explicit nil +### GetFrom + +`func (o *EvmTransaction) GetFrom() string` + +GetFrom returns the From field if non-nil, zero value otherwise. + +### GetFromOk + +`func (o *EvmTransaction) GetFromOk() (*string, bool)` + +GetFromOk returns a tuple with the From field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFrom + +`func (o *EvmTransaction) SetFrom(v string)` + +SetFrom sets From field to given value. + +### HasFrom + +`func (o *EvmTransaction) HasFrom() bool` + +HasFrom returns a boolean if a field has been set. + +### GetTo + +`func (o *EvmTransaction) GetTo() interface{}` + +GetTo returns the To field if non-nil, zero value otherwise. + +### GetToOk + +`func (o *EvmTransaction) GetToOk() (*interface{}, bool)` + +GetToOk returns a tuple with the To field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTo + +`func (o *EvmTransaction) SetTo(v interface{})` + +SetTo sets To field to given value. + +### HasTo + +`func (o *EvmTransaction) HasTo() bool` + +HasTo returns a boolean if a field has been set. + +### SetToNil + +`func (o *EvmTransaction) SetToNil(b bool)` + + SetToNil sets the value for To to be an explicit nil + +### UnsetTo +`func (o *EvmTransaction) UnsetTo()` + +UnsetTo ensures that no value is present for To, not even an explicit nil +### GetValue + +`func (o *EvmTransaction) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *EvmTransaction) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *EvmTransaction) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *EvmTransaction) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetGasPrice + +`func (o *EvmTransaction) GetGasPrice() string` + +GetGasPrice returns the GasPrice field if non-nil, zero value otherwise. + +### GetGasPriceOk + +`func (o *EvmTransaction) GetGasPriceOk() (*string, bool)` + +GetGasPriceOk returns a tuple with the GasPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasPrice + +`func (o *EvmTransaction) SetGasPrice(v string)` + +SetGasPrice sets GasPrice field to given value. + +### HasGasPrice + +`func (o *EvmTransaction) HasGasPrice() bool` + +HasGasPrice returns a boolean if a field has been set. + +### GetGas + +`func (o *EvmTransaction) GetGas() float32` + +GetGas returns the Gas field if non-nil, zero value otherwise. + +### GetGasOk + +`func (o *EvmTransaction) GetGasOk() (*float32, bool)` + +GetGasOk returns a tuple with the Gas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGas + +`func (o *EvmTransaction) SetGas(v float32)` + +SetGas sets Gas field to given value. + +### HasGas + +`func (o *EvmTransaction) HasGas() bool` + +HasGas returns a boolean if a field has been set. + +### GetInput + +`func (o *EvmTransaction) GetInput() string` + +GetInput returns the Input field if non-nil, zero value otherwise. + +### GetInputOk + +`func (o *EvmTransaction) GetInputOk() (*string, bool)` + +GetInputOk returns a tuple with the Input field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInput + +`func (o *EvmTransaction) SetInput(v string)` + +SetInput sets Input field to given value. + +### HasInput + +`func (o *EvmTransaction) HasInput() bool` + +HasInput returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBalanceV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBalanceV1Request.md new file mode 100644 index 0000000000..eb994c7664 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBalanceV1Request.md @@ -0,0 +1,87 @@ +# GetBalanceV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**DefaultBlock** | Pointer to **interface{}** | | [optional] + +## Methods + +### NewGetBalanceV1Request + +`func NewGetBalanceV1Request(address string, ) *GetBalanceV1Request` + +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 + +### NewGetBalanceV1RequestWithDefaults + +`func NewGetBalanceV1RequestWithDefaults() *GetBalanceV1Request` + +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 + +### GetAddress + +`func (o *GetBalanceV1Request) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *GetBalanceV1Request) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *GetBalanceV1Request) SetAddress(v string)` + +SetAddress sets Address field to given value. + + +### GetDefaultBlock + +`func (o *GetBalanceV1Request) GetDefaultBlock() interface{}` + +GetDefaultBlock returns the DefaultBlock field if non-nil, zero value otherwise. + +### GetDefaultBlockOk + +`func (o *GetBalanceV1Request) GetDefaultBlockOk() (*interface{}, bool)` + +GetDefaultBlockOk returns a tuple with the DefaultBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultBlock + +`func (o *GetBalanceV1Request) SetDefaultBlock(v interface{})` + +SetDefaultBlock sets DefaultBlock field to given value. + +### HasDefaultBlock + +`func (o *GetBalanceV1Request) HasDefaultBlock() bool` + +HasDefaultBlock returns a boolean if a field has been set. + +### SetDefaultBlockNil + +`func (o *GetBalanceV1Request) SetDefaultBlockNil(b bool)` + + SetDefaultBlockNil sets the value for DefaultBlock to be an explicit nil + +### UnsetDefaultBlock +`func (o *GetBalanceV1Request) UnsetDefaultBlock()` + +UnsetDefaultBlock ensures that no value is present for DefaultBlock, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBalanceV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBalanceV1Response.md new file mode 100644 index 0000000000..3b34eb7d84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBalanceV1Response.md @@ -0,0 +1,51 @@ +# GetBalanceV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Balance** | **string** | | + +## Methods + +### NewGetBalanceV1Response + +`func NewGetBalanceV1Response(balance string, ) *GetBalanceV1Response` + +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 + +### NewGetBalanceV1ResponseWithDefaults + +`func NewGetBalanceV1ResponseWithDefaults() *GetBalanceV1Response` + +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 + +### GetBalance + +`func (o *GetBalanceV1Response) GetBalance() string` + +GetBalance returns the Balance field if non-nil, zero value otherwise. + +### GetBalanceOk + +`func (o *GetBalanceV1Response) GetBalanceOk() (*string, bool)` + +GetBalanceOk returns a tuple with the Balance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBalance + +`func (o *GetBalanceV1Response) SetBalance(v string)` + +SetBalance sets Balance field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBesuRecordV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBesuRecordV1Request.md new file mode 100644 index 0000000000..eda0e030c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBesuRecordV1Request.md @@ -0,0 +1,82 @@ +# GetBesuRecordV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InvokeCall** | Pointer to [**InvokeContractV1Request**](InvokeContractV1Request.md) | | [optional] +**TransactionHash** | Pointer to **string** | | [optional] + +## Methods + +### NewGetBesuRecordV1Request + +`func NewGetBesuRecordV1Request() *GetBesuRecordV1Request` + +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 + +### NewGetBesuRecordV1RequestWithDefaults + +`func NewGetBesuRecordV1RequestWithDefaults() *GetBesuRecordV1Request` + +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 + +### GetInvokeCall + +`func (o *GetBesuRecordV1Request) GetInvokeCall() InvokeContractV1Request` + +GetInvokeCall returns the InvokeCall field if non-nil, zero value otherwise. + +### GetInvokeCallOk + +`func (o *GetBesuRecordV1Request) GetInvokeCallOk() (*InvokeContractV1Request, bool)` + +GetInvokeCallOk returns a tuple with the InvokeCall field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvokeCall + +`func (o *GetBesuRecordV1Request) SetInvokeCall(v InvokeContractV1Request)` + +SetInvokeCall sets InvokeCall field to given value. + +### HasInvokeCall + +`func (o *GetBesuRecordV1Request) HasInvokeCall() bool` + +HasInvokeCall returns a boolean if a field has been set. + +### GetTransactionHash + +`func (o *GetBesuRecordV1Request) GetTransactionHash() string` + +GetTransactionHash returns the TransactionHash field if non-nil, zero value otherwise. + +### GetTransactionHashOk + +`func (o *GetBesuRecordV1Request) GetTransactionHashOk() (*string, bool)` + +GetTransactionHashOk returns a tuple with the TransactionHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionHash + +`func (o *GetBesuRecordV1Request) SetTransactionHash(v string)` + +SetTransactionHash sets TransactionHash field to given value. + +### HasTransactionHash + +`func (o *GetBesuRecordV1Request) HasTransactionHash() bool` + +HasTransactionHash returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBesuRecordV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBesuRecordV1Response.md new file mode 100644 index 0000000000..512bd2e234 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBesuRecordV1Response.md @@ -0,0 +1,154 @@ +# GetBesuRecordV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LedgerId** | Pointer to **string** | | [optional] +**StateContract** | Pointer to **string** | | [optional] +**TransactionInputData** | Pointer to **interface{}** | | [optional] +**CallOutput** | Pointer to **interface{}** | | [optional] + +## Methods + +### NewGetBesuRecordV1Response + +`func NewGetBesuRecordV1Response() *GetBesuRecordV1Response` + +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 + +### NewGetBesuRecordV1ResponseWithDefaults + +`func NewGetBesuRecordV1ResponseWithDefaults() *GetBesuRecordV1Response` + +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 + +### GetLedgerId + +`func (o *GetBesuRecordV1Response) GetLedgerId() string` + +GetLedgerId returns the LedgerId field if non-nil, zero value otherwise. + +### GetLedgerIdOk + +`func (o *GetBesuRecordV1Response) GetLedgerIdOk() (*string, bool)` + +GetLedgerIdOk returns a tuple with the LedgerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLedgerId + +`func (o *GetBesuRecordV1Response) SetLedgerId(v string)` + +SetLedgerId sets LedgerId field to given value. + +### HasLedgerId + +`func (o *GetBesuRecordV1Response) HasLedgerId() bool` + +HasLedgerId returns a boolean if a field has been set. + +### GetStateContract + +`func (o *GetBesuRecordV1Response) GetStateContract() string` + +GetStateContract returns the StateContract field if non-nil, zero value otherwise. + +### GetStateContractOk + +`func (o *GetBesuRecordV1Response) GetStateContractOk() (*string, bool)` + +GetStateContractOk returns a tuple with the StateContract field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateContract + +`func (o *GetBesuRecordV1Response) SetStateContract(v string)` + +SetStateContract sets StateContract field to given value. + +### HasStateContract + +`func (o *GetBesuRecordV1Response) HasStateContract() bool` + +HasStateContract returns a boolean if a field has been set. + +### GetTransactionInputData + +`func (o *GetBesuRecordV1Response) GetTransactionInputData() interface{}` + +GetTransactionInputData returns the TransactionInputData field if non-nil, zero value otherwise. + +### GetTransactionInputDataOk + +`func (o *GetBesuRecordV1Response) GetTransactionInputDataOk() (*interface{}, bool)` + +GetTransactionInputDataOk returns a tuple with the TransactionInputData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionInputData + +`func (o *GetBesuRecordV1Response) SetTransactionInputData(v interface{})` + +SetTransactionInputData sets TransactionInputData field to given value. + +### HasTransactionInputData + +`func (o *GetBesuRecordV1Response) HasTransactionInputData() bool` + +HasTransactionInputData returns a boolean if a field has been set. + +### SetTransactionInputDataNil + +`func (o *GetBesuRecordV1Response) SetTransactionInputDataNil(b bool)` + + SetTransactionInputDataNil sets the value for TransactionInputData to be an explicit nil + +### UnsetTransactionInputData +`func (o *GetBesuRecordV1Response) UnsetTransactionInputData()` + +UnsetTransactionInputData ensures that no value is present for TransactionInputData, not even an explicit nil +### GetCallOutput + +`func (o *GetBesuRecordV1Response) GetCallOutput() interface{}` + +GetCallOutput returns the CallOutput field if non-nil, zero value otherwise. + +### GetCallOutputOk + +`func (o *GetBesuRecordV1Response) GetCallOutputOk() (*interface{}, bool)` + +GetCallOutputOk returns a tuple with the CallOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCallOutput + +`func (o *GetBesuRecordV1Response) SetCallOutput(v interface{})` + +SetCallOutput sets CallOutput field to given value. + +### HasCallOutput + +`func (o *GetBesuRecordV1Response) HasCallOutput() bool` + +HasCallOutput returns a boolean if a field has been set. + +### SetCallOutputNil + +`func (o *GetBesuRecordV1Response) SetCallOutputNil(b bool)` + + SetCallOutputNil sets the value for CallOutput to be an explicit nil + +### UnsetCallOutput +`func (o *GetBesuRecordV1Response) UnsetCallOutput()` + +UnsetCallOutput ensures that no value is present for CallOutput, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBlockV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBlockV1Request.md new file mode 100644 index 0000000000..efe6927fcf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBlockV1Request.md @@ -0,0 +1,61 @@ +# GetBlockV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BlockHashOrBlockNumber** | **interface{}** | | + +## Methods + +### NewGetBlockV1Request + +`func NewGetBlockV1Request(blockHashOrBlockNumber interface{}, ) *GetBlockV1Request` + +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 + +### NewGetBlockV1RequestWithDefaults + +`func NewGetBlockV1RequestWithDefaults() *GetBlockV1Request` + +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 + +### GetBlockHashOrBlockNumber + +`func (o *GetBlockV1Request) GetBlockHashOrBlockNumber() interface{}` + +GetBlockHashOrBlockNumber returns the BlockHashOrBlockNumber field if non-nil, zero value otherwise. + +### GetBlockHashOrBlockNumberOk + +`func (o *GetBlockV1Request) GetBlockHashOrBlockNumberOk() (*interface{}, bool)` + +GetBlockHashOrBlockNumberOk returns a tuple with the BlockHashOrBlockNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockHashOrBlockNumber + +`func (o *GetBlockV1Request) SetBlockHashOrBlockNumber(v interface{})` + +SetBlockHashOrBlockNumber sets BlockHashOrBlockNumber field to given value. + + +### SetBlockHashOrBlockNumberNil + +`func (o *GetBlockV1Request) SetBlockHashOrBlockNumberNil(b bool)` + + SetBlockHashOrBlockNumberNil sets the value for BlockHashOrBlockNumber to be an explicit nil + +### UnsetBlockHashOrBlockNumber +`func (o *GetBlockV1Request) UnsetBlockHashOrBlockNumber()` + +UnsetBlockHashOrBlockNumber ensures that no value is present for BlockHashOrBlockNumber, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBlockV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBlockV1Response.md new file mode 100644 index 0000000000..266296e8d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetBlockV1Response.md @@ -0,0 +1,51 @@ +# GetBlockV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Block** | [**EvmBlock**](EvmBlock.md) | | + +## Methods + +### NewGetBlockV1Response + +`func NewGetBlockV1Response(block EvmBlock, ) *GetBlockV1Response` + +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 + +### NewGetBlockV1ResponseWithDefaults + +`func NewGetBlockV1ResponseWithDefaults() *GetBlockV1Response` + +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 + +### GetBlock + +`func (o *GetBlockV1Response) GetBlock() EvmBlock` + +GetBlock returns the Block field if non-nil, zero value otherwise. + +### GetBlockOk + +`func (o *GetBlockV1Response) GetBlockOk() (*EvmBlock, bool)` + +GetBlockOk returns a tuple with the Block field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlock + +`func (o *GetBlockV1Response) SetBlock(v EvmBlock)` + +SetBlock sets Block field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetPastLogsV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetPastLogsV1Request.md new file mode 100644 index 0000000000..117a938dc4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetPastLogsV1Request.md @@ -0,0 +1,164 @@ +# GetPastLogsV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ToBlock** | Pointer to **interface{}** | | [optional] +**FromBlock** | Pointer to **interface{}** | | [optional] +**Address** | Pointer to **interface{}** | | [optional] +**Topics** | Pointer to **[]interface{}** | | [optional] + +## Methods + +### NewGetPastLogsV1Request + +`func NewGetPastLogsV1Request() *GetPastLogsV1Request` + +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 + +### NewGetPastLogsV1RequestWithDefaults + +`func NewGetPastLogsV1RequestWithDefaults() *GetPastLogsV1Request` + +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 + +### GetToBlock + +`func (o *GetPastLogsV1Request) GetToBlock() interface{}` + +GetToBlock returns the ToBlock field if non-nil, zero value otherwise. + +### GetToBlockOk + +`func (o *GetPastLogsV1Request) GetToBlockOk() (*interface{}, bool)` + +GetToBlockOk returns a tuple with the ToBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToBlock + +`func (o *GetPastLogsV1Request) SetToBlock(v interface{})` + +SetToBlock sets ToBlock field to given value. + +### HasToBlock + +`func (o *GetPastLogsV1Request) HasToBlock() bool` + +HasToBlock returns a boolean if a field has been set. + +### SetToBlockNil + +`func (o *GetPastLogsV1Request) SetToBlockNil(b bool)` + + SetToBlockNil sets the value for ToBlock to be an explicit nil + +### UnsetToBlock +`func (o *GetPastLogsV1Request) UnsetToBlock()` + +UnsetToBlock ensures that no value is present for ToBlock, not even an explicit nil +### GetFromBlock + +`func (o *GetPastLogsV1Request) GetFromBlock() interface{}` + +GetFromBlock returns the FromBlock field if non-nil, zero value otherwise. + +### GetFromBlockOk + +`func (o *GetPastLogsV1Request) GetFromBlockOk() (*interface{}, bool)` + +GetFromBlockOk returns a tuple with the FromBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFromBlock + +`func (o *GetPastLogsV1Request) SetFromBlock(v interface{})` + +SetFromBlock sets FromBlock field to given value. + +### HasFromBlock + +`func (o *GetPastLogsV1Request) HasFromBlock() bool` + +HasFromBlock returns a boolean if a field has been set. + +### SetFromBlockNil + +`func (o *GetPastLogsV1Request) SetFromBlockNil(b bool)` + + SetFromBlockNil sets the value for FromBlock to be an explicit nil + +### UnsetFromBlock +`func (o *GetPastLogsV1Request) UnsetFromBlock()` + +UnsetFromBlock ensures that no value is present for FromBlock, not even an explicit nil +### GetAddress + +`func (o *GetPastLogsV1Request) GetAddress() interface{}` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *GetPastLogsV1Request) GetAddressOk() (*interface{}, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *GetPastLogsV1Request) SetAddress(v interface{})` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *GetPastLogsV1Request) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### SetAddressNil + +`func (o *GetPastLogsV1Request) SetAddressNil(b bool)` + + SetAddressNil sets the value for Address to be an explicit nil + +### UnsetAddress +`func (o *GetPastLogsV1Request) UnsetAddress()` + +UnsetAddress ensures that no value is present for Address, not even an explicit nil +### GetTopics + +`func (o *GetPastLogsV1Request) GetTopics() []interface{}` + +GetTopics returns the Topics field if non-nil, zero value otherwise. + +### GetTopicsOk + +`func (o *GetPastLogsV1Request) GetTopicsOk() (*[]interface{}, bool)` + +GetTopicsOk returns a tuple with the Topics field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTopics + +`func (o *GetPastLogsV1Request) SetTopics(v []interface{})` + +SetTopics sets Topics field to given value. + +### HasTopics + +`func (o *GetPastLogsV1Request) HasTopics() bool` + +HasTopics returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetPastLogsV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetPastLogsV1Response.md new file mode 100644 index 0000000000..e93d96d815 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetPastLogsV1Response.md @@ -0,0 +1,51 @@ +# GetPastLogsV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Logs** | [**[]EvmLog**](EvmLog.md) | | + +## Methods + +### NewGetPastLogsV1Response + +`func NewGetPastLogsV1Response(logs []EvmLog, ) *GetPastLogsV1Response` + +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 + +### NewGetPastLogsV1ResponseWithDefaults + +`func NewGetPastLogsV1ResponseWithDefaults() *GetPastLogsV1Response` + +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 + +### GetLogs + +`func (o *GetPastLogsV1Response) GetLogs() []EvmLog` + +GetLogs returns the Logs field if non-nil, zero value otherwise. + +### GetLogsOk + +`func (o *GetPastLogsV1Response) GetLogsOk() (*[]EvmLog, bool)` + +GetLogsOk returns a tuple with the Logs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogs + +`func (o *GetPastLogsV1Response) SetLogs(v []EvmLog)` + +SetLogs sets Logs field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetTransactionV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetTransactionV1Request.md new file mode 100644 index 0000000000..e4475e6fc0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetTransactionV1Request.md @@ -0,0 +1,51 @@ +# GetTransactionV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TransactionHash** | **string** | | + +## Methods + +### NewGetTransactionV1Request + +`func NewGetTransactionV1Request(transactionHash string, ) *GetTransactionV1Request` + +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 + +### NewGetTransactionV1RequestWithDefaults + +`func NewGetTransactionV1RequestWithDefaults() *GetTransactionV1Request` + +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 + +### GetTransactionHash + +`func (o *GetTransactionV1Request) GetTransactionHash() string` + +GetTransactionHash returns the TransactionHash field if non-nil, zero value otherwise. + +### GetTransactionHashOk + +`func (o *GetTransactionV1Request) GetTransactionHashOk() (*string, bool)` + +GetTransactionHashOk returns a tuple with the TransactionHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionHash + +`func (o *GetTransactionV1Request) SetTransactionHash(v string)` + +SetTransactionHash sets TransactionHash field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetTransactionV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetTransactionV1Response.md new file mode 100644 index 0000000000..f5e172748c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/GetTransactionV1Response.md @@ -0,0 +1,51 @@ +# GetTransactionV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Transaction** | [**EvmTransaction**](EvmTransaction.md) | | + +## Methods + +### NewGetTransactionV1Response + +`func NewGetTransactionV1Response(transaction EvmTransaction, ) *GetTransactionV1Response` + +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 + +### NewGetTransactionV1ResponseWithDefaults + +`func NewGetTransactionV1ResponseWithDefaults() *GetTransactionV1Response` + +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 + +### GetTransaction + +`func (o *GetTransactionV1Response) GetTransaction() EvmTransaction` + +GetTransaction returns the Transaction field if non-nil, zero value otherwise. + +### GetTransactionOk + +`func (o *GetTransactionV1Response) GetTransactionOk() (*EvmTransaction, bool)` + +GetTransactionOk returns a tuple with the Transaction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransaction + +`func (o *GetTransactionV1Response) SetTransaction(v EvmTransaction)` + +SetTransaction sets Transaction field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/InvokeContractV1Request.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/InvokeContractV1Request.md new file mode 100644 index 0000000000..1dfdf29f9b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/InvokeContractV1Request.md @@ -0,0 +1,369 @@ +# InvokeContractV1Request + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContractName** | **string** | | +**SigningCredential** | [**Web3SigningCredential**](Web3SigningCredential.md) | | +**InvocationType** | [**EthContractInvocationType**](EthContractInvocationType.md) | | +**MethodName** | **string** | The name of the contract method to invoke. | +**Params** | **[]interface{}** | The list of arguments to pass in to the contract method being invoked. | [default to []] +**ContractAbi** | Pointer to **[]interface{}** | The application binary interface of the solidity contract, optional parameter | [optional] +**ContractAddress** | Pointer to **string** | Address of the solidity contract, optional parameter | [optional] +**Value** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**Gas** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**GasPrice** | Pointer to [**Web3BlockHeaderTimestamp**](Web3BlockHeaderTimestamp.md) | | [optional] +**Nonce** | Pointer to **float32** | | [optional] +**TimeoutMs** | Pointer to **float32** | The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND | [optional] [default to 60000] +**KeychainId** | Pointer to **string** | The keychainId for retrieve the contracts json. | [optional] +**PrivateTransactionConfig** | Pointer to [**BesuPrivateTransactionConfig**](BesuPrivateTransactionConfig.md) | | [optional] + +## Methods + +### NewInvokeContractV1Request + +`func NewInvokeContractV1Request(contractName string, signingCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, ) *InvokeContractV1Request` + +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 + +### NewInvokeContractV1RequestWithDefaults + +`func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request` + +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 + +### GetContractName + +`func (o *InvokeContractV1Request) GetContractName() string` + +GetContractName returns the ContractName field if non-nil, zero value otherwise. + +### GetContractNameOk + +`func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool)` + +GetContractNameOk returns a tuple with the ContractName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractName + +`func (o *InvokeContractV1Request) SetContractName(v string)` + +SetContractName sets ContractName field to given value. + + +### GetSigningCredential + +`func (o *InvokeContractV1Request) GetSigningCredential() Web3SigningCredential` + +GetSigningCredential returns the SigningCredential field if non-nil, zero value otherwise. + +### GetSigningCredentialOk + +`func (o *InvokeContractV1Request) GetSigningCredentialOk() (*Web3SigningCredential, bool)` + +GetSigningCredentialOk returns a tuple with the SigningCredential field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSigningCredential + +`func (o *InvokeContractV1Request) SetSigningCredential(v Web3SigningCredential)` + +SetSigningCredential sets SigningCredential field to given value. + + +### GetInvocationType + +`func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType` + +GetInvocationType returns the InvocationType field if non-nil, zero value otherwise. + +### GetInvocationTypeOk + +`func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool)` + +GetInvocationTypeOk returns a tuple with the InvocationType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvocationType + +`func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType)` + +SetInvocationType sets InvocationType field to given value. + + +### GetMethodName + +`func (o *InvokeContractV1Request) GetMethodName() string` + +GetMethodName returns the MethodName field if non-nil, zero value otherwise. + +### GetMethodNameOk + +`func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool)` + +GetMethodNameOk returns a tuple with the MethodName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethodName + +`func (o *InvokeContractV1Request) SetMethodName(v string)` + +SetMethodName sets MethodName field to given value. + + +### GetParams + +`func (o *InvokeContractV1Request) GetParams() []interface{}` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *InvokeContractV1Request) GetParamsOk() (*[]interface{}, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *InvokeContractV1Request) SetParams(v []interface{})` + +SetParams sets Params field to given value. + + +### GetContractAbi + +`func (o *InvokeContractV1Request) GetContractAbi() []interface{}` + +GetContractAbi returns the ContractAbi field if non-nil, zero value otherwise. + +### GetContractAbiOk + +`func (o *InvokeContractV1Request) GetContractAbiOk() (*[]interface{}, bool)` + +GetContractAbiOk returns a tuple with the ContractAbi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractAbi + +`func (o *InvokeContractV1Request) SetContractAbi(v []interface{})` + +SetContractAbi sets ContractAbi field to given value. + +### HasContractAbi + +`func (o *InvokeContractV1Request) HasContractAbi() bool` + +HasContractAbi returns a boolean if a field has been set. + +### GetContractAddress + +`func (o *InvokeContractV1Request) GetContractAddress() string` + +GetContractAddress returns the ContractAddress field if non-nil, zero value otherwise. + +### GetContractAddressOk + +`func (o *InvokeContractV1Request) GetContractAddressOk() (*string, bool)` + +GetContractAddressOk returns a tuple with the ContractAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractAddress + +`func (o *InvokeContractV1Request) SetContractAddress(v string)` + +SetContractAddress sets ContractAddress field to given value. + +### HasContractAddress + +`func (o *InvokeContractV1Request) HasContractAddress() bool` + +HasContractAddress returns a boolean if a field has been set. + +### GetValue + +`func (o *InvokeContractV1Request) GetValue() Web3BlockHeaderTimestamp` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *InvokeContractV1Request) GetValueOk() (*Web3BlockHeaderTimestamp, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *InvokeContractV1Request) SetValue(v Web3BlockHeaderTimestamp)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *InvokeContractV1Request) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetGas + +`func (o *InvokeContractV1Request) GetGas() Web3BlockHeaderTimestamp` + +GetGas returns the Gas field if non-nil, zero value otherwise. + +### GetGasOk + +`func (o *InvokeContractV1Request) GetGasOk() (*Web3BlockHeaderTimestamp, bool)` + +GetGasOk returns a tuple with the Gas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGas + +`func (o *InvokeContractV1Request) SetGas(v Web3BlockHeaderTimestamp)` + +SetGas sets Gas field to given value. + +### HasGas + +`func (o *InvokeContractV1Request) HasGas() bool` + +HasGas returns a boolean if a field has been set. + +### GetGasPrice + +`func (o *InvokeContractV1Request) GetGasPrice() Web3BlockHeaderTimestamp` + +GetGasPrice returns the GasPrice field if non-nil, zero value otherwise. + +### GetGasPriceOk + +`func (o *InvokeContractV1Request) GetGasPriceOk() (*Web3BlockHeaderTimestamp, bool)` + +GetGasPriceOk returns a tuple with the GasPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasPrice + +`func (o *InvokeContractV1Request) SetGasPrice(v Web3BlockHeaderTimestamp)` + +SetGasPrice sets GasPrice field to given value. + +### HasGasPrice + +`func (o *InvokeContractV1Request) HasGasPrice() bool` + +HasGasPrice returns a boolean if a field has been set. + +### GetNonce + +`func (o *InvokeContractV1Request) GetNonce() float32` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *InvokeContractV1Request) SetNonce(v float32)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *InvokeContractV1Request) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + +### GetTimeoutMs + +`func (o *InvokeContractV1Request) GetTimeoutMs() float32` + +GetTimeoutMs returns the TimeoutMs field if non-nil, zero value otherwise. + +### GetTimeoutMsOk + +`func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool)` + +GetTimeoutMsOk returns a tuple with the TimeoutMs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutMs + +`func (o *InvokeContractV1Request) SetTimeoutMs(v float32)` + +SetTimeoutMs sets TimeoutMs field to given value. + +### HasTimeoutMs + +`func (o *InvokeContractV1Request) HasTimeoutMs() bool` + +HasTimeoutMs returns a boolean if a field has been set. + +### GetKeychainId + +`func (o *InvokeContractV1Request) GetKeychainId() string` + +GetKeychainId returns the KeychainId field if non-nil, zero value otherwise. + +### GetKeychainIdOk + +`func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool)` + +GetKeychainIdOk returns a tuple with the KeychainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainId + +`func (o *InvokeContractV1Request) SetKeychainId(v string)` + +SetKeychainId sets KeychainId field to given value. + +### HasKeychainId + +`func (o *InvokeContractV1Request) HasKeychainId() bool` + +HasKeychainId returns a boolean if a field has been set. + +### GetPrivateTransactionConfig + +`func (o *InvokeContractV1Request) GetPrivateTransactionConfig() BesuPrivateTransactionConfig` + +GetPrivateTransactionConfig returns the PrivateTransactionConfig field if non-nil, zero value otherwise. + +### GetPrivateTransactionConfigOk + +`func (o *InvokeContractV1Request) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool)` + +GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateTransactionConfig + +`func (o *InvokeContractV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig)` + +SetPrivateTransactionConfig sets PrivateTransactionConfig field to given value. + +### HasPrivateTransactionConfig + +`func (o *InvokeContractV1Request) HasPrivateTransactionConfig() bool` + +HasPrivateTransactionConfig returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/InvokeContractV1Response.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/InvokeContractV1Response.md new file mode 100644 index 0000000000..6cf166a75b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/InvokeContractV1Response.md @@ -0,0 +1,113 @@ +# InvokeContractV1Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TransactionReceipt** | Pointer to [**Web3TransactionReceipt**](Web3TransactionReceipt.md) | | [optional] +**CallOutput** | Pointer to **interface{}** | | [optional] +**Success** | **bool** | | + +## Methods + +### NewInvokeContractV1Response + +`func NewInvokeContractV1Response(success bool, ) *InvokeContractV1Response` + +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 + +### NewInvokeContractV1ResponseWithDefaults + +`func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response` + +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 + +### GetTransactionReceipt + +`func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt` + +GetTransactionReceipt returns the TransactionReceipt field if non-nil, zero value otherwise. + +### GetTransactionReceiptOk + +`func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool)` + +GetTransactionReceiptOk returns a tuple with the TransactionReceipt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionReceipt + +`func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt)` + +SetTransactionReceipt sets TransactionReceipt field to given value. + +### HasTransactionReceipt + +`func (o *InvokeContractV1Response) HasTransactionReceipt() bool` + +HasTransactionReceipt returns a boolean if a field has been set. + +### GetCallOutput + +`func (o *InvokeContractV1Response) GetCallOutput() interface{}` + +GetCallOutput returns the CallOutput field if non-nil, zero value otherwise. + +### GetCallOutputOk + +`func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool)` + +GetCallOutputOk returns a tuple with the CallOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCallOutput + +`func (o *InvokeContractV1Response) SetCallOutput(v interface{})` + +SetCallOutput sets CallOutput field to given value. + +### HasCallOutput + +`func (o *InvokeContractV1Response) HasCallOutput() bool` + +HasCallOutput returns a boolean if a field has been set. + +### SetCallOutputNil + +`func (o *InvokeContractV1Response) SetCallOutputNil(b bool)` + + SetCallOutputNil sets the value for CallOutput to be an explicit nil + +### UnsetCallOutput +`func (o *InvokeContractV1Response) UnsetCallOutput()` + +UnsetCallOutput ensures that no value is present for CallOutput, not even an explicit nil +### GetSuccess + +`func (o *InvokeContractV1Response) GetSuccess() bool` + +GetSuccess returns the Success field if non-nil, zero value otherwise. + +### GetSuccessOk + +`func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool)` + +GetSuccessOk returns a tuple with the Success field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccess + +`func (o *InvokeContractV1Response) SetSuccess(v bool)` + +SetSuccess sets Success field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/ReceiptType.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/ReceiptType.md new file mode 100644 index 0000000000..021b052f82 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/ReceiptType.md @@ -0,0 +1,13 @@ +# ReceiptType + +## Enum + + +* `NODE_TX_POOL_ACK` (value: `"NODE_TX_POOL_ACK"`) + +* `LEDGER_BLOCK_ACK` (value: `"LEDGER_BLOCK_ACK"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/RunTransactionRequest.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/RunTransactionRequest.md new file mode 100644 index 0000000000..aa5b55d9ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/RunTransactionRequest.md @@ -0,0 +1,119 @@ +# RunTransactionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Web3SigningCredential** | [**Web3SigningCredential**](Web3SigningCredential.md) | | +**TransactionConfig** | [**BesuTransactionConfig**](BesuTransactionConfig.md) | | +**ConsistencyStrategy** | [**ConsistencyStrategy**](ConsistencyStrategy.md) | | +**PrivateTransactionConfig** | Pointer to [**BesuPrivateTransactionConfig**](BesuPrivateTransactionConfig.md) | | [optional] + +## Methods + +### NewRunTransactionRequest + +`func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig BesuTransactionConfig, consistencyStrategy ConsistencyStrategy, ) *RunTransactionRequest` + +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 + +### NewRunTransactionRequestWithDefaults + +`func NewRunTransactionRequestWithDefaults() *RunTransactionRequest` + +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 + +### GetWeb3SigningCredential + +`func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential` + +GetWeb3SigningCredential returns the Web3SigningCredential field if non-nil, zero value otherwise. + +### GetWeb3SigningCredentialOk + +`func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool)` + +GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWeb3SigningCredential + +`func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential)` + +SetWeb3SigningCredential sets Web3SigningCredential field to given value. + + +### GetTransactionConfig + +`func (o *RunTransactionRequest) GetTransactionConfig() BesuTransactionConfig` + +GetTransactionConfig returns the TransactionConfig field if non-nil, zero value otherwise. + +### GetTransactionConfigOk + +`func (o *RunTransactionRequest) GetTransactionConfigOk() (*BesuTransactionConfig, bool)` + +GetTransactionConfigOk returns a tuple with the TransactionConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionConfig + +`func (o *RunTransactionRequest) SetTransactionConfig(v BesuTransactionConfig)` + +SetTransactionConfig sets TransactionConfig field to given value. + + +### GetConsistencyStrategy + +`func (o *RunTransactionRequest) GetConsistencyStrategy() ConsistencyStrategy` + +GetConsistencyStrategy returns the ConsistencyStrategy field if non-nil, zero value otherwise. + +### GetConsistencyStrategyOk + +`func (o *RunTransactionRequest) GetConsistencyStrategyOk() (*ConsistencyStrategy, bool)` + +GetConsistencyStrategyOk returns a tuple with the ConsistencyStrategy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConsistencyStrategy + +`func (o *RunTransactionRequest) SetConsistencyStrategy(v ConsistencyStrategy)` + +SetConsistencyStrategy sets ConsistencyStrategy field to given value. + + +### GetPrivateTransactionConfig + +`func (o *RunTransactionRequest) GetPrivateTransactionConfig() BesuPrivateTransactionConfig` + +GetPrivateTransactionConfig returns the PrivateTransactionConfig field if non-nil, zero value otherwise. + +### GetPrivateTransactionConfigOk + +`func (o *RunTransactionRequest) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool)` + +GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateTransactionConfig + +`func (o *RunTransactionRequest) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig)` + +SetPrivateTransactionConfig sets PrivateTransactionConfig field to given value. + +### HasPrivateTransactionConfig + +`func (o *RunTransactionRequest) HasPrivateTransactionConfig() bool` + +HasPrivateTransactionConfig returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/RunTransactionResponse.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/RunTransactionResponse.md new file mode 100644 index 0000000000..3d96e8d596 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/RunTransactionResponse.md @@ -0,0 +1,51 @@ +# RunTransactionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TransactionReceipt** | [**Web3TransactionReceipt**](Web3TransactionReceipt.md) | | + +## Methods + +### NewRunTransactionResponse + +`func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt, ) *RunTransactionResponse` + +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 + +### NewRunTransactionResponseWithDefaults + +`func NewRunTransactionResponseWithDefaults() *RunTransactionResponse` + +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 + +### GetTransactionReceipt + +`func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt` + +GetTransactionReceipt returns the TransactionReceipt field if non-nil, zero value otherwise. + +### GetTransactionReceiptOk + +`func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool)` + +GetTransactionReceiptOk returns a tuple with the TransactionReceipt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionReceipt + +`func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt)` + +SetTransactionReceipt sets TransactionReceipt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SignTransactionRequest.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SignTransactionRequest.md new file mode 100644 index 0000000000..c442da72cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SignTransactionRequest.md @@ -0,0 +1,93 @@ +# SignTransactionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KeychainId** | **string** | | +**KeychainRef** | **string** | | +**TransactionHash** | **string** | The transaction hash of ledger will be used to fetch the contain. | + +## Methods + +### NewSignTransactionRequest + +`func NewSignTransactionRequest(keychainId string, keychainRef string, transactionHash string, ) *SignTransactionRequest` + +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 + +### NewSignTransactionRequestWithDefaults + +`func NewSignTransactionRequestWithDefaults() *SignTransactionRequest` + +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 + +### GetKeychainId + +`func (o *SignTransactionRequest) GetKeychainId() string` + +GetKeychainId returns the KeychainId field if non-nil, zero value otherwise. + +### GetKeychainIdOk + +`func (o *SignTransactionRequest) GetKeychainIdOk() (*string, bool)` + +GetKeychainIdOk returns a tuple with the KeychainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainId + +`func (o *SignTransactionRequest) SetKeychainId(v string)` + +SetKeychainId sets KeychainId field to given value. + + +### GetKeychainRef + +`func (o *SignTransactionRequest) GetKeychainRef() string` + +GetKeychainRef returns the KeychainRef field if non-nil, zero value otherwise. + +### GetKeychainRefOk + +`func (o *SignTransactionRequest) GetKeychainRefOk() (*string, bool)` + +GetKeychainRefOk returns a tuple with the KeychainRef field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainRef + +`func (o *SignTransactionRequest) SetKeychainRef(v string)` + +SetKeychainRef sets KeychainRef field to given value. + + +### GetTransactionHash + +`func (o *SignTransactionRequest) GetTransactionHash() string` + +GetTransactionHash returns the TransactionHash field if non-nil, zero value otherwise. + +### GetTransactionHashOk + +`func (o *SignTransactionRequest) GetTransactionHashOk() (*string, bool)` + +GetTransactionHashOk returns a tuple with the TransactionHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionHash + +`func (o *SignTransactionRequest) SetTransactionHash(v string)` + +SetTransactionHash sets TransactionHash field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SignTransactionResponse.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SignTransactionResponse.md new file mode 100644 index 0000000000..03971c8305 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SignTransactionResponse.md @@ -0,0 +1,51 @@ +# SignTransactionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Signature** | **string** | The signatures of ledger from the corresponding transaction hash. | + +## Methods + +### NewSignTransactionResponse + +`func NewSignTransactionResponse(signature string, ) *SignTransactionResponse` + +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 + +### NewSignTransactionResponseWithDefaults + +`func NewSignTransactionResponseWithDefaults() *SignTransactionResponse` + +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 + +### GetSignature + +`func (o *SignTransactionResponse) GetSignature() string` + +GetSignature returns the Signature field if non-nil, zero value otherwise. + +### GetSignatureOk + +`func (o *SignTransactionResponse) GetSignatureOk() (*string, bool)` + +GetSignatureOk returns a tuple with the Signature field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSignature + +`func (o *SignTransactionResponse) SetSignature(v string)` + +SetSignature sets Signature field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifact.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifact.md new file mode 100644 index 0000000000..602f52bdc3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifact.md @@ -0,0 +1,285 @@ +# SolidityContractJsonArtifact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContractName** | **string** | | +**Metadata** | Pointer to **string** | | [optional] +**Bytecode** | Pointer to **string** | | [optional] +**DeployedBytecode** | Pointer to **string** | | [optional] +**SourceMap** | Pointer to **string** | | [optional] +**DeployedSourceMap** | Pointer to **string** | | [optional] +**SourcePath** | Pointer to **string** | | [optional] +**Compiler** | Pointer to [**SolidityContractJsonArtifactCompiler**](SolidityContractJsonArtifactCompiler.md) | | [optional] +**FunctionHashes** | Pointer to **map[string]interface{}** | | [optional] +**GasEstimates** | Pointer to [**SolidityContractJsonArtifactGasEstimates**](SolidityContractJsonArtifactGasEstimates.md) | | [optional] + +## Methods + +### NewSolidityContractJsonArtifact + +`func NewSolidityContractJsonArtifact(contractName string, ) *SolidityContractJsonArtifact` + +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 + +### NewSolidityContractJsonArtifactWithDefaults + +`func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact` + +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 + +### GetContractName + +`func (o *SolidityContractJsonArtifact) GetContractName() string` + +GetContractName returns the ContractName field if non-nil, zero value otherwise. + +### GetContractNameOk + +`func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool)` + +GetContractNameOk returns a tuple with the ContractName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractName + +`func (o *SolidityContractJsonArtifact) SetContractName(v string)` + +SetContractName sets ContractName field to given value. + + +### GetMetadata + +`func (o *SolidityContractJsonArtifact) GetMetadata() string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *SolidityContractJsonArtifact) SetMetadata(v string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *SolidityContractJsonArtifact) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetBytecode + +`func (o *SolidityContractJsonArtifact) GetBytecode() string` + +GetBytecode returns the Bytecode field if non-nil, zero value otherwise. + +### GetBytecodeOk + +`func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool)` + +GetBytecodeOk returns a tuple with the Bytecode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBytecode + +`func (o *SolidityContractJsonArtifact) SetBytecode(v string)` + +SetBytecode sets Bytecode field to given value. + +### HasBytecode + +`func (o *SolidityContractJsonArtifact) HasBytecode() bool` + +HasBytecode returns a boolean if a field has been set. + +### GetDeployedBytecode + +`func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string` + +GetDeployedBytecode returns the DeployedBytecode field if non-nil, zero value otherwise. + +### GetDeployedBytecodeOk + +`func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool)` + +GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeployedBytecode + +`func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string)` + +SetDeployedBytecode sets DeployedBytecode field to given value. + +### HasDeployedBytecode + +`func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool` + +HasDeployedBytecode returns a boolean if a field has been set. + +### GetSourceMap + +`func (o *SolidityContractJsonArtifact) GetSourceMap() string` + +GetSourceMap returns the SourceMap field if non-nil, zero value otherwise. + +### GetSourceMapOk + +`func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool)` + +GetSourceMapOk returns a tuple with the SourceMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceMap + +`func (o *SolidityContractJsonArtifact) SetSourceMap(v string)` + +SetSourceMap sets SourceMap field to given value. + +### HasSourceMap + +`func (o *SolidityContractJsonArtifact) HasSourceMap() bool` + +HasSourceMap returns a boolean if a field has been set. + +### GetDeployedSourceMap + +`func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string` + +GetDeployedSourceMap returns the DeployedSourceMap field if non-nil, zero value otherwise. + +### GetDeployedSourceMapOk + +`func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool)` + +GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeployedSourceMap + +`func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string)` + +SetDeployedSourceMap sets DeployedSourceMap field to given value. + +### HasDeployedSourceMap + +`func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool` + +HasDeployedSourceMap returns a boolean if a field has been set. + +### GetSourcePath + +`func (o *SolidityContractJsonArtifact) GetSourcePath() string` + +GetSourcePath returns the SourcePath field if non-nil, zero value otherwise. + +### GetSourcePathOk + +`func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool)` + +GetSourcePathOk returns a tuple with the SourcePath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourcePath + +`func (o *SolidityContractJsonArtifact) SetSourcePath(v string)` + +SetSourcePath sets SourcePath field to given value. + +### HasSourcePath + +`func (o *SolidityContractJsonArtifact) HasSourcePath() bool` + +HasSourcePath returns a boolean if a field has been set. + +### GetCompiler + +`func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler` + +GetCompiler returns the Compiler field if non-nil, zero value otherwise. + +### GetCompilerOk + +`func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool)` + +GetCompilerOk returns a tuple with the Compiler field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompiler + +`func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler)` + +SetCompiler sets Compiler field to given value. + +### HasCompiler + +`func (o *SolidityContractJsonArtifact) HasCompiler() bool` + +HasCompiler returns a boolean if a field has been set. + +### GetFunctionHashes + +`func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{}` + +GetFunctionHashes returns the FunctionHashes field if non-nil, zero value otherwise. + +### GetFunctionHashesOk + +`func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (*map[string]interface{}, bool)` + +GetFunctionHashesOk returns a tuple with the FunctionHashes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFunctionHashes + +`func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{})` + +SetFunctionHashes sets FunctionHashes field to given value. + +### HasFunctionHashes + +`func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool` + +HasFunctionHashes returns a boolean if a field has been set. + +### GetGasEstimates + +`func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates` + +GetGasEstimates returns the GasEstimates field if non-nil, zero value otherwise. + +### GetGasEstimatesOk + +`func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool)` + +GetGasEstimatesOk returns a tuple with the GasEstimates field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasEstimates + +`func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates)` + +SetGasEstimates sets GasEstimates field to given value. + +### HasGasEstimates + +`func (o *SolidityContractJsonArtifact) HasGasEstimates() bool` + +HasGasEstimates returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactCompiler.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactCompiler.md new file mode 100644 index 0000000000..28cebed22e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactCompiler.md @@ -0,0 +1,82 @@ +# SolidityContractJsonArtifactCompiler + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Version** | Pointer to **string** | | [optional] + +## Methods + +### NewSolidityContractJsonArtifactCompiler + +`func NewSolidityContractJsonArtifactCompiler() *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 + +### NewSolidityContractJsonArtifactCompilerWithDefaults + +`func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler` + +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 + +### GetName + +`func (o *SolidityContractJsonArtifactCompiler) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SolidityContractJsonArtifactCompiler) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *SolidityContractJsonArtifactCompiler) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetVersion + +`func (o *SolidityContractJsonArtifactCompiler) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactGasEstimates.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactGasEstimates.md new file mode 100644 index 0000000000..f95a4cda04 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactGasEstimates.md @@ -0,0 +1,82 @@ +# SolidityContractJsonArtifactGasEstimates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Creation** | Pointer to [**SolidityContractJsonArtifactGasEstimatesCreation**](SolidityContractJsonArtifactGasEstimatesCreation.md) | | [optional] +**External** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewSolidityContractJsonArtifactGasEstimates + +`func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates` + +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 + +### NewSolidityContractJsonArtifactGasEstimatesWithDefaults + +`func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates` + +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 + +### GetCreation + +`func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation` + +GetCreation returns the Creation field if non-nil, zero value otherwise. + +### GetCreationOk + +`func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool)` + +GetCreationOk returns a tuple with the Creation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreation + +`func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation)` + +SetCreation sets Creation field to given value. + +### HasCreation + +`func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool` + +HasCreation returns a boolean if a field has been set. + +### GetExternal + +`func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{}` + +GetExternal returns the External field if non-nil, zero value otherwise. + +### GetExternalOk + +`func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (*map[string]interface{}, bool)` + +GetExternalOk returns a tuple with the External field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternal + +`func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{})` + +SetExternal sets External field to given value. + +### HasExternal + +`func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool` + +HasExternal returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactGasEstimatesCreation.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactGasEstimatesCreation.md new file mode 100644 index 0000000000..8f123dca41 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/SolidityContractJsonArtifactGasEstimatesCreation.md @@ -0,0 +1,108 @@ +# SolidityContractJsonArtifactGasEstimatesCreation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CodeDepositCost** | Pointer to **string** | | [optional] +**ExecutionCost** | Pointer to **string** | | [optional] +**TotalCost** | Pointer to **string** | | [optional] + +## Methods + +### NewSolidityContractJsonArtifactGasEstimatesCreation + +`func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation` + +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 + +### NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults + +`func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation` + +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 + +### GetCodeDepositCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string` + +GetCodeDepositCost returns the CodeDepositCost field if non-nil, zero value otherwise. + +### GetCodeDepositCostOk + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool)` + +GetCodeDepositCostOk returns a tuple with the CodeDepositCost field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCodeDepositCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string)` + +SetCodeDepositCost sets CodeDepositCost field to given value. + +### HasCodeDepositCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool` + +HasCodeDepositCost returns a boolean if a field has been set. + +### GetExecutionCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string` + +GetExecutionCost returns the ExecutionCost field if non-nil, zero value otherwise. + +### GetExecutionCostOk + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool)` + +GetExecutionCostOk returns a tuple with the ExecutionCost field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExecutionCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string)` + +SetExecutionCost sets ExecutionCost field to given value. + +### HasExecutionCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool` + +HasExecutionCost returns a boolean if a field has been set. + +### GetTotalCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string` + +GetTotalCost returns the TotalCost field if non-nil, zero value otherwise. + +### GetTotalCostOk + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool)` + +GetTotalCostOk returns a tuple with the TotalCost field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string)` + +SetTotalCost sets TotalCost field to given value. + +### HasTotalCost + +`func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool` + +HasTotalCost returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/WatchBlocksV1.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/WatchBlocksV1.md new file mode 100644 index 0000000000..b05ae6eda2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/WatchBlocksV1.md @@ -0,0 +1,19 @@ +# WatchBlocksV1 + +## Enum + + +* `Subscribe` (value: `"org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe"`) + +* `Next` (value: `"org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next"`) + +* `Unsubscribe` (value: `"org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe"`) + +* `Error` (value: `"org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error"`) + +* `Complete` (value: `"org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/WatchBlocksV1Progress.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/WatchBlocksV1Progress.md new file mode 100644 index 0000000000..ec90d8cb40 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/WatchBlocksV1Progress.md @@ -0,0 +1,51 @@ +# WatchBlocksV1Progress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BlockHeader** | [**Web3BlockHeader**](Web3BlockHeader.md) | | + +## Methods + +### NewWatchBlocksV1Progress + +`func NewWatchBlocksV1Progress(blockHeader Web3BlockHeader, ) *WatchBlocksV1Progress` + +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 + +### NewWatchBlocksV1ProgressWithDefaults + +`func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress` + +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 + +### GetBlockHeader + +`func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader` + +GetBlockHeader returns the BlockHeader field if non-nil, zero value otherwise. + +### GetBlockHeaderOk + +`func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool)` + +GetBlockHeaderOk returns a tuple with the BlockHeader field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockHeader + +`func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader)` + +SetBlockHeader sets BlockHeader field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3BlockHeader.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3BlockHeader.md new file mode 100644 index 0000000000..f9c1bf84bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3BlockHeader.md @@ -0,0 +1,324 @@ +# Web3BlockHeader + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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**](Web3BlockHeaderTimestamp.md) | | + +## Methods + +### NewWeb3BlockHeader + +`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` + +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 + +### NewWeb3BlockHeaderWithDefaults + +`func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader` + +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 + +### GetNumber + +`func (o *Web3BlockHeader) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *Web3BlockHeader) GetNumberOk() (*float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *Web3BlockHeader) SetNumber(v float32)` + +SetNumber sets Number field to given value. + + +### GetHash + +`func (o *Web3BlockHeader) GetHash() string` + +GetHash returns the Hash field if non-nil, zero value otherwise. + +### GetHashOk + +`func (o *Web3BlockHeader) GetHashOk() (*string, bool)` + +GetHashOk returns a tuple with the Hash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHash + +`func (o *Web3BlockHeader) SetHash(v string)` + +SetHash sets Hash field to given value. + + +### GetParentHash + +`func (o *Web3BlockHeader) GetParentHash() string` + +GetParentHash returns the ParentHash field if non-nil, zero value otherwise. + +### GetParentHashOk + +`func (o *Web3BlockHeader) GetParentHashOk() (*string, bool)` + +GetParentHashOk returns a tuple with the ParentHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentHash + +`func (o *Web3BlockHeader) SetParentHash(v string)` + +SetParentHash sets ParentHash field to given value. + + +### GetNonce + +`func (o *Web3BlockHeader) GetNonce() string` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *Web3BlockHeader) GetNonceOk() (*string, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *Web3BlockHeader) SetNonce(v string)` + +SetNonce sets Nonce field to given value. + + +### GetSha3Uncles + +`func (o *Web3BlockHeader) GetSha3Uncles() string` + +GetSha3Uncles returns the Sha3Uncles field if non-nil, zero value otherwise. + +### GetSha3UnclesOk + +`func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool)` + +GetSha3UnclesOk returns a tuple with the Sha3Uncles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSha3Uncles + +`func (o *Web3BlockHeader) SetSha3Uncles(v string)` + +SetSha3Uncles sets Sha3Uncles field to given value. + + +### GetLogsBloom + +`func (o *Web3BlockHeader) GetLogsBloom() string` + +GetLogsBloom returns the LogsBloom field if non-nil, zero value otherwise. + +### GetLogsBloomOk + +`func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool)` + +GetLogsBloomOk returns a tuple with the LogsBloom field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogsBloom + +`func (o *Web3BlockHeader) SetLogsBloom(v string)` + +SetLogsBloom sets LogsBloom field to given value. + + +### GetTransactionRoot + +`func (o *Web3BlockHeader) GetTransactionRoot() string` + +GetTransactionRoot returns the TransactionRoot field if non-nil, zero value otherwise. + +### GetTransactionRootOk + +`func (o *Web3BlockHeader) GetTransactionRootOk() (*string, bool)` + +GetTransactionRootOk returns a tuple with the TransactionRoot field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionRoot + +`func (o *Web3BlockHeader) SetTransactionRoot(v string)` + +SetTransactionRoot sets TransactionRoot field to given value. + + +### GetStateRoot + +`func (o *Web3BlockHeader) GetStateRoot() string` + +GetStateRoot returns the StateRoot field if non-nil, zero value otherwise. + +### GetStateRootOk + +`func (o *Web3BlockHeader) GetStateRootOk() (*string, bool)` + +GetStateRootOk returns a tuple with the StateRoot field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateRoot + +`func (o *Web3BlockHeader) SetStateRoot(v string)` + +SetStateRoot sets StateRoot field to given value. + + +### GetReceiptRoot + +`func (o *Web3BlockHeader) GetReceiptRoot() string` + +GetReceiptRoot returns the ReceiptRoot field if non-nil, zero value otherwise. + +### GetReceiptRootOk + +`func (o *Web3BlockHeader) GetReceiptRootOk() (*string, bool)` + +GetReceiptRootOk returns a tuple with the ReceiptRoot field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiptRoot + +`func (o *Web3BlockHeader) SetReceiptRoot(v string)` + +SetReceiptRoot sets ReceiptRoot field to given value. + + +### GetMiner + +`func (o *Web3BlockHeader) GetMiner() string` + +GetMiner returns the Miner field if non-nil, zero value otherwise. + +### GetMinerOk + +`func (o *Web3BlockHeader) GetMinerOk() (*string, bool)` + +GetMinerOk returns a tuple with the Miner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMiner + +`func (o *Web3BlockHeader) SetMiner(v string)` + +SetMiner sets Miner field to given value. + + +### GetExtraData + +`func (o *Web3BlockHeader) GetExtraData() string` + +GetExtraData returns the ExtraData field if non-nil, zero value otherwise. + +### GetExtraDataOk + +`func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool)` + +GetExtraDataOk returns a tuple with the ExtraData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExtraData + +`func (o *Web3BlockHeader) SetExtraData(v string)` + +SetExtraData sets ExtraData field to given value. + + +### GetGasLimit + +`func (o *Web3BlockHeader) GetGasLimit() int32` + +GetGasLimit returns the GasLimit field if non-nil, zero value otherwise. + +### GetGasLimitOk + +`func (o *Web3BlockHeader) GetGasLimitOk() (*int32, bool)` + +GetGasLimitOk returns a tuple with the GasLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasLimit + +`func (o *Web3BlockHeader) SetGasLimit(v int32)` + +SetGasLimit sets GasLimit field to given value. + + +### GetGasUsed + +`func (o *Web3BlockHeader) GetGasUsed() int32` + +GetGasUsed returns the GasUsed field if non-nil, zero value otherwise. + +### GetGasUsedOk + +`func (o *Web3BlockHeader) GetGasUsedOk() (*int32, bool)` + +GetGasUsedOk returns a tuple with the GasUsed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasUsed + +`func (o *Web3BlockHeader) SetGasUsed(v int32)` + +SetGasUsed sets GasUsed field to given value. + + +### GetTimestamp + +`func (o *Web3BlockHeader) GetTimestamp() Web3BlockHeaderTimestamp` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *Web3BlockHeader) GetTimestampOk() (*Web3BlockHeaderTimestamp, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *Web3BlockHeader) SetTimestamp(v Web3BlockHeaderTimestamp)` + +SetTimestamp sets Timestamp field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3BlockHeaderTimestamp.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3BlockHeaderTimestamp.md new file mode 100644 index 0000000000..9fe42bf9c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3BlockHeaderTimestamp.md @@ -0,0 +1,30 @@ +# Web3BlockHeaderTimestamp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewWeb3BlockHeaderTimestamp + +`func NewWeb3BlockHeaderTimestamp() *Web3BlockHeaderTimestamp` + +NewWeb3BlockHeaderTimestamp instantiates a new Web3BlockHeaderTimestamp object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWeb3BlockHeaderTimestampWithDefaults + +`func NewWeb3BlockHeaderTimestampWithDefaults() *Web3BlockHeaderTimestamp` + +NewWeb3BlockHeaderTimestampWithDefaults instantiates a new Web3BlockHeaderTimestamp object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredential.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredential.md new file mode 100644 index 0000000000..bcd385ee60 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredential.md @@ -0,0 +1,135 @@ +# Web3SigningCredential + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Web3SigningCredentialType**](Web3SigningCredentialType.md) | | +**EthAccount** | **string** | The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. | +**KeychainEntryKey** | **string** | The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. | +**KeychainId** | **string** | 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. | +**Secret** | **string** | The HEX encoded private key of an eth account. | + +## Methods + +### NewWeb3SigningCredential + +`func NewWeb3SigningCredential(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string, secret string, ) *Web3SigningCredential` + +NewWeb3SigningCredential instantiates a new Web3SigningCredential object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWeb3SigningCredentialWithDefaults + +`func NewWeb3SigningCredentialWithDefaults() *Web3SigningCredential` + +NewWeb3SigningCredentialWithDefaults instantiates a new Web3SigningCredential object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *Web3SigningCredential) GetType() Web3SigningCredentialType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Web3SigningCredential) GetTypeOk() (*Web3SigningCredentialType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Web3SigningCredential) SetType(v Web3SigningCredentialType)` + +SetType sets Type field to given value. + + +### GetEthAccount + +`func (o *Web3SigningCredential) GetEthAccount() string` + +GetEthAccount returns the EthAccount field if non-nil, zero value otherwise. + +### GetEthAccountOk + +`func (o *Web3SigningCredential) GetEthAccountOk() (*string, bool)` + +GetEthAccountOk returns a tuple with the EthAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEthAccount + +`func (o *Web3SigningCredential) SetEthAccount(v string)` + +SetEthAccount sets EthAccount field to given value. + + +### GetKeychainEntryKey + +`func (o *Web3SigningCredential) GetKeychainEntryKey() string` + +GetKeychainEntryKey returns the KeychainEntryKey field if non-nil, zero value otherwise. + +### GetKeychainEntryKeyOk + +`func (o *Web3SigningCredential) GetKeychainEntryKeyOk() (*string, bool)` + +GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainEntryKey + +`func (o *Web3SigningCredential) SetKeychainEntryKey(v string)` + +SetKeychainEntryKey sets KeychainEntryKey field to given value. + + +### GetKeychainId + +`func (o *Web3SigningCredential) GetKeychainId() string` + +GetKeychainId returns the KeychainId field if non-nil, zero value otherwise. + +### GetKeychainIdOk + +`func (o *Web3SigningCredential) GetKeychainIdOk() (*string, bool)` + +GetKeychainIdOk returns a tuple with the KeychainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainId + +`func (o *Web3SigningCredential) SetKeychainId(v string)` + +SetKeychainId sets KeychainId field to given value. + + +### GetSecret + +`func (o *Web3SigningCredential) GetSecret() string` + +GetSecret returns the Secret field if non-nil, zero value otherwise. + +### GetSecretOk + +`func (o *Web3SigningCredential) GetSecretOk() (*string, bool)` + +GetSecretOk returns a tuple with the Secret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecret + +`func (o *Web3SigningCredential) SetSecret(v string)` + +SetSecret sets Secret field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialCactusKeychainRef.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialCactusKeychainRef.md new file mode 100644 index 0000000000..8a08034fca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialCactusKeychainRef.md @@ -0,0 +1,114 @@ +# Web3SigningCredentialCactusKeychainRef + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Web3SigningCredentialType**](Web3SigningCredentialType.md) | | +**EthAccount** | **string** | The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. | +**KeychainEntryKey** | **string** | The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. | +**KeychainId** | **string** | 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. | + +## Methods + +### NewWeb3SigningCredentialCactusKeychainRef + +`func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string, ) *Web3SigningCredentialCactusKeychainRef` + +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 + +### NewWeb3SigningCredentialCactusKeychainRefWithDefaults + +`func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef` + +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 + +### GetType + +`func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType)` + +SetType sets Type field to given value. + + +### GetEthAccount + +`func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string` + +GetEthAccount returns the EthAccount field if non-nil, zero value otherwise. + +### GetEthAccountOk + +`func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool)` + +GetEthAccountOk returns a tuple with the EthAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEthAccount + +`func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string)` + +SetEthAccount sets EthAccount field to given value. + + +### GetKeychainEntryKey + +`func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string` + +GetKeychainEntryKey returns the KeychainEntryKey field if non-nil, zero value otherwise. + +### GetKeychainEntryKeyOk + +`func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool)` + +GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainEntryKey + +`func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string)` + +SetKeychainEntryKey sets KeychainEntryKey field to given value. + + +### GetKeychainId + +`func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string` + +GetKeychainId returns the KeychainId field if non-nil, zero value otherwise. + +### GetKeychainIdOk + +`func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool)` + +GetKeychainIdOk returns a tuple with the KeychainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKeychainId + +`func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string)` + +SetKeychainId sets KeychainId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialNone.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialNone.md new file mode 100644 index 0000000000..34817fcbf1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialNone.md @@ -0,0 +1,51 @@ +# Web3SigningCredentialNone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Web3SigningCredentialType**](Web3SigningCredentialType.md) | | + +## Methods + +### NewWeb3SigningCredentialNone + +`func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType, ) *Web3SigningCredentialNone` + +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 + +### NewWeb3SigningCredentialNoneWithDefaults + +`func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone` + +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 + +### GetType + +`func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialPrivateKeyHex.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialPrivateKeyHex.md new file mode 100644 index 0000000000..a181b6727e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialPrivateKeyHex.md @@ -0,0 +1,93 @@ +# Web3SigningCredentialPrivateKeyHex + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Web3SigningCredentialType**](Web3SigningCredentialType.md) | | +**EthAccount** | **string** | The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. | +**Secret** | **string** | The HEX encoded private key of an eth account. | + +## Methods + +### NewWeb3SigningCredentialPrivateKeyHex + +`func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string, ) *Web3SigningCredentialPrivateKeyHex` + +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 + +### NewWeb3SigningCredentialPrivateKeyHexWithDefaults + +`func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex` + +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 + +### GetType + +`func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType)` + +SetType sets Type field to given value. + + +### GetEthAccount + +`func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string` + +GetEthAccount returns the EthAccount field if non-nil, zero value otherwise. + +### GetEthAccountOk + +`func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool)` + +GetEthAccountOk returns a tuple with the EthAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEthAccount + +`func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string)` + +SetEthAccount sets EthAccount field to given value. + + +### GetSecret + +`func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string` + +GetSecret returns the Secret field if non-nil, zero value otherwise. + +### GetSecretOk + +`func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool)` + +GetSecretOk returns a tuple with the Secret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecret + +`func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string)` + +SetSecret sets Secret field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialType.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialType.md new file mode 100644 index 0000000000..12516b8f3e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3SigningCredentialType.md @@ -0,0 +1,17 @@ +# Web3SigningCredentialType + +## Enum + + +* `CACTUS_KEYCHAIN_REF` (value: `"CACTUS_KEYCHAIN_REF"`) + +* `GETH_KEYCHAIN_PASSWORD` (value: `"GETH_KEYCHAIN_PASSWORD"`) + +* `PRIVATE_KEY_HEX` (value: `"PRIVATE_KEY_HEX"`) + +* `NONE` (value: `"NONE"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3TransactionReceipt.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3TransactionReceipt.md new file mode 100644 index 0000000000..f44682c74a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/docs/Web3TransactionReceipt.md @@ -0,0 +1,234 @@ +# Web3TransactionReceipt + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **bool** | | +**TransactionHash** | **string** | | +**TransactionIndex** | **float32** | | +**BlockHash** | **string** | | +**BlockNumber** | **float32** | | +**GasUsed** | **float32** | | +**ContractAddress** | Pointer to **NullableString** | | [optional] +**From** | **string** | | +**To** | **string** | | + +## Methods + +### NewWeb3TransactionReceipt + +`func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string, ) *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 + +### NewWeb3TransactionReceiptWithDefaults + +`func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt` + +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 + +### GetStatus + +`func (o *Web3TransactionReceipt) GetStatus() bool` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Web3TransactionReceipt) SetStatus(v bool)` + +SetStatus sets Status field to given value. + + +### GetTransactionHash + +`func (o *Web3TransactionReceipt) GetTransactionHash() string` + +GetTransactionHash returns the TransactionHash field if non-nil, zero value otherwise. + +### GetTransactionHashOk + +`func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool)` + +GetTransactionHashOk returns a tuple with the TransactionHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionHash + +`func (o *Web3TransactionReceipt) SetTransactionHash(v string)` + +SetTransactionHash sets TransactionHash field to given value. + + +### GetTransactionIndex + +`func (o *Web3TransactionReceipt) GetTransactionIndex() float32` + +GetTransactionIndex returns the TransactionIndex field if non-nil, zero value otherwise. + +### GetTransactionIndexOk + +`func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool)` + +GetTransactionIndexOk returns a tuple with the TransactionIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionIndex + +`func (o *Web3TransactionReceipt) SetTransactionIndex(v float32)` + +SetTransactionIndex sets TransactionIndex field to given value. + + +### GetBlockHash + +`func (o *Web3TransactionReceipt) GetBlockHash() string` + +GetBlockHash returns the BlockHash field if non-nil, zero value otherwise. + +### GetBlockHashOk + +`func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool)` + +GetBlockHashOk returns a tuple with the BlockHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockHash + +`func (o *Web3TransactionReceipt) SetBlockHash(v string)` + +SetBlockHash sets BlockHash field to given value. + + +### GetBlockNumber + +`func (o *Web3TransactionReceipt) GetBlockNumber() float32` + +GetBlockNumber returns the BlockNumber field if non-nil, zero value otherwise. + +### GetBlockNumberOk + +`func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool)` + +GetBlockNumberOk returns a tuple with the BlockNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockNumber + +`func (o *Web3TransactionReceipt) SetBlockNumber(v float32)` + +SetBlockNumber sets BlockNumber field to given value. + + +### GetGasUsed + +`func (o *Web3TransactionReceipt) GetGasUsed() float32` + +GetGasUsed returns the GasUsed field if non-nil, zero value otherwise. + +### GetGasUsedOk + +`func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool)` + +GetGasUsedOk returns a tuple with the GasUsed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasUsed + +`func (o *Web3TransactionReceipt) SetGasUsed(v float32)` + +SetGasUsed sets GasUsed field to given value. + + +### GetContractAddress + +`func (o *Web3TransactionReceipt) GetContractAddress() string` + +GetContractAddress returns the ContractAddress field if non-nil, zero value otherwise. + +### GetContractAddressOk + +`func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool)` + +GetContractAddressOk returns a tuple with the ContractAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractAddress + +`func (o *Web3TransactionReceipt) SetContractAddress(v string)` + +SetContractAddress sets ContractAddress field to given value. + +### HasContractAddress + +`func (o *Web3TransactionReceipt) HasContractAddress() bool` + +HasContractAddress returns a boolean if a field has been set. + +### SetContractAddressNil + +`func (o *Web3TransactionReceipt) SetContractAddressNil(b bool)` + + SetContractAddressNil sets the value for ContractAddress to be an explicit nil + +### UnsetContractAddress +`func (o *Web3TransactionReceipt) UnsetContractAddress()` + +UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +### GetFrom + +`func (o *Web3TransactionReceipt) GetFrom() string` + +GetFrom returns the From field if non-nil, zero value otherwise. + +### GetFromOk + +`func (o *Web3TransactionReceipt) GetFromOk() (*string, bool)` + +GetFromOk returns a tuple with the From field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFrom + +`func (o *Web3TransactionReceipt) SetFrom(v string)` + +SetFrom sets From field to given value. + + +### GetTo + +`func (o *Web3TransactionReceipt) GetTo() string` + +GetTo returns the To field if non-nil, zero value otherwise. + +### GetToOk + +`func (o *Web3TransactionReceipt) GetToOk() (*string, bool)` + +GetToOk returns a tuple with the To field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTo + +`func (o *Web3TransactionReceipt) SetTo(v string)` + +SetTo sets To field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..3d67b2d804 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..9ed243b897 --- /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 0000000000..c966c8ddfd --- /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 0000000000..9271d96eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_private_transaction_config.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the BesuPrivateTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BesuPrivateTransactionConfig{} + +// BesuPrivateTransactionConfig struct for BesuPrivateTransactionConfig +type BesuPrivateTransactionConfig struct { + PrivateFrom string `json:"privateFrom"` + PrivateFor []interface{} `json:"privateFor"` +} + +// NewBesuPrivateTransactionConfig instantiates a new BesuPrivateTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBesuPrivateTransactionConfig(privateFrom string, privateFor []interface{}) *BesuPrivateTransactionConfig { + this := BesuPrivateTransactionConfig{} + this.PrivateFrom = privateFrom + this.PrivateFor = privateFor + return &this +} + +// NewBesuPrivateTransactionConfigWithDefaults instantiates a new BesuPrivateTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBesuPrivateTransactionConfigWithDefaults() *BesuPrivateTransactionConfig { + this := BesuPrivateTransactionConfig{} + return &this +} + +// GetPrivateFrom returns the PrivateFrom field value +func (o *BesuPrivateTransactionConfig) GetPrivateFrom() string { + if o == nil { + var ret string + return ret + } + + return o.PrivateFrom +} + +// GetPrivateFromOk returns a tuple with the PrivateFrom field value +// and a boolean to check if the value has been set. +func (o *BesuPrivateTransactionConfig) GetPrivateFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrivateFrom, true +} + +// SetPrivateFrom sets field value +func (o *BesuPrivateTransactionConfig) SetPrivateFrom(v string) { + o.PrivateFrom = v +} + +// GetPrivateFor returns the PrivateFor field value +func (o *BesuPrivateTransactionConfig) GetPrivateFor() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.PrivateFor +} + +// GetPrivateForOk returns a tuple with the PrivateFor field value +// and a boolean to check if the value has been set. +func (o *BesuPrivateTransactionConfig) GetPrivateForOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.PrivateFor, true +} + +// SetPrivateFor sets field value +func (o *BesuPrivateTransactionConfig) SetPrivateFor(v []interface{}) { + o.PrivateFor = v +} + +func (o BesuPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BesuPrivateTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["privateFrom"] = o.PrivateFrom + toSerialize["privateFor"] = o.PrivateFor + return toSerialize, nil +} + +type NullableBesuPrivateTransactionConfig struct { + value *BesuPrivateTransactionConfig + isSet bool +} + +func (v NullableBesuPrivateTransactionConfig) Get() *BesuPrivateTransactionConfig { + return v.value +} + +func (v *NullableBesuPrivateTransactionConfig) Set(val *BesuPrivateTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableBesuPrivateTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableBesuPrivateTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBesuPrivateTransactionConfig(val *BesuPrivateTransactionConfig) *NullableBesuPrivateTransactionConfig { + return &NullableBesuPrivateTransactionConfig{value: val, isSet: true} +} + +func (v NullableBesuPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBesuPrivateTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go new file mode 100644 index 0000000000..1fcc9ae2e4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go @@ -0,0 +1,410 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the BesuTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BesuTransactionConfig{} + +// BesuTransactionConfig struct for BesuTransactionConfig +type BesuTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *Web3BlockHeaderTimestamp `json:"from,omitempty"` + To *BesuTransactionConfigTo `json:"to,omitempty"` + Value *Web3BlockHeaderTimestamp `json:"value,omitempty"` + Gas *Web3BlockHeaderTimestamp `json:"gas,omitempty"` + GasPrice *Web3BlockHeaderTimestamp `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Data *BesuTransactionConfigTo `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BesuTransactionConfig BesuTransactionConfig + +// NewBesuTransactionConfig instantiates a new BesuTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBesuTransactionConfig() *BesuTransactionConfig { + this := BesuTransactionConfig{} + return &this +} + +// NewBesuTransactionConfigWithDefaults instantiates a new BesuTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBesuTransactionConfigWithDefaults() *BesuTransactionConfig { + this := BesuTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetRawTransaction() string { + if o == nil || IsNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || IsNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasRawTransaction() bool { + if o != nil && !IsNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *BesuTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetFrom() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.From) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetFromOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the From field. +func (o *BesuTransactionConfig) SetFrom(v Web3BlockHeaderTimestamp) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetTo() BesuTransactionConfigTo { + if o == nil || IsNil(o.To) { + var ret BesuTransactionConfigTo + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetToOk() (*BesuTransactionConfigTo, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given BesuTransactionConfigTo and assigns it to the To field. +func (o *BesuTransactionConfig) SetTo(v BesuTransactionConfigTo) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetValue() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Value) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetValueOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Value field. +func (o *BesuTransactionConfig) SetValue(v Web3BlockHeaderTimestamp) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetGas() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Gas) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetGasOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Gas field. +func (o *BesuTransactionConfig) SetGas(v Web3BlockHeaderTimestamp) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetGasPrice() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.GasPrice) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetGasPriceOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the GasPrice field. +func (o *BesuTransactionConfig) SetGasPrice(v Web3BlockHeaderTimestamp) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *BesuTransactionConfig) SetNonce(v float32) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetData() BesuTransactionConfigTo { + if o == nil || IsNil(o.Data) { + var ret BesuTransactionConfigTo + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetDataOk() (*BesuTransactionConfigTo, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given BesuTransactionConfigTo and assigns it to the Data field. +func (o *BesuTransactionConfig) SetData(v BesuTransactionConfigTo) { + o.Data = &v +} + +func (o BesuTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BesuTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BesuTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varBesuTransactionConfig := _BesuTransactionConfig{} + + if err = json.Unmarshal(bytes, &varBesuTransactionConfig); err == nil { + *o = BesuTransactionConfig(varBesuTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rawTransaction") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + delete(additionalProperties, "gas") + delete(additionalProperties, "gasPrice") + delete(additionalProperties, "nonce") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBesuTransactionConfig struct { + value *BesuTransactionConfig + isSet bool +} + +func (v NullableBesuTransactionConfig) Get() *BesuTransactionConfig { + return v.value +} + +func (v *NullableBesuTransactionConfig) Set(val *BesuTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableBesuTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableBesuTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBesuTransactionConfig(val *BesuTransactionConfig) *NullableBesuTransactionConfig { + return &NullableBesuTransactionConfig{value: val, isSet: true} +} + +func (v NullableBesuTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBesuTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go new file mode 100644 index 0000000000..0cd08280d1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// BesuTransactionConfigTo - struct for BesuTransactionConfigTo +type BesuTransactionConfigTo struct { + String *string +} + +// stringAsBesuTransactionConfigTo is a convenience function that returns string wrapped in BesuTransactionConfigTo +func StringAsBesuTransactionConfigTo(v *string) BesuTransactionConfigTo { + return BesuTransactionConfigTo{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BesuTransactionConfigTo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(BesuTransactionConfigTo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BesuTransactionConfigTo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BesuTransactionConfigTo) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *BesuTransactionConfigTo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableBesuTransactionConfigTo struct { + value *BesuTransactionConfigTo + isSet bool +} + +func (v NullableBesuTransactionConfigTo) Get() *BesuTransactionConfigTo { + return v.value +} + +func (v *NullableBesuTransactionConfigTo) Set(val *BesuTransactionConfigTo) { + v.value = val + v.isSet = true +} + +func (v NullableBesuTransactionConfigTo) IsSet() bool { + return v.isSet +} + +func (v *NullableBesuTransactionConfigTo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBesuTransactionConfigTo(val *BesuTransactionConfigTo) *NullableBesuTransactionConfigTo { + return &NullableBesuTransactionConfigTo{value: val, isSet: true} +} + +func (v NullableBesuTransactionConfigTo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBesuTransactionConfigTo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go new file mode 100644 index 0000000000..942cd8711e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go @@ -0,0 +1,182 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the ConsistencyStrategy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsistencyStrategy{} + +// ConsistencyStrategy struct for ConsistencyStrategy +type ConsistencyStrategy struct { + ReceiptType ReceiptType `json:"receiptType"` + // The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + TimeoutMs *int32 `json:"timeoutMs,omitempty"` + // The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + BlockConfirmations int32 `json:"blockConfirmations"` +} + +// NewConsistencyStrategy instantiates a new ConsistencyStrategy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsistencyStrategy(receiptType ReceiptType, blockConfirmations int32) *ConsistencyStrategy { + this := ConsistencyStrategy{} + this.ReceiptType = receiptType + this.BlockConfirmations = blockConfirmations + return &this +} + +// NewConsistencyStrategyWithDefaults instantiates a new ConsistencyStrategy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsistencyStrategyWithDefaults() *ConsistencyStrategy { + this := ConsistencyStrategy{} + return &this +} + +// GetReceiptType returns the ReceiptType field value +func (o *ConsistencyStrategy) GetReceiptType() ReceiptType { + if o == nil { + var ret ReceiptType + return ret + } + + return o.ReceiptType +} + +// GetReceiptTypeOk returns a tuple with the ReceiptType field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetReceiptTypeOk() (*ReceiptType, bool) { + if o == nil { + return nil, false + } + return &o.ReceiptType, true +} + +// SetReceiptType sets field value +func (o *ConsistencyStrategy) SetReceiptType(v ReceiptType) { + o.ReceiptType = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *ConsistencyStrategy) GetTimeoutMs() int32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret int32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetTimeoutMsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *ConsistencyStrategy) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given int32 and assigns it to the TimeoutMs field. +func (o *ConsistencyStrategy) SetTimeoutMs(v int32) { + o.TimeoutMs = &v +} + +// GetBlockConfirmations returns the BlockConfirmations field value +func (o *ConsistencyStrategy) GetBlockConfirmations() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BlockConfirmations +} + +// GetBlockConfirmationsOk returns a tuple with the BlockConfirmations field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetBlockConfirmationsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BlockConfirmations, true +} + +// SetBlockConfirmations sets field value +func (o *ConsistencyStrategy) SetBlockConfirmations(v int32) { + o.BlockConfirmations = v +} + +func (o ConsistencyStrategy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsistencyStrategy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["receiptType"] = o.ReceiptType + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["blockConfirmations"] = o.BlockConfirmations + return toSerialize, nil +} + +type NullableConsistencyStrategy struct { + value *ConsistencyStrategy + isSet bool +} + +func (v NullableConsistencyStrategy) Get() *ConsistencyStrategy { + return v.value +} + +func (v *NullableConsistencyStrategy) Set(val *ConsistencyStrategy) { + v.value = val + v.isSet = true +} + +func (v NullableConsistencyStrategy) IsSet() bool { + return v.isSet +} + +func (v *NullableConsistencyStrategy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsistencyStrategy(val *ConsistencyStrategy) *NullableConsistencyStrategy { + return &NullableConsistencyStrategy{value: val, isSet: true} +} + +func (v NullableConsistencyStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsistencyStrategy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go new file mode 100644 index 0000000000..b3c214824e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go @@ -0,0 +1,405 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Request{} + +// DeployContractSolidityBytecodeV1Request struct for DeployContractSolidityBytecodeV1Request +type DeployContractSolidityBytecodeV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + // The application binary interface of the solidity contract + ContractAbi []interface{} `json:"contractAbi"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + PrivateTransactionConfig *BesuPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewDeployContractSolidityBytecodeV1Request instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Request(contractName string, contractAbi []interface{}, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential, bytecode string, keychainId string) *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + this.ContractName = contractName + this.ContractAbi = contractAbi + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + this.Bytecode = bytecode + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractSolidityBytecodeV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1RequestWithDefaults() *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetContractAbi returns the ContractAbi field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ContractAbi, true +} + +// SetContractAbi sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetBytecode returns the Bytecode field value +func (o *DeployContractSolidityBytecodeV1Request) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetBytecode(v string) { + o.Bytecode = v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractSolidityBytecodeV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractSolidityBytecodeV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfig() BesuPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret BesuPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given BesuPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *DeployContractSolidityBytecodeV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o DeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["contractAbi"] = o.ContractAbi + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["bytecode"] = o.Bytecode + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Request struct { + value *DeployContractSolidityBytecodeV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Request) Get() *DeployContractSolidityBytecodeV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Set(val *DeployContractSolidityBytecodeV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Request(val *DeployContractSolidityBytecodeV1Request) *NullableDeployContractSolidityBytecodeV1Request { + return &NullableDeployContractSolidityBytecodeV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go new file mode 100644 index 0000000000..f63c352fc7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Response{} + +// DeployContractSolidityBytecodeV1Response struct for DeployContractSolidityBytecodeV1Response +type DeployContractSolidityBytecodeV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewDeployContractSolidityBytecodeV1Response instantiates a new DeployContractSolidityBytecodeV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Response(transactionReceipt Web3TransactionReceipt) *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewDeployContractSolidityBytecodeV1ResponseWithDefaults instantiates a new DeployContractSolidityBytecodeV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1ResponseWithDefaults() *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *DeployContractSolidityBytecodeV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o DeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Response struct { + value *DeployContractSolidityBytecodeV1Response + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Response) Get() *DeployContractSolidityBytecodeV1Response { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Set(val *DeployContractSolidityBytecodeV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Response(val *DeployContractSolidityBytecodeV1Response) *NullableDeployContractSolidityBytecodeV1Response { + return &NullableDeployContractSolidityBytecodeV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 0000000000..7185a28ac5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go new file mode 100644 index 0000000000..dcffe7a48b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go @@ -0,0 +1,739 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the EvmBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EvmBlock{} + +// EvmBlock struct for EvmBlock +type EvmBlock struct { + Number *float32 `json:"number,omitempty"` + Hash *string `json:"hash,omitempty"` + ParentHash *string `json:"parentHash,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Sha3Uncles *string `json:"sha3Uncles,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot *string `json:"stateRoot,omitempty"` + Miner *string `json:"miner,omitempty"` + Difficulty *float32 `json:"difficulty,omitempty"` + TotalDifficulty *float32 `json:"totalDifficulty,omitempty"` + ExtraData *string `json:"extraData,omitempty"` + Size *float32 `json:"size,omitempty"` + GasLimit *float32 `json:"gasLimit,omitempty"` + GasUsed *float32 `json:"gasUsed,omitempty"` + Timestamp interface{} `json:"timestamp,omitempty"` + Transactions []interface{} `json:"transactions,omitempty"` + Uncles []interface{} `json:"uncles,omitempty"` +} + +// NewEvmBlock instantiates a new EvmBlock object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEvmBlock() *EvmBlock { + this := EvmBlock{} + return &this +} + +// NewEvmBlockWithDefaults instantiates a new EvmBlock object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEvmBlockWithDefaults() *EvmBlock { + this := EvmBlock{} + return &this +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *EvmBlock) GetNumber() float32 { + if o == nil || IsNil(o.Number) { + var ret float32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetNumberOk() (*float32, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *EvmBlock) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given float32 and assigns it to the Number field. +func (o *EvmBlock) SetNumber(v float32) { + o.Number = &v +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *EvmBlock) GetHash() string { + if o == nil || IsNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetHashOk() (*string, bool) { + if o == nil || IsNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *EvmBlock) HasHash() bool { + if o != nil && !IsNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *EvmBlock) SetHash(v string) { + o.Hash = &v +} + +// GetParentHash returns the ParentHash field value if set, zero value otherwise. +func (o *EvmBlock) GetParentHash() string { + if o == nil || IsNil(o.ParentHash) { + var ret string + return ret + } + return *o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetParentHashOk() (*string, bool) { + if o == nil || IsNil(o.ParentHash) { + return nil, false + } + return o.ParentHash, true +} + +// HasParentHash returns a boolean if a field has been set. +func (o *EvmBlock) HasParentHash() bool { + if o != nil && !IsNil(o.ParentHash) { + return true + } + + return false +} + +// SetParentHash gets a reference to the given string and assigns it to the ParentHash field. +func (o *EvmBlock) SetParentHash(v string) { + o.ParentHash = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *EvmBlock) GetNonce() string { + if o == nil || IsNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetNonceOk() (*string, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *EvmBlock) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *EvmBlock) SetNonce(v string) { + o.Nonce = &v +} + +// GetSha3Uncles returns the Sha3Uncles field value if set, zero value otherwise. +func (o *EvmBlock) GetSha3Uncles() string { + if o == nil || IsNil(o.Sha3Uncles) { + var ret string + return ret + } + return *o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetSha3UnclesOk() (*string, bool) { + if o == nil || IsNil(o.Sha3Uncles) { + return nil, false + } + return o.Sha3Uncles, true +} + +// HasSha3Uncles returns a boolean if a field has been set. +func (o *EvmBlock) HasSha3Uncles() bool { + if o != nil && !IsNil(o.Sha3Uncles) { + return true + } + + return false +} + +// SetSha3Uncles gets a reference to the given string and assigns it to the Sha3Uncles field. +func (o *EvmBlock) SetSha3Uncles(v string) { + o.Sha3Uncles = &v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *EvmBlock) GetLogsBloom() string { + if o == nil || IsNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetLogsBloomOk() (*string, bool) { + if o == nil || IsNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *EvmBlock) HasLogsBloom() bool { + if o != nil && !IsNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *EvmBlock) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *EvmBlock) GetTransactionsRoot() string { + if o == nil || IsNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetTransactionsRootOk() (*string, bool) { + if o == nil || IsNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *EvmBlock) HasTransactionsRoot() bool { + if o != nil && !IsNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *EvmBlock) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value if set, zero value otherwise. +func (o *EvmBlock) GetStateRoot() string { + if o == nil || IsNil(o.StateRoot) { + var ret string + return ret + } + return *o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetStateRootOk() (*string, bool) { + if o == nil || IsNil(o.StateRoot) { + return nil, false + } + return o.StateRoot, true +} + +// HasStateRoot returns a boolean if a field has been set. +func (o *EvmBlock) HasStateRoot() bool { + if o != nil && !IsNil(o.StateRoot) { + return true + } + + return false +} + +// SetStateRoot gets a reference to the given string and assigns it to the StateRoot field. +func (o *EvmBlock) SetStateRoot(v string) { + o.StateRoot = &v +} + +// GetMiner returns the Miner field value if set, zero value otherwise. +func (o *EvmBlock) GetMiner() string { + if o == nil || IsNil(o.Miner) { + var ret string + return ret + } + return *o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetMinerOk() (*string, bool) { + if o == nil || IsNil(o.Miner) { + return nil, false + } + return o.Miner, true +} + +// HasMiner returns a boolean if a field has been set. +func (o *EvmBlock) HasMiner() bool { + if o != nil && !IsNil(o.Miner) { + return true + } + + return false +} + +// SetMiner gets a reference to the given string and assigns it to the Miner field. +func (o *EvmBlock) SetMiner(v string) { + o.Miner = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *EvmBlock) GetDifficulty() float32 { + if o == nil || IsNil(o.Difficulty) { + var ret float32 + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetDifficultyOk() (*float32, bool) { + if o == nil || IsNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *EvmBlock) HasDifficulty() bool { + if o != nil && !IsNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given float32 and assigns it to the Difficulty field. +func (o *EvmBlock) SetDifficulty(v float32) { + o.Difficulty = &v +} + +// GetTotalDifficulty returns the TotalDifficulty field value if set, zero value otherwise. +func (o *EvmBlock) GetTotalDifficulty() float32 { + if o == nil || IsNil(o.TotalDifficulty) { + var ret float32 + return ret + } + return *o.TotalDifficulty +} + +// GetTotalDifficultyOk returns a tuple with the TotalDifficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetTotalDifficultyOk() (*float32, bool) { + if o == nil || IsNil(o.TotalDifficulty) { + return nil, false + } + return o.TotalDifficulty, true +} + +// HasTotalDifficulty returns a boolean if a field has been set. +func (o *EvmBlock) HasTotalDifficulty() bool { + if o != nil && !IsNil(o.TotalDifficulty) { + return true + } + + return false +} + +// SetTotalDifficulty gets a reference to the given float32 and assigns it to the TotalDifficulty field. +func (o *EvmBlock) SetTotalDifficulty(v float32) { + o.TotalDifficulty = &v +} + +// GetExtraData returns the ExtraData field value if set, zero value otherwise. +func (o *EvmBlock) GetExtraData() string { + if o == nil || IsNil(o.ExtraData) { + var ret string + return ret + } + return *o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetExtraDataOk() (*string, bool) { + if o == nil || IsNil(o.ExtraData) { + return nil, false + } + return o.ExtraData, true +} + +// HasExtraData returns a boolean if a field has been set. +func (o *EvmBlock) HasExtraData() bool { + if o != nil && !IsNil(o.ExtraData) { + return true + } + + return false +} + +// SetExtraData gets a reference to the given string and assigns it to the ExtraData field. +func (o *EvmBlock) SetExtraData(v string) { + o.ExtraData = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *EvmBlock) GetSize() float32 { + if o == nil || IsNil(o.Size) { + var ret float32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetSizeOk() (*float32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *EvmBlock) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float32 and assigns it to the Size field. +func (o *EvmBlock) SetSize(v float32) { + o.Size = &v +} + +// GetGasLimit returns the GasLimit field value if set, zero value otherwise. +func (o *EvmBlock) GetGasLimit() float32 { + if o == nil || IsNil(o.GasLimit) { + var ret float32 + return ret + } + return *o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetGasLimitOk() (*float32, bool) { + if o == nil || IsNil(o.GasLimit) { + return nil, false + } + return o.GasLimit, true +} + +// HasGasLimit returns a boolean if a field has been set. +func (o *EvmBlock) HasGasLimit() bool { + if o != nil && !IsNil(o.GasLimit) { + return true + } + + return false +} + +// SetGasLimit gets a reference to the given float32 and assigns it to the GasLimit field. +func (o *EvmBlock) SetGasLimit(v float32) { + o.GasLimit = &v +} + +// GetGasUsed returns the GasUsed field value if set, zero value otherwise. +func (o *EvmBlock) GetGasUsed() float32 { + if o == nil || IsNil(o.GasUsed) { + var ret float32 + return ret + } + return *o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetGasUsedOk() (*float32, bool) { + if o == nil || IsNil(o.GasUsed) { + return nil, false + } + return o.GasUsed, true +} + +// HasGasUsed returns a boolean if a field has been set. +func (o *EvmBlock) HasGasUsed() bool { + if o != nil && !IsNil(o.GasUsed) { + return true + } + + return false +} + +// SetGasUsed gets a reference to the given float32 and assigns it to the GasUsed field. +func (o *EvmBlock) SetGasUsed(v float32) { + o.GasUsed = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmBlock) GetTimestamp() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmBlock) GetTimestampOk() (*interface{}, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return &o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *EvmBlock) HasTimestamp() bool { + if o != nil && IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given interface{} and assigns it to the Timestamp field. +func (o *EvmBlock) SetTimestamp(v interface{}) { + o.Timestamp = v +} + +// GetTransactions returns the Transactions field value if set, zero value otherwise. +func (o *EvmBlock) GetTransactions() []interface{} { + if o == nil || IsNil(o.Transactions) { + var ret []interface{} + return ret + } + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetTransactionsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Transactions) { + return nil, false + } + return o.Transactions, true +} + +// HasTransactions returns a boolean if a field has been set. +func (o *EvmBlock) HasTransactions() bool { + if o != nil && !IsNil(o.Transactions) { + return true + } + + return false +} + +// SetTransactions gets a reference to the given []interface{} and assigns it to the Transactions field. +func (o *EvmBlock) SetTransactions(v []interface{}) { + o.Transactions = v +} + +// GetUncles returns the Uncles field value if set, zero value otherwise. +func (o *EvmBlock) GetUncles() []interface{} { + if o == nil || IsNil(o.Uncles) { + var ret []interface{} + return ret + } + return o.Uncles +} + +// GetUnclesOk returns a tuple with the Uncles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetUnclesOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Uncles) { + return nil, false + } + return o.Uncles, true +} + +// HasUncles returns a boolean if a field has been set. +func (o *EvmBlock) HasUncles() bool { + if o != nil && !IsNil(o.Uncles) { + return true + } + + return false +} + +// SetUncles gets a reference to the given []interface{} and assigns it to the Uncles field. +func (o *EvmBlock) SetUncles(v []interface{}) { + o.Uncles = v +} + +func (o EvmBlock) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EvmBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + if !IsNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + if !IsNil(o.ParentHash) { + toSerialize["parentHash"] = o.ParentHash + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Sha3Uncles) { + toSerialize["sha3Uncles"] = o.Sha3Uncles + } + if !IsNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !IsNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + if !IsNil(o.StateRoot) { + toSerialize["stateRoot"] = o.StateRoot + } + if !IsNil(o.Miner) { + toSerialize["miner"] = o.Miner + } + if !IsNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !IsNil(o.TotalDifficulty) { + toSerialize["totalDifficulty"] = o.TotalDifficulty + } + if !IsNil(o.ExtraData) { + toSerialize["extraData"] = o.ExtraData + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.GasLimit) { + toSerialize["gasLimit"] = o.GasLimit + } + if !IsNil(o.GasUsed) { + toSerialize["gasUsed"] = o.GasUsed + } + if o.Timestamp != nil { + toSerialize["timestamp"] = o.Timestamp + } + if !IsNil(o.Transactions) { + toSerialize["transactions"] = o.Transactions + } + if !IsNil(o.Uncles) { + toSerialize["uncles"] = o.Uncles + } + return toSerialize, nil +} + +type NullableEvmBlock struct { + value *EvmBlock + isSet bool +} + +func (v NullableEvmBlock) Get() *EvmBlock { + return v.value +} + +func (v *NullableEvmBlock) Set(val *EvmBlock) { + v.value = val + v.isSet = true +} + +func (v NullableEvmBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableEvmBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvmBlock(val *EvmBlock) *NullableEvmBlock { + return &NullableEvmBlock{value: val, isSet: true} +} + +func (v NullableEvmBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvmBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go new file mode 100644 index 0000000000..2e5b607948 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go @@ -0,0 +1,306 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the EvmLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EvmLog{} + +// EvmLog struct for EvmLog +type EvmLog struct { + Address string `json:"address"` + Data string `json:"data"` + BlockHash string `json:"blockHash"` + TransactionHash string `json:"transactionHash"` + Topics []string `json:"topics"` + LogIndex float32 `json:"logIndex"` + TransactionIndex float32 `json:"transactionIndex"` + BlockNumber float32 `json:"blockNumber"` +} + +// NewEvmLog instantiates a new EvmLog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEvmLog(address string, data string, blockHash string, transactionHash string, topics []string, logIndex float32, transactionIndex float32, blockNumber float32) *EvmLog { + this := EvmLog{} + this.Address = address + this.Data = data + this.BlockHash = blockHash + this.TransactionHash = transactionHash + this.Topics = topics + this.LogIndex = logIndex + this.TransactionIndex = transactionIndex + this.BlockNumber = blockNumber + return &this +} + +// NewEvmLogWithDefaults instantiates a new EvmLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEvmLogWithDefaults() *EvmLog { + this := EvmLog{} + return &this +} + +// GetAddress returns the Address field value +func (o *EvmLog) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *EvmLog) SetAddress(v string) { + o.Address = v +} + +// GetData returns the Data field value +func (o *EvmLog) GetData() string { + if o == nil { + var ret string + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *EvmLog) SetData(v string) { + o.Data = v +} + +// GetBlockHash returns the BlockHash field value +func (o *EvmLog) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *EvmLog) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *EvmLog) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *EvmLog) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTopics returns the Topics field value +func (o *EvmLog) GetTopics() []string { + if o == nil { + var ret []string + return ret + } + + return o.Topics +} + +// GetTopicsOk returns a tuple with the Topics field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetTopicsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Topics, true +} + +// SetTopics sets field value +func (o *EvmLog) SetTopics(v []string) { + o.Topics = v +} + +// GetLogIndex returns the LogIndex field value +func (o *EvmLog) GetLogIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.LogIndex +} + +// GetLogIndexOk returns a tuple with the LogIndex field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetLogIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.LogIndex, true +} + +// SetLogIndex sets field value +func (o *EvmLog) SetLogIndex(v float32) { + o.LogIndex = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *EvmLog) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *EvmLog) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *EvmLog) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *EvmLog) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +func (o EvmLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EvmLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["data"] = o.Data + toSerialize["blockHash"] = o.BlockHash + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["topics"] = o.Topics + toSerialize["logIndex"] = o.LogIndex + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockNumber"] = o.BlockNumber + return toSerialize, nil +} + +type NullableEvmLog struct { + value *EvmLog + isSet bool +} + +func (v NullableEvmLog) Get() *EvmLog { + return v.value +} + +func (v *NullableEvmLog) Set(val *EvmLog) { + v.value = val + v.isSet = true +} + +func (v NullableEvmLog) IsSet() bool { + return v.isSet +} + +func (v *NullableEvmLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvmLog(val *EvmLog) *NullableEvmLog { + return &NullableEvmLog{value: val, isSet: true} +} + +func (v NullableEvmLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvmLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go new file mode 100644 index 0000000000..650abb41cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go @@ -0,0 +1,490 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the EvmTransaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EvmTransaction{} + +// EvmTransaction struct for EvmTransaction +type EvmTransaction struct { + Hash *string `json:"hash,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + BlockHash interface{} `json:"blockHash,omitempty"` + BlockNumber interface{} `json:"blockNumber,omitempty"` + TransactionIndex interface{} `json:"transactionIndex,omitempty"` + From *string `json:"from,omitempty"` + To interface{} `json:"to,omitempty"` + Value *string `json:"value,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + Gas *float32 `json:"gas,omitempty"` + Input *string `json:"input,omitempty"` +} + +// NewEvmTransaction instantiates a new EvmTransaction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEvmTransaction() *EvmTransaction { + this := EvmTransaction{} + return &this +} + +// NewEvmTransactionWithDefaults instantiates a new EvmTransaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEvmTransactionWithDefaults() *EvmTransaction { + this := EvmTransaction{} + return &this +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *EvmTransaction) GetHash() string { + if o == nil || IsNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetHashOk() (*string, bool) { + if o == nil || IsNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *EvmTransaction) HasHash() bool { + if o != nil && !IsNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *EvmTransaction) SetHash(v string) { + o.Hash = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *EvmTransaction) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *EvmTransaction) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *EvmTransaction) SetNonce(v float32) { + o.Nonce = &v +} + +// GetBlockHash returns the BlockHash field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetBlockHash() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetBlockHashOk() (*interface{}, bool) { + if o == nil || IsNil(o.BlockHash) { + return nil, false + } + return &o.BlockHash, true +} + +// HasBlockHash returns a boolean if a field has been set. +func (o *EvmTransaction) HasBlockHash() bool { + if o != nil && IsNil(o.BlockHash) { + return true + } + + return false +} + +// SetBlockHash gets a reference to the given interface{} and assigns it to the BlockHash field. +func (o *EvmTransaction) SetBlockHash(v interface{}) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetBlockNumber() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetBlockNumberOk() (*interface{}, bool) { + if o == nil || IsNil(o.BlockNumber) { + return nil, false + } + return &o.BlockNumber, true +} + +// HasBlockNumber returns a boolean if a field has been set. +func (o *EvmTransaction) HasBlockNumber() bool { + if o != nil && IsNil(o.BlockNumber) { + return true + } + + return false +} + +// SetBlockNumber gets a reference to the given interface{} and assigns it to the BlockNumber field. +func (o *EvmTransaction) SetBlockNumber(v interface{}) { + o.BlockNumber = v +} + +// GetTransactionIndex returns the TransactionIndex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetTransactionIndex() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetTransactionIndexOk() (*interface{}, bool) { + if o == nil || IsNil(o.TransactionIndex) { + return nil, false + } + return &o.TransactionIndex, true +} + +// HasTransactionIndex returns a boolean if a field has been set. +func (o *EvmTransaction) HasTransactionIndex() bool { + if o != nil && IsNil(o.TransactionIndex) { + return true + } + + return false +} + +// SetTransactionIndex gets a reference to the given interface{} and assigns it to the TransactionIndex field. +func (o *EvmTransaction) SetTransactionIndex(v interface{}) { + o.TransactionIndex = v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *EvmTransaction) GetFrom() string { + if o == nil || IsNil(o.From) { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetFromOk() (*string, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *EvmTransaction) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *EvmTransaction) SetFrom(v string) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetTo() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetToOk() (*interface{}, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return &o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *EvmTransaction) HasTo() bool { + if o != nil && IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given interface{} and assigns it to the To field. +func (o *EvmTransaction) SetTo(v interface{}) { + o.To = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EvmTransaction) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EvmTransaction) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EvmTransaction) SetValue(v string) { + o.Value = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *EvmTransaction) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *EvmTransaction) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *EvmTransaction) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *EvmTransaction) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *EvmTransaction) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *EvmTransaction) SetGas(v float32) { + o.Gas = &v +} + +// GetInput returns the Input field value if set, zero value otherwise. +func (o *EvmTransaction) GetInput() string { + if o == nil || IsNil(o.Input) { + var ret string + return ret + } + return *o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetInputOk() (*string, bool) { + if o == nil || IsNil(o.Input) { + return nil, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *EvmTransaction) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given string and assigns it to the Input field. +func (o *EvmTransaction) SetInput(v string) { + o.Input = &v +} + +func (o EvmTransaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EvmTransaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if o.BlockHash != nil { + toSerialize["blockHash"] = o.BlockHash + } + if o.BlockNumber != nil { + toSerialize["blockNumber"] = o.BlockNumber + } + if o.TransactionIndex != nil { + toSerialize["transactionIndex"] = o.TransactionIndex + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if o.To != nil { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.Input) { + toSerialize["input"] = o.Input + } + return toSerialize, nil +} + +type NullableEvmTransaction struct { + value *EvmTransaction + isSet bool +} + +func (v NullableEvmTransaction) Get() *EvmTransaction { + return v.value +} + +func (v *NullableEvmTransaction) Set(val *EvmTransaction) { + v.value = val + v.isSet = true +} + +func (v NullableEvmTransaction) IsSet() bool { + return v.isSet +} + +func (v *NullableEvmTransaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvmTransaction(val *EvmTransaction) *NullableEvmTransaction { + return &NullableEvmTransaction{value: val, isSet: true} +} + +func (v NullableEvmTransaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvmTransaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go new file mode 100644 index 0000000000..dc885dbc97 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go @@ -0,0 +1,154 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBalanceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBalanceV1Request{} + +// GetBalanceV1Request struct for GetBalanceV1Request +type GetBalanceV1Request struct { + Address string `json:"address"` + DefaultBlock interface{} `json:"defaultBlock,omitempty"` +} + +// NewGetBalanceV1Request instantiates a new GetBalanceV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBalanceV1Request(address string) *GetBalanceV1Request { + this := GetBalanceV1Request{} + this.Address = address + return &this +} + +// NewGetBalanceV1RequestWithDefaults instantiates a new GetBalanceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBalanceV1RequestWithDefaults() *GetBalanceV1Request { + this := GetBalanceV1Request{} + return &this +} + +// GetAddress returns the Address field value +func (o *GetBalanceV1Request) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *GetBalanceV1Request) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *GetBalanceV1Request) SetAddress(v string) { + o.Address = v +} + +// GetDefaultBlock returns the DefaultBlock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetBalanceV1Request) GetDefaultBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.DefaultBlock +} + +// GetDefaultBlockOk returns a tuple with the DefaultBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBalanceV1Request) GetDefaultBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.DefaultBlock) { + return nil, false + } + return &o.DefaultBlock, true +} + +// HasDefaultBlock returns a boolean if a field has been set. +func (o *GetBalanceV1Request) HasDefaultBlock() bool { + if o != nil && IsNil(o.DefaultBlock) { + return true + } + + return false +} + +// SetDefaultBlock gets a reference to the given interface{} and assigns it to the DefaultBlock field. +func (o *GetBalanceV1Request) SetDefaultBlock(v interface{}) { + o.DefaultBlock = v +} + +func (o GetBalanceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBalanceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if o.DefaultBlock != nil { + toSerialize["defaultBlock"] = o.DefaultBlock + } + return toSerialize, nil +} + +type NullableGetBalanceV1Request struct { + value *GetBalanceV1Request + isSet bool +} + +func (v NullableGetBalanceV1Request) Get() *GetBalanceV1Request { + return v.value +} + +func (v *NullableGetBalanceV1Request) Set(val *GetBalanceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetBalanceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBalanceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBalanceV1Request(val *GetBalanceV1Request) *NullableGetBalanceV1Request { + return &NullableGetBalanceV1Request{value: val, isSet: true} +} + +func (v NullableGetBalanceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBalanceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go new file mode 100644 index 0000000000..ac9994dff1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBalanceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBalanceV1Response{} + +// GetBalanceV1Response struct for GetBalanceV1Response +type GetBalanceV1Response struct { + Balance string `json:"balance"` +} + +// NewGetBalanceV1Response instantiates a new GetBalanceV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBalanceV1Response(balance string) *GetBalanceV1Response { + this := GetBalanceV1Response{} + this.Balance = balance + return &this +} + +// NewGetBalanceV1ResponseWithDefaults instantiates a new GetBalanceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBalanceV1ResponseWithDefaults() *GetBalanceV1Response { + this := GetBalanceV1Response{} + return &this +} + +// GetBalance returns the Balance field value +func (o *GetBalanceV1Response) GetBalance() string { + if o == nil { + var ret string + return ret + } + + return o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value +// and a boolean to check if the value has been set. +func (o *GetBalanceV1Response) GetBalanceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Balance, true +} + +// SetBalance sets field value +func (o *GetBalanceV1Response) SetBalance(v string) { + o.Balance = v +} + +func (o GetBalanceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBalanceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["balance"] = o.Balance + return toSerialize, nil +} + +type NullableGetBalanceV1Response struct { + value *GetBalanceV1Response + isSet bool +} + +func (v NullableGetBalanceV1Response) Get() *GetBalanceV1Response { + return v.value +} + +func (v *NullableGetBalanceV1Response) Set(val *GetBalanceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBalanceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBalanceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBalanceV1Response(val *GetBalanceV1Response) *NullableGetBalanceV1Response { + return &NullableGetBalanceV1Response{value: val, isSet: true} +} + +func (v NullableGetBalanceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBalanceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go new file mode 100644 index 0000000000..ce576c76df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBesuRecordV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBesuRecordV1Request{} + +// GetBesuRecordV1Request struct for GetBesuRecordV1Request +type GetBesuRecordV1Request struct { + InvokeCall *InvokeContractV1Request `json:"invokeCall,omitempty"` + TransactionHash *string `json:"transactionHash,omitempty"` +} + +// NewGetBesuRecordV1Request instantiates a new GetBesuRecordV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBesuRecordV1Request() *GetBesuRecordV1Request { + this := GetBesuRecordV1Request{} + return &this +} + +// NewGetBesuRecordV1RequestWithDefaults instantiates a new GetBesuRecordV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBesuRecordV1RequestWithDefaults() *GetBesuRecordV1Request { + this := GetBesuRecordV1Request{} + return &this +} + +// GetInvokeCall returns the InvokeCall field value if set, zero value otherwise. +func (o *GetBesuRecordV1Request) GetInvokeCall() InvokeContractV1Request { + if o == nil || IsNil(o.InvokeCall) { + var ret InvokeContractV1Request + return ret + } + return *o.InvokeCall +} + +// GetInvokeCallOk returns a tuple with the InvokeCall field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Request) GetInvokeCallOk() (*InvokeContractV1Request, bool) { + if o == nil || IsNil(o.InvokeCall) { + return nil, false + } + return o.InvokeCall, true +} + +// HasInvokeCall returns a boolean if a field has been set. +func (o *GetBesuRecordV1Request) HasInvokeCall() bool { + if o != nil && !IsNil(o.InvokeCall) { + return true + } + + return false +} + +// SetInvokeCall gets a reference to the given InvokeContractV1Request and assigns it to the InvokeCall field. +func (o *GetBesuRecordV1Request) SetInvokeCall(v InvokeContractV1Request) { + o.InvokeCall = &v +} + +// GetTransactionHash returns the TransactionHash field value if set, zero value otherwise. +func (o *GetBesuRecordV1Request) GetTransactionHash() string { + if o == nil || IsNil(o.TransactionHash) { + var ret string + return ret + } + return *o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Request) GetTransactionHashOk() (*string, bool) { + if o == nil || IsNil(o.TransactionHash) { + return nil, false + } + return o.TransactionHash, true +} + +// HasTransactionHash returns a boolean if a field has been set. +func (o *GetBesuRecordV1Request) HasTransactionHash() bool { + if o != nil && !IsNil(o.TransactionHash) { + return true + } + + return false +} + +// SetTransactionHash gets a reference to the given string and assigns it to the TransactionHash field. +func (o *GetBesuRecordV1Request) SetTransactionHash(v string) { + o.TransactionHash = &v +} + +func (o GetBesuRecordV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBesuRecordV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InvokeCall) { + toSerialize["invokeCall"] = o.InvokeCall + } + if !IsNil(o.TransactionHash) { + toSerialize["transactionHash"] = o.TransactionHash + } + return toSerialize, nil +} + +type NullableGetBesuRecordV1Request struct { + value *GetBesuRecordV1Request + isSet bool +} + +func (v NullableGetBesuRecordV1Request) Get() *GetBesuRecordV1Request { + return v.value +} + +func (v *NullableGetBesuRecordV1Request) Set(val *GetBesuRecordV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetBesuRecordV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBesuRecordV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBesuRecordV1Request(val *GetBesuRecordV1Request) *NullableGetBesuRecordV1Request { + return &NullableGetBesuRecordV1Request{value: val, isSet: true} +} + +func (v NullableGetBesuRecordV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBesuRecordV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go new file mode 100644 index 0000000000..a3a65deb0c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go @@ -0,0 +1,236 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBesuRecordV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBesuRecordV1Response{} + +// GetBesuRecordV1Response struct for GetBesuRecordV1Response +type GetBesuRecordV1Response struct { + LedgerId *string `json:"ledgerId,omitempty"` + StateContract *string `json:"stateContract,omitempty"` + TransactionInputData interface{} `json:"transactionInputData,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` +} + +// NewGetBesuRecordV1Response instantiates a new GetBesuRecordV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBesuRecordV1Response() *GetBesuRecordV1Response { + this := GetBesuRecordV1Response{} + return &this +} + +// NewGetBesuRecordV1ResponseWithDefaults instantiates a new GetBesuRecordV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBesuRecordV1ResponseWithDefaults() *GetBesuRecordV1Response { + this := GetBesuRecordV1Response{} + return &this +} + +// GetLedgerId returns the LedgerId field value if set, zero value otherwise. +func (o *GetBesuRecordV1Response) GetLedgerId() string { + if o == nil || IsNil(o.LedgerId) { + var ret string + return ret + } + return *o.LedgerId +} + +// GetLedgerIdOk returns a tuple with the LedgerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Response) GetLedgerIdOk() (*string, bool) { + if o == nil || IsNil(o.LedgerId) { + return nil, false + } + return o.LedgerId, true +} + +// HasLedgerId returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasLedgerId() bool { + if o != nil && !IsNil(o.LedgerId) { + return true + } + + return false +} + +// SetLedgerId gets a reference to the given string and assigns it to the LedgerId field. +func (o *GetBesuRecordV1Response) SetLedgerId(v string) { + o.LedgerId = &v +} + +// GetStateContract returns the StateContract field value if set, zero value otherwise. +func (o *GetBesuRecordV1Response) GetStateContract() string { + if o == nil || IsNil(o.StateContract) { + var ret string + return ret + } + return *o.StateContract +} + +// GetStateContractOk returns a tuple with the StateContract field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Response) GetStateContractOk() (*string, bool) { + if o == nil || IsNil(o.StateContract) { + return nil, false + } + return o.StateContract, true +} + +// HasStateContract returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasStateContract() bool { + if o != nil && !IsNil(o.StateContract) { + return true + } + + return false +} + +// SetStateContract gets a reference to the given string and assigns it to the StateContract field. +func (o *GetBesuRecordV1Response) SetStateContract(v string) { + o.StateContract = &v +} + +// GetTransactionInputData returns the TransactionInputData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetBesuRecordV1Response) GetTransactionInputData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.TransactionInputData +} + +// GetTransactionInputDataOk returns a tuple with the TransactionInputData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBesuRecordV1Response) GetTransactionInputDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.TransactionInputData) { + return nil, false + } + return &o.TransactionInputData, true +} + +// HasTransactionInputData returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasTransactionInputData() bool { + if o != nil && IsNil(o.TransactionInputData) { + return true + } + + return false +} + +// SetTransactionInputData gets a reference to the given interface{} and assigns it to the TransactionInputData field. +func (o *GetBesuRecordV1Response) SetTransactionInputData(v interface{}) { + o.TransactionInputData = v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetBesuRecordV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBesuRecordV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *GetBesuRecordV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +func (o GetBesuRecordV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBesuRecordV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LedgerId) { + toSerialize["ledgerId"] = o.LedgerId + } + if !IsNil(o.StateContract) { + toSerialize["stateContract"] = o.StateContract + } + if o.TransactionInputData != nil { + toSerialize["transactionInputData"] = o.TransactionInputData + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + return toSerialize, nil +} + +type NullableGetBesuRecordV1Response struct { + value *GetBesuRecordV1Response + isSet bool +} + +func (v NullableGetBesuRecordV1Response) Get() *GetBesuRecordV1Response { + return v.value +} + +func (v *NullableGetBesuRecordV1Response) Set(val *GetBesuRecordV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBesuRecordV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBesuRecordV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBesuRecordV1Response(val *GetBesuRecordV1Response) *NullableGetBesuRecordV1Response { + return &NullableGetBesuRecordV1Response{value: val, isSet: true} +} + +func (v NullableGetBesuRecordV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBesuRecordV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go new file mode 100644 index 0000000000..c095bbde71 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBlockV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockV1Request{} + +// GetBlockV1Request struct for GetBlockV1Request +type GetBlockV1Request struct { + BlockHashOrBlockNumber interface{} `json:"blockHashOrBlockNumber"` +} + +// NewGetBlockV1Request instantiates a new GetBlockV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockV1Request(blockHashOrBlockNumber interface{}) *GetBlockV1Request { + this := GetBlockV1Request{} + this.BlockHashOrBlockNumber = blockHashOrBlockNumber + return &this +} + +// NewGetBlockV1RequestWithDefaults instantiates a new GetBlockV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockV1RequestWithDefaults() *GetBlockV1Request { + this := GetBlockV1Request{} + return &this +} + +// GetBlockHashOrBlockNumber returns the BlockHashOrBlockNumber field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *GetBlockV1Request) GetBlockHashOrBlockNumber() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.BlockHashOrBlockNumber +} + +// GetBlockHashOrBlockNumberOk returns a tuple with the BlockHashOrBlockNumber field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBlockV1Request) GetBlockHashOrBlockNumberOk() (*interface{}, bool) { + if o == nil || IsNil(o.BlockHashOrBlockNumber) { + return nil, false + } + return &o.BlockHashOrBlockNumber, true +} + +// SetBlockHashOrBlockNumber sets field value +func (o *GetBlockV1Request) SetBlockHashOrBlockNumber(v interface{}) { + o.BlockHashOrBlockNumber = v +} + +func (o GetBlockV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.BlockHashOrBlockNumber != nil { + toSerialize["blockHashOrBlockNumber"] = o.BlockHashOrBlockNumber + } + return toSerialize, nil +} + +type NullableGetBlockV1Request struct { + value *GetBlockV1Request + isSet bool +} + +func (v NullableGetBlockV1Request) Get() *GetBlockV1Request { + return v.value +} + +func (v *NullableGetBlockV1Request) Set(val *GetBlockV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockV1Request(val *GetBlockV1Request) *NullableGetBlockV1Request { + return &NullableGetBlockV1Request{value: val, isSet: true} +} + +func (v NullableGetBlockV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go new file mode 100644 index 0000000000..c154ef9d2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBlockV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockV1Response{} + +// GetBlockV1Response struct for GetBlockV1Response +type GetBlockV1Response struct { + Block EvmBlock `json:"block"` +} + +// NewGetBlockV1Response instantiates a new GetBlockV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockV1Response(block EvmBlock) *GetBlockV1Response { + this := GetBlockV1Response{} + this.Block = block + return &this +} + +// NewGetBlockV1ResponseWithDefaults instantiates a new GetBlockV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockV1ResponseWithDefaults() *GetBlockV1Response { + this := GetBlockV1Response{} + return &this +} + +// GetBlock returns the Block field value +func (o *GetBlockV1Response) GetBlock() EvmBlock { + if o == nil { + var ret EvmBlock + return ret + } + + return o.Block +} + +// GetBlockOk returns a tuple with the Block field value +// and a boolean to check if the value has been set. +func (o *GetBlockV1Response) GetBlockOk() (*EvmBlock, bool) { + if o == nil { + return nil, false + } + return &o.Block, true +} + +// SetBlock sets field value +func (o *GetBlockV1Response) SetBlock(v EvmBlock) { + o.Block = v +} + +func (o GetBlockV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["block"] = o.Block + return toSerialize, nil +} + +type NullableGetBlockV1Response struct { + value *GetBlockV1Response + isSet bool +} + +func (v NullableGetBlockV1Response) Get() *GetBlockV1Response { + return v.value +} + +func (v *NullableGetBlockV1Response) Set(val *GetBlockV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockV1Response(val *GetBlockV1Response) *NullableGetBlockV1Response { + return &NullableGetBlockV1Response{value: val, isSet: true} +} + +func (v NullableGetBlockV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go new file mode 100644 index 0000000000..e7626ccca3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go @@ -0,0 +1,237 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetPastLogsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetPastLogsV1Request{} + +// GetPastLogsV1Request struct for GetPastLogsV1Request +type GetPastLogsV1Request struct { + ToBlock interface{} `json:"toBlock,omitempty"` + FromBlock interface{} `json:"fromBlock,omitempty"` + Address interface{} `json:"address,omitempty"` + Topics []interface{} `json:"topics,omitempty"` +} + +// NewGetPastLogsV1Request instantiates a new GetPastLogsV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetPastLogsV1Request() *GetPastLogsV1Request { + this := GetPastLogsV1Request{} + return &this +} + +// NewGetPastLogsV1RequestWithDefaults instantiates a new GetPastLogsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPastLogsV1RequestWithDefaults() *GetPastLogsV1Request { + this := GetPastLogsV1Request{} + return &this +} + +// GetToBlock returns the ToBlock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetPastLogsV1Request) GetToBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.ToBlock +} + +// GetToBlockOk returns a tuple with the ToBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetPastLogsV1Request) GetToBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.ToBlock) { + return nil, false + } + return &o.ToBlock, true +} + +// HasToBlock returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasToBlock() bool { + if o != nil && IsNil(o.ToBlock) { + return true + } + + return false +} + +// SetToBlock gets a reference to the given interface{} and assigns it to the ToBlock field. +func (o *GetPastLogsV1Request) SetToBlock(v interface{}) { + o.ToBlock = v +} + +// GetFromBlock returns the FromBlock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetPastLogsV1Request) GetFromBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.FromBlock +} + +// GetFromBlockOk returns a tuple with the FromBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetPastLogsV1Request) GetFromBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.FromBlock) { + return nil, false + } + return &o.FromBlock, true +} + +// HasFromBlock returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasFromBlock() bool { + if o != nil && IsNil(o.FromBlock) { + return true + } + + return false +} + +// SetFromBlock gets a reference to the given interface{} and assigns it to the FromBlock field. +func (o *GetPastLogsV1Request) SetFromBlock(v interface{}) { + o.FromBlock = v +} + +// GetAddress returns the Address field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetPastLogsV1Request) GetAddress() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetPastLogsV1Request) GetAddressOk() (*interface{}, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return &o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasAddress() bool { + if o != nil && IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given interface{} and assigns it to the Address field. +func (o *GetPastLogsV1Request) SetAddress(v interface{}) { + o.Address = v +} + +// GetTopics returns the Topics field value if set, zero value otherwise. +func (o *GetPastLogsV1Request) GetTopics() []interface{} { + if o == nil || IsNil(o.Topics) { + var ret []interface{} + return ret + } + return o.Topics +} + +// GetTopicsOk returns a tuple with the Topics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPastLogsV1Request) GetTopicsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Topics) { + return nil, false + } + return o.Topics, true +} + +// HasTopics returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasTopics() bool { + if o != nil && !IsNil(o.Topics) { + return true + } + + return false +} + +// SetTopics gets a reference to the given []interface{} and assigns it to the Topics field. +func (o *GetPastLogsV1Request) SetTopics(v []interface{}) { + o.Topics = v +} + +func (o GetPastLogsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPastLogsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ToBlock != nil { + toSerialize["toBlock"] = o.ToBlock + } + if o.FromBlock != nil { + toSerialize["fromBlock"] = o.FromBlock + } + if o.Address != nil { + toSerialize["address"] = o.Address + } + if !IsNil(o.Topics) { + toSerialize["topics"] = o.Topics + } + return toSerialize, nil +} + +type NullableGetPastLogsV1Request struct { + value *GetPastLogsV1Request + isSet bool +} + +func (v NullableGetPastLogsV1Request) Get() *GetPastLogsV1Request { + return v.value +} + +func (v *NullableGetPastLogsV1Request) Set(val *GetPastLogsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetPastLogsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPastLogsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPastLogsV1Request(val *GetPastLogsV1Request) *NullableGetPastLogsV1Request { + return &NullableGetPastLogsV1Request{value: val, isSet: true} +} + +func (v NullableGetPastLogsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPastLogsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go new file mode 100644 index 0000000000..4a26a2e69a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetPastLogsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetPastLogsV1Response{} + +// GetPastLogsV1Response struct for GetPastLogsV1Response +type GetPastLogsV1Response struct { + Logs []EvmLog `json:"logs"` +} + +// NewGetPastLogsV1Response instantiates a new GetPastLogsV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetPastLogsV1Response(logs []EvmLog) *GetPastLogsV1Response { + this := GetPastLogsV1Response{} + this.Logs = logs + return &this +} + +// NewGetPastLogsV1ResponseWithDefaults instantiates a new GetPastLogsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPastLogsV1ResponseWithDefaults() *GetPastLogsV1Response { + this := GetPastLogsV1Response{} + return &this +} + +// GetLogs returns the Logs field value +func (o *GetPastLogsV1Response) GetLogs() []EvmLog { + if o == nil { + var ret []EvmLog + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *GetPastLogsV1Response) GetLogsOk() ([]EvmLog, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *GetPastLogsV1Response) SetLogs(v []EvmLog) { + o.Logs = v +} + +func (o GetPastLogsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPastLogsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["logs"] = o.Logs + return toSerialize, nil +} + +type NullableGetPastLogsV1Response struct { + value *GetPastLogsV1Response + isSet bool +} + +func (v NullableGetPastLogsV1Response) Get() *GetPastLogsV1Response { + return v.value +} + +func (v *NullableGetPastLogsV1Response) Set(val *GetPastLogsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetPastLogsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPastLogsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPastLogsV1Response(val *GetPastLogsV1Response) *NullableGetPastLogsV1Response { + return &NullableGetPastLogsV1Response{value: val, isSet: true} +} + +func (v NullableGetPastLogsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPastLogsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go new file mode 100644 index 0000000000..5de9a18ab9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetTransactionV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionV1Request{} + +// GetTransactionV1Request struct for GetTransactionV1Request +type GetTransactionV1Request struct { + TransactionHash string `json:"transactionHash"` +} + +// NewGetTransactionV1Request instantiates a new GetTransactionV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTransactionV1Request(transactionHash string) *GetTransactionV1Request { + this := GetTransactionV1Request{} + this.TransactionHash = transactionHash + return &this +} + +// NewGetTransactionV1RequestWithDefaults instantiates a new GetTransactionV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionV1RequestWithDefaults() *GetTransactionV1Request { + this := GetTransactionV1Request{} + return &this +} + +// GetTransactionHash returns the TransactionHash field value +func (o *GetTransactionV1Request) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *GetTransactionV1Request) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *GetTransactionV1Request) SetTransactionHash(v string) { + o.TransactionHash = v +} + +func (o GetTransactionV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionHash"] = o.TransactionHash + return toSerialize, nil +} + +type NullableGetTransactionV1Request struct { + value *GetTransactionV1Request + isSet bool +} + +func (v NullableGetTransactionV1Request) Get() *GetTransactionV1Request { + return v.value +} + +func (v *NullableGetTransactionV1Request) Set(val *GetTransactionV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionV1Request(val *GetTransactionV1Request) *NullableGetTransactionV1Request { + return &NullableGetTransactionV1Request{value: val, isSet: true} +} + +func (v NullableGetTransactionV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go new file mode 100644 index 0000000000..2bafe3c63e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetTransactionV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionV1Response{} + +// GetTransactionV1Response struct for GetTransactionV1Response +type GetTransactionV1Response struct { + Transaction EvmTransaction `json:"transaction"` +} + +// NewGetTransactionV1Response instantiates a new GetTransactionV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTransactionV1Response(transaction EvmTransaction) *GetTransactionV1Response { + this := GetTransactionV1Response{} + this.Transaction = transaction + return &this +} + +// NewGetTransactionV1ResponseWithDefaults instantiates a new GetTransactionV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionV1ResponseWithDefaults() *GetTransactionV1Response { + this := GetTransactionV1Response{} + return &this +} + +// GetTransaction returns the Transaction field value +func (o *GetTransactionV1Response) GetTransaction() EvmTransaction { + if o == nil { + var ret EvmTransaction + return ret + } + + return o.Transaction +} + +// GetTransactionOk returns a tuple with the Transaction field value +// and a boolean to check if the value has been set. +func (o *GetTransactionV1Response) GetTransactionOk() (*EvmTransaction, bool) { + if o == nil { + return nil, false + } + return &o.Transaction, true +} + +// SetTransaction sets field value +func (o *GetTransactionV1Response) SetTransaction(v EvmTransaction) { + o.Transaction = v +} + +func (o GetTransactionV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transaction"] = o.Transaction + return toSerialize, nil +} + +type NullableGetTransactionV1Response struct { + value *GetTransactionV1Response + isSet bool +} + +func (v NullableGetTransactionV1Response) Get() *GetTransactionV1Response { + return v.value +} + +func (v *NullableGetTransactionV1Response) Set(val *GetTransactionV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionV1Response(val *GetTransactionV1Response) *NullableGetTransactionV1Response { + return &NullableGetTransactionV1Response{value: val, isSet: true} +} + +func (v NullableGetTransactionV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 0000000000..d708d91869 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,559 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + ContractName string `json:"contractName"` + SigningCredential Web3SigningCredential `json:"signingCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + // The application binary interface of the solidity contract, optional parameter + ContractAbi []interface{} `json:"contractAbi,omitempty"` + // Address of the solidity contract, optional parameter + ContractAddress *string `json:"contractAddress,omitempty"` + Value *Web3BlockHeaderTimestamp `json:"value,omitempty"` + Gas *Web3BlockHeaderTimestamp `json:"gas,omitempty"` + GasPrice *Web3BlockHeaderTimestamp `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId *string `json:"keychainId,omitempty"` + PrivateTransactionConfig *BesuPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contractName string, signingCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.ContractName = contractName + this.SigningCredential = signingCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *InvokeContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *InvokeContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetSigningCredential returns the SigningCredential field value +func (o *InvokeContractV1Request) GetSigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.SigningCredential +} + +// GetSigningCredentialOk returns a tuple with the SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetSigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.SigningCredential, true +} + +// SetSigningCredential sets field value +func (o *InvokeContractV1Request) SetSigningCredential(v Web3SigningCredential) { + o.SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetContractAbi returns the ContractAbi field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetContractAbi() []interface{} { + if o == nil || IsNil(o.ContractAbi) { + var ret []interface{} + return ret + } + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ContractAbi) { + return nil, false + } + return o.ContractAbi, true +} + +// HasContractAbi returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasContractAbi() bool { + if o != nil && !IsNil(o.ContractAbi) { + return true + } + + return false +} + +// SetContractAbi gets a reference to the given []interface{} and assigns it to the ContractAbi field. +func (o *InvokeContractV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress) { + var ret string + return ret + } + return *o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractAddressOk() (*string, bool) { + if o == nil || IsNil(o.ContractAddress) { + return nil, false + } + return o.ContractAddress, true +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasContractAddress() bool { + if o != nil && !IsNil(o.ContractAddress) { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given string and assigns it to the ContractAddress field. +func (o *InvokeContractV1Request) SetContractAddress(v string) { + o.ContractAddress = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Value) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v Web3BlockHeaderTimestamp) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGas() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Gas) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Gas field. +func (o *InvokeContractV1Request) SetGas(v Web3BlockHeaderTimestamp) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasPrice() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.GasPrice) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasPriceOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the GasPrice field. +func (o *InvokeContractV1Request) SetGasPrice(v Web3BlockHeaderTimestamp) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetKeychainId returns the KeychainId field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetKeychainId() string { + if o == nil || IsNil(o.KeychainId) { + var ret string + return ret + } + return *o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil || IsNil(o.KeychainId) { + return nil, false + } + return o.KeychainId, true +} + +// HasKeychainId returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasKeychainId() bool { + if o != nil && !IsNil(o.KeychainId) { + return true + } + + return false +} + +// SetKeychainId gets a reference to the given string and assigns it to the KeychainId field. +func (o *InvokeContractV1Request) SetKeychainId(v string) { + o.KeychainId = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetPrivateTransactionConfig() BesuPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret BesuPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given BesuPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *InvokeContractV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["signingCredential"] = o.SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.ContractAbi) { + toSerialize["contractAbi"] = o.ContractAbi + } + if !IsNil(o.ContractAddress) { + toSerialize["contractAddress"] = o.ContractAddress + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.KeychainId) { + toSerialize["keychainId"] = o.KeychainId + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 0000000000..8d0e4e6a66 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go new file mode 100644 index 0000000000..7e729ca511 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// ReceiptType Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. +type ReceiptType string + +// List of ReceiptType +const ( + NODE_TX_POOL_ACK ReceiptType = "NODE_TX_POOL_ACK" + LEDGER_BLOCK_ACK ReceiptType = "LEDGER_BLOCK_ACK" +) + +// All allowed values of ReceiptType enum +var AllowedReceiptTypeEnumValues = []ReceiptType{ + "NODE_TX_POOL_ACK", + "LEDGER_BLOCK_ACK", +} + +func (v *ReceiptType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ReceiptType(value) + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ReceiptType", value) +} + +// NewReceiptTypeFromValue returns a pointer to a valid ReceiptType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewReceiptTypeFromValue(v string) (*ReceiptType, error) { + ev := ReceiptType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ReceiptType: valid values are %v", v, AllowedReceiptTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ReceiptType) IsValid() bool { + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ReceiptType value +func (v ReceiptType) Ptr() *ReceiptType { + return &v +} + +type NullableReceiptType struct { + value *ReceiptType + isSet bool +} + +func (v NullableReceiptType) Get() *ReceiptType { + return v.value +} + +func (v *NullableReceiptType) Set(val *ReceiptType) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptType) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptType(val *ReceiptType) *NullableReceiptType { + return &NullableReceiptType{value: val, isSet: true} +} + +func (v NullableReceiptType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 0000000000..a72071e0f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,207 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig BesuTransactionConfig `json:"transactionConfig"` + ConsistencyStrategy ConsistencyStrategy `json:"consistencyStrategy"` + PrivateTransactionConfig *BesuPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig BesuTransactionConfig, consistencyStrategy ConsistencyStrategy) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + this.ConsistencyStrategy = consistencyStrategy + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionRequest) GetTransactionConfig() BesuTransactionConfig { + if o == nil { + var ret BesuTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTransactionConfigOk() (*BesuTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v BesuTransactionConfig) { + o.TransactionConfig = v +} + +// GetConsistencyStrategy returns the ConsistencyStrategy field value +func (o *RunTransactionRequest) GetConsistencyStrategy() ConsistencyStrategy { + if o == nil { + var ret ConsistencyStrategy + return ret + } + + return o.ConsistencyStrategy +} + +// GetConsistencyStrategyOk returns a tuple with the ConsistencyStrategy field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetConsistencyStrategyOk() (*ConsistencyStrategy, bool) { + if o == nil { + return nil, false + } + return &o.ConsistencyStrategy, true +} + +// SetConsistencyStrategy sets field value +func (o *RunTransactionRequest) SetConsistencyStrategy(v ConsistencyStrategy) { + o.ConsistencyStrategy = v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetPrivateTransactionConfig() BesuPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret BesuPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given BesuPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *RunTransactionRequest) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + toSerialize["consistencyStrategy"] = o.ConsistencyStrategy + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 0000000000..627cac1fa4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go new file mode 100644 index 0000000000..844e41f9eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go @@ -0,0 +1,172 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SignTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SignTransactionRequest{} + +// SignTransactionRequest struct for SignTransactionRequest +type SignTransactionRequest struct { + KeychainId string `json:"keychainId"` + KeychainRef string `json:"keychainRef"` + // The transaction hash of ledger will be used to fetch the contain. + TransactionHash string `json:"transactionHash"` +} + +// NewSignTransactionRequest instantiates a new SignTransactionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSignTransactionRequest(keychainId string, keychainRef string, transactionHash string) *SignTransactionRequest { + this := SignTransactionRequest{} + this.KeychainId = keychainId + this.KeychainRef = keychainRef + this.TransactionHash = transactionHash + return &this +} + +// NewSignTransactionRequestWithDefaults instantiates a new SignTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSignTransactionRequestWithDefaults() *SignTransactionRequest { + this := SignTransactionRequest{} + return &this +} + +// GetKeychainId returns the KeychainId field value +func (o *SignTransactionRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *SignTransactionRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *SignTransactionRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetKeychainRef returns the KeychainRef field value +func (o *SignTransactionRequest) GetKeychainRef() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainRef +} + +// GetKeychainRefOk returns a tuple with the KeychainRef field value +// and a boolean to check if the value has been set. +func (o *SignTransactionRequest) GetKeychainRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainRef, true +} + +// SetKeychainRef sets field value +func (o *SignTransactionRequest) SetKeychainRef(v string) { + o.KeychainRef = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *SignTransactionRequest) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *SignTransactionRequest) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *SignTransactionRequest) SetTransactionHash(v string) { + o.TransactionHash = v +} + +func (o SignTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SignTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keychainId"] = o.KeychainId + toSerialize["keychainRef"] = o.KeychainRef + toSerialize["transactionHash"] = o.TransactionHash + return toSerialize, nil +} + +type NullableSignTransactionRequest struct { + value *SignTransactionRequest + isSet bool +} + +func (v NullableSignTransactionRequest) Get() *SignTransactionRequest { + return v.value +} + +func (v *NullableSignTransactionRequest) Set(val *SignTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSignTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSignTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignTransactionRequest(val *SignTransactionRequest) *NullableSignTransactionRequest { + return &NullableSignTransactionRequest{value: val, isSet: true} +} + +func (v NullableSignTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go new file mode 100644 index 0000000000..bac3b0f434 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SignTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SignTransactionResponse{} + +// SignTransactionResponse struct for SignTransactionResponse +type SignTransactionResponse struct { + // The signatures of ledger from the corresponding transaction hash. + Signature string `json:"signature"` +} + +// NewSignTransactionResponse instantiates a new SignTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSignTransactionResponse(signature string) *SignTransactionResponse { + this := SignTransactionResponse{} + this.Signature = signature + return &this +} + +// NewSignTransactionResponseWithDefaults instantiates a new SignTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSignTransactionResponseWithDefaults() *SignTransactionResponse { + this := SignTransactionResponse{} + return &this +} + +// GetSignature returns the Signature field value +func (o *SignTransactionResponse) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *SignTransactionResponse) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *SignTransactionResponse) SetSignature(v string) { + o.Signature = v +} + +func (o SignTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SignTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableSignTransactionResponse struct { + value *SignTransactionResponse + isSet bool +} + +func (v NullableSignTransactionResponse) Get() *SignTransactionResponse { + return v.value +} + +func (v *NullableSignTransactionResponse) Set(val *SignTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSignTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSignTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignTransactionResponse(val *SignTransactionResponse) *NullableSignTransactionResponse { + return &NullableSignTransactionResponse{value: val, isSet: true} +} + +func (v NullableSignTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 0000000000..6cd73d2ae5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifact{} + +// SolidityContractJsonArtifact struct for SolidityContractJsonArtifact +type SolidityContractJsonArtifact struct { + ContractName string `json:"contractName"` + Metadata *string `json:"metadata,omitempty"` + Bytecode *string `json:"bytecode,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler *SolidityContractJsonArtifactCompiler `json:"compiler,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates *SolidityContractJsonArtifactGasEstimates `json:"gasEstimates,omitempty"` +} + +// NewSolidityContractJsonArtifact instantiates a new SolidityContractJsonArtifact object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifact(contractName string) *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + this.ContractName = contractName + return &this +} + +// NewSolidityContractJsonArtifactWithDefaults instantiates a new SolidityContractJsonArtifact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *SolidityContractJsonArtifact) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *SolidityContractJsonArtifact) SetContractName(v string) { + o.ContractName = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *SolidityContractJsonArtifact) SetMetadata(v string) { + o.Metadata = &v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *SolidityContractJsonArtifact) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *SolidityContractJsonArtifact) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *SolidityContractJsonArtifact) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler { + if o == nil || IsNil(o.Compiler) { + var ret SolidityContractJsonArtifactCompiler + return ret + } + return *o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool) { + if o == nil || IsNil(o.Compiler) { + return nil, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given SolidityContractJsonArtifactCompiler and assigns it to the Compiler field. +func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler) { + o.Compiler = &v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates { + if o == nil || IsNil(o.GasEstimates) { + var ret SolidityContractJsonArtifactGasEstimates + return ret + } + return *o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool) { + if o == nil || IsNil(o.GasEstimates) { + return nil, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given SolidityContractJsonArtifactGasEstimates and assigns it to the GasEstimates field. +func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates) { + o.GasEstimates = &v +} + +func (o SolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifact struct { + value *SolidityContractJsonArtifact + isSet bool +} + +func (v NullableSolidityContractJsonArtifact) Get() *SolidityContractJsonArtifact { + return v.value +} + +func (v *NullableSolidityContractJsonArtifact) Set(val *SolidityContractJsonArtifact) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifact) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifact(val *SolidityContractJsonArtifact) *NullableSolidityContractJsonArtifact { + return &NullableSolidityContractJsonArtifact{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 0000000000..4b927356a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactCompiler type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactCompiler{} + +// SolidityContractJsonArtifactCompiler struct for SolidityContractJsonArtifactCompiler +type SolidityContractJsonArtifactCompiler struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SolidityContractJsonArtifactCompiler SolidityContractJsonArtifactCompiler + +// NewSolidityContractJsonArtifactCompiler instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactCompiler() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// NewSolidityContractJsonArtifactCompilerWithDefaults instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SolidityContractJsonArtifactCompiler) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string) { + o.Version = &v +} + +func (o SolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactCompiler) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SolidityContractJsonArtifactCompiler) UnmarshalJSON(bytes []byte) (err error) { + varSolidityContractJsonArtifactCompiler := _SolidityContractJsonArtifactCompiler{} + + if err = json.Unmarshal(bytes, &varSolidityContractJsonArtifactCompiler); err == nil { + *o = SolidityContractJsonArtifactCompiler(varSolidityContractJsonArtifactCompiler) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSolidityContractJsonArtifactCompiler struct { + value *SolidityContractJsonArtifactCompiler + isSet bool +} + +func (v NullableSolidityContractJsonArtifactCompiler) Get() *SolidityContractJsonArtifactCompiler { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Set(val *SolidityContractJsonArtifactCompiler) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactCompiler) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactCompiler(val *SolidityContractJsonArtifactCompiler) *NullableSolidityContractJsonArtifactCompiler { + return &NullableSolidityContractJsonArtifactCompiler{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactCompiler) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 0000000000..226fc7181a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimates{} + +// SolidityContractJsonArtifactGasEstimates struct for SolidityContractJsonArtifactGasEstimates +type SolidityContractJsonArtifactGasEstimates struct { + Creation *SolidityContractJsonArtifactGasEstimatesCreation `json:"creation,omitempty"` + External map[string]interface{} `json:"external,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimates instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// GetCreation returns the Creation field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation { + if o == nil || IsNil(o.Creation) { + var ret SolidityContractJsonArtifactGasEstimatesCreation + return ret + } + return *o.Creation +} + +// GetCreationOk returns a tuple with the Creation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool) { + if o == nil || IsNil(o.Creation) { + return nil, false + } + return o.Creation, true +} + +// HasCreation returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool { + if o != nil && !IsNil(o.Creation) { + return true + } + + return false +} + +// SetCreation gets a reference to the given SolidityContractJsonArtifactGasEstimatesCreation and assigns it to the Creation field. +func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation) { + o.Creation = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{} { + if o == nil || IsNil(o.External) { + var ret map[string]interface{} + return ret + } + return o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.External) { + return map[string]interface{}{}, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given map[string]interface{} and assigns it to the External field. +func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{}) { + o.External = v +} + +func (o SolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Creation) { + toSerialize["creation"] = o.Creation + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimates struct { + value *SolidityContractJsonArtifactGasEstimates + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) Get() *SolidityContractJsonArtifactGasEstimates { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Set(val *SolidityContractJsonArtifactGasEstimates) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimates(val *SolidityContractJsonArtifactGasEstimates) *NullableSolidityContractJsonArtifactGasEstimates { + return &NullableSolidityContractJsonArtifactGasEstimates{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 0000000000..01601925d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimatesCreation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimatesCreation{} + +// SolidityContractJsonArtifactGasEstimatesCreation struct for SolidityContractJsonArtifactGasEstimatesCreation +type SolidityContractJsonArtifactGasEstimatesCreation struct { + CodeDepositCost *string `json:"codeDepositCost,omitempty"` + ExecutionCost *string `json:"executionCost,omitempty"` + TotalCost *string `json:"totalCost,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimatesCreation instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// GetCodeDepositCost returns the CodeDepositCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string { + if o == nil || IsNil(o.CodeDepositCost) { + var ret string + return ret + } + return *o.CodeDepositCost +} + +// GetCodeDepositCostOk returns a tuple with the CodeDepositCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool) { + if o == nil || IsNil(o.CodeDepositCost) { + return nil, false + } + return o.CodeDepositCost, true +} + +// HasCodeDepositCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool { + if o != nil && !IsNil(o.CodeDepositCost) { + return true + } + + return false +} + +// SetCodeDepositCost gets a reference to the given string and assigns it to the CodeDepositCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string) { + o.CodeDepositCost = &v +} + +// GetExecutionCost returns the ExecutionCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string { + if o == nil || IsNil(o.ExecutionCost) { + var ret string + return ret + } + return *o.ExecutionCost +} + +// GetExecutionCostOk returns a tuple with the ExecutionCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionCost) { + return nil, false + } + return o.ExecutionCost, true +} + +// HasExecutionCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool { + if o != nil && !IsNil(o.ExecutionCost) { + return true + } + + return false +} + +// SetExecutionCost gets a reference to the given string and assigns it to the ExecutionCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string) { + o.ExecutionCost = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string { + if o == nil || IsNil(o.TotalCost) { + var ret string + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given string and assigns it to the TotalCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string) { + o.TotalCost = &v +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CodeDepositCost) { + toSerialize["codeDepositCost"] = o.CodeDepositCost + } + if !IsNil(o.ExecutionCost) { + toSerialize["executionCost"] = o.ExecutionCost + } + if !IsNil(o.TotalCost) { + toSerialize["totalCost"] = o.TotalCost + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimatesCreation struct { + value *SolidityContractJsonArtifactGasEstimatesCreation + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) Get() *SolidityContractJsonArtifactGasEstimatesCreation { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Set(val *SolidityContractJsonArtifactGasEstimatesCreation) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimatesCreation(val *SolidityContractJsonArtifactGasEstimatesCreation) *NullableSolidityContractJsonArtifactGasEstimatesCreation { + return &NullableSolidityContractJsonArtifactGasEstimatesCreation{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 0000000000..f604658d4d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 0000000000..f1242a3521 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Progress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Progress{} + +// WatchBlocksV1Progress struct for WatchBlocksV1Progress +type WatchBlocksV1Progress struct { + BlockHeader Web3BlockHeader `json:"blockHeader"` +} + +// NewWatchBlocksV1Progress instantiates a new WatchBlocksV1Progress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1Progress(blockHeader Web3BlockHeader) *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + this.BlockHeader = blockHeader + return &this +} + +// NewWatchBlocksV1ProgressWithDefaults instantiates a new WatchBlocksV1Progress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// GetBlockHeader returns the BlockHeader field value +func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader { + if o == nil { + var ret Web3BlockHeader + return ret + } + + return o.BlockHeader +} + +// GetBlockHeaderOk returns a tuple with the BlockHeader field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool) { + if o == nil { + return nil, false + } + return &o.BlockHeader, true +} + +// SetBlockHeader sets field value +func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader) { + o.BlockHeader = v +} + +func (o WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Progress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockHeader"] = o.BlockHeader + return toSerialize, nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go new file mode 100644 index 0000000000..54dec17052 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go @@ -0,0 +1,468 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3BlockHeader type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3BlockHeader{} + +// Web3BlockHeader struct for Web3BlockHeader +type Web3BlockHeader struct { + Number float32 `json:"number"` + Hash string `json:"hash"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom string `json:"logsBloom"` + TransactionRoot string `json:"transactionRoot"` + StateRoot string `json:"stateRoot"` + ReceiptRoot string `json:"receiptRoot"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit int32 `json:"gasLimit"` + GasUsed int32 `json:"gasUsed"` + Timestamp Web3BlockHeaderTimestamp `json:"timestamp"` +} + +// NewWeb3BlockHeader instantiates a new Web3BlockHeader object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3BlockHeader(number float32, hash string, parentHash string, nonce string, sha3Uncles string, logsBloom string, transactionRoot string, stateRoot string, receiptRoot string, miner string, extraData string, gasLimit int32, gasUsed int32, timestamp Web3BlockHeaderTimestamp) *Web3BlockHeader { + this := Web3BlockHeader{} + this.Number = number + this.Hash = hash + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.LogsBloom = logsBloom + this.TransactionRoot = transactionRoot + this.StateRoot = stateRoot + this.ReceiptRoot = receiptRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + return &this +} + +// NewWeb3BlockHeaderWithDefaults instantiates a new Web3BlockHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader { + this := Web3BlockHeader{} + return &this +} + +// GetNumber returns the Number field value +func (o *Web3BlockHeader) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *Web3BlockHeader) SetNumber(v float32) { + o.Number = v +} + +// GetHash returns the Hash field value +func (o *Web3BlockHeader) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3BlockHeader) SetHash(v string) { + o.Hash = v +} + +// GetParentHash returns the ParentHash field value +func (o *Web3BlockHeader) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *Web3BlockHeader) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3BlockHeader) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3BlockHeader) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *Web3BlockHeader) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *Web3BlockHeader) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value +func (o *Web3BlockHeader) GetLogsBloom() string { + if o == nil { + var ret string + return ret + } + + return o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LogsBloom, true +} + +// SetLogsBloom sets field value +func (o *Web3BlockHeader) SetLogsBloom(v string) { + o.LogsBloom = v +} + +// GetTransactionRoot returns the TransactionRoot field value +func (o *Web3BlockHeader) GetTransactionRoot() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionRoot +} + +// GetTransactionRootOk returns a tuple with the TransactionRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTransactionRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionRoot, true +} + +// SetTransactionRoot sets field value +func (o *Web3BlockHeader) SetTransactionRoot(v string) { + o.TransactionRoot = v +} + +// GetStateRoot returns the StateRoot field value +func (o *Web3BlockHeader) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *Web3BlockHeader) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptRoot returns the ReceiptRoot field value +func (o *Web3BlockHeader) GetReceiptRoot() string { + if o == nil { + var ret string + return ret + } + + return o.ReceiptRoot +} + +// GetReceiptRootOk returns a tuple with the ReceiptRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetReceiptRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReceiptRoot, true +} + +// SetReceiptRoot sets field value +func (o *Web3BlockHeader) SetReceiptRoot(v string) { + o.ReceiptRoot = v +} + +// GetMiner returns the Miner field value +func (o *Web3BlockHeader) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *Web3BlockHeader) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *Web3BlockHeader) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *Web3BlockHeader) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *Web3BlockHeader) GetGasLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *Web3BlockHeader) SetGasLimit(v int32) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3BlockHeader) GetGasUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3BlockHeader) SetGasUsed(v int32) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *Web3BlockHeader) GetTimestamp() Web3BlockHeaderTimestamp { + if o == nil { + var ret Web3BlockHeaderTimestamp + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTimestampOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *Web3BlockHeader) SetTimestamp(v Web3BlockHeaderTimestamp) { + o.Timestamp = v +} + +func (o Web3BlockHeader) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3BlockHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["hash"] = o.Hash + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + toSerialize["logsBloom"] = o.LogsBloom + toSerialize["transactionRoot"] = o.TransactionRoot + toSerialize["stateRoot"] = o.StateRoot + toSerialize["receiptRoot"] = o.ReceiptRoot + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullableWeb3BlockHeader struct { + value *Web3BlockHeader + isSet bool +} + +func (v NullableWeb3BlockHeader) Get() *Web3BlockHeader { + return v.value +} + +func (v *NullableWeb3BlockHeader) Set(val *Web3BlockHeader) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeader(val *Web3BlockHeader) *NullableWeb3BlockHeader { + return &NullableWeb3BlockHeader{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go new file mode 100644 index 0000000000..c9f09a037e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3BlockHeaderTimestamp - struct for Web3BlockHeaderTimestamp +type Web3BlockHeaderTimestamp struct { + Float32 *float32 + String *string +} + +// float32AsWeb3BlockHeaderTimestamp is a convenience function that returns float32 wrapped in Web3BlockHeaderTimestamp +func Float32AsWeb3BlockHeaderTimestamp(v *float32) Web3BlockHeaderTimestamp { + return Web3BlockHeaderTimestamp{ + Float32: v, + } +} + +// stringAsWeb3BlockHeaderTimestamp is a convenience function that returns string wrapped in Web3BlockHeaderTimestamp +func StringAsWeb3BlockHeaderTimestamp(v *string) Web3BlockHeaderTimestamp { + return Web3BlockHeaderTimestamp{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3BlockHeaderTimestamp) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3BlockHeaderTimestamp)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3BlockHeaderTimestamp)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3BlockHeaderTimestamp) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3BlockHeaderTimestamp) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableWeb3BlockHeaderTimestamp struct { + value *Web3BlockHeaderTimestamp + isSet bool +} + +func (v NullableWeb3BlockHeaderTimestamp) Get() *Web3BlockHeaderTimestamp { + return v.value +} + +func (v *NullableWeb3BlockHeaderTimestamp) Set(val *Web3BlockHeaderTimestamp) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeaderTimestamp) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeaderTimestamp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeaderTimestamp(val *Web3BlockHeaderTimestamp) *NullableWeb3BlockHeaderTimestamp { + return &NullableWeb3BlockHeaderTimestamp{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeaderTimestamp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeaderTimestamp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..af9428c82c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..4aa2ce2289 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..ba1ca85378 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..72f2dd4a42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..5649dd0494 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 0000000000..4c1b772e59 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..a2ae524e0d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..92a89ef0d2 --- /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 0000000000..41b7dc28cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..1b4c76af8f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Besu + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..52f84b8b1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,74 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java +src/main/java/org/openapitools/client/model/BesuTransactionConfig.java +src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java +src/main/java/org/openapitools/client/model/ConsistencyStrategy.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/EvmBlock.java +src/main/java/org/openapitools/client/model/EvmLog.java +src/main/java/org/openapitools/client/model/EvmTransaction.java +src/main/java/org/openapitools/client/model/GetBalanceV1Request.java +src/main/java/org/openapitools/client/model/GetBalanceV1Response.java +src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java +src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java +src/main/java/org/openapitools/client/model/GetBlockV1Request.java +src/main/java/org/openapitools/client/model/GetBlockV1Response.java +src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java +src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java +src/main/java/org/openapitools/client/model/GetTransactionV1Request.java +src/main/java/org/openapitools/client/model/GetTransactionV1Response.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/ReceiptType.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/SignTransactionRequest.java +src/main/java/org/openapitools/client/model/SignTransactionResponse.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/Web3BlockHeader.java +src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..b3228b4d86 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,187 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Besu +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Besu ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = new DeployContractSolidityBytecodeV1Request(); // DeployContractSolidityBytecodeV1Request | + try { + DeployContractSolidityBytecodeV1Response result = apiInstance.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractSolBytecodeV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractSolBytecodeV1**](docs/DefaultApi.md#deployContractSolBytecodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**getBalanceV1**](docs/DefaultApi.md#getBalanceV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance | Return balance of an address of a given block +*DefaultApi* | [**getBesuRecordV1**](docs/DefaultApi.md#getBesuRecordV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record | Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. +*DefaultApi* | [**getBlockV1**](docs/DefaultApi.md#getBlockV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block | Returns a block matching the block +*DefaultApi* | [**getOpenApiSpecV1**](docs/DefaultApi.md#getOpenApiSpecV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec | Retrieves the .json file that contains the OpenAPI specification for the plugin. +*DefaultApi* | [**getPastLogsV1**](docs/DefaultApi.md#getPastLogsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs | Gets past logs, matching the given options. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**getTransactionV1**](docs/DefaultApi.md#getTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**signTransactionV1**](docs/DefaultApi.md#signTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction | Obtain signatures of ledger from the corresponding transaction hash. + + +## Documentation for Models + + - [BesuPrivateTransactionConfig](docs/BesuPrivateTransactionConfig.md) + - [BesuTransactionConfig](docs/BesuTransactionConfig.md) + - [BesuTransactionConfigTo](docs/BesuTransactionConfigTo.md) + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EvmBlock](docs/EvmBlock.md) + - [EvmLog](docs/EvmLog.md) + - [EvmTransaction](docs/EvmTransaction.md) + - [GetBalanceV1Request](docs/GetBalanceV1Request.md) + - [GetBalanceV1Response](docs/GetBalanceV1Response.md) + - [GetBesuRecordV1Request](docs/GetBesuRecordV1Request.md) + - [GetBesuRecordV1Response](docs/GetBesuRecordV1Response.md) + - [GetBlockV1Request](docs/GetBlockV1Request.md) + - [GetBlockV1Response](docs/GetBlockV1Response.md) + - [GetPastLogsV1Request](docs/GetPastLogsV1Request.md) + - [GetPastLogsV1Response](docs/GetPastLogsV1Response.md) + - [GetTransactionV1Request](docs/GetTransactionV1Request.md) + - [GetTransactionV1Response](docs/GetTransactionV1Response.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SignTransactionRequest](docs/SignTransactionRequest.md) + - [SignTransactionResponse](docs/SignTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3BlockHeaderTimestamp](docs/Web3BlockHeaderTimestamp.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..f235703d2e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1249 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Besu ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec: + get: + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + type: string + description: OK + summary: Retrieves the .json file that contains the OpenAPI specification for + the plugin. + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance: + post: + operationId: getBalanceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Response' + description: OK + summary: Return balance of an address of a given block + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block: + post: + operationId: getBlockV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockV1Response' + description: OK + summary: Returns a block matching the block + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction: + post: + operationId: getTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionV1Response' + description: OK + summary: Executes a transaction on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs: + post: + operationId: getPastLogsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetPastLogsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetPastLogsV1Response' + description: OK + summary: "Gets past logs, matching the given options." + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction: + post: + description: Obtain signatures of ledger from the corresponding transaction + hash. + operationId: signTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SignTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SignTransactionResponse' + description: OK + "404": + description: Not able to find the corresponding tranaction from the transaction + hash + summary: Obtain signatures of ledger from the corresponding transaction hash. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record: + post: + operationId: getBesuRecordV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBesuRecordV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/GetBesuRecordV1Response' + description: OK + summary: "Retrieves an arbitrary record (any piece of information) from the\ + \ ledger. Ledger records can be call outputs, transaction input, etc." + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record + x-content-type: application/json + x-accepts: text/plain +components: + schemas: + GetBalanceV1Response: + example: + balance: balance + properties: + balance: + type: string + required: + - balance + type: object + GetBalanceV1Request: + additionalProperties: false + example: + address: address + defaultBlock: "" + properties: + address: + type: string + defaultBlock: {} + required: + - address + type: object + EvmBlock: + example: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + miner: + type: string + difficulty: + type: number + totalDifficulty: + type: number + extraData: + type: string + size: + type: number + gasLimit: + type: number + gasUsed: + type: number + timestamp: {} + transactions: + items: {} + type: array + uncles: + items: {} + type: array + type: object + GetBlockV1Response: + example: + block: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + block: + $ref: '#/components/schemas/EvmBlock' + required: + - block + type: object + EvmTransaction: + example: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + hash: + type: string + nonce: + type: number + blockHash: {} + blockNumber: {} + transactionIndex: {} + from: + type: string + to: {} + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + type: object + GetTransactionV1Response: + example: + transaction: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + transaction: + $ref: '#/components/schemas/EvmTransaction' + required: + - transaction + type: object + GetTransactionV1Request: + additionalProperties: false + example: + transactionHash: transactionHash + properties: + transactionHash: + type: string + required: + - transactionHash + type: object + GetPastLogsV1Response: + example: + logs: + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + logs: + items: + $ref: '#/components/schemas/EvmLog' + type: array + required: + - logs + type: object + GetPastLogsV1Request: + additionalProperties: false + example: + fromBlock: "" + toBlock: "" + address: "" + topics: + - "" + - "" + properties: + toBlock: {} + fromBlock: {} + address: {} + topics: + items: {} + type: array + type: object + EvmLog: + example: + blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + address: + type: string + data: + type: string + blockHash: + type: string + transactionHash: + type: string + topics: + items: + type: string + type: array + logIndex: + type: number + transactionIndex: + type: number + blockNumber: + type: number + required: + - address + - blockHash + - blockNumber + - data + - logIndex + - topics + - transactionHash + - transactionIndex + type: object + GetBlockV1Request: + additionalProperties: false + example: + blockHashOrBlockNumber: "" + properties: + blockHashOrBlockNumber: {} + required: + - blockHashOrBlockNumber + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionRoot: + type: string + stateRoot: + type: string + receiptRoot: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + required: + - blockHeader + type: object + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + BesuTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + to: + $ref: '#/components/schemas/BesuTransactionConfig_to' + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + data: + $ref: '#/components/schemas/BesuTransactionConfig_to' + type: object + BesuPrivateTransactionConfig: + example: + privateFrom: privateFrom + privateFor: + - "" + - "" + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + required: + - privateFor + - privateFrom + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/BesuTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - bytecode + - constructorArgs + - contractAbi + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + properties: + contractName: + nullable: false + type: string + signingCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAbi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + contractAddress: + description: "Address of the solidity contract, optional parameter" + nullable: false + type: string + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + SignTransactionRequest: + additionalProperties: false + example: + keychainId: keychainId + keychainRef: keychainRef + transactionHash: transactionHash + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + transactionHash: + description: The transaction hash of ledger will be used to fetch the contain. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - keychainId + - keychainRef + - transactionHash + type: object + SignTransactionResponse: + example: + signature: signature + properties: + signature: + description: The signatures of ledger from the corresponding transaction + hash. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - signature + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetBesuRecordV1Request: + additionalProperties: false + example: + invokeCall: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + transactionHash: transactionHash + properties: + invokeCall: + $ref: '#/components/schemas/InvokeContractV1Request' + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + type: object + GetBesuRecordV1Response: + properties: + ledgerId: + type: string + stateContract: + type: string + transactionInputData: {} + callOutput: {} + type: object + Web3BlockHeader_timestamp: + oneOf: + - type: string + - type: number + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + BesuTransactionConfig_to: + oneOf: + - type: string + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..772166db97 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..2d79f8a60a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..9601cee4a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..e1e802c8cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..75a5e0fbc2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..3fc2bc6fa4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,449 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BesuPrivateTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BesuTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BesuTransactionConfigTo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsistencyStrategy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EvmBlock.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EvmLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EvmTransaction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBalanceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBalanceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBesuRecordV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBesuRecordV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetPastLogsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetPastLogsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SignTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SignTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeaderTimestamp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..b701c29ce8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..fbcf354c5c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..1969e8afc5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..fd98ffedd4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..499d28f69d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1390 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.GetBalanceV1Request; +import org.openapitools.client.model.GetBalanceV1Response; +import org.openapitools.client.model.GetBesuRecordV1Request; +import org.openapitools.client.model.GetBesuRecordV1Response; +import org.openapitools.client.model.GetBlockV1Request; +import org.openapitools.client.model.GetBlockV1Response; +import org.openapitools.client.model.GetPastLogsV1Request; +import org.openapitools.client.model.GetPastLogsV1Response; +import org.openapitools.client.model.GetTransactionV1Request; +import org.openapitools.client.model.GetTransactionV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.SignTransactionRequest; +import org.openapitools.client.model.SignTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deployContractSolBytecodeV1 + * @param deployContractSolidityBytecodeV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Call(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractSolBytecodeV1ValidateBeforeCall(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeV1Call(deployContractSolidityBytecodeV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeV1(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeV1WithHttpInfo(deployContractSolidityBytecodeV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeV1WithHttpInfo(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Async(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBalanceV1 + * @param getBalanceV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBalanceV1Call(GetBalanceV1Request getBalanceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBalanceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBalanceV1ValidateBeforeCall(GetBalanceV1Request getBalanceV1Request, final ApiCallback _callback) throws ApiException { + return getBalanceV1Call(getBalanceV1Request, _callback); + + } + + /** + * Return balance of an address of a given block + * + * @param getBalanceV1Request (optional) + * @return GetBalanceV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetBalanceV1Response getBalanceV1(GetBalanceV1Request getBalanceV1Request) throws ApiException { + ApiResponse localVarResp = getBalanceV1WithHttpInfo(getBalanceV1Request); + return localVarResp.getData(); + } + + /** + * Return balance of an address of a given block + * + * @param getBalanceV1Request (optional) + * @return ApiResponse<GetBalanceV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getBalanceV1WithHttpInfo(GetBalanceV1Request getBalanceV1Request) throws ApiException { + okhttp3.Call localVarCall = getBalanceV1ValidateBeforeCall(getBalanceV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Return balance of an address of a given block (asynchronously) + * + * @param getBalanceV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBalanceV1Async(GetBalanceV1Request getBalanceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBalanceV1ValidateBeforeCall(getBalanceV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBesuRecordV1 + * @param getBesuRecordV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBesuRecordV1Call(GetBesuRecordV1Request getBesuRecordV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBesuRecordV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBesuRecordV1ValidateBeforeCall(GetBesuRecordV1Request getBesuRecordV1Request, final ApiCallback _callback) throws ApiException { + return getBesuRecordV1Call(getBesuRecordV1Request, _callback); + + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + * + * @param getBesuRecordV1Request (optional) + * @return GetBesuRecordV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetBesuRecordV1Response getBesuRecordV1(GetBesuRecordV1Request getBesuRecordV1Request) throws ApiException { + ApiResponse localVarResp = getBesuRecordV1WithHttpInfo(getBesuRecordV1Request); + return localVarResp.getData(); + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + * + * @param getBesuRecordV1Request (optional) + * @return ApiResponse<GetBesuRecordV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getBesuRecordV1WithHttpInfo(GetBesuRecordV1Request getBesuRecordV1Request) throws ApiException { + okhttp3.Call localVarCall = getBesuRecordV1ValidateBeforeCall(getBesuRecordV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. (asynchronously) + * + * @param getBesuRecordV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBesuRecordV1Async(GetBesuRecordV1Request getBesuRecordV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBesuRecordV1ValidateBeforeCall(getBesuRecordV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlockV1 + * @param getBlockV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBlockV1Call(GetBlockV1Request getBlockV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBlockV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlockV1ValidateBeforeCall(GetBlockV1Request getBlockV1Request, final ApiCallback _callback) throws ApiException { + return getBlockV1Call(getBlockV1Request, _callback); + + } + + /** + * Returns a block matching the block + * + * @param getBlockV1Request (optional) + * @return GetBlockV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetBlockV1Response getBlockV1(GetBlockV1Request getBlockV1Request) throws ApiException { + ApiResponse localVarResp = getBlockV1WithHttpInfo(getBlockV1Request); + return localVarResp.getData(); + } + + /** + * Returns a block matching the block + * + * @param getBlockV1Request (optional) + * @return ApiResponse<GetBlockV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getBlockV1WithHttpInfo(GetBlockV1Request getBlockV1Request) throws ApiException { + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Returns a block matching the block (asynchronously) + * + * @param getBlockV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBlockV1Async(GetBlockV1Request getBlockV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOpenApiSpecV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOpenApiSpecV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOpenApiSpecV1Call(_callback); + + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getOpenApiSpecV1() throws ApiException { + ApiResponse localVarResp = getOpenApiSpecV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getOpenApiSpecV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPastLogsV1 + * @param getPastLogsV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPastLogsV1Call(GetPastLogsV1Request getPastLogsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getPastLogsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPastLogsV1ValidateBeforeCall(GetPastLogsV1Request getPastLogsV1Request, final ApiCallback _callback) throws ApiException { + return getPastLogsV1Call(getPastLogsV1Request, _callback); + + } + + /** + * Gets past logs, matching the given options. + * + * @param getPastLogsV1Request (optional) + * @return GetPastLogsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetPastLogsV1Response getPastLogsV1(GetPastLogsV1Request getPastLogsV1Request) throws ApiException { + ApiResponse localVarResp = getPastLogsV1WithHttpInfo(getPastLogsV1Request); + return localVarResp.getData(); + } + + /** + * Gets past logs, matching the given options. + * + * @param getPastLogsV1Request (optional) + * @return ApiResponse<GetPastLogsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPastLogsV1WithHttpInfo(GetPastLogsV1Request getPastLogsV1Request) throws ApiException { + okhttp3.Call localVarCall = getPastLogsV1ValidateBeforeCall(getPastLogsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Gets past logs, matching the given options. (asynchronously) + * + * @param getPastLogsV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPastLogsV1Async(GetPastLogsV1Request getPastLogsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPastLogsV1ValidateBeforeCall(getPastLogsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTransactionV1 + * @param getTransactionV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionV1Call(GetTransactionV1Request getTransactionV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getTransactionV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTransactionV1ValidateBeforeCall(GetTransactionV1Request getTransactionV1Request, final ApiCallback _callback) throws ApiException { + return getTransactionV1Call(getTransactionV1Request, _callback); + + } + + /** + * Executes a transaction on a besu ledger + * + * @param getTransactionV1Request (optional) + * @return GetTransactionV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetTransactionV1Response getTransactionV1(GetTransactionV1Request getTransactionV1Request) throws ApiException { + ApiResponse localVarResp = getTransactionV1WithHttpInfo(getTransactionV1Request); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a besu ledger + * + * @param getTransactionV1Request (optional) + * @return ApiResponse<GetTransactionV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getTransactionV1WithHttpInfo(GetTransactionV1Request getTransactionV1Request) throws ApiException { + okhttp3.Call localVarCall = getTransactionV1ValidateBeforeCall(getTransactionV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a besu ledger (asynchronously) + * + * @param getTransactionV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionV1Async(GetTransactionV1Request getTransactionV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTransactionV1ValidateBeforeCall(getTransactionV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Executes a transaction on a besu ledger + * + * @param runTransactionRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a besu ledger + * + * @param runTransactionRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a besu ledger (asynchronously) + * + * @param runTransactionRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for signTransactionV1 + * @param signTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public okhttp3.Call signTransactionV1Call(SignTransactionRequest signTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = signTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call signTransactionV1ValidateBeforeCall(SignTransactionRequest signTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'signTransactionRequest' is set + if (signTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'signTransactionRequest' when calling signTransactionV1(Async)"); + } + + return signTransactionV1Call(signTransactionRequest, _callback); + + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. + * Obtain signatures of ledger from the corresponding transaction hash. + * @param signTransactionRequest (required) + * @return SignTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public SignTransactionResponse signTransactionV1(SignTransactionRequest signTransactionRequest) throws ApiException { + ApiResponse localVarResp = signTransactionV1WithHttpInfo(signTransactionRequest); + return localVarResp.getData(); + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. + * Obtain signatures of ledger from the corresponding transaction hash. + * @param signTransactionRequest (required) + * @return ApiResponse<SignTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public ApiResponse signTransactionV1WithHttpInfo(SignTransactionRequest signTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = signTransactionV1ValidateBeforeCall(signTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. (asynchronously) + * Obtain signatures of ledger from the corresponding transaction hash. + * @param signTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public okhttp3.Call signTransactionV1Async(SignTransactionRequest signTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = signTransactionV1ValidateBeforeCall(signTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..a5156007d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..152c351d89 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..019ad17384 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..a83fc43a1a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..e7de9c5e87 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java new file mode 100644 index 0000000000..5a5c89f9b1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java @@ -0,0 +1,261 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * BesuPrivateTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BesuPrivateTransactionConfig { + public static final String SERIALIZED_NAME_PRIVATE_FROM = "privateFrom"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FROM) + private String privateFrom; + + public static final String SERIALIZED_NAME_PRIVATE_FOR = "privateFor"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FOR) + private List privateFor = null; + + public BesuPrivateTransactionConfig() { + } + + public BesuPrivateTransactionConfig privateFrom(String privateFrom) { + + this.privateFrom = privateFrom; + return this; + } + + /** + * Get privateFrom + * @return privateFrom + **/ + @javax.annotation.Nonnull + public String getPrivateFrom() { + return privateFrom; + } + + + public void setPrivateFrom(String privateFrom) { + this.privateFrom = privateFrom; + } + + + public BesuPrivateTransactionConfig privateFor(List privateFor) { + + this.privateFor = privateFor; + return this; + } + + public BesuPrivateTransactionConfig addPrivateForItem(Object privateForItem) { + if (this.privateFor == null) { + this.privateFor = null; + } + this.privateFor.add(privateForItem); + return this; + } + + /** + * Get privateFor + * @return privateFor + **/ + @javax.annotation.Nonnull + public List getPrivateFor() { + return privateFor; + } + + + public void setPrivateFor(List privateFor) { + this.privateFor = privateFor; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BesuPrivateTransactionConfig besuPrivateTransactionConfig = (BesuPrivateTransactionConfig) o; + return Objects.equals(this.privateFrom, besuPrivateTransactionConfig.privateFrom) && + Objects.equals(this.privateFor, besuPrivateTransactionConfig.privateFor); + } + + @Override + public int hashCode() { + return Objects.hash(privateFrom, privateFor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BesuPrivateTransactionConfig {\n"); + sb.append(" privateFrom: ").append(toIndentedString(privateFrom)).append("\n"); + sb.append(" privateFor: ").append(toIndentedString(privateFor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateFrom"); + openapiFields.add("privateFor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateFrom"); + openapiRequiredFields.add("privateFor"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BesuPrivateTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BesuPrivateTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BesuPrivateTransactionConfig is not found in the empty JSON string", BesuPrivateTransactionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BesuPrivateTransactionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BesuPrivateTransactionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BesuPrivateTransactionConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("privateFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateFrom").toString())); + } + // ensure the required json array is present + if (jsonObj.get("privateFor") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("privateFor").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFor` to be an array in the JSON string but got `%s`", jsonObj.get("privateFor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BesuPrivateTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BesuPrivateTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BesuPrivateTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BesuPrivateTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BesuPrivateTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BesuPrivateTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BesuPrivateTransactionConfig + * @throws IOException if the JSON string is invalid with respect to BesuPrivateTransactionConfig + */ + public static BesuPrivateTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BesuPrivateTransactionConfig.class); + } + + /** + * Convert an instance of BesuPrivateTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java new file mode 100644 index 0000000000..ec9fe879fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.BesuTransactionConfigTo; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * BesuTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BesuTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private Web3BlockHeaderTimestamp from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private BesuTransactionConfigTo to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Web3BlockHeaderTimestamp value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private Web3BlockHeaderTimestamp gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private Web3BlockHeaderTimestamp gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private BesuTransactionConfigTo data; + + public BesuTransactionConfig() { + } + + public BesuTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public BesuTransactionConfig from(Web3BlockHeaderTimestamp from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getFrom() { + return from; + } + + + public void setFrom(Web3BlockHeaderTimestamp from) { + this.from = from; + } + + + public BesuTransactionConfig to(BesuTransactionConfigTo to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public BesuTransactionConfigTo getTo() { + return to; + } + + + public void setTo(BesuTransactionConfigTo to) { + this.to = to; + } + + + public BesuTransactionConfig value(Web3BlockHeaderTimestamp value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getValue() { + return value; + } + + + public void setValue(Web3BlockHeaderTimestamp value) { + this.value = value; + } + + + public BesuTransactionConfig gas(Web3BlockHeaderTimestamp gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGas() { + return gas; + } + + + public void setGas(Web3BlockHeaderTimestamp gas) { + this.gas = gas; + } + + + public BesuTransactionConfig gasPrice(Web3BlockHeaderTimestamp gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(Web3BlockHeaderTimestamp gasPrice) { + this.gasPrice = gasPrice; + } + + + public BesuTransactionConfig nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public BesuTransactionConfig data(BesuTransactionConfigTo data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public BesuTransactionConfigTo getData() { + return data; + } + + + public void setData(BesuTransactionConfigTo data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BesuTransactionConfig instance itself + */ + public BesuTransactionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BesuTransactionConfig besuTransactionConfig = (BesuTransactionConfig) o; + return Objects.equals(this.rawTransaction, besuTransactionConfig.rawTransaction) && + Objects.equals(this.from, besuTransactionConfig.from) && + Objects.equals(this.to, besuTransactionConfig.to) && + Objects.equals(this.value, besuTransactionConfig.value) && + Objects.equals(this.gas, besuTransactionConfig.gas) && + Objects.equals(this.gasPrice, besuTransactionConfig.gasPrice) && + Objects.equals(this.nonce, besuTransactionConfig.nonce) && + Objects.equals(this.data, besuTransactionConfig.data)&& + Objects.equals(this.additionalProperties, besuTransactionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, gas, gasPrice, nonce, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BesuTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BesuTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BesuTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BesuTransactionConfig is not found in the empty JSON string", BesuTransactionConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("from")); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + BesuTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("to")); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + BesuTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BesuTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BesuTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BesuTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BesuTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BesuTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + BesuTransactionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BesuTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BesuTransactionConfig + * @throws IOException if the JSON string is invalid with respect to BesuTransactionConfig + */ + public static BesuTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BesuTransactionConfig.class); + } + + /** + * Convert an instance of BesuTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java new file mode 100644 index 0000000000..1b7db9dcb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BesuTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(BesuTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BesuTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BesuTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BesuTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public BesuTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + BesuTransactionConfigTo ret = new BesuTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for BesuTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public BesuTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public BesuTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return BesuTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BesuTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for BesuTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of BesuTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of BesuTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to BesuTransactionConfigTo + */ + public static BesuTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BesuTransactionConfigTo.class); + } + + /** + * Convert an instance of BesuTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java new file mode 100644 index 0000000000..046a93af2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java @@ -0,0 +1,274 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ReceiptType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsistencyStrategy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsistencyStrategy { + public static final String SERIALIZED_NAME_RECEIPT_TYPE = "receiptType"; + @SerializedName(SERIALIZED_NAME_RECEIPT_TYPE) + private ReceiptType receiptType; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private Integer timeoutMs; + + public static final String SERIALIZED_NAME_BLOCK_CONFIRMATIONS = "blockConfirmations"; + @SerializedName(SERIALIZED_NAME_BLOCK_CONFIRMATIONS) + private Integer blockConfirmations; + + public ConsistencyStrategy() { + } + + public ConsistencyStrategy receiptType(ReceiptType receiptType) { + + this.receiptType = receiptType; + return this; + } + + /** + * Get receiptType + * @return receiptType + **/ + @javax.annotation.Nonnull + public ReceiptType getReceiptType() { + return receiptType; + } + + + public void setReceiptType(ReceiptType receiptType) { + this.receiptType = receiptType; + } + + + public ConsistencyStrategy timeoutMs(Integer timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public Integer getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public ConsistencyStrategy blockConfirmations(Integer blockConfirmations) { + + this.blockConfirmations = blockConfirmations; + return this; + } + + /** + * The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + * minimum: 0 + * maximum: 20000 + * @return blockConfirmations + **/ + @javax.annotation.Nonnull + public Integer getBlockConfirmations() { + return blockConfirmations; + } + + + public void setBlockConfirmations(Integer blockConfirmations) { + this.blockConfirmations = blockConfirmations; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsistencyStrategy consistencyStrategy = (ConsistencyStrategy) o; + return Objects.equals(this.receiptType, consistencyStrategy.receiptType) && + Objects.equals(this.timeoutMs, consistencyStrategy.timeoutMs) && + Objects.equals(this.blockConfirmations, consistencyStrategy.blockConfirmations); + } + + @Override + public int hashCode() { + return Objects.hash(receiptType, timeoutMs, blockConfirmations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsistencyStrategy {\n"); + sb.append(" receiptType: ").append(toIndentedString(receiptType)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" blockConfirmations: ").append(toIndentedString(blockConfirmations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("receiptType"); + openapiFields.add("timeoutMs"); + openapiFields.add("blockConfirmations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("receiptType"); + openapiRequiredFields.add("blockConfirmations"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsistencyStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsistencyStrategy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsistencyStrategy is not found in the empty JSON string", ConsistencyStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsistencyStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsistencyStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsistencyStrategy.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsistencyStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsistencyStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsistencyStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsistencyStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsistencyStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsistencyStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsistencyStrategy + * @throws IOException if the JSON string is invalid with respect to ConsistencyStrategy + */ + public static ConsistencyStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsistencyStrategy.class); + } + + /** + * Convert an instance of ConsistencyStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java new file mode 100644 index 0000000000..866a710d7f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java @@ -0,0 +1,522 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private BesuPrivateTransactionConfig privateTransactionConfig; + + public DeployContractSolidityBytecodeV1Request() { + } + + public DeployContractSolidityBytecodeV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractSolidityBytecodeV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public DeployContractSolidityBytecodeV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return contractAbi + **/ + @javax.annotation.Nonnull + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public DeployContractSolidityBytecodeV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractSolidityBytecodeV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeV1Request bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public DeployContractSolidityBytecodeV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractSolidityBytecodeV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractSolidityBytecodeV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractSolidityBytecodeV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeV1Request privateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public BesuPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = (DeployContractSolidityBytecodeV1Request) o; + return Objects.equals(this.contractName, deployContractSolidityBytecodeV1Request.contractName) && + Objects.equals(this.contractAbi, deployContractSolidityBytecodeV1Request.contractAbi) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeV1Request.constructorArgs) && + Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeV1Request.web3SigningCredential) && + Objects.equals(this.bytecode, deployContractSolidityBytecodeV1Request.bytecode) && + Objects.equals(this.keychainId, deployContractSolidityBytecodeV1Request.keychainId) && + Objects.equals(this.gas, deployContractSolidityBytecodeV1Request.gas) && + Objects.equals(this.gasPrice, deployContractSolidityBytecodeV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeV1Request.timeoutMs) && + Objects.equals(this.privateTransactionConfig, deployContractSolidityBytecodeV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, contractAbi, constructorArgs, web3SigningCredential, bytecode, keychainId, gas, gasPrice, timeoutMs, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("contractAbi"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("bytecode"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("contractAbi"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("bytecode"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("contractAbi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + BesuPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static DeployContractSolidityBytecodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java new file mode 100644 index 0000000000..d99c7e7973 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractSolidityBytecodeV1Response() { + } + + public DeployContractSolidityBytecodeV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Response deployContractSolidityBytecodeV1Response = (DeployContractSolidityBytecodeV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractSolidityBytecodeV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Response is not found in the empty JSON string", DeployContractSolidityBytecodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static DeployContractSolidityBytecodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Response.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 0000000000..1f5a2e829b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java new file mode 100644 index 0000000000..7210ab56aa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java @@ -0,0 +1,747 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EvmBlock + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EvmBlock { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private BigDecimal difficulty; + + public static final String SERIALIZED_NAME_TOTAL_DIFFICULTY = "totalDifficulty"; + @SerializedName(SERIALIZED_NAME_TOTAL_DIFFICULTY) + private BigDecimal totalDifficulty; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private BigDecimal size; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private BigDecimal gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private Object timestamp = null; + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions; + + public static final String SERIALIZED_NAME_UNCLES = "uncles"; + @SerializedName(SERIALIZED_NAME_UNCLES) + private List uncles; + + public EvmBlock() { + } + + public EvmBlock number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public EvmBlock hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nullable + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public EvmBlock parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nullable + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public EvmBlock nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public EvmBlock sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nullable + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public EvmBlock logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public EvmBlock transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public EvmBlock stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nullable + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public EvmBlock miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nullable + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public EvmBlock difficulty(BigDecimal difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + public BigDecimal getDifficulty() { + return difficulty; + } + + + public void setDifficulty(BigDecimal difficulty) { + this.difficulty = difficulty; + } + + + public EvmBlock totalDifficulty(BigDecimal totalDifficulty) { + + this.totalDifficulty = totalDifficulty; + return this; + } + + /** + * Get totalDifficulty + * @return totalDifficulty + **/ + @javax.annotation.Nullable + public BigDecimal getTotalDifficulty() { + return totalDifficulty; + } + + + public void setTotalDifficulty(BigDecimal totalDifficulty) { + this.totalDifficulty = totalDifficulty; + } + + + public EvmBlock extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nullable + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public EvmBlock size(BigDecimal size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nullable + public BigDecimal getSize() { + return size; + } + + + public void setSize(BigDecimal size) { + this.size = size; + } + + + public EvmBlock gasLimit(BigDecimal gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nullable + public BigDecimal getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(BigDecimal gasLimit) { + this.gasLimit = gasLimit; + } + + + public EvmBlock gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nullable + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public EvmBlock timestamp(Object timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + public Object getTimestamp() { + return timestamp; + } + + + public void setTimestamp(Object timestamp) { + this.timestamp = timestamp; + } + + + public EvmBlock transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public EvmBlock addTransactionsItem(Object transactionsItem) { + if (this.transactions == null) { + this.transactions = new ArrayList<>(); + } + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nullable + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + public EvmBlock uncles(List uncles) { + + this.uncles = uncles; + return this; + } + + public EvmBlock addUnclesItem(Object unclesItem) { + if (this.uncles == null) { + this.uncles = new ArrayList<>(); + } + this.uncles.add(unclesItem); + return this; + } + + /** + * Get uncles + * @return uncles + **/ + @javax.annotation.Nullable + public List getUncles() { + return uncles; + } + + + public void setUncles(List uncles) { + this.uncles = uncles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmBlock evmBlock = (EvmBlock) o; + return Objects.equals(this.number, evmBlock.number) && + Objects.equals(this.hash, evmBlock.hash) && + Objects.equals(this.parentHash, evmBlock.parentHash) && + Objects.equals(this.nonce, evmBlock.nonce) && + Objects.equals(this.sha3Uncles, evmBlock.sha3Uncles) && + Objects.equals(this.logsBloom, evmBlock.logsBloom) && + Objects.equals(this.transactionsRoot, evmBlock.transactionsRoot) && + Objects.equals(this.stateRoot, evmBlock.stateRoot) && + Objects.equals(this.miner, evmBlock.miner) && + Objects.equals(this.difficulty, evmBlock.difficulty) && + Objects.equals(this.totalDifficulty, evmBlock.totalDifficulty) && + Objects.equals(this.extraData, evmBlock.extraData) && + Objects.equals(this.size, evmBlock.size) && + Objects.equals(this.gasLimit, evmBlock.gasLimit) && + Objects.equals(this.gasUsed, evmBlock.gasUsed) && + Objects.equals(this.timestamp, evmBlock.timestamp) && + Objects.equals(this.transactions, evmBlock.transactions) && + Objects.equals(this.uncles, evmBlock.uncles); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, miner, difficulty, totalDifficulty, extraData, size, gasLimit, gasUsed, timestamp, transactions, uncles); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmBlock {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" totalDifficulty: ").append(toIndentedString(totalDifficulty)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append(" uncles: ").append(toIndentedString(uncles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("miner"); + openapiFields.add("difficulty"); + openapiFields.add("totalDifficulty"); + openapiFields.add("extraData"); + openapiFields.add("size"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + openapiFields.add("transactions"); + openapiFields.add("uncles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvmBlock + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EvmBlock.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EvmBlock is not found in the empty JSON string", EvmBlock.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvmBlock.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvmBlock` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("hash") != null && !jsonObj.get("hash").isJsonNull()) && !jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if ((jsonObj.get("parentHash") != null && !jsonObj.get("parentHash").isJsonNull()) && !jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("sha3Uncles") != null && !jsonObj.get("sha3Uncles").isJsonNull()) && !jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if ((jsonObj.get("stateRoot") != null && !jsonObj.get("stateRoot").isJsonNull()) && !jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("miner") != null && !jsonObj.get("miner").isJsonNull()) && !jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if ((jsonObj.get("extraData") != null && !jsonObj.get("extraData").isJsonNull()) && !jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transactions") != null && !jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("uncles") != null && !jsonObj.get("uncles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uncles` to be an array in the JSON string but got `%s`", jsonObj.get("uncles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvmBlock.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvmBlock' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvmBlock.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvmBlock value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvmBlock read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvmBlock given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvmBlock + * @throws IOException if the JSON string is invalid with respect to EvmBlock + */ + public static EvmBlock fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvmBlock.class); + } + + /** + * Convert an instance of EvmBlock to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java new file mode 100644 index 0000000000..f0cb8bee56 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java @@ -0,0 +1,445 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EvmLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EvmLog { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TOPICS = "topics"; + @SerializedName(SERIALIZED_NAME_TOPICS) + private List topics = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LOG_INDEX = "logIndex"; + @SerializedName(SERIALIZED_NAME_LOG_INDEX) + private BigDecimal logIndex; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public EvmLog() { + } + + public EvmLog address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public EvmLog data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + public EvmLog blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public EvmLog transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public EvmLog topics(List topics) { + + this.topics = topics; + return this; + } + + public EvmLog addTopicsItem(String topicsItem) { + if (this.topics == null) { + this.topics = new ArrayList<>(); + } + this.topics.add(topicsItem); + return this; + } + + /** + * Get topics + * @return topics + **/ + @javax.annotation.Nonnull + public List getTopics() { + return topics; + } + + + public void setTopics(List topics) { + this.topics = topics; + } + + + public EvmLog logIndex(BigDecimal logIndex) { + + this.logIndex = logIndex; + return this; + } + + /** + * Get logIndex + * @return logIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getLogIndex() { + return logIndex; + } + + + public void setLogIndex(BigDecimal logIndex) { + this.logIndex = logIndex; + } + + + public EvmLog transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public EvmLog blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmLog evmLog = (EvmLog) o; + return Objects.equals(this.address, evmLog.address) && + Objects.equals(this.data, evmLog.data) && + Objects.equals(this.blockHash, evmLog.blockHash) && + Objects.equals(this.transactionHash, evmLog.transactionHash) && + Objects.equals(this.topics, evmLog.topics) && + Objects.equals(this.logIndex, evmLog.logIndex) && + Objects.equals(this.transactionIndex, evmLog.transactionIndex) && + Objects.equals(this.blockNumber, evmLog.blockNumber); + } + + @Override + public int hashCode() { + return Objects.hash(address, data, blockHash, transactionHash, topics, logIndex, transactionIndex, blockNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmLog {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" topics: ").append(toIndentedString(topics)).append("\n"); + sb.append(" logIndex: ").append(toIndentedString(logIndex)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("data"); + openapiFields.add("blockHash"); + openapiFields.add("transactionHash"); + openapiFields.add("topics"); + openapiFields.add("logIndex"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("topics"); + openapiRequiredFields.add("logIndex"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvmLog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EvmLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EvmLog is not found in the empty JSON string", EvmLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvmLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvmLog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EvmLog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + // ensure the required json array is present + if (jsonObj.get("topics") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("topics").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `topics` to be an array in the JSON string but got `%s`", jsonObj.get("topics").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvmLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvmLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvmLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvmLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvmLog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvmLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvmLog + * @throws IOException if the JSON string is invalid with respect to EvmLog + */ + public static EvmLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvmLog.class); + } + + /** + * Convert an instance of EvmLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java new file mode 100644 index 0000000000..8fec01001c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java @@ -0,0 +1,513 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EvmTransaction + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EvmTransaction { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private Object blockHash = null; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private Object blockNumber = null; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private Object transactionIndex = null; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private Object to = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public EvmTransaction() { + } + + public EvmTransaction hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nullable + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public EvmTransaction nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public EvmTransaction blockHash(Object blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nullable + public Object getBlockHash() { + return blockHash; + } + + + public void setBlockHash(Object blockHash) { + this.blockHash = blockHash; + } + + + public EvmTransaction blockNumber(Object blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nullable + public Object getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(Object blockNumber) { + this.blockNumber = blockNumber; + } + + + public EvmTransaction transactionIndex(Object transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nullable + public Object getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(Object transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public EvmTransaction from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public EvmTransaction to(Object to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public Object getTo() { + return to; + } + + + public void setTo(Object to) { + this.to = to; + } + + + public EvmTransaction value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public EvmTransaction gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public EvmTransaction gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public EvmTransaction input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nullable + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmTransaction evmTransaction = (EvmTransaction) o; + return Objects.equals(this.hash, evmTransaction.hash) && + Objects.equals(this.nonce, evmTransaction.nonce) && + Objects.equals(this.blockHash, evmTransaction.blockHash) && + Objects.equals(this.blockNumber, evmTransaction.blockNumber) && + Objects.equals(this.transactionIndex, evmTransaction.transactionIndex) && + Objects.equals(this.from, evmTransaction.from) && + Objects.equals(this.to, evmTransaction.to) && + Objects.equals(this.value, evmTransaction.value) && + Objects.equals(this.gasPrice, evmTransaction.gasPrice) && + Objects.equals(this.gas, evmTransaction.gas) && + Objects.equals(this.input, evmTransaction.input); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gasPrice, gas, input); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmTransaction {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("nonce"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("transactionIndex"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gasPrice"); + openapiFields.add("gas"); + openapiFields.add("input"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvmTransaction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EvmTransaction.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EvmTransaction is not found in the empty JSON string", EvmTransaction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvmTransaction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvmTransaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("hash") != null && !jsonObj.get("hash").isJsonNull()) && !jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + if ((jsonObj.get("input") != null && !jsonObj.get("input").isJsonNull()) && !jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvmTransaction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvmTransaction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvmTransaction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvmTransaction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvmTransaction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvmTransaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvmTransaction + * @throws IOException if the JSON string is invalid with respect to EvmTransaction + */ + public static EvmTransaction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvmTransaction.class); + } + + /** + * Convert an instance of EvmTransaction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java new file mode 100644 index 0000000000..93df8d4785 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBalanceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBalanceV1Request { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_DEFAULT_BLOCK = "defaultBlock"; + @SerializedName(SERIALIZED_NAME_DEFAULT_BLOCK) + private Object defaultBlock = null; + + public GetBalanceV1Request() { + } + + public GetBalanceV1Request address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public GetBalanceV1Request defaultBlock(Object defaultBlock) { + + this.defaultBlock = defaultBlock; + return this; + } + + /** + * Get defaultBlock + * @return defaultBlock + **/ + @javax.annotation.Nullable + public Object getDefaultBlock() { + return defaultBlock; + } + + + public void setDefaultBlock(Object defaultBlock) { + this.defaultBlock = defaultBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBalanceV1Request getBalanceV1Request = (GetBalanceV1Request) o; + return Objects.equals(this.address, getBalanceV1Request.address) && + Objects.equals(this.defaultBlock, getBalanceV1Request.defaultBlock); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(address, defaultBlock); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBalanceV1Request {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" defaultBlock: ").append(toIndentedString(defaultBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("defaultBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBalanceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBalanceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBalanceV1Request is not found in the empty JSON string", GetBalanceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBalanceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBalanceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBalanceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBalanceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBalanceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBalanceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBalanceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBalanceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBalanceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBalanceV1Request + * @throws IOException if the JSON string is invalid with respect to GetBalanceV1Request + */ + public static GetBalanceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBalanceV1Request.class); + } + + /** + * Convert an instance of GetBalanceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java new file mode 100644 index 0000000000..32ac16a4d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBalanceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBalanceV1Response { + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private String balance; + + public GetBalanceV1Response() { + } + + public GetBalanceV1Response balance(String balance) { + + this.balance = balance; + return this; + } + + /** + * Get balance + * @return balance + **/ + @javax.annotation.Nonnull + public String getBalance() { + return balance; + } + + + public void setBalance(String balance) { + this.balance = balance; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBalanceV1Response getBalanceV1Response = (GetBalanceV1Response) o; + return Objects.equals(this.balance, getBalanceV1Response.balance); + } + + @Override + public int hashCode() { + return Objects.hash(balance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBalanceV1Response {\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("balance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("balance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBalanceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBalanceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBalanceV1Response is not found in the empty JSON string", GetBalanceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBalanceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBalanceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBalanceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("balance").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `balance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balance").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBalanceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBalanceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBalanceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBalanceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBalanceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBalanceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBalanceV1Response + * @throws IOException if the JSON string is invalid with respect to GetBalanceV1Response + */ + public static GetBalanceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBalanceV1Response.class); + } + + /** + * Convert an instance of GetBalanceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java new file mode 100644 index 0000000000..3db239fb9a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java @@ -0,0 +1,241 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.InvokeContractV1Request; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBesuRecordV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBesuRecordV1Request { + public static final String SERIALIZED_NAME_INVOKE_CALL = "invokeCall"; + @SerializedName(SERIALIZED_NAME_INVOKE_CALL) + private InvokeContractV1Request invokeCall; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public GetBesuRecordV1Request() { + } + + public GetBesuRecordV1Request invokeCall(InvokeContractV1Request invokeCall) { + + this.invokeCall = invokeCall; + return this; + } + + /** + * Get invokeCall + * @return invokeCall + **/ + @javax.annotation.Nullable + public InvokeContractV1Request getInvokeCall() { + return invokeCall; + } + + + public void setInvokeCall(InvokeContractV1Request invokeCall) { + this.invokeCall = invokeCall; + } + + + public GetBesuRecordV1Request transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nullable + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBesuRecordV1Request getBesuRecordV1Request = (GetBesuRecordV1Request) o; + return Objects.equals(this.invokeCall, getBesuRecordV1Request.invokeCall) && + Objects.equals(this.transactionHash, getBesuRecordV1Request.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(invokeCall, transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBesuRecordV1Request {\n"); + sb.append(" invokeCall: ").append(toIndentedString(invokeCall)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("invokeCall"); + openapiFields.add("transactionHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBesuRecordV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBesuRecordV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBesuRecordV1Request is not found in the empty JSON string", GetBesuRecordV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBesuRecordV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBesuRecordV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `invokeCall` + if (jsonObj.get("invokeCall") != null && !jsonObj.get("invokeCall").isJsonNull()) { + InvokeContractV1Request.validateJsonObject(jsonObj.getAsJsonObject("invokeCall")); + } + if ((jsonObj.get("transactionHash") != null && !jsonObj.get("transactionHash").isJsonNull()) && !jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBesuRecordV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBesuRecordV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBesuRecordV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBesuRecordV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBesuRecordV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBesuRecordV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBesuRecordV1Request + * @throws IOException if the JSON string is invalid with respect to GetBesuRecordV1Request + */ + public static GetBesuRecordV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBesuRecordV1Request.class); + } + + /** + * Convert an instance of GetBesuRecordV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java new file mode 100644 index 0000000000..abd15a6a54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java @@ -0,0 +1,307 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBesuRecordV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBesuRecordV1Response { + public static final String SERIALIZED_NAME_LEDGER_ID = "ledgerId"; + @SerializedName(SERIALIZED_NAME_LEDGER_ID) + private String ledgerId; + + public static final String SERIALIZED_NAME_STATE_CONTRACT = "stateContract"; + @SerializedName(SERIALIZED_NAME_STATE_CONTRACT) + private String stateContract; + + public static final String SERIALIZED_NAME_TRANSACTION_INPUT_DATA = "transactionInputData"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INPUT_DATA) + private Object transactionInputData = null; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public GetBesuRecordV1Response() { + } + + public GetBesuRecordV1Response ledgerId(String ledgerId) { + + this.ledgerId = ledgerId; + return this; + } + + /** + * Get ledgerId + * @return ledgerId + **/ + @javax.annotation.Nullable + public String getLedgerId() { + return ledgerId; + } + + + public void setLedgerId(String ledgerId) { + this.ledgerId = ledgerId; + } + + + public GetBesuRecordV1Response stateContract(String stateContract) { + + this.stateContract = stateContract; + return this; + } + + /** + * Get stateContract + * @return stateContract + **/ + @javax.annotation.Nullable + public String getStateContract() { + return stateContract; + } + + + public void setStateContract(String stateContract) { + this.stateContract = stateContract; + } + + + public GetBesuRecordV1Response transactionInputData(Object transactionInputData) { + + this.transactionInputData = transactionInputData; + return this; + } + + /** + * Get transactionInputData + * @return transactionInputData + **/ + @javax.annotation.Nullable + public Object getTransactionInputData() { + return transactionInputData; + } + + + public void setTransactionInputData(Object transactionInputData) { + this.transactionInputData = transactionInputData; + } + + + public GetBesuRecordV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBesuRecordV1Response getBesuRecordV1Response = (GetBesuRecordV1Response) o; + return Objects.equals(this.ledgerId, getBesuRecordV1Response.ledgerId) && + Objects.equals(this.stateContract, getBesuRecordV1Response.stateContract) && + Objects.equals(this.transactionInputData, getBesuRecordV1Response.transactionInputData) && + Objects.equals(this.callOutput, getBesuRecordV1Response.callOutput); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(ledgerId, stateContract, transactionInputData, callOutput); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBesuRecordV1Response {\n"); + sb.append(" ledgerId: ").append(toIndentedString(ledgerId)).append("\n"); + sb.append(" stateContract: ").append(toIndentedString(stateContract)).append("\n"); + sb.append(" transactionInputData: ").append(toIndentedString(transactionInputData)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ledgerId"); + openapiFields.add("stateContract"); + openapiFields.add("transactionInputData"); + openapiFields.add("callOutput"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBesuRecordV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBesuRecordV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBesuRecordV1Response is not found in the empty JSON string", GetBesuRecordV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBesuRecordV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBesuRecordV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("ledgerId") != null && !jsonObj.get("ledgerId").isJsonNull()) && !jsonObj.get("ledgerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ledgerId").toString())); + } + if ((jsonObj.get("stateContract") != null && !jsonObj.get("stateContract").isJsonNull()) && !jsonObj.get("stateContract").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateContract` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateContract").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBesuRecordV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBesuRecordV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBesuRecordV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBesuRecordV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBesuRecordV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBesuRecordV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBesuRecordV1Response + * @throws IOException if the JSON string is invalid with respect to GetBesuRecordV1Response + */ + public static GetBesuRecordV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBesuRecordV1Response.class); + } + + /** + * Convert an instance of GetBesuRecordV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java new file mode 100644 index 0000000000..944d1f213b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBlockV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockV1Request { + public static final String SERIALIZED_NAME_BLOCK_HASH_OR_BLOCK_NUMBER = "blockHashOrBlockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH_OR_BLOCK_NUMBER) + private Object blockHashOrBlockNumber = null; + + public GetBlockV1Request() { + } + + public GetBlockV1Request blockHashOrBlockNumber(Object blockHashOrBlockNumber) { + + this.blockHashOrBlockNumber = blockHashOrBlockNumber; + return this; + } + + /** + * Get blockHashOrBlockNumber + * @return blockHashOrBlockNumber + **/ + @javax.annotation.Nullable + public Object getBlockHashOrBlockNumber() { + return blockHashOrBlockNumber; + } + + + public void setBlockHashOrBlockNumber(Object blockHashOrBlockNumber) { + this.blockHashOrBlockNumber = blockHashOrBlockNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockV1Request getBlockV1Request = (GetBlockV1Request) o; + return Objects.equals(this.blockHashOrBlockNumber, getBlockV1Request.blockHashOrBlockNumber); + } + + @Override + public int hashCode() { + return Objects.hash(blockHashOrBlockNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockV1Request {\n"); + sb.append(" blockHashOrBlockNumber: ").append(toIndentedString(blockHashOrBlockNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHashOrBlockNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockHashOrBlockNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockV1Request is not found in the empty JSON string", GetBlockV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockV1Request + * @throws IOException if the JSON string is invalid with respect to GetBlockV1Request + */ + public static GetBlockV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockV1Request.class); + } + + /** + * Convert an instance of GetBlockV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java new file mode 100644 index 0000000000..19a7b34575 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.EvmBlock; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBlockV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockV1Response { + public static final String SERIALIZED_NAME_BLOCK = "block"; + @SerializedName(SERIALIZED_NAME_BLOCK) + private EvmBlock block; + + public GetBlockV1Response() { + } + + public GetBlockV1Response block(EvmBlock block) { + + this.block = block; + return this; + } + + /** + * Get block + * @return block + **/ + @javax.annotation.Nonnull + public EvmBlock getBlock() { + return block; + } + + + public void setBlock(EvmBlock block) { + this.block = block; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockV1Response getBlockV1Response = (GetBlockV1Response) o; + return Objects.equals(this.block, getBlockV1Response.block); + } + + @Override + public int hashCode() { + return Objects.hash(block); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockV1Response {\n"); + sb.append(" block: ").append(toIndentedString(block)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("block"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("block"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockV1Response is not found in the empty JSON string", GetBlockV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `block` + EvmBlock.validateJsonObject(jsonObj.getAsJsonObject("block")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockV1Response + * @throws IOException if the JSON string is invalid with respect to GetBlockV1Response + */ + public static GetBlockV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockV1Response.class); + } + + /** + * Convert an instance of GetBlockV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java new file mode 100644 index 0000000000..05c29eec01 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java @@ -0,0 +1,315 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetPastLogsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetPastLogsV1Request { + public static final String SERIALIZED_NAME_TO_BLOCK = "toBlock"; + @SerializedName(SERIALIZED_NAME_TO_BLOCK) + private Object toBlock = null; + + public static final String SERIALIZED_NAME_FROM_BLOCK = "fromBlock"; + @SerializedName(SERIALIZED_NAME_FROM_BLOCK) + private Object fromBlock = null; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Object address = null; + + public static final String SERIALIZED_NAME_TOPICS = "topics"; + @SerializedName(SERIALIZED_NAME_TOPICS) + private List topics; + + public GetPastLogsV1Request() { + } + + public GetPastLogsV1Request toBlock(Object toBlock) { + + this.toBlock = toBlock; + return this; + } + + /** + * Get toBlock + * @return toBlock + **/ + @javax.annotation.Nullable + public Object getToBlock() { + return toBlock; + } + + + public void setToBlock(Object toBlock) { + this.toBlock = toBlock; + } + + + public GetPastLogsV1Request fromBlock(Object fromBlock) { + + this.fromBlock = fromBlock; + return this; + } + + /** + * Get fromBlock + * @return fromBlock + **/ + @javax.annotation.Nullable + public Object getFromBlock() { + return fromBlock; + } + + + public void setFromBlock(Object fromBlock) { + this.fromBlock = fromBlock; + } + + + public GetPastLogsV1Request address(Object address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + public Object getAddress() { + return address; + } + + + public void setAddress(Object address) { + this.address = address; + } + + + public GetPastLogsV1Request topics(List topics) { + + this.topics = topics; + return this; + } + + public GetPastLogsV1Request addTopicsItem(Object topicsItem) { + if (this.topics == null) { + this.topics = new ArrayList<>(); + } + this.topics.add(topicsItem); + return this; + } + + /** + * Get topics + * @return topics + **/ + @javax.annotation.Nullable + public List getTopics() { + return topics; + } + + + public void setTopics(List topics) { + this.topics = topics; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPastLogsV1Request getPastLogsV1Request = (GetPastLogsV1Request) o; + return Objects.equals(this.toBlock, getPastLogsV1Request.toBlock) && + Objects.equals(this.fromBlock, getPastLogsV1Request.fromBlock) && + Objects.equals(this.address, getPastLogsV1Request.address) && + Objects.equals(this.topics, getPastLogsV1Request.topics); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(toBlock, fromBlock, address, topics); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPastLogsV1Request {\n"); + sb.append(" toBlock: ").append(toIndentedString(toBlock)).append("\n"); + sb.append(" fromBlock: ").append(toIndentedString(fromBlock)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" topics: ").append(toIndentedString(topics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("toBlock"); + openapiFields.add("fromBlock"); + openapiFields.add("address"); + openapiFields.add("topics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPastLogsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetPastLogsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPastLogsV1Request is not found in the empty JSON string", GetPastLogsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPastLogsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPastLogsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("topics") != null && !jsonObj.get("topics").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `topics` to be an array in the JSON string but got `%s`", jsonObj.get("topics").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPastLogsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPastLogsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPastLogsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPastLogsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPastLogsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPastLogsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPastLogsV1Request + * @throws IOException if the JSON string is invalid with respect to GetPastLogsV1Request + */ + public static GetPastLogsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPastLogsV1Request.class); + } + + /** + * Convert an instance of GetPastLogsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java new file mode 100644 index 0000000000..6aad971ece --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java @@ -0,0 +1,234 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EvmLog; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetPastLogsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetPastLogsV1Response { + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = new ArrayList<>(); + + public GetPastLogsV1Response() { + } + + public GetPastLogsV1Response logs(List logs) { + + this.logs = logs; + return this; + } + + public GetPastLogsV1Response addLogsItem(EvmLog logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nonnull + public List getLogs() { + return logs; + } + + + public void setLogs(List logs) { + this.logs = logs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPastLogsV1Response getPastLogsV1Response = (GetPastLogsV1Response) o; + return Objects.equals(this.logs, getPastLogsV1Response.logs); + } + + @Override + public int hashCode() { + return Objects.hash(logs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPastLogsV1Response {\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("logs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("logs"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPastLogsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetPastLogsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPastLogsV1Response is not found in the empty JSON string", GetPastLogsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPastLogsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPastLogsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPastLogsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + + JsonArray jsonArraylogs = jsonObj.getAsJsonArray("logs"); + // validate the required field `logs` (array) + for (int i = 0; i < jsonArraylogs.size(); i++) { + EvmLog.validateJsonObject(jsonArraylogs.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPastLogsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPastLogsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPastLogsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPastLogsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPastLogsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPastLogsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPastLogsV1Response + * @throws IOException if the JSON string is invalid with respect to GetPastLogsV1Response + */ + public static GetPastLogsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPastLogsV1Response.class); + } + + /** + * Convert an instance of GetPastLogsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java new file mode 100644 index 0000000000..fe10b68d1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetTransactionV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionV1Request { + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public GetTransactionV1Request() { + } + + public GetTransactionV1Request transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionV1Request getTransactionV1Request = (GetTransactionV1Request) o; + return Objects.equals(this.transactionHash, getTransactionV1Request.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionV1Request {\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionV1Request is not found in the empty JSON string", GetTransactionV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionV1Request + * @throws IOException if the JSON string is invalid with respect to GetTransactionV1Request + */ + public static GetTransactionV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionV1Request.class); + } + + /** + * Convert an instance of GetTransactionV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java new file mode 100644 index 0000000000..934cf02d23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.EvmTransaction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetTransactionV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionV1Response { + public static final String SERIALIZED_NAME_TRANSACTION = "transaction"; + @SerializedName(SERIALIZED_NAME_TRANSACTION) + private EvmTransaction transaction; + + public GetTransactionV1Response() { + } + + public GetTransactionV1Response transaction(EvmTransaction transaction) { + + this.transaction = transaction; + return this; + } + + /** + * Get transaction + * @return transaction + **/ + @javax.annotation.Nonnull + public EvmTransaction getTransaction() { + return transaction; + } + + + public void setTransaction(EvmTransaction transaction) { + this.transaction = transaction; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionV1Response getTransactionV1Response = (GetTransactionV1Response) o; + return Objects.equals(this.transaction, getTransactionV1Response.transaction); + } + + @Override + public int hashCode() { + return Objects.hash(transaction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionV1Response {\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transaction"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transaction"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionV1Response is not found in the empty JSON string", GetTransactionV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `transaction` + EvmTransaction.validateJsonObject(jsonObj.getAsJsonObject("transaction")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionV1Response + * @throws IOException if the JSON string is invalid with respect to GetTransactionV1Response + */ + public static GetTransactionV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionV1Response.class); + } + + /** + * Convert an instance of GetTransactionV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 0000000000..9e43181608 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,645 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_SIGNING_CREDENTIAL = "signingCredential"; + @SerializedName(SERIALIZED_NAME_SIGNING_CREDENTIAL) + private Web3SigningCredential signingCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Web3BlockHeaderTimestamp value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private Web3BlockHeaderTimestamp gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private Web3BlockHeaderTimestamp gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private BesuPrivateTransactionConfig privateTransactionConfig; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request signingCredential(Web3SigningCredential signingCredential) { + + this.signingCredential = signingCredential; + return this; + } + + /** + * Get signingCredential + * @return signingCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getSigningCredential() { + return signingCredential; + } + + + public void setSigningCredential(Web3SigningCredential signingCredential) { + this.signingCredential = signingCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public InvokeContractV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return contractAbi + **/ + @javax.annotation.Nullable + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public InvokeContractV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract, optional parameter + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractV1Request value(Web3BlockHeaderTimestamp value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getValue() { + return value; + } + + + public void setValue(Web3BlockHeaderTimestamp value) { + this.value = value; + } + + + public InvokeContractV1Request gas(Web3BlockHeaderTimestamp gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGas() { + return gas; + } + + + public void setGas(Web3BlockHeaderTimestamp gas) { + this.gas = gas; + } + + + public InvokeContractV1Request gasPrice(Web3BlockHeaderTimestamp gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(Web3BlockHeaderTimestamp gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nullable + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public InvokeContractV1Request privateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public BesuPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.signingCredential, invokeContractV1Request.signingCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.contractAbi, invokeContractV1Request.contractAbi) && + Objects.equals(this.contractAddress, invokeContractV1Request.contractAddress) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gas, invokeContractV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId) && + Objects.equals(this.privateTransactionConfig, invokeContractV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, signingCredential, invocationType, methodName, params, contractAbi, contractAddress, value, gas, gasPrice, nonce, timeoutMs, keychainId, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" signingCredential: ").append(toIndentedString(signingCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("signingCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAbi"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("signingCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `signingCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("signingCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractAbi") != null && !jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + if ((jsonObj.get("keychainId") != null && !jsonObj.get("keychainId").isJsonNull()) && !jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + BesuPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..0510ac145d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java new file mode 100644 index 0000000000..fe0c08dacb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. + */ +@JsonAdapter(ReceiptType.Adapter.class) +public enum ReceiptType { + + NODE_TX_POOL_ACK("NODE_TX_POOL_ACK"), + + LEDGER_BLOCK_ACK("LEDGER_BLOCK_ACK"); + + private String value; + + ReceiptType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ReceiptType fromValue(String value) { + for (ReceiptType b : ReceiptType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ReceiptType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ReceiptType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ReceiptType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 0000000000..48f9308aa3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,311 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.BesuTransactionConfig; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private BesuTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_CONSISTENCY_STRATEGY = "consistencyStrategy"; + @SerializedName(SERIALIZED_NAME_CONSISTENCY_STRATEGY) + private ConsistencyStrategy consistencyStrategy; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private BesuPrivateTransactionConfig privateTransactionConfig; + + public RunTransactionRequest() { + } + + public RunTransactionRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionRequest transactionConfig(BesuTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + public BesuTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(BesuTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionRequest consistencyStrategy(ConsistencyStrategy consistencyStrategy) { + + this.consistencyStrategy = consistencyStrategy; + return this; + } + + /** + * Get consistencyStrategy + * @return consistencyStrategy + **/ + @javax.annotation.Nonnull + public ConsistencyStrategy getConsistencyStrategy() { + return consistencyStrategy; + } + + + public void setConsistencyStrategy(ConsistencyStrategy consistencyStrategy) { + this.consistencyStrategy = consistencyStrategy; + } + + + public RunTransactionRequest privateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public BesuPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.web3SigningCredential, runTransactionRequest.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionRequest.transactionConfig) && + Objects.equals(this.consistencyStrategy, runTransactionRequest.consistencyStrategy) && + Objects.equals(this.privateTransactionConfig, runTransactionRequest.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, consistencyStrategy, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" consistencyStrategy: ").append(toIndentedString(consistencyStrategy)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("consistencyStrategy"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + openapiRequiredFields.add("consistencyStrategy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `consistencyStrategy` + ConsistencyStrategy.validateJsonObject(jsonObj.getAsJsonObject("consistencyStrategy")); + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + BesuPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..e82865a3d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java new file mode 100644 index 0000000000..ce661beab8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SignTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SignTransactionRequest { + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_KEYCHAIN_REF = "keychainRef"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_REF) + private String keychainRef; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public SignTransactionRequest() { + } + + public SignTransactionRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public SignTransactionRequest keychainRef(String keychainRef) { + + this.keychainRef = keychainRef; + return this; + } + + /** + * Get keychainRef + * @return keychainRef + **/ + @javax.annotation.Nonnull + public String getKeychainRef() { + return keychainRef; + } + + + public void setKeychainRef(String keychainRef) { + this.keychainRef = keychainRef; + } + + + public SignTransactionRequest transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * The transaction hash of ledger will be used to fetch the contain. + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignTransactionRequest signTransactionRequest = (SignTransactionRequest) o; + return Objects.equals(this.keychainId, signTransactionRequest.keychainId) && + Objects.equals(this.keychainRef, signTransactionRequest.keychainRef) && + Objects.equals(this.transactionHash, signTransactionRequest.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(keychainId, keychainRef, transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignTransactionRequest {\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" keychainRef: ").append(toIndentedString(keychainRef)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychainId"); + openapiFields.add("keychainRef"); + openapiFields.add("transactionHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("keychainRef"); + openapiRequiredFields.add("transactionHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SignTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SignTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SignTransactionRequest is not found in the empty JSON string", SignTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SignTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SignTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SignTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("keychainRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainRef").toString())); + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SignTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SignTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SignTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SignTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SignTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SignTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SignTransactionRequest + * @throws IOException if the JSON string is invalid with respect to SignTransactionRequest + */ + public static SignTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SignTransactionRequest.class); + } + + /** + * Convert an instance of SignTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java new file mode 100644 index 0000000000..4d98d1dc1a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SignTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SignTransactionResponse { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public SignTransactionResponse() { + } + + public SignTransactionResponse signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * The signatures of ledger from the corresponding transaction hash. + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignTransactionResponse signTransactionResponse = (SignTransactionResponse) o; + return Objects.equals(this.signature, signTransactionResponse.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignTransactionResponse {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SignTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SignTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SignTransactionResponse is not found in the empty JSON string", SignTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SignTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SignTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SignTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SignTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SignTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SignTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SignTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SignTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SignTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SignTransactionResponse + * @throws IOException if the JSON string is invalid with respect to SignTransactionResponse + */ + public static SignTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SignTransactionResponse.class); + } + + /** + * Convert an instance of SignTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 0000000000..1edcb663d0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,502 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = new HashMap<>(); + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 0000000000..677f1bd398 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,314 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 0000000000..b166f1e429 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = new HashMap<>(); + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 0000000000..666f8b270a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 0000000000..ab193bc131 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 0000000000..7c477b4837 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3BlockHeader; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Progress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress { + public static final String SERIALIZED_NAME_BLOCK_HEADER = "blockHeader"; + @SerializedName(SERIALIZED_NAME_BLOCK_HEADER) + private Web3BlockHeader blockHeader; + + public WatchBlocksV1Progress() { + } + + public WatchBlocksV1Progress blockHeader(Web3BlockHeader blockHeader) { + + this.blockHeader = blockHeader; + return this; + } + + /** + * Get blockHeader + * @return blockHeader + **/ + @javax.annotation.Nonnull + public Web3BlockHeader getBlockHeader() { + return blockHeader; + } + + + public void setBlockHeader(Web3BlockHeader blockHeader) { + this.blockHeader = blockHeader; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Progress watchBlocksV1Progress = (WatchBlocksV1Progress) o; + return Objects.equals(this.blockHeader, watchBlocksV1Progress.blockHeader); + } + + @Override + public int hashCode() { + return Objects.hash(blockHeader); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Progress {\n"); + sb.append(" blockHeader: ").append(toIndentedString(blockHeader)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHeader"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockHeader"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Progress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Progress is not found in the empty JSON string", WatchBlocksV1Progress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Progress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Progress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1Progress.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `blockHeader` + Web3BlockHeader.validateJsonObject(jsonObj.getAsJsonObject("blockHeader")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Progress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java new file mode 100644 index 0000000000..549349aeb6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java @@ -0,0 +1,624 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3BlockHeader + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeader { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTION_ROOT = "transactionRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ROOT) + private String transactionRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPT_ROOT = "receiptRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPT_ROOT) + private String receiptRoot; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private Integer gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private Integer gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private Web3BlockHeaderTimestamp timestamp; + + public Web3BlockHeader() { + } + + public Web3BlockHeader number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public Web3BlockHeader hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3BlockHeader parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public Web3BlockHeader nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3BlockHeader sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public Web3BlockHeader logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nonnull + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3BlockHeader transactionRoot(String transactionRoot) { + + this.transactionRoot = transactionRoot; + return this; + } + + /** + * Get transactionRoot + * @return transactionRoot + **/ + @javax.annotation.Nonnull + public String getTransactionRoot() { + return transactionRoot; + } + + + public void setTransactionRoot(String transactionRoot) { + this.transactionRoot = transactionRoot; + } + + + public Web3BlockHeader stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public Web3BlockHeader receiptRoot(String receiptRoot) { + + this.receiptRoot = receiptRoot; + return this; + } + + /** + * Get receiptRoot + * @return receiptRoot + **/ + @javax.annotation.Nonnull + public String getReceiptRoot() { + return receiptRoot; + } + + + public void setReceiptRoot(String receiptRoot) { + this.receiptRoot = receiptRoot; + } + + + public Web3BlockHeader miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public Web3BlockHeader extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public Web3BlockHeader gasLimit(Integer gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + public Integer getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(Integer gasLimit) { + this.gasLimit = gasLimit; + } + + + public Web3BlockHeader gasUsed(Integer gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public Integer getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(Integer gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3BlockHeader timestamp(Web3BlockHeaderTimestamp timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public Web3BlockHeaderTimestamp getTimestamp() { + return timestamp; + } + + + public void setTimestamp(Web3BlockHeaderTimestamp timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3BlockHeader web3BlockHeader = (Web3BlockHeader) o; + return Objects.equals(this.number, web3BlockHeader.number) && + Objects.equals(this.hash, web3BlockHeader.hash) && + Objects.equals(this.parentHash, web3BlockHeader.parentHash) && + Objects.equals(this.nonce, web3BlockHeader.nonce) && + Objects.equals(this.sha3Uncles, web3BlockHeader.sha3Uncles) && + Objects.equals(this.logsBloom, web3BlockHeader.logsBloom) && + Objects.equals(this.transactionRoot, web3BlockHeader.transactionRoot) && + Objects.equals(this.stateRoot, web3BlockHeader.stateRoot) && + Objects.equals(this.receiptRoot, web3BlockHeader.receiptRoot) && + Objects.equals(this.miner, web3BlockHeader.miner) && + Objects.equals(this.extraData, web3BlockHeader.extraData) && + Objects.equals(this.gasLimit, web3BlockHeader.gasLimit) && + Objects.equals(this.gasUsed, web3BlockHeader.gasUsed) && + Objects.equals(this.timestamp, web3BlockHeader.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionRoot, stateRoot, receiptRoot, miner, extraData, gasLimit, gasUsed, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3BlockHeader {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionRoot: ").append(toIndentedString(transactionRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptRoot: ").append(toIndentedString(receiptRoot)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptRoot"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("logsBloom"); + openapiRequiredFields.add("transactionRoot"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("receiptRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3BlockHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3BlockHeader is not found in the empty JSON string", Web3BlockHeader.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3BlockHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3BlockHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3BlockHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if (!jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if (!jsonObj.get("transactionRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if (!jsonObj.get("receiptRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptRoot").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // validate the required field `timestamp` + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3BlockHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3BlockHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3BlockHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeader + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeader + */ + public static Web3BlockHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeader.class); + } + + /** + * Convert an instance of Web3BlockHeader to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java new file mode 100644 index 0000000000..a030d276ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeaderTimestamp extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3BlockHeaderTimestamp.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeaderTimestamp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeaderTimestamp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeaderTimestamp value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public Web3BlockHeaderTimestamp read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + Web3BlockHeaderTimestamp ret = new Web3BlockHeaderTimestamp(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3BlockHeaderTimestamp: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3BlockHeaderTimestamp() { + super("oneOf", Boolean.FALSE); + } + + public Web3BlockHeaderTimestamp(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3BlockHeaderTimestamp(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3BlockHeaderTimestamp.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeaderTimestamp + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3BlockHeaderTimestamp with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3BlockHeaderTimestamp given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeaderTimestamp + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeaderTimestamp + */ + public static Web3BlockHeaderTimestamp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeaderTimestamp.class); + } + + /** + * Convert an instance of Web3BlockHeaderTimestamp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..31d09eef33 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..0c4e5e1f57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..56bf738f83 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..c63372d6eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..cdc2bfdf27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 0000000000..a5de661341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..8aacabf4aa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,183 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.GetBalanceV1Request; +import org.openapitools.client.model.GetBalanceV1Response; +import org.openapitools.client.model.GetBesuRecordV1Request; +import org.openapitools.client.model.GetBesuRecordV1Response; +import org.openapitools.client.model.GetBlockV1Request; +import org.openapitools.client.model.GetBlockV1Response; +import org.openapitools.client.model.GetPastLogsV1Request; +import org.openapitools.client.model.GetPastLogsV1Response; +import org.openapitools.client.model.GetTransactionV1Request; +import org.openapitools.client.model.GetTransactionV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.SignTransactionRequest; +import org.openapitools.client.model.SignTransactionResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeV1Test() throws ApiException { + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + // TODO: test validations + } + + /** + * Return balance of an address of a given block + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBalanceV1Test() throws ApiException { + GetBalanceV1Request getBalanceV1Request = null; + GetBalanceV1Response response = api.getBalanceV1(getBalanceV1Request); + // TODO: test validations + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBesuRecordV1Test() throws ApiException { + GetBesuRecordV1Request getBesuRecordV1Request = null; + GetBesuRecordV1Response response = api.getBesuRecordV1(getBesuRecordV1Request); + // TODO: test validations + } + + /** + * Returns a block matching the block + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockV1Test() throws ApiException { + GetBlockV1Request getBlockV1Request = null; + GetBlockV1Response response = api.getBlockV1(getBlockV1Request); + // TODO: test validations + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOpenApiSpecV1Test() throws ApiException { + String response = api.getOpenApiSpecV1(); + // TODO: test validations + } + + /** + * Gets past logs, matching the given options. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPastLogsV1Test() throws ApiException { + GetPastLogsV1Request getPastLogsV1Request = null; + GetPastLogsV1Response response = api.getPastLogsV1(getPastLogsV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Executes a transaction on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTransactionV1Test() throws ApiException { + GetTransactionV1Request getTransactionV1Request = null; + GetTransactionV1Response response = api.getTransactionV1(getTransactionV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. + * + * Obtain signatures of ledger from the corresponding transaction hash. + * + * @throws ApiException if the Api call fails + */ + @Test + public void signTransactionV1Test() throws ApiException { + SignTransactionRequest signTransactionRequest = null; + SignTransactionResponse response = api.signTransactionV1(signTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java new file mode 100644 index 0000000000..0776f75ca2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BesuPrivateTransactionConfig + */ +public class BesuPrivateTransactionConfigTest { + private final BesuPrivateTransactionConfig model = new BesuPrivateTransactionConfig(); + + /** + * Model tests for BesuPrivateTransactionConfig + */ + @Test + public void testBesuPrivateTransactionConfig() { + // TODO: test BesuPrivateTransactionConfig + } + + /** + * Test the property 'privateFrom' + */ + @Test + public void privateFromTest() { + // TODO: test privateFrom + } + + /** + * Test the property 'privateFor' + */ + @Test + public void privateForTest() { + // TODO: test privateFor + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java new file mode 100644 index 0000000000..7c066ddf6e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.BesuTransactionConfigTo; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BesuTransactionConfig + */ +public class BesuTransactionConfigTest { + private final BesuTransactionConfig model = new BesuTransactionConfig(); + + /** + * Model tests for BesuTransactionConfig + */ + @Test + public void testBesuTransactionConfig() { + // TODO: test BesuTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java new file mode 100644 index 0000000000..5e8ab76392 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BesuTransactionConfigTo + */ +public class BesuTransactionConfigToTest { + private final BesuTransactionConfigTo model = new BesuTransactionConfigTo(); + + /** + * Model tests for BesuTransactionConfigTo + */ + @Test + public void testBesuTransactionConfigTo() { + // TODO: test BesuTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java new file mode 100644 index 0000000000..1ea7695b6c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ReceiptType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsistencyStrategy + */ +public class ConsistencyStrategyTest { + private final ConsistencyStrategy model = new ConsistencyStrategy(); + + /** + * Model tests for ConsistencyStrategy + */ + @Test + public void testConsistencyStrategy() { + // TODO: test ConsistencyStrategy + } + + /** + * Test the property 'receiptType' + */ + @Test + public void receiptTypeTest() { + // TODO: test receiptType + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'blockConfirmations' + */ + @Test + public void blockConfirmationsTest() { + // TODO: test blockConfirmations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java new file mode 100644 index 0000000000..b85b5a4c63 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java @@ -0,0 +1,125 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Request + */ +public class DeployContractSolidityBytecodeV1RequestTest { + private final DeployContractSolidityBytecodeV1Request model = new DeployContractSolidityBytecodeV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Request + */ + @Test + public void testDeployContractSolidityBytecodeV1Request() { + // TODO: test DeployContractSolidityBytecodeV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java new file mode 100644 index 0000000000..81c7ffacdd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Response + */ +public class DeployContractSolidityBytecodeV1ResponseTest { + private final DeployContractSolidityBytecodeV1Response model = new DeployContractSolidityBytecodeV1Response(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Response + */ + @Test + public void testDeployContractSolidityBytecodeV1Response() { + // TODO: test DeployContractSolidityBytecodeV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 0000000000..13bab314a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java new file mode 100644 index 0000000000..9af4d491c1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java @@ -0,0 +1,188 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EvmBlock + */ +public class EvmBlockTest { + private final EvmBlock model = new EvmBlock(); + + /** + * Model tests for EvmBlock + */ + @Test + public void testEvmBlock() { + // TODO: test EvmBlock + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'totalDifficulty' + */ + @Test + public void totalDifficultyTest() { + // TODO: test totalDifficulty + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + + /** + * Test the property 'uncles' + */ + @Test + public void unclesTest() { + // TODO: test uncles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java new file mode 100644 index 0000000000..f3651ad83e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EvmLog + */ +public class EvmLogTest { + private final EvmLog model = new EvmLog(); + + /** + * Model tests for EvmLog + */ + @Test + public void testEvmLog() { + // TODO: test EvmLog + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'topics' + */ + @Test + public void topicsTest() { + // TODO: test topics + } + + /** + * Test the property 'logIndex' + */ + @Test + public void logIndexTest() { + // TODO: test logIndex + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java new file mode 100644 index 0000000000..e00cf179eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java @@ -0,0 +1,130 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EvmTransaction + */ +public class EvmTransactionTest { + private final EvmTransaction model = new EvmTransaction(); + + /** + * Model tests for EvmTransaction + */ + @Test + public void testEvmTransaction() { + // TODO: test EvmTransaction + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java new file mode 100644 index 0000000000..a6679c64be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBalanceV1Request + */ +public class GetBalanceV1RequestTest { + private final GetBalanceV1Request model = new GetBalanceV1Request(); + + /** + * Model tests for GetBalanceV1Request + */ + @Test + public void testGetBalanceV1Request() { + // TODO: test GetBalanceV1Request + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'defaultBlock' + */ + @Test + public void defaultBlockTest() { + // TODO: test defaultBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java new file mode 100644 index 0000000000..4f12e9688f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBalanceV1Response + */ +public class GetBalanceV1ResponseTest { + private final GetBalanceV1Response model = new GetBalanceV1Response(); + + /** + * Model tests for GetBalanceV1Response + */ + @Test + public void testGetBalanceV1Response() { + // TODO: test GetBalanceV1Response + } + + /** + * Test the property 'balance' + */ + @Test + public void balanceTest() { + // TODO: test balance + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java new file mode 100644 index 0000000000..ddb3be7920 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.InvokeContractV1Request; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBesuRecordV1Request + */ +public class GetBesuRecordV1RequestTest { + private final GetBesuRecordV1Request model = new GetBesuRecordV1Request(); + + /** + * Model tests for GetBesuRecordV1Request + */ + @Test + public void testGetBesuRecordV1Request() { + // TODO: test GetBesuRecordV1Request + } + + /** + * Test the property 'invokeCall' + */ + @Test + public void invokeCallTest() { + // TODO: test invokeCall + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java new file mode 100644 index 0000000000..2a348abce4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBesuRecordV1Response + */ +public class GetBesuRecordV1ResponseTest { + private final GetBesuRecordV1Response model = new GetBesuRecordV1Response(); + + /** + * Model tests for GetBesuRecordV1Response + */ + @Test + public void testGetBesuRecordV1Response() { + // TODO: test GetBesuRecordV1Response + } + + /** + * Test the property 'ledgerId' + */ + @Test + public void ledgerIdTest() { + // TODO: test ledgerId + } + + /** + * Test the property 'stateContract' + */ + @Test + public void stateContractTest() { + // TODO: test stateContract + } + + /** + * Test the property 'transactionInputData' + */ + @Test + public void transactionInputDataTest() { + // TODO: test transactionInputData + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java new file mode 100644 index 0000000000..ca0412d936 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockV1Request + */ +public class GetBlockV1RequestTest { + private final GetBlockV1Request model = new GetBlockV1Request(); + + /** + * Model tests for GetBlockV1Request + */ + @Test + public void testGetBlockV1Request() { + // TODO: test GetBlockV1Request + } + + /** + * Test the property 'blockHashOrBlockNumber' + */ + @Test + public void blockHashOrBlockNumberTest() { + // TODO: test blockHashOrBlockNumber + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java new file mode 100644 index 0000000000..21ed360a58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.EvmBlock; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockV1Response + */ +public class GetBlockV1ResponseTest { + private final GetBlockV1Response model = new GetBlockV1Response(); + + /** + * Model tests for GetBlockV1Response + */ + @Test + public void testGetBlockV1Response() { + // TODO: test GetBlockV1Response + } + + /** + * Test the property 'block' + */ + @Test + public void blockTest() { + // TODO: test block + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java new file mode 100644 index 0000000000..10180db2ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetPastLogsV1Request + */ +public class GetPastLogsV1RequestTest { + private final GetPastLogsV1Request model = new GetPastLogsV1Request(); + + /** + * Model tests for GetPastLogsV1Request + */ + @Test + public void testGetPastLogsV1Request() { + // TODO: test GetPastLogsV1Request + } + + /** + * Test the property 'toBlock' + */ + @Test + public void toBlockTest() { + // TODO: test toBlock + } + + /** + * Test the property 'fromBlock' + */ + @Test + public void fromBlockTest() { + // TODO: test fromBlock + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'topics' + */ + @Test + public void topicsTest() { + // TODO: test topics + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java new file mode 100644 index 0000000000..f96b1b3832 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java @@ -0,0 +1,51 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EvmLog; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetPastLogsV1Response + */ +public class GetPastLogsV1ResponseTest { + private final GetPastLogsV1Response model = new GetPastLogsV1Response(); + + /** + * Model tests for GetPastLogsV1Response + */ + @Test + public void testGetPastLogsV1Response() { + // TODO: test GetPastLogsV1Response + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java new file mode 100644 index 0000000000..fbd38b96e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionV1Request + */ +public class GetTransactionV1RequestTest { + private final GetTransactionV1Request model = new GetTransactionV1Request(); + + /** + * Model tests for GetTransactionV1Request + */ + @Test + public void testGetTransactionV1Request() { + // TODO: test GetTransactionV1Request + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java new file mode 100644 index 0000000000..2d3722afad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.EvmTransaction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionV1Response + */ +public class GetTransactionV1ResponseTest { + private final GetTransactionV1Response model = new GetTransactionV1Response(); + + /** + * Model tests for GetTransactionV1Response + */ + @Test + public void testGetTransactionV1Response() { + // TODO: test GetTransactionV1Response + } + + /** + * Test the property 'transaction' + */ + @Test + public void transactionTest() { + // TODO: test transaction + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 0000000000..134db6d099 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,159 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'signingCredential' + */ + @Test + public void signingCredentialTest() { + // TODO: test signingCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..81554d7a3b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java new file mode 100644 index 0000000000..fa8bfb3b75 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReceiptType + */ +public class ReceiptTypeTest { + /** + * Model tests for ReceiptType + */ + @Test + public void testReceiptType() { + // TODO: test ReceiptType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 0000000000..6d1d3da950 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.BesuTransactionConfig; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'consistencyStrategy' + */ + @Test + public void consistencyStrategyTest() { + // TODO: test consistencyStrategy + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..b27d49cb4d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java new file mode 100644 index 0000000000..1533d0ea2e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SignTransactionRequest + */ +public class SignTransactionRequestTest { + private final SignTransactionRequest model = new SignTransactionRequest(); + + /** + * Model tests for SignTransactionRequest + */ + @Test + public void testSignTransactionRequest() { + // TODO: test SignTransactionRequest + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java new file mode 100644 index 0000000000..bc689ebca9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SignTransactionResponse + */ +public class SignTransactionResponseTest { + private final SignTransactionResponse model = new SignTransactionResponse(); + + /** + * Model tests for SignTransactionResponse + */ + @Test + public void testSignTransactionResponse() { + // TODO: test SignTransactionResponse + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 0000000000..23ffa006ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 0000000000..00171bab6e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 0000000000..466c3f1b74 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 0000000000..55bcd2a6b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 0000000000..c34278797f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3BlockHeader; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'blockHeader' + */ + @Test + public void blockHeaderTest() { + // TODO: test blockHeader + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 0000000000..d8fc4e5703 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java new file mode 100644 index 0000000000..cc7957dd8f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java @@ -0,0 +1,154 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeader + */ +public class Web3BlockHeaderTest { + private final Web3BlockHeader model = new Web3BlockHeader(); + + /** + * Model tests for Web3BlockHeader + */ + @Test + public void testWeb3BlockHeader() { + // TODO: test Web3BlockHeader + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionRoot' + */ + @Test + public void transactionRootTest() { + // TODO: test transactionRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptRoot' + */ + @Test + public void receiptRootTest() { + // TODO: test receiptRoot + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java new file mode 100644 index 0000000000..62ae84bd16 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeaderTimestamp + */ +public class Web3BlockHeaderTimestampTest { + private final Web3BlockHeaderTimestamp model = new Web3BlockHeaderTimestamp(); + + /** + * Model tests for Web3BlockHeaderTimestamp + */ + @Test + public void testWeb3BlockHeaderTimestamp() { + // TODO: test Web3BlockHeaderTimestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..895ae9f8ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..25e487b50b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..a29c1e7b6a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..b43e24194a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..7d23367b16 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 0000000000..ca5c398094 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts index 7b3f63a37d..39a1c27605 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-invoke-contract.test.ts @@ -1,4 +1,5 @@ -import test, { Test } from "tape"; +import "jest-extended"; + import { v4 as uuidv4 } from "uuid"; import { PluginRegistry } from "@hyperledger/cactus-core"; import { @@ -15,88 +16,101 @@ import { LogLevelDesc } from "@hyperledger/cactus-common"; import HelloWorldContractJson from "../../../../solidity/hello-world-contract/HelloWorld.json"; import Web3 from "web3"; import { PluginImportType } from "@hyperledger/cactus-core-api"; +import { Account } from "web3-core"; -test("deploys contract via .json file", async (t: Test) => { +describe("PluginLedgerConnectorBesu", () => { const logLevel: LogLevelDesc = "TRACE"; const containerImageVersion = "2021-08-24--feat-1244"; const containerImageName = "ghcr.io/hyperledger/cactus-besu-21-1-6-all-in-one"; const besuOptions = { containerImageName, containerImageVersion }; const besuTestLedger = new BesuTestLedger(besuOptions); - await besuTestLedger.start(); + const keychainEntryKey = uuidv4(); - test.onFinish(async () => { - await besuTestLedger.stop(); - await besuTestLedger.destroy(); + let rpcApiHttpHost: string; + let rpcApiWsHost: string; + let web3: Web3; + let testEthAccount: Account; + let contractAddress: string; + let firstHighNetWorthAccount: string; + let connector: PluginLedgerConnectorBesu; + let keychainPlugin: PluginKeychainMemory; + let besuKeyPair: { privateKey: string }; + + beforeAll(async () => { + await besuTestLedger.start(); }); - const rpcApiHttpHost = await besuTestLedger.getRpcApiHttpHost(); - const rpcApiWsHost = await besuTestLedger.getRpcApiWsHost(); + beforeAll(async () => { + rpcApiHttpHost = await besuTestLedger.getRpcApiHttpHost(); + rpcApiWsHost = await besuTestLedger.getRpcApiWsHost(); + web3 = new Web3(rpcApiHttpHost); + testEthAccount = web3.eth.accounts.create(uuidv4()); - /** - * Constant defining the standard 'dev' Besu genesis.json contents. - * - * @see https://github.com/hyperledger/besu/blob/21.1.6/config/src/main/resources/dev.json - */ - const firstHighNetWorthAccount = besuTestLedger.getGenesisAccountPubKey(); - const besuKeyPair = { - privateKey: besuTestLedger.getGenesisAccountPrivKey(), - }; - const contractName = "HelloWorld"; + /** + * Constant defining the standard 'dev' Besu genesis.json contents. + * + * @see https://github.com/hyperledger/besu/blob/21.1.6/config/src/main/resources/dev.json + */ + firstHighNetWorthAccount = besuTestLedger.getGenesisAccountPubKey(); + besuKeyPair = { + privateKey: besuTestLedger.getGenesisAccountPrivKey(), + }; - const web3 = new Web3(rpcApiHttpHost); - const testEthAccount = web3.eth.accounts.create(uuidv4()); + const keychainEntryValue = testEthAccount.privateKey; + keychainPlugin = new PluginKeychainMemory({ + instanceId: uuidv4(), + keychainId: uuidv4(), + // pre-provision keychain with mock backend holding the private key of the + // test account that we'll reference while sending requests with the + // signing credential pointing to this keychain entry. + backend: new Map([[keychainEntryKey, keychainEntryValue]]), + logLevel, + }); + keychainPlugin.set( + HelloWorldContractJson.contractName, + JSON.stringify(HelloWorldContractJson), + ); + const factory = new PluginFactoryLedgerConnector({ + pluginImportType: PluginImportType.Local, + }); - const keychainEntryKey = uuidv4(); - const keychainEntryValue = testEthAccount.privateKey; - const keychainPlugin = new PluginKeychainMemory({ - instanceId: uuidv4(), - keychainId: uuidv4(), - // pre-provision keychain with mock backend holding the private key of the - // test account that we'll reference while sending requests with the - // signing credential pointing to this keychain entry. - backend: new Map([[keychainEntryKey, keychainEntryValue]]), - logLevel, - }); - keychainPlugin.set( - HelloWorldContractJson.contractName, - JSON.stringify(HelloWorldContractJson), - ); - const factory = new PluginFactoryLedgerConnector({ - pluginImportType: PluginImportType.Local, - }); - const connector: PluginLedgerConnectorBesu = await factory.create({ - rpcApiHttpHost, - rpcApiWsHost, - instanceId: uuidv4(), - pluginRegistry: new PluginRegistry({ plugins: [keychainPlugin] }), - }); + connector = await factory.create({ + rpcApiHttpHost, + rpcApiWsHost, + instanceId: uuidv4(), + pluginRegistry: new PluginRegistry({ plugins: [keychainPlugin] }), + }); - await connector.transact({ - web3SigningCredential: { - ethAccount: firstHighNetWorthAccount, - secret: besuKeyPair.privateKey, - type: Web3SigningCredentialType.PrivateKeyHex, - }, - consistencyStrategy: { - blockConfirmations: 0, - receiptType: ReceiptType.NodeTxPoolAck, - }, - transactionConfig: { - from: firstHighNetWorthAccount, - to: testEthAccount.address, - value: 10e9, - gas: 1000000, - }, - }); + await connector.transact({ + web3SigningCredential: { + ethAccount: firstHighNetWorthAccount, + secret: besuKeyPair.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + consistencyStrategy: { + blockConfirmations: 0, + receiptType: ReceiptType.NodeTxPoolAck, + }, + transactionConfig: { + from: firstHighNetWorthAccount, + to: testEthAccount.address, + value: 10e9, + gas: 1000000, + }, + }); - const balance = await web3.eth.getBalance(testEthAccount.address); - t.ok(balance, "Retrieved balance of test account OK"); - t.equals(parseInt(balance, 10), 10e9, "Balance of test account is OK"); + const balance = await web3.eth.getBalance(testEthAccount.address); + expect(balance).toBeTruthy(); + expect(parseInt(balance, 10)).toEqual(10e9); + }); - let contractAddress: string; + afterAll(async () => { + await besuTestLedger.stop(); + await besuTestLedger.destroy(); + }); - test("deploys contract via .json file", async (t2: Test) => { + it("deploys contract via .json file", async () => { const deployOut = await connector.deployContract({ keychainId: keychainPlugin.getKeychainId(), contractName: HelloWorldContractJson.contractName, @@ -110,24 +124,16 @@ test("deploys contract via .json file", async (t: Test) => { bytecode: HelloWorldContractJson.bytecode, gas: 1000000, }); - t2.ok(deployOut, "deployContract() output is truthy OK"); - t2.ok( - deployOut.transactionReceipt, - "deployContract() output.transactionReceipt is truthy OK", - ); - t2.ok( - deployOut.transactionReceipt.contractAddress, - "deployContract() output.transactionReceipt.contractAddress is truthy OK", - ); + expect(deployOut).toBeTruthy(); + expect(deployOut.transactionReceipt).toBeTruthy(); + expect(deployOut.transactionReceipt.contractAddress).toBeTruthy(); contractAddress = deployOut.transactionReceipt.contractAddress as string; - t2.ok( - typeof contractAddress === "string", - "contractAddress typeof string OK", - ); + expect(contractAddress).toBeString(); + expect(contractAddress).not.toBeEmpty(); const { callOutput: helloMsg } = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Call, methodName: "sayHello", @@ -138,14 +144,12 @@ test("deploys contract via .json file", async (t: Test) => { type: Web3SigningCredentialType.PrivateKeyHex, }, }); - t2.ok(helloMsg, "sayHello() output is truthy"); - t2.true( - typeof helloMsg === "string", - "sayHello() output is type of string", - ); + expect(helloMsg).toBeTruthy(); + expect(helloMsg).toBeString(); + expect(helloMsg).not.toBeEmpty(); }); - test("invoke Web3SigningCredentialType.NONE", async (t2: Test) => { + it("invokes contracts with Web3SigningCredentialType.NONE", async () => { const testEthAccount2 = web3.eth.accounts.create(uuidv4()); const { rawTransaction } = await web3.eth.accounts.signTransaction( @@ -172,15 +176,14 @@ test("deploys contract via .json file", async (t: Test) => { }); const balance2 = await web3.eth.getBalance(testEthAccount2.address); - t2.ok(balance2, "Retrieved balance of test account 2 OK"); - t2.equals(parseInt(balance2, 10), 10e6, "Balance of test account2 is OK"); - t2.end(); + expect(balance2).toBeTruthy(); + expect(parseInt(balance2, 10)).toEqual(10e6); }); - test("invoke Web3SigningCredentialType.PrivateKeyHex", async (t2: Test) => { + it("invokes contracts with Web3SigningCredentialType.PrivateKeyHex", async () => { const newName = `DrCactus${uuidv4()}`; const setNameOut = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Send, methodName: "setName", @@ -192,33 +195,31 @@ test("deploys contract via .json file", async (t: Test) => { }, nonce: 1, }); - t2.ok(setNameOut, "setName() invocation #1 output is truthy OK"); - - try { - const setNameOutInvalid = await connector.invokeContract({ - contractName, - keychainId: keychainPlugin.getKeychainId(), - invocationType: EthContractInvocationType.Send, - methodName: "setName", - params: [newName], - gas: 1000000, - signingCredential: { - ethAccount: testEthAccount.address, - secret: testEthAccount.privateKey, - type: Web3SigningCredentialType.PrivateKeyHex, - }, - nonce: 1, - }); - t2.ifError(setNameOutInvalid.transactionReceipt); - } catch (error) { - t2.notStrictEqual( - error, - "Nonce too low", - "setName() invocation with invalid nonce", - ); - } + expect(setNameOut).toBeTruthy(); + expect(setNameOut).toBeObject(); + + const setNameOutInvalidTask = connector.invokeContract({ + contractName: HelloWorldContractJson.contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.Send, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential: { + ethAccount: testEthAccount.address, + secret: testEthAccount.privateKey, + type: Web3SigningCredentialType.PrivateKeyHex, + }, + nonce: 1, + }); + + expect(setNameOutInvalidTask).rejects.toThrowWithMessage( + Error, + "Returned error: Nonce too low", + ); + const { callOutput: getNameOut } = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Call, methodName: "getName", @@ -230,10 +231,10 @@ test("deploys contract via .json file", async (t: Test) => { type: Web3SigningCredentialType.PrivateKeyHex, }, }); - t2.equal(getNameOut, newName, `getName() output reflects the update OK`); + expect(getNameOut).toEqual(newName); const getNameOut2 = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Send, methodName: "getName", @@ -245,10 +246,10 @@ test("deploys contract via .json file", async (t: Test) => { type: Web3SigningCredentialType.PrivateKeyHex, }, }); - t2.ok(getNameOut2, "getName() invocation #2 output is truthy OK"); + expect(getNameOut2).toBeTruthy(); const response = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Send, methodName: "deposit", @@ -261,10 +262,10 @@ test("deploys contract via .json file", async (t: Test) => { }, value: 10, }); - t2.ok(response, "deposit() payable invocation output is truthy OK"); + expect(response).toBeTruthy(); const { callOutput } = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Call, methodName: "getNameByIndex", @@ -276,16 +277,10 @@ test("deploys contract via .json file", async (t: Test) => { type: Web3SigningCredentialType.PrivateKeyHex, }, }); - t2.equal( - callOutput, - newName, - `getNameByIndex() output reflects the update OK`, - ); - - t2.end(); + expect(callOutput).toEqual(newName); }); - test("invoke Web3SigningCredentialType.CactusKeychainRef", async (t2: Test) => { + it("invokes contracts with Web3SigningCredentialType.CactusKeychainRef", async () => { const newName = `DrCactus${uuidv4()}`; const signingCredential: Web3SigningCredentialCactusKeychainRef = { ethAccount: testEthAccount.address, @@ -295,7 +290,7 @@ test("deploys contract via .json file", async (t: Test) => { }; const setNameOut = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Send, methodName: "setName", @@ -304,30 +299,27 @@ test("deploys contract via .json file", async (t: Test) => { signingCredential, nonce: 4, }); - t2.ok(setNameOut, "setName() invocation #1 output is truthy OK"); - - try { - const setNameOutInvalid = await connector.invokeContract({ - contractName, - keychainId: keychainPlugin.getKeychainId(), - invocationType: EthContractInvocationType.Send, - methodName: "setName", - params: [newName], - gas: 1000000, - signingCredential, - nonce: 4, - }); - t2.ifError(setNameOutInvalid.transactionReceipt); - } catch (error) { - t2.notStrictEqual( - error, - "Nonce too low", - "setName() invocation with invalid nonce", - ); - } + + expect(setNameOut).toBeTruthy(); + + const setNameOutInvalidTask = connector.invokeContract({ + contractName: HelloWorldContractJson.contractName, + keychainId: keychainPlugin.getKeychainId(), + invocationType: EthContractInvocationType.Send, + methodName: "setName", + params: [newName], + gas: 1000000, + signingCredential, + nonce: 4, + }); + + await expect(setNameOutInvalidTask).rejects.toThrowWithMessage( + Error, + "Returned error: Nonce too low", + ); const { callOutput: getNameOut } = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Call, methodName: "getName", @@ -335,10 +327,10 @@ test("deploys contract via .json file", async (t: Test) => { gas: 1000000, signingCredential, }); - t2.equal(getNameOut, newName, `getName() output reflects the update OK`); + expect(getNameOut).toEqual(newName); const getNameOut2 = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Send, methodName: "getName", @@ -346,10 +338,10 @@ test("deploys contract via .json file", async (t: Test) => { gas: 1000000, signingCredential, }); - t2.ok(getNameOut2, "getName() invocation #2 output is truthy OK"); + expect(getNameOut2).toBeTruthy(); const response = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Send, methodName: "deposit", @@ -358,10 +350,11 @@ test("deploys contract via .json file", async (t: Test) => { signingCredential, value: 10, }); - t2.ok(response, "deposit() payable invocation output is truthy OK"); + + expect(response).toBeTruthy(); const { callOutput: callOut } = await connector.invokeContract({ - contractName, + contractName: HelloWorldContractJson.contractName, keychainId: keychainPlugin.getKeychainId(), invocationType: EthContractInvocationType.Call, methodName: "getNameByIndex", @@ -369,14 +362,7 @@ test("deploys contract via .json file", async (t: Test) => { gas: 1000000, signingCredential, }); - t2.equal( - callOut, - newName, - `getNameByIndex() output reflects the update OK`, - ); - t2.end(); + expect(callOut).toEqual(newName); }); - - t.end(); }); diff --git a/packages/cactus-plugin-ledger-connector-corda/package.json b/packages/cactus-plugin-ledger-connector-corda/package.json index 146f763977..32ef7c1672 100644 --- a/packages/cactus-plugin-ledger-connector-corda/package.json +++ b/packages/cactus-plugin-ledger-connector-corda/package.json @@ -46,9 +46,11 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "run-p generate-sdk generate-server", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", - "generate-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", + "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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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/", + "generate-server": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin-spring -o ./src/main-server/kotlin/gen/kotlin-spring/ -c ./src/main-server/openapi-generator-config.yaml", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..00f79671a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,47 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_clear_monitor_transactions_v1_request.go +model_clear_monitor_transactions_v1_response.go +model_corda_node_ssh_credentials.go +model_corda_rpc_credentials.go +model_corda_x500_name.go +model_cordapp_deployment_config.go +model_cordapp_info.go +model_deploy_contract_jars_bad_request_v1_response.go +model_deploy_contract_jars_success_v1_response.go +model_deploy_contract_jars_v1_request.go +model_diagnose_node_v1_request.go +model_diagnose_node_v1_response.go +model_flow_invocation_type.go +model_get_monitor_transactions_v1_request.go +model_get_monitor_transactions_v1_response.go +model_get_monitor_transactions_v1_response_tx_inner.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_jar_file.go +model_jvm_object.go +model_jvm_type.go +model_jvm_type_kind.go +model_list_flows_v1_request.go +model_list_flows_v1_response.go +model_network_host_and_port.go +model_node_diagnostic_info.go +model_node_info.go +model_party.go +model_public_key.go +model_sha256.go +model_start_monitor_v1_request.go +model_start_monitor_v1_response.go +model_stop_monitor_v1_request.go +model_stop_monitor_v1_response.go +model_x500_principal.go +response.go +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..4bb2c5bd60 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,155 @@ +# Go API client for cactus-plugin-ledger-connector-corda + +Can perform basic tasks on a Corda ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-corda "github.com/hyperledger/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**ClearMonitorTransactionsV1**](docs/DefaultApi.md#clearmonitortransactionsv1) | **Delete** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions | Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. +*DefaultApi* | [**DeployContractJarsV1**](docs/DefaultApi.md#deploycontractjarsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars | Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). +*DefaultApi* | [**DiagnoseNodeV1**](docs/DefaultApi.md#diagnosenodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node | +*DefaultApi* | [**GetMonitorTransactionsV1**](docs/DefaultApi.md#getmonitortransactionsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions | Get transactions for monitored state classes. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract | Invokes a contract on a Corda ledger (e.g. a flow) +*DefaultApi* | [**ListFlowsV1**](docs/DefaultApi.md#listflowsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows | +*DefaultApi* | [**NetworkMapV1**](docs/DefaultApi.md#networkmapv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map | +*DefaultApi* | [**StartMonitorV1**](docs/DefaultApi.md#startmonitorv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor | Start monitoring corda changes (transactions) of given state class +*DefaultApi* | [**StopMonitorV1**](docs/DefaultApi.md#stopmonitorv1) | **Delete** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor | Stop monitoring corda changes (transactions) of given state class + + +## Documentation For Models + + - [ClearMonitorTransactionsV1Request](docs/ClearMonitorTransactionsV1Request.md) + - [ClearMonitorTransactionsV1Response](docs/ClearMonitorTransactionsV1Response.md) + - [CordaNodeSshCredentials](docs/CordaNodeSshCredentials.md) + - [CordaRpcCredentials](docs/CordaRpcCredentials.md) + - [CordaX500Name](docs/CordaX500Name.md) + - [CordappDeploymentConfig](docs/CordappDeploymentConfig.md) + - [CordappInfo](docs/CordappInfo.md) + - [DeployContractJarsBadRequestV1Response](docs/DeployContractJarsBadRequestV1Response.md) + - [DeployContractJarsSuccessV1Response](docs/DeployContractJarsSuccessV1Response.md) + - [DeployContractJarsV1Request](docs/DeployContractJarsV1Request.md) + - [DiagnoseNodeV1Request](docs/DiagnoseNodeV1Request.md) + - [DiagnoseNodeV1Response](docs/DiagnoseNodeV1Response.md) + - [FlowInvocationType](docs/FlowInvocationType.md) + - [GetMonitorTransactionsV1Request](docs/GetMonitorTransactionsV1Request.md) + - [GetMonitorTransactionsV1Response](docs/GetMonitorTransactionsV1Response.md) + - [GetMonitorTransactionsV1ResponseTxInner](docs/GetMonitorTransactionsV1ResponseTxInner.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [JarFile](docs/JarFile.md) + - [JvmObject](docs/JvmObject.md) + - [JvmType](docs/JvmType.md) + - [JvmTypeKind](docs/JvmTypeKind.md) + - [ListFlowsV1Request](docs/ListFlowsV1Request.md) + - [ListFlowsV1Response](docs/ListFlowsV1Response.md) + - [NetworkHostAndPort](docs/NetworkHostAndPort.md) + - [NodeDiagnosticInfo](docs/NodeDiagnosticInfo.md) + - [NodeInfo](docs/NodeInfo.md) + - [Party](docs/Party.md) + - [PublicKey](docs/PublicKey.md) + - [SHA256](docs/SHA256.md) + - [StartMonitorV1Request](docs/StartMonitorV1Request.md) + - [StartMonitorV1Response](docs/StartMonitorV1Response.md) + - [StopMonitorV1Request](docs/StopMonitorV1Request.md) + - [StopMonitorV1Response](docs/StopMonitorV1Response.md) + - [X500Principal](docs/X500Principal.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..07a90c1a42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1390 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Corda ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Corda + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars: + post: + operationId: deployContractJarsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsSuccessV1Response' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsBadRequestV1Response' + description: Bad Request + summary: "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda\ + \ speak)." + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics +components: + schemas: + SHA256: + description: "SHA-256 is part of the SHA-2 hash function family. Generated hash\ + \ is fixed size, 256-bits (32-bytes)." + example: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + externalDocs: + description: Official Corda documentation of the SHA256 class. + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.crypto/-secure-hash/-s-h-a256/index.html + properties: + bytes: + example: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + type: string + offset: + example: 0 + type: integer + size: + example: 32 + type: integer + required: + - bytes + - offset + - size + type: object + CordappInfo: + description: A CordappInfo describes a single CorDapp currently installed on + the node + example: + licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + externalDocs: + description: Official Corda Documentation of the class CordappInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.cordapp/-cordapp-info/index.html + properties: + jarHash: + $ref: '#/components/schemas/SHA256' + licence: + description: The name of the licence this CorDapp is released under + type: string + minimumPlatformVersion: + description: The minimum platform version the node must be at for the CorDapp + to run + type: integer + name: + description: The name of the JAR file that defines the CorDapp + type: string + shortName: + description: The name of the CorDapp + type: string + targetPlatformVersion: + description: The target platform version this CorDapp has been tested against + type: integer + type: + description: "A description of what sort of CorDapp this is - either a contract,\ + \ workflow, or a combination." + type: string + vendor: + description: The vendor of this CorDapp + type: string + version: + description: The version of this CorDapp + type: string + required: + - jarHash + - licence + - minimumPlatformVersion + - name + - shortName + - targetPlatformVersion + - type + - vendor + - version + type: object + NodeDiagnosticInfo: + description: A NodeDiagnosticInfo holds information about the current node version. + example: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + externalDocs: + description: Official Corda Documentation of the class NodeDiagnosticInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.node/-node-diagnostic-info/index.html + properties: + cordapps: + description: A list of CorDapps currently installed on this node + items: + $ref: '#/components/schemas/CordappInfo' + maxItems: 4096 + minItems: 0 + type: array + platformVersion: + description: "The platform version of this node. This number represents\ + \ a released API version, and should be used to make functionality decisions\ + \ (e.g. enabling an app feature only if an underlying platform feature\ + \ exists)" + type: integer + revision: + description: The git commit hash this node was built from + type: string + vendor: + description: The vendor of this node + type: string + version: + description: "The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note\ + \ that this string is effectively freeform, and so should only be used\ + \ for providing diagnostic information. It should not be used to make\ + \ functionality decisions (the platformVersion is a better fit for this)." + type: string + required: + - cordapps + - platformVersion + - revision + - vendor + - version + type: object + FlowInvocationType: + description: Determines which flow starting method will be used on the back-end + when invoking the flow. Based on the value here the plugin back-end might + invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() + method. Streamed responses are aggregated and returned in a single response + to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. + do. + enum: + - TRACKED_FLOW_DYNAMIC + - FLOW_DYNAMIC + nullable: false + type: string + JarFile: + additionalProperties: true + example: + filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + properties: + filename: + maxLength: 255 + minLength: 1 + nullable: false + type: string + hasDbMigrations: + description: Indicates whether the cordapp jar in question contains any + embedded migrations that Cactus can/should execute between copying the + jar into the cordapp directory and starting the node back up. + nullable: false + type: boolean + contentBase64: + format: base64 + maxLength: 1073741824 + minLength: 1 + nullable: false + type: string + required: + - contentBase64 + - filename + - hasDbMigrations + type: object + JvmType: + description: Represents a reference to a JVM type (such as a Java class) + example: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + properties: + fqClassName: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + constructorName: + description: This parameter is used to specify that the function used to + construct this JvmType is not a constructor function but instead is a + factory function. Setting this parameter will cause the plugin to look + up methods of the class denoted by fqClassName instead of its constructors. + maxLength: 65535 + minLength: 1 + nullable: false + type: string + invocationTarget: + $ref: '#/components/schemas/JvmObject' + required: + - fqClassName + type: object + JvmTypeKind: + enum: + - PRIMITIVE + - REFERENCE + nullable: false + type: string + JvmObject: + description: "Can represent JVM primitive and reference types as well. The jvmTypeKind\ + \ field indicates which one is being stored. If the jvmTypeKind field is set\ + \ to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise\ + \ (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property\ + \ is filled with a primitive data type supported by the JSON standard such\ + \ as strings, booleans, numbers, etc." + example: + jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + jvmTypeKind: + $ref: '#/components/schemas/JvmTypeKind' + primitiveValue: + type: object + jvmCtorArgs: + default: [] + items: + $ref: '#/components/schemas/JvmObject' + maxLength: 1024 + minLength: 0 + nullable: false + type: array + jvmType: + $ref: '#/components/schemas/JvmType' + required: + - jvmType + - jvmTypeKind + type: object + CordappDeploymentConfig: + example: + cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + sshCredentials: + $ref: '#/components/schemas/CordaNodeSshCredentials' + rpcCredentials: + $ref: '#/components/schemas/CordaRpcCredentials' + cordaNodeStartCmd: + description: The shell command to execute in order to start back up a Corda + node after having placed new jars in the cordapp directory of said node. + example: ./build/nodes/runNodes + maxLength: 65535 + minLength: 1 + nullable: false + type: string + cordappDir: + description: The absolute file system path where the Corda Node is expecting + deployed Cordapp jar files to be placed. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + cordaJarPath: + description: The absolute file system path where the corda.jar file of the + node can be found. This is used to execute database schema migrations + where applicable (H2 database in use in development environments). + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeBaseDirPath: + description: The absolute file system path where the base directory of the + Corda node can be found. This is used to pass in to corda.jar when being + invoked for certain tasks such as executing database schema migrations + for a deployed contract. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + required: + - cordaJarPath + - cordaNodeStartCmd + - cordappDir + - nodeBaseDirPath + - rpcCredentials + - sshCredentials + type: object + CordaRpcCredentials: + example: + hostname: hostname + password: password + port: 39501 + username: username + properties: + hostname: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + username: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + password: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - hostname + - password + - port + - username + type: object + CordaNodeSshCredentials: + example: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + hostKeyEntry: + example: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + maxLength: 65535 + minLength: 1 + nullable: false + type: string + username: + maxLength: 32 + minLength: 1 + nullable: false + type: string + password: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + hostname: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + required: + - hostKeyEntry + - hostname + - password + - port + - username + type: object + DeployContractJarsV1Request: + additionalProperties: false + example: + jarFiles: + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + cordappDeploymentConfigs: + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + cordappDeploymentConfigs: + default: [] + description: The list of deployment configurations pointing to the nodes + where the provided cordapp jar files are to be deployed . + items: + $ref: '#/components/schemas/CordappDeploymentConfig' + maxLength: 1024 + minLength: 0 + type: array + jarFiles: + items: + $ref: '#/components/schemas/JarFile' + nullable: false + type: array + required: + - cordappDeploymentConfigs + - jarFiles + type: object + DeployContractJarsSuccessV1Response: + example: + deployedJarFiles: + - deployedJarFiles + - deployedJarFiles + properties: + deployedJarFiles: + items: + minItems: 1 + nullable: false + type: string + type: array + required: + - deployedJarFiles + type: object + DeployContractJarsBadRequestV1Response: + properties: + errors: + items: + maxItems: 2048 + maxLength: 65535 + minItems: 1 + minLength: 1 + type: string + type: array + required: + - errors + type: object + InvokeContractV1Request: + additionalProperties: false + example: + flowInvocationType: null + timeoutMs: 0 + flowFullClassName: net.corda.samples.obligation.flows.IOUIssueFlow + params: + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + flowFullClassName: + description: The fully qualified name of the Corda flow to invoke + example: net.corda.samples.obligation.flows.IOUIssueFlow + maxLength: 1024 + minLength: 1 + nullable: false + type: string + flowInvocationType: + $ref: '#/components/schemas/FlowInvocationType' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: + $ref: '#/components/schemas/JvmObject' + nullable: false + type: array + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. + minimum: 0 + nullable: false + type: integer + required: + - flowFullClassName + - flowInvocationType + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + callOutput: "{}" + success: true + progress: + - progress + - progress + flowId: flowId + transactionId: transactionId + properties: + success: + nullable: false + type: boolean + callOutput: + description: Data returned from the JVM when no transaction is running + type: object + transactionId: + description: The net.corda.core.flows.StateMachineRunId value returned by + the flow execution. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + progress: + default: [] + description: "An array of strings representing the aggregated stream of\ + \ progress updates provided by a *tracked* flow invocation. If the flow\ + \ invocation was not tracked, this array is still returned, but as empty." + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + flowId: + description: The id for the flow handle + type: string + required: + - callOutput + - flowId + - success + type: object + StartMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StartMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if monitoring started correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + GetMonitorTransactionsV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + GetMonitorTransactionsV1Response: + example: + msg: msg + tx: + - data: data + index: index + - data: data + index: index + success: true + stateFullClassName: net.corda.samples.example.states.IOUState + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + tx: + default: [] + items: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response_tx_inner' + type: array + required: + - msg + - success + type: object + ClearMonitorTransactionsV1Request: + additionalProperties: false + example: + txIndexes: + - txIndexes + - txIndexes + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + txIndexes: + default: [] + items: + type: string + type: array + required: + - clientAppId + - stateFullClassName + - txIndexes + type: object + ClearMonitorTransactionsV1Response: + additionalProperties: false + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + StopMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StopMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + ListFlowsV1Request: + additionalProperties: false + example: + filter: filter + properties: + filter: + type: string + type: object + ListFlowsV1Response: + example: + flowNames: + - net.corda.core.flows.ContractUpgradeFlow$Authorise + - net.corda.core.flows.ContractUpgradeFlow$Deauthorise + - net.corda.core.flows.ContractUpgradeFlow$Initiate + - 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.core.flows.ContractUpgradeFlow$Authorise + - net.corda.core.flows.ContractUpgradeFlow$Deauthorise + - net.corda.core.flows.ContractUpgradeFlow$Initiate + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + required: + - flowNames + type: object + NetworkHostAndPort: + example: + port: 0.8008281904610115 + host: host + properties: + host: + type: string + port: + type: number + required: + - host + - port + type: object + PartyAndCertificate: + type: object + PublicKey: + description: An instance of a java.security.PublicKey (which is an interface) + implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + example: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + properties: + algorithm: + example: EdDSA + type: string + format: + example: X.509 + type: string + encoded: + example: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + type: string + required: + - algorithm + - encoded + - format + type: object + X500Principal: + example: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + properties: + name: + example: "O=PartyA,L=London,C=GB" + type: string + encoded: + description: Base64 encoded public key + example: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + type: string + required: + - encoded + - name + type: object + CordaX500Name: + example: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + commonName: + type: string + organisationUnit: + type: string + organisation: + example: PartyA + type: string + locality: + example: London + type: string + state: + type: string + country: + example: GB + type: string + x500Principal: + $ref: '#/components/schemas/X500Principal' + required: + - country + - locality + - organisation + - x500Principal + type: object + Party: + example: + owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + name: + $ref: '#/components/schemas/CordaX500Name' + owningKey: + $ref: '#/components/schemas/PublicKey' + required: + - name + - owningKey + type: object + NodeInfo: + example: + legalIdentities: + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + addresses: + - port: 0.8008281904610115 + host: host + - port: 0.8008281904610115 + host: host + serial: 1.4658129805029452 + platformVersion: 6 + legalIdentitiesAndCerts: + - null + - null + properties: + addresses: + items: + $ref: '#/components/schemas/NetworkHostAndPort' + type: array + platformVersion: + type: integer + serial: + type: number + legalIdentities: + items: + $ref: '#/components/schemas/Party' + type: array + legalIdentitiesAndCerts: + items: + $ref: '#/components/schemas/PartyAndCertificate' + type: array + required: + - addresses + - legalIdentities + - legalIdentitiesAndCerts + - platformVersion + - serial + type: object + NetworkMapV1Request: + type: object + NetworkMapV1Response: + items: + $ref: '#/components/schemas/NodeInfo' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + DiagnoseNodeV1Request: + additionalProperties: false + example: + nodeIds: + - nodeIds + - nodeIds + - nodeIds + - nodeIds + - nodeIds + properties: + nodeIds: + default: [] + description: "Optional property specifying which Corda Node should be the\ + \ one being diagnosed in case the Connector has multiple connections established\ + \ for different nodes (which is not yet a supported feature, but we want\ + \ to keep this possibility open for the future)." + items: + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + type: object + DiagnoseNodeV1Response: + example: + nodeDiagnosticInfo: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + properties: + nodeDiagnosticInfo: + $ref: '#/components/schemas/NodeDiagnosticInfo' + required: + - nodeDiagnosticInfo + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetMonitorTransactionsV1Response_tx_inner: + example: + data: data + index: index + properties: + index: + type: string + data: + maxItems: 10000000 + minItems: 0 + type: string + type: object diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..8da03ca906 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1081 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiClearMonitorTransactionsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + clearMonitorTransactionsV1Request *ClearMonitorTransactionsV1Request +} + +func (r ApiClearMonitorTransactionsV1Request) ClearMonitorTransactionsV1Request(clearMonitorTransactionsV1Request ClearMonitorTransactionsV1Request) ApiClearMonitorTransactionsV1Request { + r.clearMonitorTransactionsV1Request = &clearMonitorTransactionsV1Request + return r +} + +func (r ApiClearMonitorTransactionsV1Request) Execute() (*ClearMonitorTransactionsV1Response, *http.Response, error) { + return r.ApiService.ClearMonitorTransactionsV1Execute(r) +} + +/* +ClearMonitorTransactionsV1 Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClearMonitorTransactionsV1Request +*/ +func (a *DefaultApiService) ClearMonitorTransactionsV1(ctx context.Context) ApiClearMonitorTransactionsV1Request { + return ApiClearMonitorTransactionsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ClearMonitorTransactionsV1Response +func (a *DefaultApiService) ClearMonitorTransactionsV1Execute(r ApiClearMonitorTransactionsV1Request) (*ClearMonitorTransactionsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClearMonitorTransactionsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ClearMonitorTransactionsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clearMonitorTransactionsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractJarsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractJarsV1Request *DeployContractJarsV1Request +} + +func (r ApiDeployContractJarsV1Request) DeployContractJarsV1Request(deployContractJarsV1Request DeployContractJarsV1Request) ApiDeployContractJarsV1Request { + r.deployContractJarsV1Request = &deployContractJarsV1Request + return r +} + +func (r ApiDeployContractJarsV1Request) Execute() (*DeployContractJarsSuccessV1Response, *http.Response, error) { + return r.ApiService.DeployContractJarsV1Execute(r) +} + +/* +DeployContractJarsV1 Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractJarsV1Request +*/ +func (a *DefaultApiService) DeployContractJarsV1(ctx context.Context) ApiDeployContractJarsV1Request { + return ApiDeployContractJarsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractJarsSuccessV1Response +func (a *DefaultApiService) DeployContractJarsV1Execute(r ApiDeployContractJarsV1Request) (*DeployContractJarsSuccessV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractJarsSuccessV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractJarsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractJarsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v DeployContractJarsBadRequestV1Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDiagnoseNodeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + diagnoseNodeV1Request *DiagnoseNodeV1Request +} + +func (r ApiDiagnoseNodeV1Request) DiagnoseNodeV1Request(diagnoseNodeV1Request DiagnoseNodeV1Request) ApiDiagnoseNodeV1Request { + r.diagnoseNodeV1Request = &diagnoseNodeV1Request + return r +} + +func (r ApiDiagnoseNodeV1Request) Execute() (*DiagnoseNodeV1Response, *http.Response, error) { + return r.ApiService.DiagnoseNodeV1Execute(r) +} + +/* +DiagnoseNodeV1 Method for DiagnoseNodeV1 + +Responds with diagnostic information about the Corda node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDiagnoseNodeV1Request +*/ +func (a *DefaultApiService) DiagnoseNodeV1(ctx context.Context) ApiDiagnoseNodeV1Request { + return ApiDiagnoseNodeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DiagnoseNodeV1Response +func (a *DefaultApiService) DiagnoseNodeV1Execute(r ApiDiagnoseNodeV1Request) (*DiagnoseNodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DiagnoseNodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DiagnoseNodeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.diagnoseNodeV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetMonitorTransactionsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getMonitorTransactionsV1Request *GetMonitorTransactionsV1Request +} + +func (r ApiGetMonitorTransactionsV1Request) GetMonitorTransactionsV1Request(getMonitorTransactionsV1Request GetMonitorTransactionsV1Request) ApiGetMonitorTransactionsV1Request { + r.getMonitorTransactionsV1Request = &getMonitorTransactionsV1Request + return r +} + +func (r ApiGetMonitorTransactionsV1Request) Execute() (*GetMonitorTransactionsV1Response, *http.Response, error) { + return r.ApiService.GetMonitorTransactionsV1Execute(r) +} + +/* +GetMonitorTransactionsV1 Get transactions for monitored state classes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetMonitorTransactionsV1Request +*/ +func (a *DefaultApiService) GetMonitorTransactionsV1(ctx context.Context) ApiGetMonitorTransactionsV1Request { + return ApiGetMonitorTransactionsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetMonitorTransactionsV1Response +func (a *DefaultApiService) GetMonitorTransactionsV1Execute(r ApiGetMonitorTransactionsV1Request) (*GetMonitorTransactionsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMonitorTransactionsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMonitorTransactionsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getMonitorTransactionsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a Corda ledger (e.g. a flow) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListFlowsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + listFlowsV1Request *ListFlowsV1Request +} + +func (r ApiListFlowsV1Request) ListFlowsV1Request(listFlowsV1Request ListFlowsV1Request) ApiListFlowsV1Request { + r.listFlowsV1Request = &listFlowsV1Request + return r +} + +func (r ApiListFlowsV1Request) Execute() (*ListFlowsV1Response, *http.Response, error) { + return r.ApiService.ListFlowsV1Execute(r) +} + +/* +ListFlowsV1 Method for ListFlowsV1 + +Responds with a list of the flows on the Corda node. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListFlowsV1Request +*/ +func (a *DefaultApiService) ListFlowsV1(ctx context.Context) ApiListFlowsV1Request { + return ApiListFlowsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListFlowsV1Response +func (a *DefaultApiService) ListFlowsV1Execute(r ApiListFlowsV1Request) (*ListFlowsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListFlowsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListFlowsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.listFlowsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiNetworkMapV1Request struct { + ctx context.Context + ApiService *DefaultApiService + body *map[string]interface{} +} + +func (r ApiNetworkMapV1Request) Body(body map[string]interface{}) ApiNetworkMapV1Request { + r.body = &body + return r +} + +func (r ApiNetworkMapV1Request) Execute() ([]NodeInfo, *http.Response, error) { + return r.ApiService.NetworkMapV1Execute(r) +} + +/* +NetworkMapV1 Method for NetworkMapV1 + +Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNetworkMapV1Request +*/ +func (a *DefaultApiService) NetworkMapV1(ctx context.Context) ApiNetworkMapV1Request { + return ApiNetworkMapV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []NodeInfo +func (a *DefaultApiService) NetworkMapV1Execute(r ApiNetworkMapV1Request) ([]NodeInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []NodeInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.NetworkMapV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStartMonitorV1Request struct { + ctx context.Context + ApiService *DefaultApiService + startMonitorV1Request *StartMonitorV1Request +} + +func (r ApiStartMonitorV1Request) StartMonitorV1Request(startMonitorV1Request StartMonitorV1Request) ApiStartMonitorV1Request { + r.startMonitorV1Request = &startMonitorV1Request + return r +} + +func (r ApiStartMonitorV1Request) Execute() (*StartMonitorV1Response, *http.Response, error) { + return r.ApiService.StartMonitorV1Execute(r) +} + +/* +StartMonitorV1 Start monitoring corda changes (transactions) of given state class + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStartMonitorV1Request +*/ +func (a *DefaultApiService) StartMonitorV1(ctx context.Context) ApiStartMonitorV1Request { + return ApiStartMonitorV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StartMonitorV1Response +func (a *DefaultApiService) StartMonitorV1Execute(r ApiStartMonitorV1Request) (*StartMonitorV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StartMonitorV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StartMonitorV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.startMonitorV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStopMonitorV1Request struct { + ctx context.Context + ApiService *DefaultApiService + stopMonitorV1Request *StopMonitorV1Request +} + +func (r ApiStopMonitorV1Request) StopMonitorV1Request(stopMonitorV1Request StopMonitorV1Request) ApiStopMonitorV1Request { + r.stopMonitorV1Request = &stopMonitorV1Request + return r +} + +func (r ApiStopMonitorV1Request) Execute() (*StopMonitorV1Response, *http.Response, error) { + return r.ApiService.StopMonitorV1Execute(r) +} + +/* +StopMonitorV1 Stop monitoring corda changes (transactions) of given state class + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStopMonitorV1Request +*/ +func (a *DefaultApiService) StopMonitorV1(ctx context.Context) ApiStopMonitorV1Request { + return ApiStopMonitorV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StopMonitorV1Response +func (a *DefaultApiService) StopMonitorV1Execute(r ApiStopMonitorV1Request) (*StopMonitorV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StopMonitorV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StopMonitorV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.stopMonitorV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..befe12babb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Corda API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..bcc61ce1c0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..f1c51746f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..b77723a206 --- /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 0000000000..c966c8ddfd --- /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 0000000000..79f374ee88 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_request.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ClearMonitorTransactionsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClearMonitorTransactionsV1Request{} + +// ClearMonitorTransactionsV1Request struct for ClearMonitorTransactionsV1Request +type ClearMonitorTransactionsV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` + TxIndexes []string `json:"txIndexes"` +} + +// NewClearMonitorTransactionsV1Request instantiates a new ClearMonitorTransactionsV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClearMonitorTransactionsV1Request(clientAppId string, stateFullClassName string, txIndexes []string) *ClearMonitorTransactionsV1Request { + this := ClearMonitorTransactionsV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + this.TxIndexes = txIndexes + return &this +} + +// NewClearMonitorTransactionsV1RequestWithDefaults instantiates a new ClearMonitorTransactionsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClearMonitorTransactionsV1RequestWithDefaults() *ClearMonitorTransactionsV1Request { + this := ClearMonitorTransactionsV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *ClearMonitorTransactionsV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *ClearMonitorTransactionsV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *ClearMonitorTransactionsV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *ClearMonitorTransactionsV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +// GetTxIndexes returns the TxIndexes field value +func (o *ClearMonitorTransactionsV1Request) GetTxIndexes() []string { + if o == nil { + var ret []string + return ret + } + + return o.TxIndexes +} + +// GetTxIndexesOk returns a tuple with the TxIndexes field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Request) GetTxIndexesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TxIndexes, true +} + +// SetTxIndexes sets field value +func (o *ClearMonitorTransactionsV1Request) SetTxIndexes(v []string) { + o.TxIndexes = v +} + +func (o ClearMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClearMonitorTransactionsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + toSerialize["txIndexes"] = o.TxIndexes + return toSerialize, nil +} + +type NullableClearMonitorTransactionsV1Request struct { + value *ClearMonitorTransactionsV1Request + isSet bool +} + +func (v NullableClearMonitorTransactionsV1Request) Get() *ClearMonitorTransactionsV1Request { + return v.value +} + +func (v *NullableClearMonitorTransactionsV1Request) Set(val *ClearMonitorTransactionsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableClearMonitorTransactionsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableClearMonitorTransactionsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClearMonitorTransactionsV1Request(val *ClearMonitorTransactionsV1Request) *NullableClearMonitorTransactionsV1Request { + return &NullableClearMonitorTransactionsV1Request{value: val, isSet: true} +} + +func (v NullableClearMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClearMonitorTransactionsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go new file mode 100644 index 0000000000..98bad0a689 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ClearMonitorTransactionsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClearMonitorTransactionsV1Response{} + +// ClearMonitorTransactionsV1Response struct for ClearMonitorTransactionsV1Response +type ClearMonitorTransactionsV1Response struct { + // Flag set to true if operation completed correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` +} + +// NewClearMonitorTransactionsV1Response instantiates a new ClearMonitorTransactionsV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClearMonitorTransactionsV1Response(success bool, msg string) *ClearMonitorTransactionsV1Response { + this := ClearMonitorTransactionsV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewClearMonitorTransactionsV1ResponseWithDefaults instantiates a new ClearMonitorTransactionsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClearMonitorTransactionsV1ResponseWithDefaults() *ClearMonitorTransactionsV1Response { + this := ClearMonitorTransactionsV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *ClearMonitorTransactionsV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *ClearMonitorTransactionsV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *ClearMonitorTransactionsV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *ClearMonitorTransactionsV1Response) SetMsg(v string) { + o.Msg = v +} + +func (o ClearMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClearMonitorTransactionsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +type NullableClearMonitorTransactionsV1Response struct { + value *ClearMonitorTransactionsV1Response + isSet bool +} + +func (v NullableClearMonitorTransactionsV1Response) Get() *ClearMonitorTransactionsV1Response { + return v.value +} + +func (v *NullableClearMonitorTransactionsV1Response) Set(val *ClearMonitorTransactionsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableClearMonitorTransactionsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableClearMonitorTransactionsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClearMonitorTransactionsV1Response(val *ClearMonitorTransactionsV1Response) *NullableClearMonitorTransactionsV1Response { + return &NullableClearMonitorTransactionsV1Response{value: val, isSet: true} +} + +func (v NullableClearMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClearMonitorTransactionsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go new file mode 100644 index 0000000000..d1b6e0ff90 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordaNodeSshCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordaNodeSshCredentials{} + +// CordaNodeSshCredentials struct for CordaNodeSshCredentials +type CordaNodeSshCredentials struct { + HostKeyEntry string `json:"hostKeyEntry"` + Username string `json:"username"` + Password string `json:"password"` + Hostname string `json:"hostname"` + Port int32 `json:"port"` +} + +// NewCordaNodeSshCredentials instantiates a new CordaNodeSshCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCordaNodeSshCredentials(hostKeyEntry string, username string, password string, hostname string, port int32) *CordaNodeSshCredentials { + this := CordaNodeSshCredentials{} + this.HostKeyEntry = hostKeyEntry + this.Username = username + this.Password = password + this.Hostname = hostname + this.Port = port + return &this +} + +// NewCordaNodeSshCredentialsWithDefaults instantiates a new CordaNodeSshCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordaNodeSshCredentialsWithDefaults() *CordaNodeSshCredentials { + this := CordaNodeSshCredentials{} + return &this +} + +// GetHostKeyEntry returns the HostKeyEntry field value +func (o *CordaNodeSshCredentials) GetHostKeyEntry() string { + if o == nil { + var ret string + return ret + } + + return o.HostKeyEntry +} + +// GetHostKeyEntryOk returns a tuple with the HostKeyEntry field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetHostKeyEntryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HostKeyEntry, true +} + +// SetHostKeyEntry sets field value +func (o *CordaNodeSshCredentials) SetHostKeyEntry(v string) { + o.HostKeyEntry = v +} + +// GetUsername returns the Username field value +func (o *CordaNodeSshCredentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CordaNodeSshCredentials) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *CordaNodeSshCredentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CordaNodeSshCredentials) SetPassword(v string) { + o.Password = v +} + +// GetHostname returns the Hostname field value +func (o *CordaNodeSshCredentials) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *CordaNodeSshCredentials) SetHostname(v string) { + o.Hostname = v +} + +// GetPort returns the Port field value +func (o *CordaNodeSshCredentials) GetPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *CordaNodeSshCredentials) SetPort(v int32) { + o.Port = v +} + +func (o CordaNodeSshCredentials) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordaNodeSshCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hostKeyEntry"] = o.HostKeyEntry + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + toSerialize["hostname"] = o.Hostname + toSerialize["port"] = o.Port + return toSerialize, nil +} + +type NullableCordaNodeSshCredentials struct { + value *CordaNodeSshCredentials + isSet bool +} + +func (v NullableCordaNodeSshCredentials) Get() *CordaNodeSshCredentials { + return v.value +} + +func (v *NullableCordaNodeSshCredentials) Set(val *CordaNodeSshCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableCordaNodeSshCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCordaNodeSshCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordaNodeSshCredentials(val *CordaNodeSshCredentials) *NullableCordaNodeSshCredentials { + return &NullableCordaNodeSshCredentials{value: val, isSet: true} +} + +func (v NullableCordaNodeSshCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordaNodeSshCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go new file mode 100644 index 0000000000..bbfac9577e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordaRpcCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordaRpcCredentials{} + +// CordaRpcCredentials struct for CordaRpcCredentials +type CordaRpcCredentials struct { + Hostname string `json:"hostname"` + Port int32 `json:"port"` + Username string `json:"username"` + Password string `json:"password"` +} + +// NewCordaRpcCredentials instantiates a new CordaRpcCredentials object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCordaRpcCredentials(hostname string, port int32, username string, password string) *CordaRpcCredentials { + this := CordaRpcCredentials{} + this.Hostname = hostname + this.Port = port + this.Username = username + this.Password = password + return &this +} + +// NewCordaRpcCredentialsWithDefaults instantiates a new CordaRpcCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordaRpcCredentialsWithDefaults() *CordaRpcCredentials { + this := CordaRpcCredentials{} + return &this +} + +// GetHostname returns the Hostname field value +func (o *CordaRpcCredentials) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *CordaRpcCredentials) SetHostname(v string) { + o.Hostname = v +} + +// GetPort returns the Port field value +func (o *CordaRpcCredentials) GetPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *CordaRpcCredentials) SetPort(v int32) { + o.Port = v +} + +// GetUsername returns the Username field value +func (o *CordaRpcCredentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CordaRpcCredentials) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *CordaRpcCredentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CordaRpcCredentials) SetPassword(v string) { + o.Password = v +} + +func (o CordaRpcCredentials) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordaRpcCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hostname"] = o.Hostname + toSerialize["port"] = o.Port + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + return toSerialize, nil +} + +type NullableCordaRpcCredentials struct { + value *CordaRpcCredentials + isSet bool +} + +func (v NullableCordaRpcCredentials) Get() *CordaRpcCredentials { + return v.value +} + +func (v *NullableCordaRpcCredentials) Set(val *CordaRpcCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableCordaRpcCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCordaRpcCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordaRpcCredentials(val *CordaRpcCredentials) *NullableCordaRpcCredentials { + return &NullableCordaRpcCredentials{value: val, isSet: true} +} + +func (v NullableCordaRpcCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordaRpcCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go new file mode 100644 index 0000000000..b22a60ef5d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go @@ -0,0 +1,306 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordaX500Name type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordaX500Name{} + +// CordaX500Name struct for CordaX500Name +type CordaX500Name struct { + CommonName *string `json:"commonName,omitempty"` + OrganisationUnit *string `json:"organisationUnit,omitempty"` + Organisation string `json:"organisation"` + Locality string `json:"locality"` + State *string `json:"state,omitempty"` + Country string `json:"country"` + X500Principal X500Principal `json:"x500Principal"` +} + +// NewCordaX500Name instantiates a new CordaX500Name object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCordaX500Name(organisation string, locality string, country string, x500Principal X500Principal) *CordaX500Name { + this := CordaX500Name{} + this.Organisation = organisation + this.Locality = locality + this.Country = country + this.X500Principal = x500Principal + return &this +} + +// NewCordaX500NameWithDefaults instantiates a new CordaX500Name object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordaX500NameWithDefaults() *CordaX500Name { + this := CordaX500Name{} + return &this +} + +// GetCommonName returns the CommonName field value if set, zero value otherwise. +func (o *CordaX500Name) GetCommonName() string { + if o == nil || IsNil(o.CommonName) { + var ret string + return ret + } + return *o.CommonName +} + +// GetCommonNameOk returns a tuple with the CommonName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetCommonNameOk() (*string, bool) { + if o == nil || IsNil(o.CommonName) { + return nil, false + } + return o.CommonName, true +} + +// HasCommonName returns a boolean if a field has been set. +func (o *CordaX500Name) HasCommonName() bool { + if o != nil && !IsNil(o.CommonName) { + return true + } + + return false +} + +// SetCommonName gets a reference to the given string and assigns it to the CommonName field. +func (o *CordaX500Name) SetCommonName(v string) { + o.CommonName = &v +} + +// GetOrganisationUnit returns the OrganisationUnit field value if set, zero value otherwise. +func (o *CordaX500Name) GetOrganisationUnit() string { + if o == nil || IsNil(o.OrganisationUnit) { + var ret string + return ret + } + return *o.OrganisationUnit +} + +// GetOrganisationUnitOk returns a tuple with the OrganisationUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetOrganisationUnitOk() (*string, bool) { + if o == nil || IsNil(o.OrganisationUnit) { + return nil, false + } + return o.OrganisationUnit, true +} + +// HasOrganisationUnit returns a boolean if a field has been set. +func (o *CordaX500Name) HasOrganisationUnit() bool { + if o != nil && !IsNil(o.OrganisationUnit) { + return true + } + + return false +} + +// SetOrganisationUnit gets a reference to the given string and assigns it to the OrganisationUnit field. +func (o *CordaX500Name) SetOrganisationUnit(v string) { + o.OrganisationUnit = &v +} + +// GetOrganisation returns the Organisation field value +func (o *CordaX500Name) GetOrganisation() string { + if o == nil { + var ret string + return ret + } + + return o.Organisation +} + +// GetOrganisationOk returns a tuple with the Organisation field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetOrganisationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Organisation, true +} + +// SetOrganisation sets field value +func (o *CordaX500Name) SetOrganisation(v string) { + o.Organisation = v +} + +// GetLocality returns the Locality field value +func (o *CordaX500Name) GetLocality() string { + if o == nil { + var ret string + return ret + } + + return o.Locality +} + +// GetLocalityOk returns a tuple with the Locality field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetLocalityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Locality, true +} + +// SetLocality sets field value +func (o *CordaX500Name) SetLocality(v string) { + o.Locality = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *CordaX500Name) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *CordaX500Name) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *CordaX500Name) SetState(v string) { + o.State = &v +} + +// GetCountry returns the Country field value +func (o *CordaX500Name) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *CordaX500Name) SetCountry(v string) { + o.Country = v +} + +// GetX500Principal returns the X500Principal field value +func (o *CordaX500Name) GetX500Principal() X500Principal { + if o == nil { + var ret X500Principal + return ret + } + + return o.X500Principal +} + +// GetX500PrincipalOk returns a tuple with the X500Principal field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetX500PrincipalOk() (*X500Principal, bool) { + if o == nil { + return nil, false + } + return &o.X500Principal, true +} + +// SetX500Principal sets field value +func (o *CordaX500Name) SetX500Principal(v X500Principal) { + o.X500Principal = v +} + +func (o CordaX500Name) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordaX500Name) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CommonName) { + toSerialize["commonName"] = o.CommonName + } + if !IsNil(o.OrganisationUnit) { + toSerialize["organisationUnit"] = o.OrganisationUnit + } + toSerialize["organisation"] = o.Organisation + toSerialize["locality"] = o.Locality + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + toSerialize["country"] = o.Country + toSerialize["x500Principal"] = o.X500Principal + return toSerialize, nil +} + +type NullableCordaX500Name struct { + value *CordaX500Name + isSet bool +} + +func (v NullableCordaX500Name) Get() *CordaX500Name { + return v.value +} + +func (v *NullableCordaX500Name) Set(val *CordaX500Name) { + v.value = val + v.isSet = true +} + +func (v NullableCordaX500Name) IsSet() bool { + return v.isSet +} + +func (v *NullableCordaX500Name) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordaX500Name(val *CordaX500Name) *NullableCordaX500Name { + return &NullableCordaX500Name{value: val, isSet: true} +} + +func (v NullableCordaX500Name) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordaX500Name) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go new file mode 100644 index 0000000000..ed2f8bc8c9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go @@ -0,0 +1,256 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordappDeploymentConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordappDeploymentConfig{} + +// CordappDeploymentConfig struct for CordappDeploymentConfig +type CordappDeploymentConfig struct { + SshCredentials CordaNodeSshCredentials `json:"sshCredentials"` + RpcCredentials CordaRpcCredentials `json:"rpcCredentials"` + // The shell command to execute in order to start back up a Corda node after having placed new jars in the cordapp directory of said node. + CordaNodeStartCmd string `json:"cordaNodeStartCmd"` + // The absolute file system path where the Corda Node is expecting deployed Cordapp jar files to be placed. + CordappDir string `json:"cordappDir"` + // The absolute file system path where the corda.jar file of the node can be found. This is used to execute database schema migrations where applicable (H2 database in use in development environments). + CordaJarPath string `json:"cordaJarPath"` + // The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract. + NodeBaseDirPath string `json:"nodeBaseDirPath"` +} + +// NewCordappDeploymentConfig instantiates a new CordappDeploymentConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCordappDeploymentConfig(sshCredentials CordaNodeSshCredentials, rpcCredentials CordaRpcCredentials, cordaNodeStartCmd string, cordappDir string, cordaJarPath string, nodeBaseDirPath string) *CordappDeploymentConfig { + this := CordappDeploymentConfig{} + this.SshCredentials = sshCredentials + this.RpcCredentials = rpcCredentials + this.CordaNodeStartCmd = cordaNodeStartCmd + this.CordappDir = cordappDir + this.CordaJarPath = cordaJarPath + this.NodeBaseDirPath = nodeBaseDirPath + return &this +} + +// NewCordappDeploymentConfigWithDefaults instantiates a new CordappDeploymentConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordappDeploymentConfigWithDefaults() *CordappDeploymentConfig { + this := CordappDeploymentConfig{} + return &this +} + +// GetSshCredentials returns the SshCredentials field value +func (o *CordappDeploymentConfig) GetSshCredentials() CordaNodeSshCredentials { + if o == nil { + var ret CordaNodeSshCredentials + return ret + } + + return o.SshCredentials +} + +// GetSshCredentialsOk returns a tuple with the SshCredentials field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetSshCredentialsOk() (*CordaNodeSshCredentials, bool) { + if o == nil { + return nil, false + } + return &o.SshCredentials, true +} + +// SetSshCredentials sets field value +func (o *CordappDeploymentConfig) SetSshCredentials(v CordaNodeSshCredentials) { + o.SshCredentials = v +} + +// GetRpcCredentials returns the RpcCredentials field value +func (o *CordappDeploymentConfig) GetRpcCredentials() CordaRpcCredentials { + if o == nil { + var ret CordaRpcCredentials + return ret + } + + return o.RpcCredentials +} + +// GetRpcCredentialsOk returns a tuple with the RpcCredentials field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetRpcCredentialsOk() (*CordaRpcCredentials, bool) { + if o == nil { + return nil, false + } + return &o.RpcCredentials, true +} + +// SetRpcCredentials sets field value +func (o *CordappDeploymentConfig) SetRpcCredentials(v CordaRpcCredentials) { + o.RpcCredentials = v +} + +// GetCordaNodeStartCmd returns the CordaNodeStartCmd field value +func (o *CordappDeploymentConfig) GetCordaNodeStartCmd() string { + if o == nil { + var ret string + return ret + } + + return o.CordaNodeStartCmd +} + +// GetCordaNodeStartCmdOk returns a tuple with the CordaNodeStartCmd field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetCordaNodeStartCmdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CordaNodeStartCmd, true +} + +// SetCordaNodeStartCmd sets field value +func (o *CordappDeploymentConfig) SetCordaNodeStartCmd(v string) { + o.CordaNodeStartCmd = v +} + +// GetCordappDir returns the CordappDir field value +func (o *CordappDeploymentConfig) GetCordappDir() string { + if o == nil { + var ret string + return ret + } + + return o.CordappDir +} + +// GetCordappDirOk returns a tuple with the CordappDir field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetCordappDirOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CordappDir, true +} + +// SetCordappDir sets field value +func (o *CordappDeploymentConfig) SetCordappDir(v string) { + o.CordappDir = v +} + +// GetCordaJarPath returns the CordaJarPath field value +func (o *CordappDeploymentConfig) GetCordaJarPath() string { + if o == nil { + var ret string + return ret + } + + return o.CordaJarPath +} + +// GetCordaJarPathOk returns a tuple with the CordaJarPath field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetCordaJarPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CordaJarPath, true +} + +// SetCordaJarPath sets field value +func (o *CordappDeploymentConfig) SetCordaJarPath(v string) { + o.CordaJarPath = v +} + +// GetNodeBaseDirPath returns the NodeBaseDirPath field value +func (o *CordappDeploymentConfig) GetNodeBaseDirPath() string { + if o == nil { + var ret string + return ret + } + + return o.NodeBaseDirPath +} + +// GetNodeBaseDirPathOk returns a tuple with the NodeBaseDirPath field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetNodeBaseDirPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeBaseDirPath, true +} + +// SetNodeBaseDirPath sets field value +func (o *CordappDeploymentConfig) SetNodeBaseDirPath(v string) { + o.NodeBaseDirPath = v +} + +func (o CordappDeploymentConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordappDeploymentConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sshCredentials"] = o.SshCredentials + toSerialize["rpcCredentials"] = o.RpcCredentials + toSerialize["cordaNodeStartCmd"] = o.CordaNodeStartCmd + toSerialize["cordappDir"] = o.CordappDir + toSerialize["cordaJarPath"] = o.CordaJarPath + toSerialize["nodeBaseDirPath"] = o.NodeBaseDirPath + return toSerialize, nil +} + +type NullableCordappDeploymentConfig struct { + value *CordappDeploymentConfig + isSet bool +} + +func (v NullableCordappDeploymentConfig) Get() *CordappDeploymentConfig { + return v.value +} + +func (v *NullableCordappDeploymentConfig) Set(val *CordappDeploymentConfig) { + v.value = val + v.isSet = true +} + +func (v NullableCordappDeploymentConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableCordappDeploymentConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordappDeploymentConfig(val *CordappDeploymentConfig) *NullableCordappDeploymentConfig { + return &NullableCordappDeploymentConfig{value: val, isSet: true} +} + +func (v NullableCordappDeploymentConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordappDeploymentConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go new file mode 100644 index 0000000000..97c9d337a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go @@ -0,0 +1,341 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordappInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordappInfo{} + +// CordappInfo A CordappInfo describes a single CorDapp currently installed on the node +type CordappInfo struct { + JarHash SHA256 `json:"jarHash"` + // The name of the licence this CorDapp is released under + Licence string `json:"licence"` + // The minimum platform version the node must be at for the CorDapp to run + MinimumPlatformVersion int32 `json:"minimumPlatformVersion"` + // The name of the JAR file that defines the CorDapp + Name string `json:"name"` + // The name of the CorDapp + ShortName string `json:"shortName"` + // The target platform version this CorDapp has been tested against + TargetPlatformVersion int32 `json:"targetPlatformVersion"` + // A description of what sort of CorDapp this is - either a contract, workflow, or a combination. + Type string `json:"type"` + // The vendor of this CorDapp + Vendor string `json:"vendor"` + // The version of this CorDapp + Version string `json:"version"` +} + +// NewCordappInfo instantiates a new CordappInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCordappInfo(jarHash SHA256, licence string, minimumPlatformVersion int32, name string, shortName string, targetPlatformVersion int32, type_ string, vendor string, version string) *CordappInfo { + this := CordappInfo{} + this.JarHash = jarHash + this.Licence = licence + this.MinimumPlatformVersion = minimumPlatformVersion + this.Name = name + this.ShortName = shortName + this.TargetPlatformVersion = targetPlatformVersion + this.Type = type_ + this.Vendor = vendor + this.Version = version + return &this +} + +// NewCordappInfoWithDefaults instantiates a new CordappInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordappInfoWithDefaults() *CordappInfo { + this := CordappInfo{} + return &this +} + +// GetJarHash returns the JarHash field value +func (o *CordappInfo) GetJarHash() SHA256 { + if o == nil { + var ret SHA256 + return ret + } + + return o.JarHash +} + +// GetJarHashOk returns a tuple with the JarHash field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetJarHashOk() (SHA256, bool) { + if o == nil { + return SHA256{}, false + } + return o.JarHash, true +} + +// SetJarHash sets field value +func (o *CordappInfo) SetJarHash(v SHA256) { + o.JarHash = v +} + +// GetLicence returns the Licence field value +func (o *CordappInfo) GetLicence() string { + if o == nil { + var ret string + return ret + } + + return o.Licence +} + +// GetLicenceOk returns a tuple with the Licence field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetLicenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Licence, true +} + +// SetLicence sets field value +func (o *CordappInfo) SetLicence(v string) { + o.Licence = v +} + +// GetMinimumPlatformVersion returns the MinimumPlatformVersion field value +func (o *CordappInfo) GetMinimumPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MinimumPlatformVersion +} + +// GetMinimumPlatformVersionOk returns a tuple with the MinimumPlatformVersion field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetMinimumPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MinimumPlatformVersion, true +} + +// SetMinimumPlatformVersion sets field value +func (o *CordappInfo) SetMinimumPlatformVersion(v int32) { + o.MinimumPlatformVersion = v +} + +// GetName returns the Name field value +func (o *CordappInfo) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CordappInfo) SetName(v string) { + o.Name = v +} + +// GetShortName returns the ShortName field value +func (o *CordappInfo) GetShortName() string { + if o == nil { + var ret string + return ret + } + + return o.ShortName +} + +// GetShortNameOk returns a tuple with the ShortName field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetShortNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortName, true +} + +// SetShortName sets field value +func (o *CordappInfo) SetShortName(v string) { + o.ShortName = v +} + +// GetTargetPlatformVersion returns the TargetPlatformVersion field value +func (o *CordappInfo) GetTargetPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TargetPlatformVersion +} + +// GetTargetPlatformVersionOk returns a tuple with the TargetPlatformVersion field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetTargetPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TargetPlatformVersion, true +} + +// SetTargetPlatformVersion sets field value +func (o *CordappInfo) SetTargetPlatformVersion(v int32) { + o.TargetPlatformVersion = v +} + +// GetType returns the Type field value +func (o *CordappInfo) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CordappInfo) SetType(v string) { + o.Type = v +} + +// GetVendor returns the Vendor field value +func (o *CordappInfo) GetVendor() string { + if o == nil { + var ret string + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetVendorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Vendor, true +} + +// SetVendor sets field value +func (o *CordappInfo) SetVendor(v string) { + o.Vendor = v +} + +// GetVersion returns the Version field value +func (o *CordappInfo) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CordappInfo) SetVersion(v string) { + o.Version = v +} + +func (o CordappInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordappInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jarHash"] = o.JarHash + toSerialize["licence"] = o.Licence + toSerialize["minimumPlatformVersion"] = o.MinimumPlatformVersion + toSerialize["name"] = o.Name + toSerialize["shortName"] = o.ShortName + toSerialize["targetPlatformVersion"] = o.TargetPlatformVersion + toSerialize["type"] = o.Type + toSerialize["vendor"] = o.Vendor + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableCordappInfo struct { + value *CordappInfo + isSet bool +} + +func (v NullableCordappInfo) Get() *CordappInfo { + return v.value +} + +func (v *NullableCordappInfo) Set(val *CordappInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCordappInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCordappInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordappInfo(val *CordappInfo) *NullableCordappInfo { + return &NullableCordappInfo{value: val, isSet: true} +} + +func (v NullableCordappInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordappInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go new file mode 100644 index 0000000000..7e3c0a9898 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DeployContractJarsBadRequestV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJarsBadRequestV1Response{} + +// DeployContractJarsBadRequestV1Response struct for DeployContractJarsBadRequestV1Response +type DeployContractJarsBadRequestV1Response struct { + Errors []string `json:"errors"` +} + +// NewDeployContractJarsBadRequestV1Response instantiates a new DeployContractJarsBadRequestV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractJarsBadRequestV1Response(errors []string) *DeployContractJarsBadRequestV1Response { + this := DeployContractJarsBadRequestV1Response{} + this.Errors = errors + return &this +} + +// NewDeployContractJarsBadRequestV1ResponseWithDefaults instantiates a new DeployContractJarsBadRequestV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJarsBadRequestV1ResponseWithDefaults() *DeployContractJarsBadRequestV1Response { + this := DeployContractJarsBadRequestV1Response{} + return &this +} + +// GetErrors returns the Errors field value +func (o *DeployContractJarsBadRequestV1Response) GetErrors() []string { + if o == nil { + var ret []string + return ret + } + + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsBadRequestV1Response) GetErrorsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Errors, true +} + +// SetErrors sets field value +func (o *DeployContractJarsBadRequestV1Response) SetErrors(v []string) { + o.Errors = v +} + +func (o DeployContractJarsBadRequestV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJarsBadRequestV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["errors"] = o.Errors + return toSerialize, nil +} + +type NullableDeployContractJarsBadRequestV1Response struct { + value *DeployContractJarsBadRequestV1Response + isSet bool +} + +func (v NullableDeployContractJarsBadRequestV1Response) Get() *DeployContractJarsBadRequestV1Response { + return v.value +} + +func (v *NullableDeployContractJarsBadRequestV1Response) Set(val *DeployContractJarsBadRequestV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJarsBadRequestV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJarsBadRequestV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJarsBadRequestV1Response(val *DeployContractJarsBadRequestV1Response) *NullableDeployContractJarsBadRequestV1Response { + return &NullableDeployContractJarsBadRequestV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractJarsBadRequestV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJarsBadRequestV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go new file mode 100644 index 0000000000..48421d80e6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DeployContractJarsSuccessV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJarsSuccessV1Response{} + +// DeployContractJarsSuccessV1Response struct for DeployContractJarsSuccessV1Response +type DeployContractJarsSuccessV1Response struct { + DeployedJarFiles []string `json:"deployedJarFiles"` +} + +// NewDeployContractJarsSuccessV1Response instantiates a new DeployContractJarsSuccessV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractJarsSuccessV1Response(deployedJarFiles []string) *DeployContractJarsSuccessV1Response { + this := DeployContractJarsSuccessV1Response{} + this.DeployedJarFiles = deployedJarFiles + return &this +} + +// NewDeployContractJarsSuccessV1ResponseWithDefaults instantiates a new DeployContractJarsSuccessV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJarsSuccessV1ResponseWithDefaults() *DeployContractJarsSuccessV1Response { + this := DeployContractJarsSuccessV1Response{} + return &this +} + +// GetDeployedJarFiles returns the DeployedJarFiles field value +func (o *DeployContractJarsSuccessV1Response) GetDeployedJarFiles() []string { + if o == nil { + var ret []string + return ret + } + + return o.DeployedJarFiles +} + +// GetDeployedJarFilesOk returns a tuple with the DeployedJarFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsSuccessV1Response) GetDeployedJarFilesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.DeployedJarFiles, true +} + +// SetDeployedJarFiles sets field value +func (o *DeployContractJarsSuccessV1Response) SetDeployedJarFiles(v []string) { + o.DeployedJarFiles = v +} + +func (o DeployContractJarsSuccessV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJarsSuccessV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["deployedJarFiles"] = o.DeployedJarFiles + return toSerialize, nil +} + +type NullableDeployContractJarsSuccessV1Response struct { + value *DeployContractJarsSuccessV1Response + isSet bool +} + +func (v NullableDeployContractJarsSuccessV1Response) Get() *DeployContractJarsSuccessV1Response { + return v.value +} + +func (v *NullableDeployContractJarsSuccessV1Response) Set(val *DeployContractJarsSuccessV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJarsSuccessV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJarsSuccessV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJarsSuccessV1Response(val *DeployContractJarsSuccessV1Response) *NullableDeployContractJarsSuccessV1Response { + return &NullableDeployContractJarsSuccessV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractJarsSuccessV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJarsSuccessV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go new file mode 100644 index 0000000000..0baff18324 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go @@ -0,0 +1,145 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DeployContractJarsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJarsV1Request{} + +// DeployContractJarsV1Request struct for DeployContractJarsV1Request +type DeployContractJarsV1Request struct { + // The list of deployment configurations pointing to the nodes where the provided cordapp jar files are to be deployed . + CordappDeploymentConfigs []CordappDeploymentConfig `json:"cordappDeploymentConfigs"` + JarFiles []JarFile `json:"jarFiles"` +} + +// NewDeployContractJarsV1Request instantiates a new DeployContractJarsV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractJarsV1Request(cordappDeploymentConfigs []CordappDeploymentConfig, jarFiles []JarFile) *DeployContractJarsV1Request { + this := DeployContractJarsV1Request{} + this.CordappDeploymentConfigs = cordappDeploymentConfigs + this.JarFiles = jarFiles + return &this +} + +// NewDeployContractJarsV1RequestWithDefaults instantiates a new DeployContractJarsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJarsV1RequestWithDefaults() *DeployContractJarsV1Request { + this := DeployContractJarsV1Request{} + return &this +} + +// GetCordappDeploymentConfigs returns the CordappDeploymentConfigs field value +func (o *DeployContractJarsV1Request) GetCordappDeploymentConfigs() []CordappDeploymentConfig { + if o == nil { + var ret []CordappDeploymentConfig + return ret + } + + return o.CordappDeploymentConfigs +} + +// GetCordappDeploymentConfigsOk returns a tuple with the CordappDeploymentConfigs field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsV1Request) GetCordappDeploymentConfigsOk() ([]CordappDeploymentConfig, bool) { + if o == nil { + return nil, false + } + return o.CordappDeploymentConfigs, true +} + +// SetCordappDeploymentConfigs sets field value +func (o *DeployContractJarsV1Request) SetCordappDeploymentConfigs(v []CordappDeploymentConfig) { + o.CordappDeploymentConfigs = v +} + +// GetJarFiles returns the JarFiles field value +func (o *DeployContractJarsV1Request) GetJarFiles() []JarFile { + if o == nil { + var ret []JarFile + return ret + } + + return o.JarFiles +} + +// GetJarFilesOk returns a tuple with the JarFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsV1Request) GetJarFilesOk() ([]JarFile, bool) { + if o == nil { + return nil, false + } + return o.JarFiles, true +} + +// SetJarFiles sets field value +func (o *DeployContractJarsV1Request) SetJarFiles(v []JarFile) { + o.JarFiles = v +} + +func (o DeployContractJarsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJarsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cordappDeploymentConfigs"] = o.CordappDeploymentConfigs + toSerialize["jarFiles"] = o.JarFiles + return toSerialize, nil +} + +type NullableDeployContractJarsV1Request struct { + value *DeployContractJarsV1Request + isSet bool +} + +func (v NullableDeployContractJarsV1Request) Get() *DeployContractJarsV1Request { + return v.value +} + +func (v *NullableDeployContractJarsV1Request) Set(val *DeployContractJarsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJarsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJarsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJarsV1Request(val *DeployContractJarsV1Request) *NullableDeployContractJarsV1Request { + return &NullableDeployContractJarsV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractJarsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJarsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go new file mode 100644 index 0000000000..5b587d28ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go @@ -0,0 +1,127 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DiagnoseNodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DiagnoseNodeV1Request{} + +// DiagnoseNodeV1Request struct for DiagnoseNodeV1Request +type DiagnoseNodeV1Request struct { + // Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). + NodeIds []string `json:"nodeIds,omitempty"` +} + +// NewDiagnoseNodeV1Request instantiates a new DiagnoseNodeV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDiagnoseNodeV1Request() *DiagnoseNodeV1Request { + this := DiagnoseNodeV1Request{} + return &this +} + +// NewDiagnoseNodeV1RequestWithDefaults instantiates a new DiagnoseNodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiagnoseNodeV1RequestWithDefaults() *DiagnoseNodeV1Request { + this := DiagnoseNodeV1Request{} + return &this +} + +// GetNodeIds returns the NodeIds field value if set, zero value otherwise. +func (o *DiagnoseNodeV1Request) GetNodeIds() []string { + if o == nil || IsNil(o.NodeIds) { + var ret []string + return ret + } + return o.NodeIds +} + +// GetNodeIdsOk returns a tuple with the NodeIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiagnoseNodeV1Request) GetNodeIdsOk() ([]string, bool) { + if o == nil || IsNil(o.NodeIds) { + return nil, false + } + return o.NodeIds, true +} + +// HasNodeIds returns a boolean if a field has been set. +func (o *DiagnoseNodeV1Request) HasNodeIds() bool { + if o != nil && !IsNil(o.NodeIds) { + return true + } + + return false +} + +// SetNodeIds gets a reference to the given []string and assigns it to the NodeIds field. +func (o *DiagnoseNodeV1Request) SetNodeIds(v []string) { + o.NodeIds = v +} + +func (o DiagnoseNodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DiagnoseNodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NodeIds) { + toSerialize["nodeIds"] = o.NodeIds + } + return toSerialize, nil +} + +type NullableDiagnoseNodeV1Request struct { + value *DiagnoseNodeV1Request + isSet bool +} + +func (v NullableDiagnoseNodeV1Request) Get() *DiagnoseNodeV1Request { + return v.value +} + +func (v *NullableDiagnoseNodeV1Request) Set(val *DiagnoseNodeV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDiagnoseNodeV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDiagnoseNodeV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDiagnoseNodeV1Request(val *DiagnoseNodeV1Request) *NullableDiagnoseNodeV1Request { + return &NullableDiagnoseNodeV1Request{value: val, isSet: true} +} + +func (v NullableDiagnoseNodeV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDiagnoseNodeV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go new file mode 100644 index 0000000000..64dedc7c74 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DiagnoseNodeV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DiagnoseNodeV1Response{} + +// DiagnoseNodeV1Response struct for DiagnoseNodeV1Response +type DiagnoseNodeV1Response struct { + NodeDiagnosticInfo NodeDiagnosticInfo `json:"nodeDiagnosticInfo"` +} + +// NewDiagnoseNodeV1Response instantiates a new DiagnoseNodeV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDiagnoseNodeV1Response(nodeDiagnosticInfo NodeDiagnosticInfo) *DiagnoseNodeV1Response { + this := DiagnoseNodeV1Response{} + this.NodeDiagnosticInfo = nodeDiagnosticInfo + return &this +} + +// NewDiagnoseNodeV1ResponseWithDefaults instantiates a new DiagnoseNodeV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiagnoseNodeV1ResponseWithDefaults() *DiagnoseNodeV1Response { + this := DiagnoseNodeV1Response{} + return &this +} + +// GetNodeDiagnosticInfo returns the NodeDiagnosticInfo field value +func (o *DiagnoseNodeV1Response) GetNodeDiagnosticInfo() NodeDiagnosticInfo { + if o == nil { + var ret NodeDiagnosticInfo + return ret + } + + return o.NodeDiagnosticInfo +} + +// GetNodeDiagnosticInfoOk returns a tuple with the NodeDiagnosticInfo field value +// and a boolean to check if the value has been set. +func (o *DiagnoseNodeV1Response) GetNodeDiagnosticInfoOk() (*NodeDiagnosticInfo, bool) { + if o == nil { + return nil, false + } + return &o.NodeDiagnosticInfo, true +} + +// SetNodeDiagnosticInfo sets field value +func (o *DiagnoseNodeV1Response) SetNodeDiagnosticInfo(v NodeDiagnosticInfo) { + o.NodeDiagnosticInfo = v +} + +func (o DiagnoseNodeV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DiagnoseNodeV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nodeDiagnosticInfo"] = o.NodeDiagnosticInfo + return toSerialize, nil +} + +type NullableDiagnoseNodeV1Response struct { + value *DiagnoseNodeV1Response + isSet bool +} + +func (v NullableDiagnoseNodeV1Response) Get() *DiagnoseNodeV1Response { + return v.value +} + +func (v *NullableDiagnoseNodeV1Response) Set(val *DiagnoseNodeV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDiagnoseNodeV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDiagnoseNodeV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDiagnoseNodeV1Response(val *DiagnoseNodeV1Response) *NullableDiagnoseNodeV1Response { + return &NullableDiagnoseNodeV1Response{value: val, isSet: true} +} + +func (v NullableDiagnoseNodeV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDiagnoseNodeV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go new file mode 100644 index 0000000000..eed9df1fe7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" + "fmt" +) + +// FlowInvocationType Determines which flow starting method will be used on the back-end when invoking the flow. Based on the value here the plugin back-end might invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() method. Streamed responses are aggregated and returned in a single response to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. do. +type FlowInvocationType string + +// List of FlowInvocationType +const ( + TRACKED_FLOW_DYNAMIC FlowInvocationType = "TRACKED_FLOW_DYNAMIC" + FLOW_DYNAMIC FlowInvocationType = "FLOW_DYNAMIC" +) + +// All allowed values of FlowInvocationType enum +var AllowedFlowInvocationTypeEnumValues = []FlowInvocationType{ + "TRACKED_FLOW_DYNAMIC", + "FLOW_DYNAMIC", +} + +func (v *FlowInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlowInvocationType(value) + for _, existing := range AllowedFlowInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FlowInvocationType", value) +} + +// NewFlowInvocationTypeFromValue returns a pointer to a valid FlowInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlowInvocationTypeFromValue(v string) (*FlowInvocationType, error) { + ev := FlowInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlowInvocationType: valid values are %v", v, AllowedFlowInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlowInvocationType) IsValid() bool { + for _, existing := range AllowedFlowInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FlowInvocationType value +func (v FlowInvocationType) Ptr() *FlowInvocationType { + return &v +} + +type NullableFlowInvocationType struct { + value *FlowInvocationType + isSet bool +} + +func (v NullableFlowInvocationType) Get() *FlowInvocationType { + return v.value +} + +func (v *NullableFlowInvocationType) Set(val *FlowInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableFlowInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowInvocationType(val *FlowInvocationType) *NullableFlowInvocationType { + return &NullableFlowInvocationType{value: val, isSet: true} +} + +func (v NullableFlowInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go new file mode 100644 index 0000000000..175bf80943 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the GetMonitorTransactionsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMonitorTransactionsV1Request{} + +// GetMonitorTransactionsV1Request struct for GetMonitorTransactionsV1Request +type GetMonitorTransactionsV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` +} + +// NewGetMonitorTransactionsV1Request instantiates a new GetMonitorTransactionsV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMonitorTransactionsV1Request(clientAppId string, stateFullClassName string) *GetMonitorTransactionsV1Request { + this := GetMonitorTransactionsV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + return &this +} + +// NewGetMonitorTransactionsV1RequestWithDefaults instantiates a new GetMonitorTransactionsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMonitorTransactionsV1RequestWithDefaults() *GetMonitorTransactionsV1Request { + this := GetMonitorTransactionsV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *GetMonitorTransactionsV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *GetMonitorTransactionsV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *GetMonitorTransactionsV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *GetMonitorTransactionsV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +func (o GetMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMonitorTransactionsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + return toSerialize, nil +} + +type NullableGetMonitorTransactionsV1Request struct { + value *GetMonitorTransactionsV1Request + isSet bool +} + +func (v NullableGetMonitorTransactionsV1Request) Get() *GetMonitorTransactionsV1Request { + return v.value +} + +func (v *NullableGetMonitorTransactionsV1Request) Set(val *GetMonitorTransactionsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetMonitorTransactionsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMonitorTransactionsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMonitorTransactionsV1Request(val *GetMonitorTransactionsV1Request) *NullableGetMonitorTransactionsV1Request { + return &NullableGetMonitorTransactionsV1Request{value: val, isSet: true} +} + +func (v NullableGetMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMonitorTransactionsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go new file mode 100644 index 0000000000..ebd4a8ec1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go @@ -0,0 +1,219 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the GetMonitorTransactionsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMonitorTransactionsV1Response{} + +// GetMonitorTransactionsV1Response struct for GetMonitorTransactionsV1Response +type GetMonitorTransactionsV1Response struct { + // Flag set to true if operation completed correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` + // The fully qualified name of the Corda state to monitor + StateFullClassName *string `json:"stateFullClassName,omitempty"` + Tx []GetMonitorTransactionsV1ResponseTxInner `json:"tx,omitempty"` +} + +// NewGetMonitorTransactionsV1Response instantiates a new GetMonitorTransactionsV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMonitorTransactionsV1Response(success bool, msg string) *GetMonitorTransactionsV1Response { + this := GetMonitorTransactionsV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewGetMonitorTransactionsV1ResponseWithDefaults instantiates a new GetMonitorTransactionsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMonitorTransactionsV1ResponseWithDefaults() *GetMonitorTransactionsV1Response { + this := GetMonitorTransactionsV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *GetMonitorTransactionsV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *GetMonitorTransactionsV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *GetMonitorTransactionsV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *GetMonitorTransactionsV1Response) SetMsg(v string) { + o.Msg = v +} + +// GetStateFullClassName returns the StateFullClassName field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1Response) GetStateFullClassName() string { + if o == nil || IsNil(o.StateFullClassName) { + var ret string + return ret + } + return *o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetStateFullClassNameOk() (*string, bool) { + if o == nil || IsNil(o.StateFullClassName) { + return nil, false + } + return o.StateFullClassName, true +} + +// HasStateFullClassName returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1Response) HasStateFullClassName() bool { + if o != nil && !IsNil(o.StateFullClassName) { + return true + } + + return false +} + +// SetStateFullClassName gets a reference to the given string and assigns it to the StateFullClassName field. +func (o *GetMonitorTransactionsV1Response) SetStateFullClassName(v string) { + o.StateFullClassName = &v +} + +// GetTx returns the Tx field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1Response) GetTx() []GetMonitorTransactionsV1ResponseTxInner { + if o == nil || IsNil(o.Tx) { + var ret []GetMonitorTransactionsV1ResponseTxInner + return ret + } + return o.Tx +} + +// GetTxOk returns a tuple with the Tx field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetTxOk() ([]GetMonitorTransactionsV1ResponseTxInner, bool) { + if o == nil || IsNil(o.Tx) { + return nil, false + } + return o.Tx, true +} + +// HasTx returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1Response) HasTx() bool { + if o != nil && !IsNil(o.Tx) { + return true + } + + return false +} + +// SetTx gets a reference to the given []GetMonitorTransactionsV1ResponseTxInner and assigns it to the Tx field. +func (o *GetMonitorTransactionsV1Response) SetTx(v []GetMonitorTransactionsV1ResponseTxInner) { + o.Tx = v +} + +func (o GetMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMonitorTransactionsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + if !IsNil(o.StateFullClassName) { + toSerialize["stateFullClassName"] = o.StateFullClassName + } + if !IsNil(o.Tx) { + toSerialize["tx"] = o.Tx + } + return toSerialize, nil +} + +type NullableGetMonitorTransactionsV1Response struct { + value *GetMonitorTransactionsV1Response + isSet bool +} + +func (v NullableGetMonitorTransactionsV1Response) Get() *GetMonitorTransactionsV1Response { + return v.value +} + +func (v *NullableGetMonitorTransactionsV1Response) Set(val *GetMonitorTransactionsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetMonitorTransactionsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMonitorTransactionsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMonitorTransactionsV1Response(val *GetMonitorTransactionsV1Response) *NullableGetMonitorTransactionsV1Response { + return &NullableGetMonitorTransactionsV1Response{value: val, isSet: true} +} + +func (v NullableGetMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMonitorTransactionsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go new file mode 100644 index 0000000000..2c33283e09 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the GetMonitorTransactionsV1ResponseTxInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMonitorTransactionsV1ResponseTxInner{} + +// GetMonitorTransactionsV1ResponseTxInner struct for GetMonitorTransactionsV1ResponseTxInner +type GetMonitorTransactionsV1ResponseTxInner struct { + Index *string `json:"index,omitempty"` + Data *string `json:"data,omitempty"` +} + +// NewGetMonitorTransactionsV1ResponseTxInner instantiates a new GetMonitorTransactionsV1ResponseTxInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMonitorTransactionsV1ResponseTxInner() *GetMonitorTransactionsV1ResponseTxInner { + this := GetMonitorTransactionsV1ResponseTxInner{} + return &this +} + +// NewGetMonitorTransactionsV1ResponseTxInnerWithDefaults instantiates a new GetMonitorTransactionsV1ResponseTxInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMonitorTransactionsV1ResponseTxInnerWithDefaults() *GetMonitorTransactionsV1ResponseTxInner { + this := GetMonitorTransactionsV1ResponseTxInner{} + return &this +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetIndex() string { + if o == nil || IsNil(o.Index) { + var ret string + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetIndexOk() (*string, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given string and assigns it to the Index field. +func (o *GetMonitorTransactionsV1ResponseTxInner) SetIndex(v string) { + o.Index = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetData() string { + if o == nil || IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetDataOk() (*string, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *GetMonitorTransactionsV1ResponseTxInner) SetData(v string) { + o.Data = &v +} + +func (o GetMonitorTransactionsV1ResponseTxInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMonitorTransactionsV1ResponseTxInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullableGetMonitorTransactionsV1ResponseTxInner struct { + value *GetMonitorTransactionsV1ResponseTxInner + isSet bool +} + +func (v NullableGetMonitorTransactionsV1ResponseTxInner) Get() *GetMonitorTransactionsV1ResponseTxInner { + return v.value +} + +func (v *NullableGetMonitorTransactionsV1ResponseTxInner) Set(val *GetMonitorTransactionsV1ResponseTxInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetMonitorTransactionsV1ResponseTxInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMonitorTransactionsV1ResponseTxInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMonitorTransactionsV1ResponseTxInner(val *GetMonitorTransactionsV1ResponseTxInner) *NullableGetMonitorTransactionsV1ResponseTxInner { + return &NullableGetMonitorTransactionsV1ResponseTxInner{value: val, isSet: true} +} + +func (v NullableGetMonitorTransactionsV1ResponseTxInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMonitorTransactionsV1ResponseTxInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 0000000000..05d0207a1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,214 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // The fully qualified name of the Corda flow to invoke + FlowFullClassName string `json:"flowFullClassName"` + FlowInvocationType FlowInvocationType `json:"flowInvocationType"` + // The list of arguments to pass in to the contract method being invoked. + Params []JvmObject `json:"params"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. + TimeoutMs *int32 `json:"timeoutMs,omitempty"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Request(flowFullClassName string, flowInvocationType FlowInvocationType, params []JvmObject) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.FlowFullClassName = flowFullClassName + this.FlowInvocationType = flowInvocationType + this.Params = params + var timeoutMs int32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs int32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetFlowFullClassName returns the FlowFullClassName field value +func (o *InvokeContractV1Request) GetFlowFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.FlowFullClassName +} + +// GetFlowFullClassNameOk returns a tuple with the FlowFullClassName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetFlowFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlowFullClassName, true +} + +// SetFlowFullClassName sets field value +func (o *InvokeContractV1Request) SetFlowFullClassName(v string) { + o.FlowFullClassName = v +} + +// GetFlowInvocationType returns the FlowInvocationType field value +func (o *InvokeContractV1Request) GetFlowInvocationType() FlowInvocationType { + if o == nil { + var ret FlowInvocationType + return ret + } + + return o.FlowInvocationType +} + +// GetFlowInvocationTypeOk returns a tuple with the FlowInvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetFlowInvocationTypeOk() (*FlowInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.FlowInvocationType, true +} + +// SetFlowInvocationType sets field value +func (o *InvokeContractV1Request) SetFlowInvocationType(v FlowInvocationType) { + o.FlowInvocationType = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []JvmObject { + if o == nil { + var ret []JvmObject + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]JvmObject, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []JvmObject) { + o.Params = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() int32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret int32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given int32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v int32) { + o.TimeoutMs = &v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flowFullClassName"] = o.FlowFullClassName + toSerialize["flowInvocationType"] = o.FlowInvocationType + toSerialize["params"] = o.Params + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 0000000000..54a4fb85f4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,247 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + Success bool `json:"success"` + // Data returned from the JVM when no transaction is running + CallOutput map[string]interface{} `json:"callOutput"` + // The net.corda.core.flows.StateMachineRunId value returned by the flow execution. + TransactionId *string `json:"transactionId,omitempty"` + // An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. + Progress []string `json:"progress,omitempty"` + // The id for the flow handle + FlowId string `json:"flowId"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool, callOutput map[string]interface{}, flowId string) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + this.CallOutput = callOutput + this.FlowId = flowId + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetCallOutput returns the CallOutput field value +func (o *InvokeContractV1Response) GetCallOutput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetCallOutputOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.CallOutput, true +} + +// SetCallOutput sets field value +func (o *InvokeContractV1Response) SetCallOutput(v map[string]interface{}) { + o.CallOutput = v +} + +// GetTransactionId returns the TransactionId field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionId() string { + if o == nil || IsNil(o.TransactionId) { + var ret string + return ret + } + return *o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionIdOk() (*string, bool) { + if o == nil || IsNil(o.TransactionId) { + return nil, false + } + return o.TransactionId, true +} + +// HasTransactionId returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionId() bool { + if o != nil && !IsNil(o.TransactionId) { + return true + } + + return false +} + +// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field. +func (o *InvokeContractV1Response) SetTransactionId(v string) { + o.TransactionId = &v +} + +// GetProgress returns the Progress field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetProgress() []string { + if o == nil || IsNil(o.Progress) { + var ret []string + return ret + } + return o.Progress +} + +// GetProgressOk returns a tuple with the Progress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetProgressOk() ([]string, bool) { + if o == nil || IsNil(o.Progress) { + return nil, false + } + return o.Progress, true +} + +// HasProgress returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasProgress() bool { + if o != nil && !IsNil(o.Progress) { + return true + } + + return false +} + +// SetProgress gets a reference to the given []string and assigns it to the Progress field. +func (o *InvokeContractV1Response) SetProgress(v []string) { + o.Progress = v +} + +// GetFlowId returns the FlowId field value +func (o *InvokeContractV1Response) GetFlowId() string { + if o == nil { + var ret string + return ret + } + + return o.FlowId +} + +// GetFlowIdOk returns a tuple with the FlowId field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetFlowIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlowId, true +} + +// SetFlowId sets field value +func (o *InvokeContractV1Response) SetFlowId(v string) { + o.FlowId = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["callOutput"] = o.CallOutput + if !IsNil(o.TransactionId) { + toSerialize["transactionId"] = o.TransactionId + } + if !IsNil(o.Progress) { + toSerialize["progress"] = o.Progress + } + toSerialize["flowId"] = o.FlowId + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go new file mode 100644 index 0000000000..5c44f86da5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go @@ -0,0 +1,199 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the JarFile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JarFile{} + +// JarFile struct for JarFile +type JarFile struct { + Filename string `json:"filename"` + // Indicates whether the cordapp jar in question contains any embedded migrations that Cactus can/should execute between copying the jar into the cordapp directory and starting the node back up. + HasDbMigrations bool `json:"hasDbMigrations"` + ContentBase64 string `json:"contentBase64"` + AdditionalProperties map[string]interface{} +} + +type _JarFile JarFile + +// NewJarFile instantiates a new JarFile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJarFile(filename string, hasDbMigrations bool, contentBase64 string) *JarFile { + this := JarFile{} + this.Filename = filename + this.HasDbMigrations = hasDbMigrations + this.ContentBase64 = contentBase64 + return &this +} + +// NewJarFileWithDefaults instantiates a new JarFile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJarFileWithDefaults() *JarFile { + this := JarFile{} + return &this +} + +// GetFilename returns the Filename field value +func (o *JarFile) GetFilename() string { + if o == nil { + var ret string + return ret + } + + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *JarFile) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value +func (o *JarFile) SetFilename(v string) { + o.Filename = v +} + +// GetHasDbMigrations returns the HasDbMigrations field value +func (o *JarFile) GetHasDbMigrations() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasDbMigrations +} + +// GetHasDbMigrationsOk returns a tuple with the HasDbMigrations field value +// and a boolean to check if the value has been set. +func (o *JarFile) GetHasDbMigrationsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasDbMigrations, true +} + +// SetHasDbMigrations sets field value +func (o *JarFile) SetHasDbMigrations(v bool) { + o.HasDbMigrations = v +} + +// GetContentBase64 returns the ContentBase64 field value +func (o *JarFile) GetContentBase64() string { + if o == nil { + var ret string + return ret + } + + return o.ContentBase64 +} + +// GetContentBase64Ok returns a tuple with the ContentBase64 field value +// and a boolean to check if the value has been set. +func (o *JarFile) GetContentBase64Ok() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentBase64, true +} + +// SetContentBase64 sets field value +func (o *JarFile) SetContentBase64(v string) { + o.ContentBase64 = v +} + +func (o JarFile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JarFile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["filename"] = o.Filename + toSerialize["hasDbMigrations"] = o.HasDbMigrations + toSerialize["contentBase64"] = o.ContentBase64 + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JarFile) UnmarshalJSON(bytes []byte) (err error) { + varJarFile := _JarFile{} + + if err = json.Unmarshal(bytes, &varJarFile); err == nil { + *o = JarFile(varJarFile) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "filename") + delete(additionalProperties, "hasDbMigrations") + delete(additionalProperties, "contentBase64") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJarFile struct { + value *JarFile + isSet bool +} + +func (v NullableJarFile) Get() *JarFile { + return v.value +} + +func (v *NullableJarFile) Set(val *JarFile) { + v.value = val + v.isSet = true +} + +func (v NullableJarFile) IsSet() bool { + return v.isSet +} + +func (v *NullableJarFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJarFile(val *JarFile) *NullableJarFile { + return &NullableJarFile{value: val, isSet: true} +} + +func (v NullableJarFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJarFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go new file mode 100644 index 0000000000..ffd053b24e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go @@ -0,0 +1,216 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the JvmObject type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JvmObject{} + +// JvmObject Can represent JVM primitive and reference types as well. The jvmTypeKind field indicates which one is being stored. If the jvmTypeKind field is set to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property is filled with a primitive data type supported by the JSON standard such as strings, booleans, numbers, etc. +type JvmObject struct { + JvmTypeKind JvmTypeKind `json:"jvmTypeKind"` + PrimitiveValue map[string]interface{} `json:"primitiveValue,omitempty"` + JvmCtorArgs []JvmObject `json:"jvmCtorArgs,omitempty"` + JvmType JvmType `json:"jvmType"` +} + +// NewJvmObject instantiates a new JvmObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJvmObject(jvmTypeKind JvmTypeKind, jvmType JvmType) *JvmObject { + this := JvmObject{} + this.JvmTypeKind = jvmTypeKind + this.JvmType = jvmType + return &this +} + +// NewJvmObjectWithDefaults instantiates a new JvmObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJvmObjectWithDefaults() *JvmObject { + this := JvmObject{} + return &this +} + +// GetJvmTypeKind returns the JvmTypeKind field value +func (o *JvmObject) GetJvmTypeKind() JvmTypeKind { + if o == nil { + var ret JvmTypeKind + return ret + } + + return o.JvmTypeKind +} + +// GetJvmTypeKindOk returns a tuple with the JvmTypeKind field value +// and a boolean to check if the value has been set. +func (o *JvmObject) GetJvmTypeKindOk() (*JvmTypeKind, bool) { + if o == nil { + return nil, false + } + return &o.JvmTypeKind, true +} + +// SetJvmTypeKind sets field value +func (o *JvmObject) SetJvmTypeKind(v JvmTypeKind) { + o.JvmTypeKind = v +} + +// GetPrimitiveValue returns the PrimitiveValue field value if set, zero value otherwise. +func (o *JvmObject) GetPrimitiveValue() map[string]interface{} { + if o == nil || IsNil(o.PrimitiveValue) { + var ret map[string]interface{} + return ret + } + return o.PrimitiveValue +} + +// GetPrimitiveValueOk returns a tuple with the PrimitiveValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmObject) GetPrimitiveValueOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.PrimitiveValue) { + return map[string]interface{}{}, false + } + return o.PrimitiveValue, true +} + +// HasPrimitiveValue returns a boolean if a field has been set. +func (o *JvmObject) HasPrimitiveValue() bool { + if o != nil && !IsNil(o.PrimitiveValue) { + return true + } + + return false +} + +// SetPrimitiveValue gets a reference to the given map[string]interface{} and assigns it to the PrimitiveValue field. +func (o *JvmObject) SetPrimitiveValue(v map[string]interface{}) { + o.PrimitiveValue = v +} + +// GetJvmCtorArgs returns the JvmCtorArgs field value if set, zero value otherwise. +func (o *JvmObject) GetJvmCtorArgs() []JvmObject { + if o == nil || IsNil(o.JvmCtorArgs) { + var ret []JvmObject + return ret + } + return o.JvmCtorArgs +} + +// GetJvmCtorArgsOk returns a tuple with the JvmCtorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmObject) GetJvmCtorArgsOk() ([]JvmObject, bool) { + if o == nil || IsNil(o.JvmCtorArgs) { + return nil, false + } + return o.JvmCtorArgs, true +} + +// HasJvmCtorArgs returns a boolean if a field has been set. +func (o *JvmObject) HasJvmCtorArgs() bool { + if o != nil && !IsNil(o.JvmCtorArgs) { + return true + } + + return false +} + +// SetJvmCtorArgs gets a reference to the given []JvmObject and assigns it to the JvmCtorArgs field. +func (o *JvmObject) SetJvmCtorArgs(v []JvmObject) { + o.JvmCtorArgs = v +} + +// GetJvmType returns the JvmType field value +func (o *JvmObject) GetJvmType() JvmType { + if o == nil { + var ret JvmType + return ret + } + + return o.JvmType +} + +// GetJvmTypeOk returns a tuple with the JvmType field value +// and a boolean to check if the value has been set. +func (o *JvmObject) GetJvmTypeOk() (*JvmType, bool) { + if o == nil { + return nil, false + } + return &o.JvmType, true +} + +// SetJvmType sets field value +func (o *JvmObject) SetJvmType(v JvmType) { + o.JvmType = v +} + +func (o JvmObject) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JvmObject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jvmTypeKind"] = o.JvmTypeKind + if !IsNil(o.PrimitiveValue) { + toSerialize["primitiveValue"] = o.PrimitiveValue + } + if !IsNil(o.JvmCtorArgs) { + toSerialize["jvmCtorArgs"] = o.JvmCtorArgs + } + toSerialize["jvmType"] = o.JvmType + return toSerialize, nil +} + +type NullableJvmObject struct { + value *JvmObject + isSet bool +} + +func (v NullableJvmObject) Get() *JvmObject { + return v.value +} + +func (v *NullableJvmObject) Set(val *JvmObject) { + v.value = val + v.isSet = true +} + +func (v NullableJvmObject) IsSet() bool { + return v.isSet +} + +func (v *NullableJvmObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJvmObject(val *JvmObject) *NullableJvmObject { + return &NullableJvmObject{value: val, isSet: true} +} + +func (v NullableJvmObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJvmObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go new file mode 100644 index 0000000000..83190a0781 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the JvmType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JvmType{} + +// JvmType Represents a reference to a JVM type (such as a Java class) +type JvmType struct { + FqClassName string `json:"fqClassName"` + // This parameter is used to specify that the function used to construct this JvmType is not a constructor function but instead is a factory function. Setting this parameter will cause the plugin to look up methods of the class denoted by fqClassName instead of its constructors. + ConstructorName *string `json:"constructorName,omitempty"` + InvocationTarget *JvmObject `json:"invocationTarget,omitempty"` +} + +// NewJvmType instantiates a new JvmType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJvmType(fqClassName string) *JvmType { + this := JvmType{} + this.FqClassName = fqClassName + return &this +} + +// NewJvmTypeWithDefaults instantiates a new JvmType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJvmTypeWithDefaults() *JvmType { + this := JvmType{} + return &this +} + +// GetFqClassName returns the FqClassName field value +func (o *JvmType) GetFqClassName() string { + if o == nil { + var ret string + return ret + } + + return o.FqClassName +} + +// GetFqClassNameOk returns a tuple with the FqClassName field value +// and a boolean to check if the value has been set. +func (o *JvmType) GetFqClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FqClassName, true +} + +// SetFqClassName sets field value +func (o *JvmType) SetFqClassName(v string) { + o.FqClassName = v +} + +// GetConstructorName returns the ConstructorName field value if set, zero value otherwise. +func (o *JvmType) GetConstructorName() string { + if o == nil || IsNil(o.ConstructorName) { + var ret string + return ret + } + return *o.ConstructorName +} + +// GetConstructorNameOk returns a tuple with the ConstructorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmType) GetConstructorNameOk() (*string, bool) { + if o == nil || IsNil(o.ConstructorName) { + return nil, false + } + return o.ConstructorName, true +} + +// HasConstructorName returns a boolean if a field has been set. +func (o *JvmType) HasConstructorName() bool { + if o != nil && !IsNil(o.ConstructorName) { + return true + } + + return false +} + +// SetConstructorName gets a reference to the given string and assigns it to the ConstructorName field. +func (o *JvmType) SetConstructorName(v string) { + o.ConstructorName = &v +} + +// GetInvocationTarget returns the InvocationTarget field value if set, zero value otherwise. +func (o *JvmType) GetInvocationTarget() JvmObject { + if o == nil || IsNil(o.InvocationTarget) { + var ret JvmObject + return ret + } + return *o.InvocationTarget +} + +// GetInvocationTargetOk returns a tuple with the InvocationTarget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmType) GetInvocationTargetOk() (*JvmObject, bool) { + if o == nil || IsNil(o.InvocationTarget) { + return nil, false + } + return o.InvocationTarget, true +} + +// HasInvocationTarget returns a boolean if a field has been set. +func (o *JvmType) HasInvocationTarget() bool { + if o != nil && !IsNil(o.InvocationTarget) { + return true + } + + return false +} + +// SetInvocationTarget gets a reference to the given JvmObject and assigns it to the InvocationTarget field. +func (o *JvmType) SetInvocationTarget(v JvmObject) { + o.InvocationTarget = &v +} + +func (o JvmType) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JvmType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["fqClassName"] = o.FqClassName + if !IsNil(o.ConstructorName) { + toSerialize["constructorName"] = o.ConstructorName + } + if !IsNil(o.InvocationTarget) { + toSerialize["invocationTarget"] = o.InvocationTarget + } + return toSerialize, nil +} + +type NullableJvmType struct { + value *JvmType + isSet bool +} + +func (v NullableJvmType) Get() *JvmType { + return v.value +} + +func (v *NullableJvmType) Set(val *JvmType) { + v.value = val + v.isSet = true +} + +func (v NullableJvmType) IsSet() bool { + return v.isSet +} + +func (v *NullableJvmType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJvmType(val *JvmType) *NullableJvmType { + return &NullableJvmType{value: val, isSet: true} +} + +func (v NullableJvmType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJvmType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go new file mode 100644 index 0000000000..7a079e3b49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" + "fmt" +) + +// JvmTypeKind the model 'JvmTypeKind' +type JvmTypeKind string + +// List of JvmTypeKind +const ( + PRIMITIVE JvmTypeKind = "PRIMITIVE" + REFERENCE JvmTypeKind = "REFERENCE" +) + +// All allowed values of JvmTypeKind enum +var AllowedJvmTypeKindEnumValues = []JvmTypeKind{ + "PRIMITIVE", + "REFERENCE", +} + +func (v *JvmTypeKind) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := JvmTypeKind(value) + for _, existing := range AllowedJvmTypeKindEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid JvmTypeKind", value) +} + +// NewJvmTypeKindFromValue returns a pointer to a valid JvmTypeKind +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewJvmTypeKindFromValue(v string) (*JvmTypeKind, error) { + ev := JvmTypeKind(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for JvmTypeKind: valid values are %v", v, AllowedJvmTypeKindEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v JvmTypeKind) IsValid() bool { + for _, existing := range AllowedJvmTypeKindEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to JvmTypeKind value +func (v JvmTypeKind) Ptr() *JvmTypeKind { + return &v +} + +type NullableJvmTypeKind struct { + value *JvmTypeKind + isSet bool +} + +func (v NullableJvmTypeKind) Get() *JvmTypeKind { + return v.value +} + +func (v *NullableJvmTypeKind) Set(val *JvmTypeKind) { + v.value = val + v.isSet = true +} + +func (v NullableJvmTypeKind) IsSet() bool { + return v.isSet +} + +func (v *NullableJvmTypeKind) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJvmTypeKind(val *JvmTypeKind) *NullableJvmTypeKind { + return &NullableJvmTypeKind{value: val, isSet: true} +} + +func (v NullableJvmTypeKind) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJvmTypeKind) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go new file mode 100644 index 0000000000..e1fc080c6c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ListFlowsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlowsV1Request{} + +// ListFlowsV1Request struct for ListFlowsV1Request +type ListFlowsV1Request struct { + Filter *string `json:"filter,omitempty"` +} + +// NewListFlowsV1Request instantiates a new ListFlowsV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlowsV1Request() *ListFlowsV1Request { + this := ListFlowsV1Request{} + return &this +} + +// NewListFlowsV1RequestWithDefaults instantiates a new ListFlowsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlowsV1RequestWithDefaults() *ListFlowsV1Request { + this := ListFlowsV1Request{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *ListFlowsV1Request) GetFilter() string { + if o == nil || IsNil(o.Filter) { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListFlowsV1Request) GetFilterOk() (*string, bool) { + if o == nil || IsNil(o.Filter) { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *ListFlowsV1Request) HasFilter() bool { + if o != nil && !IsNil(o.Filter) { + return true + } + + return false +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *ListFlowsV1Request) SetFilter(v string) { + o.Filter = &v +} + +func (o ListFlowsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlowsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Filter) { + toSerialize["filter"] = o.Filter + } + return toSerialize, nil +} + +type NullableListFlowsV1Request struct { + value *ListFlowsV1Request + isSet bool +} + +func (v NullableListFlowsV1Request) Get() *ListFlowsV1Request { + return v.value +} + +func (v *NullableListFlowsV1Request) Set(val *ListFlowsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableListFlowsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlowsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlowsV1Request(val *ListFlowsV1Request) *NullableListFlowsV1Request { + return &NullableListFlowsV1Request{value: val, isSet: true} +} + +func (v NullableListFlowsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlowsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go new file mode 100644 index 0000000000..aebd2c6538 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ListFlowsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlowsV1Response{} + +// ListFlowsV1Response struct for ListFlowsV1Response +type ListFlowsV1Response struct { + // An array of strings storing the names of the flows as returned by the flowList Corda RPC. + FlowNames []string `json:"flowNames"` +} + +// NewListFlowsV1Response instantiates a new ListFlowsV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlowsV1Response(flowNames []string) *ListFlowsV1Response { + this := ListFlowsV1Response{} + this.FlowNames = flowNames + return &this +} + +// NewListFlowsV1ResponseWithDefaults instantiates a new ListFlowsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlowsV1ResponseWithDefaults() *ListFlowsV1Response { + this := ListFlowsV1Response{} + return &this +} + +// GetFlowNames returns the FlowNames field value +func (o *ListFlowsV1Response) GetFlowNames() []string { + if o == nil { + var ret []string + return ret + } + + return o.FlowNames +} + +// GetFlowNamesOk returns a tuple with the FlowNames field value +// and a boolean to check if the value has been set. +func (o *ListFlowsV1Response) GetFlowNamesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.FlowNames, true +} + +// SetFlowNames sets field value +func (o *ListFlowsV1Response) SetFlowNames(v []string) { + o.FlowNames = v +} + +func (o ListFlowsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlowsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flowNames"] = o.FlowNames + return toSerialize, nil +} + +type NullableListFlowsV1Response struct { + value *ListFlowsV1Response + isSet bool +} + +func (v NullableListFlowsV1Response) Get() *ListFlowsV1Response { + return v.value +} + +func (v *NullableListFlowsV1Response) Set(val *ListFlowsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableListFlowsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlowsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlowsV1Response(val *ListFlowsV1Response) *NullableListFlowsV1Response { + return &NullableListFlowsV1Response{value: val, isSet: true} +} + +func (v NullableListFlowsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlowsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go new file mode 100644 index 0000000000..ca9243bbba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the NetworkHostAndPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkHostAndPort{} + +// NetworkHostAndPort struct for NetworkHostAndPort +type NetworkHostAndPort struct { + Host string `json:"host"` + Port float32 `json:"port"` +} + +// NewNetworkHostAndPort instantiates a new NetworkHostAndPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkHostAndPort(host string, port float32) *NetworkHostAndPort { + this := NetworkHostAndPort{} + this.Host = host + this.Port = port + return &this +} + +// NewNetworkHostAndPortWithDefaults instantiates a new NetworkHostAndPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkHostAndPortWithDefaults() *NetworkHostAndPort { + this := NetworkHostAndPort{} + return &this +} + +// GetHost returns the Host field value +func (o *NetworkHostAndPort) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *NetworkHostAndPort) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *NetworkHostAndPort) SetHost(v string) { + o.Host = v +} + +// GetPort returns the Port field value +func (o *NetworkHostAndPort) GetPort() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *NetworkHostAndPort) GetPortOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *NetworkHostAndPort) SetPort(v float32) { + o.Port = v +} + +func (o NetworkHostAndPort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkHostAndPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + toSerialize["port"] = o.Port + return toSerialize, nil +} + +type NullableNetworkHostAndPort struct { + value *NetworkHostAndPort + isSet bool +} + +func (v NullableNetworkHostAndPort) Get() *NetworkHostAndPort { + return v.value +} + +func (v *NullableNetworkHostAndPort) Set(val *NetworkHostAndPort) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkHostAndPort) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkHostAndPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkHostAndPort(val *NetworkHostAndPort) *NullableNetworkHostAndPort { + return &NullableNetworkHostAndPort{value: val, isSet: true} +} + +func (v NullableNetworkHostAndPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkHostAndPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go new file mode 100644 index 0000000000..1581ec59ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go @@ -0,0 +1,230 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the NodeDiagnosticInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeDiagnosticInfo{} + +// NodeDiagnosticInfo A NodeDiagnosticInfo holds information about the current node version. +type NodeDiagnosticInfo struct { + // A list of CorDapps currently installed on this node + Cordapps []CordappInfo `json:"cordapps"` + // The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists) + PlatformVersion int32 `json:"platformVersion"` + // The git commit hash this node was built from + Revision string `json:"revision"` + // The vendor of this node + Vendor string `json:"vendor"` + // The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). + Version string `json:"version"` +} + +// NewNodeDiagnosticInfo instantiates a new NodeDiagnosticInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeDiagnosticInfo(cordapps []CordappInfo, platformVersion int32, revision string, vendor string, version string) *NodeDiagnosticInfo { + this := NodeDiagnosticInfo{} + this.Cordapps = cordapps + this.PlatformVersion = platformVersion + this.Revision = revision + this.Vendor = vendor + this.Version = version + return &this +} + +// NewNodeDiagnosticInfoWithDefaults instantiates a new NodeDiagnosticInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeDiagnosticInfoWithDefaults() *NodeDiagnosticInfo { + this := NodeDiagnosticInfo{} + return &this +} + +// GetCordapps returns the Cordapps field value +func (o *NodeDiagnosticInfo) GetCordapps() []CordappInfo { + if o == nil { + var ret []CordappInfo + return ret + } + + return o.Cordapps +} + +// GetCordappsOk returns a tuple with the Cordapps field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetCordappsOk() ([]CordappInfo, bool) { + if o == nil { + return nil, false + } + return o.Cordapps, true +} + +// SetCordapps sets field value +func (o *NodeDiagnosticInfo) SetCordapps(v []CordappInfo) { + o.Cordapps = v +} + +// GetPlatformVersion returns the PlatformVersion field value +func (o *NodeDiagnosticInfo) GetPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PlatformVersion +} + +// GetPlatformVersionOk returns a tuple with the PlatformVersion field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PlatformVersion, true +} + +// SetPlatformVersion sets field value +func (o *NodeDiagnosticInfo) SetPlatformVersion(v int32) { + o.PlatformVersion = v +} + +// GetRevision returns the Revision field value +func (o *NodeDiagnosticInfo) GetRevision() string { + if o == nil { + var ret string + return ret + } + + return o.Revision +} + +// GetRevisionOk returns a tuple with the Revision field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetRevisionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Revision, true +} + +// SetRevision sets field value +func (o *NodeDiagnosticInfo) SetRevision(v string) { + o.Revision = v +} + +// GetVendor returns the Vendor field value +func (o *NodeDiagnosticInfo) GetVendor() string { + if o == nil { + var ret string + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetVendorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Vendor, true +} + +// SetVendor sets field value +func (o *NodeDiagnosticInfo) SetVendor(v string) { + o.Vendor = v +} + +// GetVersion returns the Version field value +func (o *NodeDiagnosticInfo) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *NodeDiagnosticInfo) SetVersion(v string) { + o.Version = v +} + +func (o NodeDiagnosticInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeDiagnosticInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cordapps"] = o.Cordapps + toSerialize["platformVersion"] = o.PlatformVersion + toSerialize["revision"] = o.Revision + toSerialize["vendor"] = o.Vendor + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableNodeDiagnosticInfo struct { + value *NodeDiagnosticInfo + isSet bool +} + +func (v NullableNodeDiagnosticInfo) Get() *NodeDiagnosticInfo { + return v.value +} + +func (v *NullableNodeDiagnosticInfo) Set(val *NodeDiagnosticInfo) { + v.value = val + v.isSet = true +} + +func (v NullableNodeDiagnosticInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeDiagnosticInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeDiagnosticInfo(val *NodeDiagnosticInfo) *NullableNodeDiagnosticInfo { + return &NullableNodeDiagnosticInfo{value: val, isSet: true} +} + +func (v NullableNodeDiagnosticInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeDiagnosticInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go new file mode 100644 index 0000000000..f5773b84a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the NodeInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeInfo{} + +// NodeInfo struct for NodeInfo +type NodeInfo struct { + Addresses []NetworkHostAndPort `json:"addresses"` + PlatformVersion int32 `json:"platformVersion"` + Serial float32 `json:"serial"` + LegalIdentities []Party `json:"legalIdentities"` + LegalIdentitiesAndCerts []map[string]interface{} `json:"legalIdentitiesAndCerts"` +} + +// NewNodeInfo instantiates a new NodeInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeInfo(addresses []NetworkHostAndPort, platformVersion int32, serial float32, legalIdentities []Party, legalIdentitiesAndCerts []map[string]interface{}) *NodeInfo { + this := NodeInfo{} + this.Addresses = addresses + this.PlatformVersion = platformVersion + this.Serial = serial + this.LegalIdentities = legalIdentities + this.LegalIdentitiesAndCerts = legalIdentitiesAndCerts + return &this +} + +// NewNodeInfoWithDefaults instantiates a new NodeInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeInfoWithDefaults() *NodeInfo { + this := NodeInfo{} + return &this +} + +// GetAddresses returns the Addresses field value +func (o *NodeInfo) GetAddresses() []NetworkHostAndPort { + if o == nil { + var ret []NetworkHostAndPort + return ret + } + + return o.Addresses +} + +// GetAddressesOk returns a tuple with the Addresses field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetAddressesOk() ([]NetworkHostAndPort, bool) { + if o == nil { + return nil, false + } + return o.Addresses, true +} + +// SetAddresses sets field value +func (o *NodeInfo) SetAddresses(v []NetworkHostAndPort) { + o.Addresses = v +} + +// GetPlatformVersion returns the PlatformVersion field value +func (o *NodeInfo) GetPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PlatformVersion +} + +// GetPlatformVersionOk returns a tuple with the PlatformVersion field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PlatformVersion, true +} + +// SetPlatformVersion sets field value +func (o *NodeInfo) SetPlatformVersion(v int32) { + o.PlatformVersion = v +} + +// GetSerial returns the Serial field value +func (o *NodeInfo) GetSerial() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetSerialOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Serial, true +} + +// SetSerial sets field value +func (o *NodeInfo) SetSerial(v float32) { + o.Serial = v +} + +// GetLegalIdentities returns the LegalIdentities field value +func (o *NodeInfo) GetLegalIdentities() []Party { + if o == nil { + var ret []Party + return ret + } + + return o.LegalIdentities +} + +// GetLegalIdentitiesOk returns a tuple with the LegalIdentities field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetLegalIdentitiesOk() ([]Party, bool) { + if o == nil { + return nil, false + } + return o.LegalIdentities, true +} + +// SetLegalIdentities sets field value +func (o *NodeInfo) SetLegalIdentities(v []Party) { + o.LegalIdentities = v +} + +// GetLegalIdentitiesAndCerts returns the LegalIdentitiesAndCerts field value +func (o *NodeInfo) GetLegalIdentitiesAndCerts() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + + return o.LegalIdentitiesAndCerts +} + +// GetLegalIdentitiesAndCertsOk returns a tuple with the LegalIdentitiesAndCerts field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetLegalIdentitiesAndCertsOk() ([]map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LegalIdentitiesAndCerts, true +} + +// SetLegalIdentitiesAndCerts sets field value +func (o *NodeInfo) SetLegalIdentitiesAndCerts(v []map[string]interface{}) { + o.LegalIdentitiesAndCerts = v +} + +func (o NodeInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["addresses"] = o.Addresses + toSerialize["platformVersion"] = o.PlatformVersion + toSerialize["serial"] = o.Serial + toSerialize["legalIdentities"] = o.LegalIdentities + toSerialize["legalIdentitiesAndCerts"] = o.LegalIdentitiesAndCerts + return toSerialize, nil +} + +type NullableNodeInfo struct { + value *NodeInfo + isSet bool +} + +func (v NullableNodeInfo) Get() *NodeInfo { + return v.value +} + +func (v *NullableNodeInfo) Set(val *NodeInfo) { + v.value = val + v.isSet = true +} + +func (v NullableNodeInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeInfo(val *NodeInfo) *NullableNodeInfo { + return &NullableNodeInfo{value: val, isSet: true} +} + +func (v NullableNodeInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go new file mode 100644 index 0000000000..ecd255b2a1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the Party type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Party{} + +// Party struct for Party +type Party struct { + Name CordaX500Name `json:"name"` + OwningKey PublicKey `json:"owningKey"` +} + +// NewParty instantiates a new Party object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewParty(name CordaX500Name, owningKey PublicKey) *Party { + this := Party{} + this.Name = name + this.OwningKey = owningKey + return &this +} + +// NewPartyWithDefaults instantiates a new Party object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartyWithDefaults() *Party { + this := Party{} + return &this +} + +// GetName returns the Name field value +func (o *Party) GetName() CordaX500Name { + if o == nil { + var ret CordaX500Name + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Party) GetNameOk() (*CordaX500Name, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Party) SetName(v CordaX500Name) { + o.Name = v +} + +// GetOwningKey returns the OwningKey field value +func (o *Party) GetOwningKey() PublicKey { + if o == nil { + var ret PublicKey + return ret + } + + return o.OwningKey +} + +// GetOwningKeyOk returns a tuple with the OwningKey field value +// and a boolean to check if the value has been set. +func (o *Party) GetOwningKeyOk() (*PublicKey, bool) { + if o == nil { + return nil, false + } + return &o.OwningKey, true +} + +// SetOwningKey sets field value +func (o *Party) SetOwningKey(v PublicKey) { + o.OwningKey = v +} + +func (o Party) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Party) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["owningKey"] = o.OwningKey + return toSerialize, nil +} + +type NullableParty struct { + value *Party + isSet bool +} + +func (v NullableParty) Get() *Party { + return v.value +} + +func (v *NullableParty) Set(val *Party) { + v.value = val + v.isSet = true +} + +func (v NullableParty) IsSet() bool { + return v.isSet +} + +func (v *NullableParty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParty(val *Party) *NullableParty { + return &NullableParty{value: val, isSet: true} +} + +func (v NullableParty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go new file mode 100644 index 0000000000..dd37ff728f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the PublicKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicKey{} + +// PublicKey An instance of a java.security.PublicKey (which is an interface) implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl +type PublicKey struct { + Algorithm string `json:"algorithm"` + Format string `json:"format"` + Encoded string `json:"encoded"` +} + +// NewPublicKey instantiates a new PublicKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicKey(algorithm string, format string, encoded string) *PublicKey { + this := PublicKey{} + this.Algorithm = algorithm + this.Format = format + this.Encoded = encoded + return &this +} + +// NewPublicKeyWithDefaults instantiates a new PublicKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicKeyWithDefaults() *PublicKey { + this := PublicKey{} + return &this +} + +// GetAlgorithm returns the Algorithm field value +func (o *PublicKey) GetAlgorithm() string { + if o == nil { + var ret string + return ret + } + + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *PublicKey) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *PublicKey) SetAlgorithm(v string) { + o.Algorithm = v +} + +// GetFormat returns the Format field value +func (o *PublicKey) GetFormat() string { + if o == nil { + var ret string + return ret + } + + return o.Format +} + +// GetFormatOk returns a tuple with the Format field value +// and a boolean to check if the value has been set. +func (o *PublicKey) GetFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Format, true +} + +// SetFormat sets field value +func (o *PublicKey) SetFormat(v string) { + o.Format = v +} + +// GetEncoded returns the Encoded field value +func (o *PublicKey) GetEncoded() string { + if o == nil { + var ret string + return ret + } + + return o.Encoded +} + +// GetEncodedOk returns a tuple with the Encoded field value +// and a boolean to check if the value has been set. +func (o *PublicKey) GetEncodedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Encoded, true +} + +// SetEncoded sets field value +func (o *PublicKey) SetEncoded(v string) { + o.Encoded = v +} + +func (o PublicKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["algorithm"] = o.Algorithm + toSerialize["format"] = o.Format + toSerialize["encoded"] = o.Encoded + return toSerialize, nil +} + +type NullablePublicKey struct { + value *PublicKey + isSet bool +} + +func (v NullablePublicKey) Get() *PublicKey { + return v.value +} + +func (v *NullablePublicKey) Set(val *PublicKey) { + v.value = val + v.isSet = true +} + +func (v NullablePublicKey) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicKey(val *PublicKey) *NullablePublicKey { + return &NullablePublicKey{value: val, isSet: true} +} + +func (v NullablePublicKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go new file mode 100644 index 0000000000..1232532fd6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the SHA256 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SHA256{} + +// SHA256 SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes). +type SHA256 struct { + Bytes string `json:"bytes"` + Offset int32 `json:"offset"` + Size int32 `json:"size"` +} + +// NewSHA256 instantiates a new SHA256 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSHA256(bytes string, offset int32, size int32) *SHA256 { + this := SHA256{} + this.Bytes = bytes + this.Offset = offset + this.Size = size + return &this +} + +// NewSHA256WithDefaults instantiates a new SHA256 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSHA256WithDefaults() *SHA256 { + this := SHA256{} + return &this +} + +// GetBytes returns the Bytes field value +func (o *SHA256) GetBytes() string { + if o == nil { + var ret string + return ret + } + + return o.Bytes +} + +// GetBytesOk returns a tuple with the Bytes field value +// and a boolean to check if the value has been set. +func (o *SHA256) GetBytesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytes, true +} + +// SetBytes sets field value +func (o *SHA256) SetBytes(v string) { + o.Bytes = v +} + +// GetOffset returns the Offset field value +func (o *SHA256) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *SHA256) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *SHA256) SetOffset(v int32) { + o.Offset = v +} + +// GetSize returns the Size field value +func (o *SHA256) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *SHA256) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *SHA256) SetSize(v int32) { + o.Size = v +} + +func (o SHA256) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SHA256) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bytes"] = o.Bytes + toSerialize["offset"] = o.Offset + toSerialize["size"] = o.Size + return toSerialize, nil +} + +type NullableSHA256 struct { + value *SHA256 + isSet bool +} + +func (v NullableSHA256) Get() *SHA256 { + return v.value +} + +func (v *NullableSHA256) Set(val *SHA256) { + v.value = val + v.isSet = true +} + +func (v NullableSHA256) IsSet() bool { + return v.isSet +} + +func (v *NullableSHA256) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSHA256(val *SHA256) *NullableSHA256 { + return &NullableSHA256{value: val, isSet: true} +} + +func (v NullableSHA256) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSHA256) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go new file mode 100644 index 0000000000..bc311d5eda --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StartMonitorV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StartMonitorV1Request{} + +// StartMonitorV1Request struct for StartMonitorV1Request +type StartMonitorV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` +} + +// NewStartMonitorV1Request instantiates a new StartMonitorV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStartMonitorV1Request(clientAppId string, stateFullClassName string) *StartMonitorV1Request { + this := StartMonitorV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + return &this +} + +// NewStartMonitorV1RequestWithDefaults instantiates a new StartMonitorV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStartMonitorV1RequestWithDefaults() *StartMonitorV1Request { + this := StartMonitorV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *StartMonitorV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *StartMonitorV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *StartMonitorV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *StartMonitorV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +func (o StartMonitorV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StartMonitorV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + return toSerialize, nil +} + +type NullableStartMonitorV1Request struct { + value *StartMonitorV1Request + isSet bool +} + +func (v NullableStartMonitorV1Request) Get() *StartMonitorV1Request { + return v.value +} + +func (v *NullableStartMonitorV1Request) Set(val *StartMonitorV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableStartMonitorV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableStartMonitorV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStartMonitorV1Request(val *StartMonitorV1Request) *NullableStartMonitorV1Request { + return &NullableStartMonitorV1Request{value: val, isSet: true} +} + +func (v NullableStartMonitorV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStartMonitorV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go new file mode 100644 index 0000000000..9d0b707eb0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StartMonitorV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StartMonitorV1Response{} + +// StartMonitorV1Response struct for StartMonitorV1Response +type StartMonitorV1Response struct { + // Flag set to true if monitoring started correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` +} + +// NewStartMonitorV1Response instantiates a new StartMonitorV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStartMonitorV1Response(success bool, msg string) *StartMonitorV1Response { + this := StartMonitorV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewStartMonitorV1ResponseWithDefaults instantiates a new StartMonitorV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStartMonitorV1ResponseWithDefaults() *StartMonitorV1Response { + this := StartMonitorV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *StartMonitorV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *StartMonitorV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *StartMonitorV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *StartMonitorV1Response) SetMsg(v string) { + o.Msg = v +} + +func (o StartMonitorV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StartMonitorV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +type NullableStartMonitorV1Response struct { + value *StartMonitorV1Response + isSet bool +} + +func (v NullableStartMonitorV1Response) Get() *StartMonitorV1Response { + return v.value +} + +func (v *NullableStartMonitorV1Response) Set(val *StartMonitorV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableStartMonitorV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableStartMonitorV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStartMonitorV1Response(val *StartMonitorV1Response) *NullableStartMonitorV1Response { + return &NullableStartMonitorV1Response{value: val, isSet: true} +} + +func (v NullableStartMonitorV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStartMonitorV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go new file mode 100644 index 0000000000..a8e42033c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StopMonitorV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StopMonitorV1Request{} + +// StopMonitorV1Request struct for StopMonitorV1Request +type StopMonitorV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` +} + +// NewStopMonitorV1Request instantiates a new StopMonitorV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStopMonitorV1Request(clientAppId string, stateFullClassName string) *StopMonitorV1Request { + this := StopMonitorV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + return &this +} + +// NewStopMonitorV1RequestWithDefaults instantiates a new StopMonitorV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStopMonitorV1RequestWithDefaults() *StopMonitorV1Request { + this := StopMonitorV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *StopMonitorV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *StopMonitorV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *StopMonitorV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *StopMonitorV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +func (o StopMonitorV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StopMonitorV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + return toSerialize, nil +} + +type NullableStopMonitorV1Request struct { + value *StopMonitorV1Request + isSet bool +} + +func (v NullableStopMonitorV1Request) Get() *StopMonitorV1Request { + return v.value +} + +func (v *NullableStopMonitorV1Request) Set(val *StopMonitorV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableStopMonitorV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableStopMonitorV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStopMonitorV1Request(val *StopMonitorV1Request) *NullableStopMonitorV1Request { + return &NullableStopMonitorV1Request{value: val, isSet: true} +} + +func (v NullableStopMonitorV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStopMonitorV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go new file mode 100644 index 0000000000..c679dec504 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StopMonitorV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StopMonitorV1Response{} + +// StopMonitorV1Response struct for StopMonitorV1Response +type StopMonitorV1Response struct { + // Flag set to true if operation completed correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` +} + +// NewStopMonitorV1Response instantiates a new StopMonitorV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStopMonitorV1Response(success bool, msg string) *StopMonitorV1Response { + this := StopMonitorV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewStopMonitorV1ResponseWithDefaults instantiates a new StopMonitorV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStopMonitorV1ResponseWithDefaults() *StopMonitorV1Response { + this := StopMonitorV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *StopMonitorV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *StopMonitorV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *StopMonitorV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *StopMonitorV1Response) SetMsg(v string) { + o.Msg = v +} + +func (o StopMonitorV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StopMonitorV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +type NullableStopMonitorV1Response struct { + value *StopMonitorV1Response + isSet bool +} + +func (v NullableStopMonitorV1Response) Get() *StopMonitorV1Response { + return v.value +} + +func (v *NullableStopMonitorV1Response) Set(val *StopMonitorV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableStopMonitorV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableStopMonitorV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStopMonitorV1Response(val *StopMonitorV1Response) *NullableStopMonitorV1Response { + return &NullableStopMonitorV1Response{value: val, isSet: true} +} + +func (v NullableStopMonitorV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStopMonitorV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go new file mode 100644 index 0000000000..83b5c1d855 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go @@ -0,0 +1,145 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the X500Principal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &X500Principal{} + +// X500Principal struct for X500Principal +type X500Principal struct { + Name string `json:"name"` + // Base64 encoded public key + Encoded string `json:"encoded"` +} + +// NewX500Principal instantiates a new X500Principal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewX500Principal(name string, encoded string) *X500Principal { + this := X500Principal{} + this.Name = name + this.Encoded = encoded + return &this +} + +// NewX500PrincipalWithDefaults instantiates a new X500Principal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewX500PrincipalWithDefaults() *X500Principal { + this := X500Principal{} + return &this +} + +// GetName returns the Name field value +func (o *X500Principal) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *X500Principal) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *X500Principal) SetName(v string) { + o.Name = v +} + +// GetEncoded returns the Encoded field value +func (o *X500Principal) GetEncoded() string { + if o == nil { + var ret string + return ret + } + + return o.Encoded +} + +// GetEncodedOk returns a tuple with the Encoded field value +// and a boolean to check if the value has been set. +func (o *X500Principal) GetEncodedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Encoded, true +} + +// SetEncoded sets field value +func (o *X500Principal) SetEncoded(v string) { + o.Encoded = v +} + +func (o X500Principal) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o X500Principal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["encoded"] = o.Encoded + return toSerialize, nil +} + +type NullableX500Principal struct { + value *X500Principal + isSet bool +} + +func (v NullableX500Principal) Get() *X500Principal { + return v.value +} + +func (v *NullableX500Principal) Set(val *X500Principal) { + v.value = val + v.isSet = true +} + +func (v NullableX500Principal) IsSet() bool { + return v.isSet +} + +func (v *NullableX500Principal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableX500Principal(val *X500Principal) *NullableX500Principal { + return &NullableX500Principal{value: val, isSet: true} +} + +func (v NullableX500Principal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableX500Principal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..8032f809b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..064cfe602e --- /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 0000000000..fd52906631 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..85332d768f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Corda + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..428992e208 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,68 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java +src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java +src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java +src/main/java/org/openapitools/client/model/CordaRpcCredentials.java +src/main/java/org/openapitools/client/model/CordaX500Name.java +src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java +src/main/java/org/openapitools/client/model/CordappInfo.java +src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java +src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java +src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java +src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java +src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java +src/main/java/org/openapitools/client/model/FlowInvocationType.java +src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java +src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java +src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/JarFile.java +src/main/java/org/openapitools/client/model/JvmObject.java +src/main/java/org/openapitools/client/model/JvmType.java +src/main/java/org/openapitools/client/model/JvmTypeKind.java +src/main/java/org/openapitools/client/model/ListFlowsV1Request.java +src/main/java/org/openapitools/client/model/ListFlowsV1Response.java +src/main/java/org/openapitools/client/model/NetworkHostAndPort.java +src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java +src/main/java/org/openapitools/client/model/NodeInfo.java +src/main/java/org/openapitools/client/model/Party.java +src/main/java/org/openapitools/client/model/PublicKey.java +src/main/java/org/openapitools/client/model/SHA256.java +src/main/java/org/openapitools/client/model/StartMonitorV1Request.java +src/main/java/org/openapitools/client/model/StartMonitorV1Response.java +src/main/java/org/openapitools/client/model/StopMonitorV1Request.java +src/main/java/org/openapitools/client/model/StopMonitorV1Response.java +src/main/java/org/openapitools/client/model/X500Principal.java diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..5715223532 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,180 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Corda +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Corda ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request = new ClearMonitorTransactionsV1Request(); // ClearMonitorTransactionsV1Request | + try { + ClearMonitorTransactionsV1Response result = apiInstance.clearMonitorTransactionsV1(clearMonitorTransactionsV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#clearMonitorTransactionsV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**clearMonitorTransactionsV1**](docs/DefaultApi.md#clearMonitorTransactionsV1) | **DELETE** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions | Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. +*DefaultApi* | [**deployContractJarsV1**](docs/DefaultApi.md#deployContractJarsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars | Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). +*DefaultApi* | [**diagnoseNodeV1**](docs/DefaultApi.md#diagnoseNodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node | +*DefaultApi* | [**getMonitorTransactionsV1**](docs/DefaultApi.md#getMonitorTransactionsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions | Get transactions for monitored state classes. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract | Invokes a contract on a Corda ledger (e.g. a flow) +*DefaultApi* | [**listFlowsV1**](docs/DefaultApi.md#listFlowsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows | +*DefaultApi* | [**networkMapV1**](docs/DefaultApi.md#networkMapV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map | +*DefaultApi* | [**startMonitorV1**](docs/DefaultApi.md#startMonitorV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor | Start monitoring corda changes (transactions) of given state class +*DefaultApi* | [**stopMonitorV1**](docs/DefaultApi.md#stopMonitorV1) | **DELETE** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor | Stop monitoring corda changes (transactions) of given state class + + +## Documentation for Models + + - [ClearMonitorTransactionsV1Request](docs/ClearMonitorTransactionsV1Request.md) + - [ClearMonitorTransactionsV1Response](docs/ClearMonitorTransactionsV1Response.md) + - [CordaNodeSshCredentials](docs/CordaNodeSshCredentials.md) + - [CordaRpcCredentials](docs/CordaRpcCredentials.md) + - [CordaX500Name](docs/CordaX500Name.md) + - [CordappDeploymentConfig](docs/CordappDeploymentConfig.md) + - [CordappInfo](docs/CordappInfo.md) + - [DeployContractJarsBadRequestV1Response](docs/DeployContractJarsBadRequestV1Response.md) + - [DeployContractJarsSuccessV1Response](docs/DeployContractJarsSuccessV1Response.md) + - [DeployContractJarsV1Request](docs/DeployContractJarsV1Request.md) + - [DiagnoseNodeV1Request](docs/DiagnoseNodeV1Request.md) + - [DiagnoseNodeV1Response](docs/DiagnoseNodeV1Response.md) + - [FlowInvocationType](docs/FlowInvocationType.md) + - [GetMonitorTransactionsV1Request](docs/GetMonitorTransactionsV1Request.md) + - [GetMonitorTransactionsV1Response](docs/GetMonitorTransactionsV1Response.md) + - [GetMonitorTransactionsV1ResponseTxInner](docs/GetMonitorTransactionsV1ResponseTxInner.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [JarFile](docs/JarFile.md) + - [JvmObject](docs/JvmObject.md) + - [JvmType](docs/JvmType.md) + - [JvmTypeKind](docs/JvmTypeKind.md) + - [ListFlowsV1Request](docs/ListFlowsV1Request.md) + - [ListFlowsV1Response](docs/ListFlowsV1Response.md) + - [NetworkHostAndPort](docs/NetworkHostAndPort.md) + - [NodeDiagnosticInfo](docs/NodeDiagnosticInfo.md) + - [NodeInfo](docs/NodeInfo.md) + - [Party](docs/Party.md) + - [PublicKey](docs/PublicKey.md) + - [SHA256](docs/SHA256.md) + - [StartMonitorV1Request](docs/StartMonitorV1Request.md) + - [StartMonitorV1Response](docs/StartMonitorV1Response.md) + - [StopMonitorV1Request](docs/StopMonitorV1Request.md) + - [StopMonitorV1Response](docs/StopMonitorV1Response.md) + - [X500Principal](docs/X500Principal.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..8dd3ee92b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1410 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Corda ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Corda + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars: + post: + operationId: deployContractJarsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsSuccessV1Response' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsBadRequestV1Response' + description: Bad Request + summary: "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda\ + \ speak)." + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a Corda ledger (e.g. a flow) + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor: + post: + operationId: startMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Response' + description: OK + summary: Start monitoring corda changes (transactions) of given state class + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions: + get: + operationId: GetMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response' + description: OK + summary: Get transactions for monitored state classes. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions + verbLowerCase: get + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions: + delete: + operationId: ClearMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Response' + description: OK + summary: Clear transactions from internal store so they'll not be available + by GetMonitorTransactionsV1 anymore. + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions + verbLowerCase: delete + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor: + delete: + operationId: stopMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Response' + description: OK + summary: Stop monitoring corda changes (transactions) of given state class + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor + verbLowerCase: delete + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map: + post: + description: "Responds with a snapshot of the network map as provided by the\ + \ Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun\ + \ networkMapSnapshot(): List" + operationId: networkMapV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows: + post: + description: Responds with a list of the flows on the Corda node. + operationId: listFlowsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node: + post: + description: Responds with diagnostic information about the Corda node + operationId: diagnoseNodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + SHA256: + description: "SHA-256 is part of the SHA-2 hash function family. Generated hash\ + \ is fixed size, 256-bits (32-bytes)." + example: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + externalDocs: + description: Official Corda documentation of the SHA256 class. + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.crypto/-secure-hash/-s-h-a256/index.html + properties: + bytes: + example: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + type: string + offset: + example: 0 + type: integer + size: + example: 32 + type: integer + required: + - bytes + - offset + - size + type: object + CordappInfo: + description: A CordappInfo describes a single CorDapp currently installed on + the node + example: + licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + externalDocs: + description: Official Corda Documentation of the class CordappInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.cordapp/-cordapp-info/index.html + properties: + jarHash: + $ref: '#/components/schemas/SHA256' + licence: + description: The name of the licence this CorDapp is released under + type: string + minimumPlatformVersion: + description: The minimum platform version the node must be at for the CorDapp + to run + type: integer + name: + description: The name of the JAR file that defines the CorDapp + type: string + shortName: + description: The name of the CorDapp + type: string + targetPlatformVersion: + description: The target platform version this CorDapp has been tested against + type: integer + type: + description: "A description of what sort of CorDapp this is - either a contract,\ + \ workflow, or a combination." + type: string + vendor: + description: The vendor of this CorDapp + type: string + version: + description: The version of this CorDapp + type: string + required: + - jarHash + - licence + - minimumPlatformVersion + - name + - shortName + - targetPlatformVersion + - type + - vendor + - version + type: object + NodeDiagnosticInfo: + description: A NodeDiagnosticInfo holds information about the current node version. + example: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + externalDocs: + description: Official Corda Documentation of the class NodeDiagnosticInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.node/-node-diagnostic-info/index.html + properties: + cordapps: + description: A list of CorDapps currently installed on this node + items: + $ref: '#/components/schemas/CordappInfo' + maxItems: 4096 + minItems: 0 + type: array + platformVersion: + description: "The platform version of this node. This number represents\ + \ a released API version, and should be used to make functionality decisions\ + \ (e.g. enabling an app feature only if an underlying platform feature\ + \ exists)" + type: integer + revision: + description: The git commit hash this node was built from + type: string + vendor: + description: The vendor of this node + type: string + version: + description: "The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note\ + \ that this string is effectively freeform, and so should only be used\ + \ for providing diagnostic information. It should not be used to make\ + \ functionality decisions (the platformVersion is a better fit for this)." + type: string + required: + - cordapps + - platformVersion + - revision + - vendor + - version + type: object + FlowInvocationType: + description: Determines which flow starting method will be used on the back-end + when invoking the flow. Based on the value here the plugin back-end might + invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() + method. Streamed responses are aggregated and returned in a single response + to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. + do. + enum: + - TRACKED_FLOW_DYNAMIC + - FLOW_DYNAMIC + nullable: false + type: string + JarFile: + additionalProperties: true + example: + filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + properties: + filename: + maxLength: 255 + minLength: 1 + nullable: false + type: string + hasDbMigrations: + description: Indicates whether the cordapp jar in question contains any + embedded migrations that Cactus can/should execute between copying the + jar into the cordapp directory and starting the node back up. + nullable: false + type: boolean + contentBase64: + format: base64 + maxLength: 1073741824 + minLength: 1 + nullable: false + type: string + required: + - contentBase64 + - filename + - hasDbMigrations + type: object + JvmType: + description: Represents a reference to a JVM type (such as a Java class) + example: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + properties: + fqClassName: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + constructorName: + description: This parameter is used to specify that the function used to + construct this JvmType is not a constructor function but instead is a + factory function. Setting this parameter will cause the plugin to look + up methods of the class denoted by fqClassName instead of its constructors. + maxLength: 65535 + minLength: 1 + nullable: false + type: string + invocationTarget: + $ref: '#/components/schemas/JvmObject' + required: + - fqClassName + type: object + JvmTypeKind: + enum: + - PRIMITIVE + - REFERENCE + nullable: false + type: string + JvmObject: + description: "Can represent JVM primitive and reference types as well. The jvmTypeKind\ + \ field indicates which one is being stored. If the jvmTypeKind field is set\ + \ to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise\ + \ (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property\ + \ is filled with a primitive data type supported by the JSON standard such\ + \ as strings, booleans, numbers, etc." + example: + jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + jvmTypeKind: + $ref: '#/components/schemas/JvmTypeKind' + primitiveValue: + type: object + jvmCtorArgs: + default: [] + items: + $ref: '#/components/schemas/JvmObject' + maxLength: 1024 + minLength: 0 + nullable: false + type: array + jvmType: + $ref: '#/components/schemas/JvmType' + required: + - jvmType + - jvmTypeKind + type: object + CordappDeploymentConfig: + example: + cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + sshCredentials: + $ref: '#/components/schemas/CordaNodeSshCredentials' + rpcCredentials: + $ref: '#/components/schemas/CordaRpcCredentials' + cordaNodeStartCmd: + description: The shell command to execute in order to start back up a Corda + node after having placed new jars in the cordapp directory of said node. + example: ./build/nodes/runNodes + maxLength: 65535 + minLength: 1 + nullable: false + type: string + cordappDir: + description: The absolute file system path where the Corda Node is expecting + deployed Cordapp jar files to be placed. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + cordaJarPath: + description: The absolute file system path where the corda.jar file of the + node can be found. This is used to execute database schema migrations + where applicable (H2 database in use in development environments). + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeBaseDirPath: + description: The absolute file system path where the base directory of the + Corda node can be found. This is used to pass in to corda.jar when being + invoked for certain tasks such as executing database schema migrations + for a deployed contract. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + required: + - cordaJarPath + - cordaNodeStartCmd + - cordappDir + - nodeBaseDirPath + - rpcCredentials + - sshCredentials + type: object + CordaRpcCredentials: + example: + hostname: hostname + password: password + port: 39501 + username: username + properties: + hostname: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + username: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + password: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - hostname + - password + - port + - username + type: object + CordaNodeSshCredentials: + example: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + hostKeyEntry: + example: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + maxLength: 65535 + minLength: 1 + nullable: false + type: string + username: + maxLength: 32 + minLength: 1 + nullable: false + type: string + password: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + hostname: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + required: + - hostKeyEntry + - hostname + - password + - port + - username + type: object + DeployContractJarsV1Request: + additionalProperties: false + example: + jarFiles: + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + cordappDeploymentConfigs: + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + cordappDeploymentConfigs: + default: [] + description: The list of deployment configurations pointing to the nodes + where the provided cordapp jar files are to be deployed . + items: + $ref: '#/components/schemas/CordappDeploymentConfig' + maxLength: 1024 + minLength: 0 + type: array + jarFiles: + items: + $ref: '#/components/schemas/JarFile' + nullable: false + type: array + required: + - cordappDeploymentConfigs + - jarFiles + type: object + DeployContractJarsSuccessV1Response: + example: + deployedJarFiles: + - deployedJarFiles + - deployedJarFiles + properties: + deployedJarFiles: + items: + minItems: 1 + nullable: false + type: string + type: array + required: + - deployedJarFiles + type: object + DeployContractJarsBadRequestV1Response: + properties: + errors: + items: + maxItems: 2048 + maxLength: 65535 + minItems: 1 + minLength: 1 + type: string + type: array + required: + - errors + type: object + InvokeContractV1Request: + additionalProperties: false + example: + flowInvocationType: null + timeoutMs: 0 + flowFullClassName: net.corda.samples.obligation.flows.IOUIssueFlow + params: + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + flowFullClassName: + description: The fully qualified name of the Corda flow to invoke + example: net.corda.samples.obligation.flows.IOUIssueFlow + maxLength: 1024 + minLength: 1 + nullable: false + type: string + flowInvocationType: + $ref: '#/components/schemas/FlowInvocationType' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: + $ref: '#/components/schemas/JvmObject' + nullable: false + type: array + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. + minimum: 0 + nullable: false + type: integer + required: + - flowFullClassName + - flowInvocationType + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + callOutput: "{}" + success: true + progress: + - progress + - progress + flowId: flowId + transactionId: transactionId + properties: + success: + nullable: false + type: boolean + callOutput: + description: Data returned from the JVM when no transaction is running + type: object + transactionId: + description: The net.corda.core.flows.StateMachineRunId value returned by + the flow execution. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + progress: + default: [] + description: "An array of strings representing the aggregated stream of\ + \ progress updates provided by a *tracked* flow invocation. If the flow\ + \ invocation was not tracked, this array is still returned, but as empty." + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + flowId: + description: The id for the flow handle + type: string + required: + - callOutput + - flowId + - success + type: object + StartMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StartMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if monitoring started correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + GetMonitorTransactionsV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + GetMonitorTransactionsV1Response: + example: + msg: msg + tx: + - data: data + index: index + - data: data + index: index + success: true + stateFullClassName: net.corda.samples.example.states.IOUState + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + tx: + default: [] + items: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response_tx_inner' + type: array + required: + - msg + - success + type: object + ClearMonitorTransactionsV1Request: + additionalProperties: false + example: + txIndexes: + - txIndexes + - txIndexes + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + txIndexes: + default: [] + items: + type: string + type: array + required: + - clientAppId + - stateFullClassName + - txIndexes + type: object + ClearMonitorTransactionsV1Response: + additionalProperties: false + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + StopMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StopMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + ListFlowsV1Request: + additionalProperties: false + example: + filter: filter + properties: + filter: + type: string + type: object + ListFlowsV1Response: + example: + flowNames: + - net.corda.core.flows.ContractUpgradeFlow$Authorise + - net.corda.core.flows.ContractUpgradeFlow$Deauthorise + - net.corda.core.flows.ContractUpgradeFlow$Initiate + - 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.core.flows.ContractUpgradeFlow$Authorise + - net.corda.core.flows.ContractUpgradeFlow$Deauthorise + - net.corda.core.flows.ContractUpgradeFlow$Initiate + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + required: + - flowNames + type: object + NetworkHostAndPort: + example: + port: 0.8008281904610115 + host: host + properties: + host: + type: string + port: + type: number + required: + - host + - port + type: object + PartyAndCertificate: + type: object + PublicKey: + description: An instance of a java.security.PublicKey (which is an interface) + implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + example: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + properties: + algorithm: + example: EdDSA + type: string + format: + example: X.509 + type: string + encoded: + example: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + type: string + required: + - algorithm + - encoded + - format + type: object + X500Principal: + example: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + properties: + name: + example: "O=PartyA,L=London,C=GB" + type: string + encoded: + description: Base64 encoded public key + example: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + type: string + required: + - encoded + - name + type: object + CordaX500Name: + example: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + commonName: + type: string + organisationUnit: + type: string + organisation: + example: PartyA + type: string + locality: + example: London + type: string + state: + type: string + country: + example: GB + type: string + x500Principal: + $ref: '#/components/schemas/X500Principal' + required: + - country + - locality + - organisation + - x500Principal + type: object + Party: + example: + owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + name: + $ref: '#/components/schemas/CordaX500Name' + owningKey: + $ref: '#/components/schemas/PublicKey' + required: + - name + - owningKey + type: object + NodeInfo: + example: + legalIdentities: + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + addresses: + - port: 0.8008281904610115 + host: host + - port: 0.8008281904610115 + host: host + serial: 1.4658129805029452 + platformVersion: 6 + legalIdentitiesAndCerts: + - null + - null + properties: + addresses: + items: + $ref: '#/components/schemas/NetworkHostAndPort' + type: array + platformVersion: + type: integer + serial: + type: number + legalIdentities: + items: + $ref: '#/components/schemas/Party' + type: array + legalIdentitiesAndCerts: + items: + $ref: '#/components/schemas/PartyAndCertificate' + type: array + required: + - addresses + - legalIdentities + - legalIdentitiesAndCerts + - platformVersion + - serial + type: object + NetworkMapV1Request: + type: object + NetworkMapV1Response: + items: + $ref: '#/components/schemas/NodeInfo' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + DiagnoseNodeV1Request: + additionalProperties: false + example: + nodeIds: + - nodeIds + - nodeIds + - nodeIds + - nodeIds + - nodeIds + properties: + nodeIds: + default: [] + description: "Optional property specifying which Corda Node should be the\ + \ one being diagnosed in case the Connector has multiple connections established\ + \ for different nodes (which is not yet a supported feature, but we want\ + \ to keep this possibility open for the future)." + items: + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + type: object + DiagnoseNodeV1Response: + example: + nodeDiagnosticInfo: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + properties: + nodeDiagnosticInfo: + $ref: '#/components/schemas/NodeDiagnosticInfo' + required: + - nodeDiagnosticInfo + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetMonitorTransactionsV1Response_tx_inner: + example: + data: data + index: index + properties: + index: + type: string + data: + maxItems: 10000000 + minItems: 0 + type: string + type: object + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..59711fcaef --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..e4a514eb78 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..9b3d7a788c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..a68eb0cf2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..255efad5c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..44a8243c61 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,433 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClearMonitorTransactionsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClearMonitorTransactionsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordaNodeSshCredentials.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordaRpcCredentials.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordaX500Name.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordappDeploymentConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordappInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJarsBadRequestV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJarsSuccessV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJarsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DiagnoseNodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DiagnoseNodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetMonitorTransactionsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetMonitorTransactionsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetMonitorTransactionsV1ResponseTxInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JarFile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JvmObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JvmType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ListFlowsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ListFlowsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NetworkHostAndPort.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NodeDiagnosticInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NodeInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Party.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PublicKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SHA256.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StartMonitorV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StartMonitorV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StopMonitorV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StopMonitorV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.X500Principal.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..803b76c4f8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..f959c4aa72 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..38564f42e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..fb93a4e9ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..0fa383e9a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1272 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.ClearMonitorTransactionsV1Request; +import org.openapitools.client.model.ClearMonitorTransactionsV1Response; +import org.openapitools.client.model.DeployContractJarsBadRequestV1Response; +import org.openapitools.client.model.DeployContractJarsSuccessV1Response; +import org.openapitools.client.model.DeployContractJarsV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Response; +import org.openapitools.client.model.GetMonitorTransactionsV1Request; +import org.openapitools.client.model.GetMonitorTransactionsV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.ListFlowsV1Request; +import org.openapitools.client.model.ListFlowsV1Response; +import org.openapitools.client.model.NodeInfo; +import org.openapitools.client.model.StartMonitorV1Request; +import org.openapitools.client.model.StartMonitorV1Response; +import org.openapitools.client.model.StopMonitorV1Request; +import org.openapitools.client.model.StopMonitorV1Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for clearMonitorTransactionsV1 + * @param clearMonitorTransactionsV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clearMonitorTransactionsV1Call(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = clearMonitorTransactionsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call clearMonitorTransactionsV1ValidateBeforeCall(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + return clearMonitorTransactionsV1Call(clearMonitorTransactionsV1Request, _callback); + + } + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return ClearMonitorTransactionsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ClearMonitorTransactionsV1Response clearMonitorTransactionsV1(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request) throws ApiException { + ApiResponse localVarResp = clearMonitorTransactionsV1WithHttpInfo(clearMonitorTransactionsV1Request); + return localVarResp.getData(); + } + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return ApiResponse<ClearMonitorTransactionsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse clearMonitorTransactionsV1WithHttpInfo(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request) throws ApiException { + okhttp3.Call localVarCall = clearMonitorTransactionsV1ValidateBeforeCall(clearMonitorTransactionsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. (asynchronously) + * + * @param clearMonitorTransactionsV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clearMonitorTransactionsV1Async(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = clearMonitorTransactionsV1ValidateBeforeCall(clearMonitorTransactionsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractJarsV1 + * @param deployContractJarsV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public okhttp3.Call deployContractJarsV1Call(DeployContractJarsV1Request deployContractJarsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractJarsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractJarsV1ValidateBeforeCall(DeployContractJarsV1Request deployContractJarsV1Request, final ApiCallback _callback) throws ApiException { + return deployContractJarsV1Call(deployContractJarsV1Request, _callback); + + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return DeployContractJarsSuccessV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public DeployContractJarsSuccessV1Response deployContractJarsV1(DeployContractJarsV1Request deployContractJarsV1Request) throws ApiException { + ApiResponse localVarResp = deployContractJarsV1WithHttpInfo(deployContractJarsV1Request); + return localVarResp.getData(); + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return ApiResponse<DeployContractJarsSuccessV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public ApiResponse deployContractJarsV1WithHttpInfo(DeployContractJarsV1Request deployContractJarsV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractJarsV1ValidateBeforeCall(deployContractJarsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). (asynchronously) + * + * @param deployContractJarsV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public okhttp3.Call deployContractJarsV1Async(DeployContractJarsV1Request deployContractJarsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractJarsV1ValidateBeforeCall(deployContractJarsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for diagnoseNodeV1 + * @param diagnoseNodeV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call diagnoseNodeV1Call(DiagnoseNodeV1Request diagnoseNodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = diagnoseNodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call diagnoseNodeV1ValidateBeforeCall(DiagnoseNodeV1Request diagnoseNodeV1Request, final ApiCallback _callback) throws ApiException { + return diagnoseNodeV1Call(diagnoseNodeV1Request, _callback); + + } + + /** + * + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @return DiagnoseNodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DiagnoseNodeV1Response diagnoseNodeV1(DiagnoseNodeV1Request diagnoseNodeV1Request) throws ApiException { + ApiResponse localVarResp = diagnoseNodeV1WithHttpInfo(diagnoseNodeV1Request); + return localVarResp.getData(); + } + + /** + * + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @return ApiResponse<DiagnoseNodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse diagnoseNodeV1WithHttpInfo(DiagnoseNodeV1Request diagnoseNodeV1Request) throws ApiException { + okhttp3.Call localVarCall = diagnoseNodeV1ValidateBeforeCall(diagnoseNodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call diagnoseNodeV1Async(DiagnoseNodeV1Request diagnoseNodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = diagnoseNodeV1ValidateBeforeCall(diagnoseNodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getMonitorTransactionsV1 + * @param getMonitorTransactionsV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getMonitorTransactionsV1Call(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getMonitorTransactionsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMonitorTransactionsV1ValidateBeforeCall(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + return getMonitorTransactionsV1Call(getMonitorTransactionsV1Request, _callback); + + } + + /** + * Get transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return GetMonitorTransactionsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetMonitorTransactionsV1Response getMonitorTransactionsV1(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request) throws ApiException { + ApiResponse localVarResp = getMonitorTransactionsV1WithHttpInfo(getMonitorTransactionsV1Request); + return localVarResp.getData(); + } + + /** + * Get transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return ApiResponse<GetMonitorTransactionsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getMonitorTransactionsV1WithHttpInfo(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request) throws ApiException { + okhttp3.Call localVarCall = getMonitorTransactionsV1ValidateBeforeCall(getMonitorTransactionsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get transactions for monitored state classes. (asynchronously) + * + * @param getMonitorTransactionsV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getMonitorTransactionsV1Async(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMonitorTransactionsV1ValidateBeforeCall(getMonitorTransactionsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) (asynchronously) + * + * @param invokeContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listFlowsV1 + * @param listFlowsV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call listFlowsV1Call(ListFlowsV1Request listFlowsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = listFlowsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listFlowsV1ValidateBeforeCall(ListFlowsV1Request listFlowsV1Request, final ApiCallback _callback) throws ApiException { + return listFlowsV1Call(listFlowsV1Request, _callback); + + } + + /** + * + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @return ListFlowsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ListFlowsV1Response listFlowsV1(ListFlowsV1Request listFlowsV1Request) throws ApiException { + ApiResponse localVarResp = listFlowsV1WithHttpInfo(listFlowsV1Request); + return localVarResp.getData(); + } + + /** + * + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @return ApiResponse<ListFlowsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse listFlowsV1WithHttpInfo(ListFlowsV1Request listFlowsV1Request) throws ApiException { + okhttp3.Call localVarCall = listFlowsV1ValidateBeforeCall(listFlowsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call listFlowsV1Async(ListFlowsV1Request listFlowsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listFlowsV1ValidateBeforeCall(listFlowsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for networkMapV1 + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call networkMapV1Call(Object body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call networkMapV1ValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException { + return networkMapV1Call(body, _callback); + + } + + /** + * + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @return List<NodeInfo> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public List networkMapV1(Object body) throws ApiException { + ApiResponse> localVarResp = networkMapV1WithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @return ApiResponse<List<NodeInfo>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse> networkMapV1WithHttpInfo(Object body) throws ApiException { + okhttp3.Call localVarCall = networkMapV1ValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call networkMapV1Async(Object body, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = networkMapV1ValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for startMonitorV1 + * @param startMonitorV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call startMonitorV1Call(StartMonitorV1Request startMonitorV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = startMonitorV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call startMonitorV1ValidateBeforeCall(StartMonitorV1Request startMonitorV1Request, final ApiCallback _callback) throws ApiException { + return startMonitorV1Call(startMonitorV1Request, _callback); + + } + + /** + * Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return StartMonitorV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public StartMonitorV1Response startMonitorV1(StartMonitorV1Request startMonitorV1Request) throws ApiException { + ApiResponse localVarResp = startMonitorV1WithHttpInfo(startMonitorV1Request); + return localVarResp.getData(); + } + + /** + * Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return ApiResponse<StartMonitorV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse startMonitorV1WithHttpInfo(StartMonitorV1Request startMonitorV1Request) throws ApiException { + okhttp3.Call localVarCall = startMonitorV1ValidateBeforeCall(startMonitorV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Start monitoring corda changes (transactions) of given state class (asynchronously) + * + * @param startMonitorV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call startMonitorV1Async(StartMonitorV1Request startMonitorV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = startMonitorV1ValidateBeforeCall(startMonitorV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for stopMonitorV1 + * @param stopMonitorV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call stopMonitorV1Call(StopMonitorV1Request stopMonitorV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = stopMonitorV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call stopMonitorV1ValidateBeforeCall(StopMonitorV1Request stopMonitorV1Request, final ApiCallback _callback) throws ApiException { + return stopMonitorV1Call(stopMonitorV1Request, _callback); + + } + + /** + * Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return StopMonitorV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public StopMonitorV1Response stopMonitorV1(StopMonitorV1Request stopMonitorV1Request) throws ApiException { + ApiResponse localVarResp = stopMonitorV1WithHttpInfo(stopMonitorV1Request); + return localVarResp.getData(); + } + + /** + * Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return ApiResponse<StopMonitorV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse stopMonitorV1WithHttpInfo(StopMonitorV1Request stopMonitorV1Request) throws ApiException { + okhttp3.Call localVarCall = stopMonitorV1ValidateBeforeCall(stopMonitorV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Stop monitoring corda changes (transactions) of given state class (asynchronously) + * + * @param stopMonitorV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call stopMonitorV1Async(StopMonitorV1Request stopMonitorV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = stopMonitorV1ValidateBeforeCall(stopMonitorV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..8625c8ceb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..f2e55e265c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..ea528a12a1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..2b00f430dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..be90659090 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java new file mode 100644 index 0000000000..f13fa01fd7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java @@ -0,0 +1,293 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClearMonitorTransactionsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClearMonitorTransactionsV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public static final String SERIALIZED_NAME_TX_INDEXES = "txIndexes"; + @SerializedName(SERIALIZED_NAME_TX_INDEXES) + private List txIndexes = null; + + public ClearMonitorTransactionsV1Request() { + } + + public ClearMonitorTransactionsV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public ClearMonitorTransactionsV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + public ClearMonitorTransactionsV1Request txIndexes(List txIndexes) { + + this.txIndexes = txIndexes; + return this; + } + + public ClearMonitorTransactionsV1Request addTxIndexesItem(String txIndexesItem) { + if (this.txIndexes == null) { + this.txIndexes = null; + } + this.txIndexes.add(txIndexesItem); + return this; + } + + /** + * Get txIndexes + * @return txIndexes + **/ + @javax.annotation.Nonnull + public List getTxIndexes() { + return txIndexes; + } + + + public void setTxIndexes(List txIndexes) { + this.txIndexes = txIndexes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request = (ClearMonitorTransactionsV1Request) o; + return Objects.equals(this.clientAppId, clearMonitorTransactionsV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, clearMonitorTransactionsV1Request.stateFullClassName) && + Objects.equals(this.txIndexes, clearMonitorTransactionsV1Request.txIndexes); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName, txIndexes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClearMonitorTransactionsV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append(" txIndexes: ").append(toIndentedString(txIndexes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + openapiFields.add("txIndexes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + openapiRequiredFields.add("txIndexes"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClearMonitorTransactionsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClearMonitorTransactionsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClearMonitorTransactionsV1Request is not found in the empty JSON string", ClearMonitorTransactionsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClearMonitorTransactionsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClearMonitorTransactionsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClearMonitorTransactionsV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("txIndexes") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("txIndexes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `txIndexes` to be an array in the JSON string but got `%s`", jsonObj.get("txIndexes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClearMonitorTransactionsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClearMonitorTransactionsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClearMonitorTransactionsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClearMonitorTransactionsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClearMonitorTransactionsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClearMonitorTransactionsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClearMonitorTransactionsV1Request + * @throws IOException if the JSON string is invalid with respect to ClearMonitorTransactionsV1Request + */ + public static ClearMonitorTransactionsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClearMonitorTransactionsV1Request.class); + } + + /** + * Convert an instance of ClearMonitorTransactionsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java new file mode 100644 index 0000000000..08d23ca50e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClearMonitorTransactionsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClearMonitorTransactionsV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public ClearMonitorTransactionsV1Response() { + } + + public ClearMonitorTransactionsV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if operation completed correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public ClearMonitorTransactionsV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearMonitorTransactionsV1Response clearMonitorTransactionsV1Response = (ClearMonitorTransactionsV1Response) o; + return Objects.equals(this.success, clearMonitorTransactionsV1Response.success) && + Objects.equals(this.msg, clearMonitorTransactionsV1Response.msg); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClearMonitorTransactionsV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClearMonitorTransactionsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClearMonitorTransactionsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClearMonitorTransactionsV1Response is not found in the empty JSON string", ClearMonitorTransactionsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClearMonitorTransactionsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClearMonitorTransactionsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClearMonitorTransactionsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClearMonitorTransactionsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClearMonitorTransactionsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClearMonitorTransactionsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClearMonitorTransactionsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClearMonitorTransactionsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClearMonitorTransactionsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClearMonitorTransactionsV1Response + * @throws IOException if the JSON string is invalid with respect to ClearMonitorTransactionsV1Response + */ + public static ClearMonitorTransactionsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClearMonitorTransactionsV1Response.class); + } + + /** + * Convert an instance of ClearMonitorTransactionsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java new file mode 100644 index 0000000000..9e2831b07d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordaNodeSshCredentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordaNodeSshCredentials { + public static final String SERIALIZED_NAME_HOST_KEY_ENTRY = "hostKeyEntry"; + @SerializedName(SERIALIZED_NAME_HOST_KEY_ENTRY) + private String hostKeyEntry; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_HOSTNAME = "hostname"; + @SerializedName(SERIALIZED_NAME_HOSTNAME) + private String hostname; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + private Integer port; + + public CordaNodeSshCredentials() { + } + + public CordaNodeSshCredentials hostKeyEntry(String hostKeyEntry) { + + this.hostKeyEntry = hostKeyEntry; + return this; + } + + /** + * Get hostKeyEntry + * @return hostKeyEntry + **/ + @javax.annotation.Nonnull + public String getHostKeyEntry() { + return hostKeyEntry; + } + + + public void setHostKeyEntry(String hostKeyEntry) { + this.hostKeyEntry = hostKeyEntry; + } + + + public CordaNodeSshCredentials username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public CordaNodeSshCredentials password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public CordaNodeSshCredentials hostname(String hostname) { + + this.hostname = hostname; + return this; + } + + /** + * Get hostname + * @return hostname + **/ + @javax.annotation.Nonnull + public String getHostname() { + return hostname; + } + + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + + public CordaNodeSshCredentials port(Integer port) { + + this.port = port; + return this; + } + + /** + * Get port + * minimum: 1 + * maximum: 65535 + * @return port + **/ + @javax.annotation.Nonnull + public Integer getPort() { + return port; + } + + + public void setPort(Integer port) { + this.port = port; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordaNodeSshCredentials cordaNodeSshCredentials = (CordaNodeSshCredentials) o; + return Objects.equals(this.hostKeyEntry, cordaNodeSshCredentials.hostKeyEntry) && + Objects.equals(this.username, cordaNodeSshCredentials.username) && + Objects.equals(this.password, cordaNodeSshCredentials.password) && + Objects.equals(this.hostname, cordaNodeSshCredentials.hostname) && + Objects.equals(this.port, cordaNodeSshCredentials.port); + } + + @Override + public int hashCode() { + return Objects.hash(hostKeyEntry, username, password, hostname, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordaNodeSshCredentials {\n"); + sb.append(" hostKeyEntry: ").append(toIndentedString(hostKeyEntry)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hostKeyEntry"); + openapiFields.add("username"); + openapiFields.add("password"); + openapiFields.add("hostname"); + openapiFields.add("port"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hostKeyEntry"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("password"); + openapiRequiredFields.add("hostname"); + openapiRequiredFields.add("port"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordaNodeSshCredentials + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordaNodeSshCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordaNodeSshCredentials is not found in the empty JSON string", CordaNodeSshCredentials.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordaNodeSshCredentials.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordaNodeSshCredentials` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordaNodeSshCredentials.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hostKeyEntry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hostKeyEntry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostKeyEntry").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if (!jsonObj.get("hostname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordaNodeSshCredentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordaNodeSshCredentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordaNodeSshCredentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordaNodeSshCredentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordaNodeSshCredentials read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordaNodeSshCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordaNodeSshCredentials + * @throws IOException if the JSON string is invalid with respect to CordaNodeSshCredentials + */ + public static CordaNodeSshCredentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordaNodeSshCredentials.class); + } + + /** + * Convert an instance of CordaNodeSshCredentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java new file mode 100644 index 0000000000..2a627fc902 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java @@ -0,0 +1,311 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordaRpcCredentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordaRpcCredentials { + public static final String SERIALIZED_NAME_HOSTNAME = "hostname"; + @SerializedName(SERIALIZED_NAME_HOSTNAME) + private String hostname; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + private Integer port; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public CordaRpcCredentials() { + } + + public CordaRpcCredentials hostname(String hostname) { + + this.hostname = hostname; + return this; + } + + /** + * Get hostname + * @return hostname + **/ + @javax.annotation.Nonnull + public String getHostname() { + return hostname; + } + + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + + public CordaRpcCredentials port(Integer port) { + + this.port = port; + return this; + } + + /** + * Get port + * minimum: 1 + * maximum: 65535 + * @return port + **/ + @javax.annotation.Nonnull + public Integer getPort() { + return port; + } + + + public void setPort(Integer port) { + this.port = port; + } + + + public CordaRpcCredentials username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public CordaRpcCredentials password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordaRpcCredentials cordaRpcCredentials = (CordaRpcCredentials) o; + return Objects.equals(this.hostname, cordaRpcCredentials.hostname) && + Objects.equals(this.port, cordaRpcCredentials.port) && + Objects.equals(this.username, cordaRpcCredentials.username) && + Objects.equals(this.password, cordaRpcCredentials.password); + } + + @Override + public int hashCode() { + return Objects.hash(hostname, port, username, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordaRpcCredentials {\n"); + sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hostname"); + openapiFields.add("port"); + openapiFields.add("username"); + openapiFields.add("password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hostname"); + openapiRequiredFields.add("port"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("password"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordaRpcCredentials + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordaRpcCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordaRpcCredentials is not found in the empty JSON string", CordaRpcCredentials.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordaRpcCredentials.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordaRpcCredentials` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordaRpcCredentials.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hostname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordaRpcCredentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordaRpcCredentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordaRpcCredentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordaRpcCredentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordaRpcCredentials read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordaRpcCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordaRpcCredentials + * @throws IOException if the JSON string is invalid with respect to CordaRpcCredentials + */ + public static CordaRpcCredentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordaRpcCredentials.class); + } + + /** + * Convert an instance of CordaRpcCredentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java new file mode 100644 index 0000000000..c3fbff0719 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java @@ -0,0 +1,405 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.X500Principal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordaX500Name + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordaX500Name { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_ORGANISATION_UNIT = "organisationUnit"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_UNIT) + private String organisationUnit; + + public static final String SERIALIZED_NAME_ORGANISATION = "organisation"; + @SerializedName(SERIALIZED_NAME_ORGANISATION) + private String organisation; + + public static final String SERIALIZED_NAME_LOCALITY = "locality"; + @SerializedName(SERIALIZED_NAME_LOCALITY) + private String locality; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_X500_PRINCIPAL = "x500Principal"; + @SerializedName(SERIALIZED_NAME_X500_PRINCIPAL) + private X500Principal x500Principal; + + public CordaX500Name() { + } + + public CordaX500Name commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * Get commonName + * @return commonName + **/ + @javax.annotation.Nullable + public String getCommonName() { + return commonName; + } + + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + + public CordaX500Name organisationUnit(String organisationUnit) { + + this.organisationUnit = organisationUnit; + return this; + } + + /** + * Get organisationUnit + * @return organisationUnit + **/ + @javax.annotation.Nullable + public String getOrganisationUnit() { + return organisationUnit; + } + + + public void setOrganisationUnit(String organisationUnit) { + this.organisationUnit = organisationUnit; + } + + + public CordaX500Name organisation(String organisation) { + + this.organisation = organisation; + return this; + } + + /** + * Get organisation + * @return organisation + **/ + @javax.annotation.Nonnull + public String getOrganisation() { + return organisation; + } + + + public void setOrganisation(String organisation) { + this.organisation = organisation; + } + + + public CordaX500Name locality(String locality) { + + this.locality = locality; + return this; + } + + /** + * Get locality + * @return locality + **/ + @javax.annotation.Nonnull + public String getLocality() { + return locality; + } + + + public void setLocality(String locality) { + this.locality = locality; + } + + + public CordaX500Name state(String state) { + + this.state = state; + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public CordaX500Name country(String country) { + + this.country = country; + return this; + } + + /** + * Get country + * @return country + **/ + @javax.annotation.Nonnull + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public CordaX500Name x500Principal(X500Principal x500Principal) { + + this.x500Principal = x500Principal; + return this; + } + + /** + * Get x500Principal + * @return x500Principal + **/ + @javax.annotation.Nonnull + public X500Principal getX500Principal() { + return x500Principal; + } + + + public void setX500Principal(X500Principal x500Principal) { + this.x500Principal = x500Principal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordaX500Name cordaX500Name = (CordaX500Name) o; + return Objects.equals(this.commonName, cordaX500Name.commonName) && + Objects.equals(this.organisationUnit, cordaX500Name.organisationUnit) && + Objects.equals(this.organisation, cordaX500Name.organisation) && + Objects.equals(this.locality, cordaX500Name.locality) && + Objects.equals(this.state, cordaX500Name.state) && + Objects.equals(this.country, cordaX500Name.country) && + Objects.equals(this.x500Principal, cordaX500Name.x500Principal); + } + + @Override + public int hashCode() { + return Objects.hash(commonName, organisationUnit, organisation, locality, state, country, x500Principal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordaX500Name {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" organisationUnit: ").append(toIndentedString(organisationUnit)).append("\n"); + sb.append(" organisation: ").append(toIndentedString(organisation)).append("\n"); + sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" x500Principal: ").append(toIndentedString(x500Principal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commonName"); + openapiFields.add("organisationUnit"); + openapiFields.add("organisation"); + openapiFields.add("locality"); + openapiFields.add("state"); + openapiFields.add("country"); + openapiFields.add("x500Principal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("organisation"); + openapiRequiredFields.add("locality"); + openapiRequiredFields.add("country"); + openapiRequiredFields.add("x500Principal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordaX500Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordaX500Name.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordaX500Name is not found in the empty JSON string", CordaX500Name.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordaX500Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordaX500Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordaX500Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("commonName") != null && !jsonObj.get("commonName").isJsonNull()) && !jsonObj.get("commonName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commonName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commonName").toString())); + } + if ((jsonObj.get("organisationUnit") != null && !jsonObj.get("organisationUnit").isJsonNull()) && !jsonObj.get("organisationUnit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organisationUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organisationUnit").toString())); + } + if (!jsonObj.get("organisation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organisation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organisation").toString())); + } + if (!jsonObj.get("locality").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `locality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locality").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if (!jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + // validate the required field `x500Principal` + X500Principal.validateJsonObject(jsonObj.getAsJsonObject("x500Principal")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordaX500Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordaX500Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordaX500Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordaX500Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordaX500Name read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordaX500Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordaX500Name + * @throws IOException if the JSON string is invalid with respect to CordaX500Name + */ + public static CordaX500Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordaX500Name.class); + } + + /** + * Convert an instance of CordaX500Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java new file mode 100644 index 0000000000..9250be7d58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java @@ -0,0 +1,376 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.CordaNodeSshCredentials; +import org.openapitools.client.model.CordaRpcCredentials; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordappDeploymentConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordappDeploymentConfig { + public static final String SERIALIZED_NAME_SSH_CREDENTIALS = "sshCredentials"; + @SerializedName(SERIALIZED_NAME_SSH_CREDENTIALS) + private CordaNodeSshCredentials sshCredentials; + + public static final String SERIALIZED_NAME_RPC_CREDENTIALS = "rpcCredentials"; + @SerializedName(SERIALIZED_NAME_RPC_CREDENTIALS) + private CordaRpcCredentials rpcCredentials; + + public static final String SERIALIZED_NAME_CORDA_NODE_START_CMD = "cordaNodeStartCmd"; + @SerializedName(SERIALIZED_NAME_CORDA_NODE_START_CMD) + private String cordaNodeStartCmd; + + public static final String SERIALIZED_NAME_CORDAPP_DIR = "cordappDir"; + @SerializedName(SERIALIZED_NAME_CORDAPP_DIR) + private String cordappDir; + + public static final String SERIALIZED_NAME_CORDA_JAR_PATH = "cordaJarPath"; + @SerializedName(SERIALIZED_NAME_CORDA_JAR_PATH) + private String cordaJarPath; + + public static final String SERIALIZED_NAME_NODE_BASE_DIR_PATH = "nodeBaseDirPath"; + @SerializedName(SERIALIZED_NAME_NODE_BASE_DIR_PATH) + private String nodeBaseDirPath; + + public CordappDeploymentConfig() { + } + + public CordappDeploymentConfig sshCredentials(CordaNodeSshCredentials sshCredentials) { + + this.sshCredentials = sshCredentials; + return this; + } + + /** + * Get sshCredentials + * @return sshCredentials + **/ + @javax.annotation.Nonnull + public CordaNodeSshCredentials getSshCredentials() { + return sshCredentials; + } + + + public void setSshCredentials(CordaNodeSshCredentials sshCredentials) { + this.sshCredentials = sshCredentials; + } + + + public CordappDeploymentConfig rpcCredentials(CordaRpcCredentials rpcCredentials) { + + this.rpcCredentials = rpcCredentials; + return this; + } + + /** + * Get rpcCredentials + * @return rpcCredentials + **/ + @javax.annotation.Nonnull + public CordaRpcCredentials getRpcCredentials() { + return rpcCredentials; + } + + + public void setRpcCredentials(CordaRpcCredentials rpcCredentials) { + this.rpcCredentials = rpcCredentials; + } + + + public CordappDeploymentConfig cordaNodeStartCmd(String cordaNodeStartCmd) { + + this.cordaNodeStartCmd = cordaNodeStartCmd; + return this; + } + + /** + * The shell command to execute in order to start back up a Corda node after having placed new jars in the cordapp directory of said node. + * @return cordaNodeStartCmd + **/ + @javax.annotation.Nonnull + public String getCordaNodeStartCmd() { + return cordaNodeStartCmd; + } + + + public void setCordaNodeStartCmd(String cordaNodeStartCmd) { + this.cordaNodeStartCmd = cordaNodeStartCmd; + } + + + public CordappDeploymentConfig cordappDir(String cordappDir) { + + this.cordappDir = cordappDir; + return this; + } + + /** + * The absolute file system path where the Corda Node is expecting deployed Cordapp jar files to be placed. + * @return cordappDir + **/ + @javax.annotation.Nonnull + public String getCordappDir() { + return cordappDir; + } + + + public void setCordappDir(String cordappDir) { + this.cordappDir = cordappDir; + } + + + public CordappDeploymentConfig cordaJarPath(String cordaJarPath) { + + this.cordaJarPath = cordaJarPath; + return this; + } + + /** + * The absolute file system path where the corda.jar file of the node can be found. This is used to execute database schema migrations where applicable (H2 database in use in development environments). + * @return cordaJarPath + **/ + @javax.annotation.Nonnull + public String getCordaJarPath() { + return cordaJarPath; + } + + + public void setCordaJarPath(String cordaJarPath) { + this.cordaJarPath = cordaJarPath; + } + + + public CordappDeploymentConfig nodeBaseDirPath(String nodeBaseDirPath) { + + this.nodeBaseDirPath = nodeBaseDirPath; + return this; + } + + /** + * The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract. + * @return nodeBaseDirPath + **/ + @javax.annotation.Nonnull + public String getNodeBaseDirPath() { + return nodeBaseDirPath; + } + + + public void setNodeBaseDirPath(String nodeBaseDirPath) { + this.nodeBaseDirPath = nodeBaseDirPath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordappDeploymentConfig cordappDeploymentConfig = (CordappDeploymentConfig) o; + return Objects.equals(this.sshCredentials, cordappDeploymentConfig.sshCredentials) && + Objects.equals(this.rpcCredentials, cordappDeploymentConfig.rpcCredentials) && + Objects.equals(this.cordaNodeStartCmd, cordappDeploymentConfig.cordaNodeStartCmd) && + Objects.equals(this.cordappDir, cordappDeploymentConfig.cordappDir) && + Objects.equals(this.cordaJarPath, cordappDeploymentConfig.cordaJarPath) && + Objects.equals(this.nodeBaseDirPath, cordappDeploymentConfig.nodeBaseDirPath); + } + + @Override + public int hashCode() { + return Objects.hash(sshCredentials, rpcCredentials, cordaNodeStartCmd, cordappDir, cordaJarPath, nodeBaseDirPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordappDeploymentConfig {\n"); + sb.append(" sshCredentials: ").append(toIndentedString(sshCredentials)).append("\n"); + sb.append(" rpcCredentials: ").append(toIndentedString(rpcCredentials)).append("\n"); + sb.append(" cordaNodeStartCmd: ").append(toIndentedString(cordaNodeStartCmd)).append("\n"); + sb.append(" cordappDir: ").append(toIndentedString(cordappDir)).append("\n"); + sb.append(" cordaJarPath: ").append(toIndentedString(cordaJarPath)).append("\n"); + sb.append(" nodeBaseDirPath: ").append(toIndentedString(nodeBaseDirPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sshCredentials"); + openapiFields.add("rpcCredentials"); + openapiFields.add("cordaNodeStartCmd"); + openapiFields.add("cordappDir"); + openapiFields.add("cordaJarPath"); + openapiFields.add("nodeBaseDirPath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sshCredentials"); + openapiRequiredFields.add("rpcCredentials"); + openapiRequiredFields.add("cordaNodeStartCmd"); + openapiRequiredFields.add("cordappDir"); + openapiRequiredFields.add("cordaJarPath"); + openapiRequiredFields.add("nodeBaseDirPath"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordappDeploymentConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordappDeploymentConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordappDeploymentConfig is not found in the empty JSON string", CordappDeploymentConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordappDeploymentConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordappDeploymentConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordappDeploymentConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `sshCredentials` + CordaNodeSshCredentials.validateJsonObject(jsonObj.getAsJsonObject("sshCredentials")); + // validate the required field `rpcCredentials` + CordaRpcCredentials.validateJsonObject(jsonObj.getAsJsonObject("rpcCredentials")); + if (!jsonObj.get("cordaNodeStartCmd").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cordaNodeStartCmd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cordaNodeStartCmd").toString())); + } + if (!jsonObj.get("cordappDir").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cordappDir` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cordappDir").toString())); + } + if (!jsonObj.get("cordaJarPath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cordaJarPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cordaJarPath").toString())); + } + if (!jsonObj.get("nodeBaseDirPath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeBaseDirPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeBaseDirPath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordappDeploymentConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordappDeploymentConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordappDeploymentConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordappDeploymentConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordappDeploymentConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordappDeploymentConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordappDeploymentConfig + * @throws IOException if the JSON string is invalid with respect to CordappDeploymentConfig + */ + public static CordappDeploymentConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordappDeploymentConfig.class); + } + + /** + * Convert an instance of CordappDeploymentConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java new file mode 100644 index 0000000000..1198497c9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java @@ -0,0 +1,464 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.SHA256; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A CordappInfo describes a single CorDapp currently installed on the node + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordappInfo { + public static final String SERIALIZED_NAME_JAR_HASH = "jarHash"; + @SerializedName(SERIALIZED_NAME_JAR_HASH) + private SHA256 jarHash; + + public static final String SERIALIZED_NAME_LICENCE = "licence"; + @SerializedName(SERIALIZED_NAME_LICENCE) + private String licence; + + public static final String SERIALIZED_NAME_MINIMUM_PLATFORM_VERSION = "minimumPlatformVersion"; + @SerializedName(SERIALIZED_NAME_MINIMUM_PLATFORM_VERSION) + private Integer minimumPlatformVersion; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SHORT_NAME = "shortName"; + @SerializedName(SERIALIZED_NAME_SHORT_NAME) + private String shortName; + + public static final String SERIALIZED_NAME_TARGET_PLATFORM_VERSION = "targetPlatformVersion"; + @SerializedName(SERIALIZED_NAME_TARGET_PLATFORM_VERSION) + private Integer targetPlatformVersion; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + @SerializedName(SERIALIZED_NAME_VENDOR) + private String vendor; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public CordappInfo() { + } + + public CordappInfo jarHash(SHA256 jarHash) { + + this.jarHash = jarHash; + return this; + } + + /** + * Get jarHash + * @return jarHash + **/ + @javax.annotation.Nonnull + public SHA256 getJarHash() { + return jarHash; + } + + + public void setJarHash(SHA256 jarHash) { + this.jarHash = jarHash; + } + + + public CordappInfo licence(String licence) { + + this.licence = licence; + return this; + } + + /** + * The name of the licence this CorDapp is released under + * @return licence + **/ + @javax.annotation.Nonnull + public String getLicence() { + return licence; + } + + + public void setLicence(String licence) { + this.licence = licence; + } + + + public CordappInfo minimumPlatformVersion(Integer minimumPlatformVersion) { + + this.minimumPlatformVersion = minimumPlatformVersion; + return this; + } + + /** + * The minimum platform version the node must be at for the CorDapp to run + * @return minimumPlatformVersion + **/ + @javax.annotation.Nonnull + public Integer getMinimumPlatformVersion() { + return minimumPlatformVersion; + } + + + public void setMinimumPlatformVersion(Integer minimumPlatformVersion) { + this.minimumPlatformVersion = minimumPlatformVersion; + } + + + public CordappInfo name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the JAR file that defines the CorDapp + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CordappInfo shortName(String shortName) { + + this.shortName = shortName; + return this; + } + + /** + * The name of the CorDapp + * @return shortName + **/ + @javax.annotation.Nonnull + public String getShortName() { + return shortName; + } + + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + + public CordappInfo targetPlatformVersion(Integer targetPlatformVersion) { + + this.targetPlatformVersion = targetPlatformVersion; + return this; + } + + /** + * The target platform version this CorDapp has been tested against + * @return targetPlatformVersion + **/ + @javax.annotation.Nonnull + public Integer getTargetPlatformVersion() { + return targetPlatformVersion; + } + + + public void setTargetPlatformVersion(Integer targetPlatformVersion) { + this.targetPlatformVersion = targetPlatformVersion; + } + + + public CordappInfo type(String type) { + + this.type = type; + return this; + } + + /** + * A description of what sort of CorDapp this is - either a contract, workflow, or a combination. + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public CordappInfo vendor(String vendor) { + + this.vendor = vendor; + return this; + } + + /** + * The vendor of this CorDapp + * @return vendor + **/ + @javax.annotation.Nonnull + public String getVendor() { + return vendor; + } + + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + + public CordappInfo version(String version) { + + this.version = version; + return this; + } + + /** + * The version of this CorDapp + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordappInfo cordappInfo = (CordappInfo) o; + return Objects.equals(this.jarHash, cordappInfo.jarHash) && + Objects.equals(this.licence, cordappInfo.licence) && + Objects.equals(this.minimumPlatformVersion, cordappInfo.minimumPlatformVersion) && + Objects.equals(this.name, cordappInfo.name) && + Objects.equals(this.shortName, cordappInfo.shortName) && + Objects.equals(this.targetPlatformVersion, cordappInfo.targetPlatformVersion) && + Objects.equals(this.type, cordappInfo.type) && + Objects.equals(this.vendor, cordappInfo.vendor) && + Objects.equals(this.version, cordappInfo.version); + } + + @Override + public int hashCode() { + return Objects.hash(jarHash, licence, minimumPlatformVersion, name, shortName, targetPlatformVersion, type, vendor, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordappInfo {\n"); + sb.append(" jarHash: ").append(toIndentedString(jarHash)).append("\n"); + sb.append(" licence: ").append(toIndentedString(licence)).append("\n"); + sb.append(" minimumPlatformVersion: ").append(toIndentedString(minimumPlatformVersion)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" shortName: ").append(toIndentedString(shortName)).append("\n"); + sb.append(" targetPlatformVersion: ").append(toIndentedString(targetPlatformVersion)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jarHash"); + openapiFields.add("licence"); + openapiFields.add("minimumPlatformVersion"); + openapiFields.add("name"); + openapiFields.add("shortName"); + openapiFields.add("targetPlatformVersion"); + openapiFields.add("type"); + openapiFields.add("vendor"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jarHash"); + openapiRequiredFields.add("licence"); + openapiRequiredFields.add("minimumPlatformVersion"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("shortName"); + openapiRequiredFields.add("targetPlatformVersion"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("vendor"); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordappInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordappInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordappInfo is not found in the empty JSON string", CordappInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordappInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordappInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordappInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("licence").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `licence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("licence").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("shortName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shortName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortName").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordappInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordappInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordappInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordappInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordappInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordappInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordappInfo + * @throws IOException if the JSON string is invalid with respect to CordappInfo + */ + public static CordappInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordappInfo.class); + } + + /** + * Convert an instance of CordappInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java new file mode 100644 index 0000000000..4b72b5413a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJarsBadRequestV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJarsBadRequestV1Response { + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = new ArrayList<>(); + + public DeployContractJarsBadRequestV1Response() { + } + + public DeployContractJarsBadRequestV1Response errors(List errors) { + + this.errors = errors; + return this; + } + + public DeployContractJarsBadRequestV1Response addErrorsItem(String errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + **/ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + + public void setErrors(List errors) { + this.errors = errors; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJarsBadRequestV1Response deployContractJarsBadRequestV1Response = (DeployContractJarsBadRequestV1Response) o; + return Objects.equals(this.errors, deployContractJarsBadRequestV1Response.errors); + } + + @Override + public int hashCode() { + return Objects.hash(errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJarsBadRequestV1Response {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("errors"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJarsBadRequestV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJarsBadRequestV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJarsBadRequestV1Response is not found in the empty JSON string", DeployContractJarsBadRequestV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJarsBadRequestV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJarsBadRequestV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJarsBadRequestV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("errors") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJarsBadRequestV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJarsBadRequestV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJarsBadRequestV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJarsBadRequestV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJarsBadRequestV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJarsBadRequestV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJarsBadRequestV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractJarsBadRequestV1Response + */ + public static DeployContractJarsBadRequestV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJarsBadRequestV1Response.class); + } + + /** + * Convert an instance of DeployContractJarsBadRequestV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java new file mode 100644 index 0000000000..915eeba226 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJarsSuccessV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJarsSuccessV1Response { + public static final String SERIALIZED_NAME_DEPLOYED_JAR_FILES = "deployedJarFiles"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_JAR_FILES) + private List deployedJarFiles = new ArrayList<>(); + + public DeployContractJarsSuccessV1Response() { + } + + public DeployContractJarsSuccessV1Response deployedJarFiles(List deployedJarFiles) { + + this.deployedJarFiles = deployedJarFiles; + return this; + } + + public DeployContractJarsSuccessV1Response addDeployedJarFilesItem(String deployedJarFilesItem) { + if (this.deployedJarFiles == null) { + this.deployedJarFiles = new ArrayList<>(); + } + this.deployedJarFiles.add(deployedJarFilesItem); + return this; + } + + /** + * Get deployedJarFiles + * @return deployedJarFiles + **/ + @javax.annotation.Nonnull + public List getDeployedJarFiles() { + return deployedJarFiles; + } + + + public void setDeployedJarFiles(List deployedJarFiles) { + this.deployedJarFiles = deployedJarFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJarsSuccessV1Response deployContractJarsSuccessV1Response = (DeployContractJarsSuccessV1Response) o; + return Objects.equals(this.deployedJarFiles, deployContractJarsSuccessV1Response.deployedJarFiles); + } + + @Override + public int hashCode() { + return Objects.hash(deployedJarFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJarsSuccessV1Response {\n"); + sb.append(" deployedJarFiles: ").append(toIndentedString(deployedJarFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("deployedJarFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("deployedJarFiles"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJarsSuccessV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJarsSuccessV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJarsSuccessV1Response is not found in the empty JSON string", DeployContractJarsSuccessV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJarsSuccessV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJarsSuccessV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJarsSuccessV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("deployedJarFiles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("deployedJarFiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedJarFiles` to be an array in the JSON string but got `%s`", jsonObj.get("deployedJarFiles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJarsSuccessV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJarsSuccessV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJarsSuccessV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJarsSuccessV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJarsSuccessV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJarsSuccessV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJarsSuccessV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractJarsSuccessV1Response + */ + public static DeployContractJarsSuccessV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJarsSuccessV1Response.class); + } + + /** + * Convert an instance of DeployContractJarsSuccessV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java new file mode 100644 index 0000000000..8a7bbf3b1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CordappDeploymentConfig; +import org.openapitools.client.model.JarFile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJarsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJarsV1Request { + public static final String SERIALIZED_NAME_CORDAPP_DEPLOYMENT_CONFIGS = "cordappDeploymentConfigs"; + @SerializedName(SERIALIZED_NAME_CORDAPP_DEPLOYMENT_CONFIGS) + private List cordappDeploymentConfigs = null; + + public static final String SERIALIZED_NAME_JAR_FILES = "jarFiles"; + @SerializedName(SERIALIZED_NAME_JAR_FILES) + private List jarFiles = new ArrayList<>(); + + public DeployContractJarsV1Request() { + } + + public DeployContractJarsV1Request cordappDeploymentConfigs(List cordappDeploymentConfigs) { + + this.cordappDeploymentConfigs = cordappDeploymentConfigs; + return this; + } + + public DeployContractJarsV1Request addCordappDeploymentConfigsItem(CordappDeploymentConfig cordappDeploymentConfigsItem) { + if (this.cordappDeploymentConfigs == null) { + this.cordappDeploymentConfigs = null; + } + this.cordappDeploymentConfigs.add(cordappDeploymentConfigsItem); + return this; + } + + /** + * The list of deployment configurations pointing to the nodes where the provided cordapp jar files are to be deployed . + * @return cordappDeploymentConfigs + **/ + @javax.annotation.Nonnull + public List getCordappDeploymentConfigs() { + return cordappDeploymentConfigs; + } + + + public void setCordappDeploymentConfigs(List cordappDeploymentConfigs) { + this.cordappDeploymentConfigs = cordappDeploymentConfigs; + } + + + public DeployContractJarsV1Request jarFiles(List jarFiles) { + + this.jarFiles = jarFiles; + return this; + } + + public DeployContractJarsV1Request addJarFilesItem(JarFile jarFilesItem) { + if (this.jarFiles == null) { + this.jarFiles = new ArrayList<>(); + } + this.jarFiles.add(jarFilesItem); + return this; + } + + /** + * Get jarFiles + * @return jarFiles + **/ + @javax.annotation.Nonnull + public List getJarFiles() { + return jarFiles; + } + + + public void setJarFiles(List jarFiles) { + this.jarFiles = jarFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJarsV1Request deployContractJarsV1Request = (DeployContractJarsV1Request) o; + return Objects.equals(this.cordappDeploymentConfigs, deployContractJarsV1Request.cordappDeploymentConfigs) && + Objects.equals(this.jarFiles, deployContractJarsV1Request.jarFiles); + } + + @Override + public int hashCode() { + return Objects.hash(cordappDeploymentConfigs, jarFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJarsV1Request {\n"); + sb.append(" cordappDeploymentConfigs: ").append(toIndentedString(cordappDeploymentConfigs)).append("\n"); + sb.append(" jarFiles: ").append(toIndentedString(jarFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cordappDeploymentConfigs"); + openapiFields.add("jarFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cordappDeploymentConfigs"); + openapiRequiredFields.add("jarFiles"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJarsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJarsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJarsV1Request is not found in the empty JSON string", DeployContractJarsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJarsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJarsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJarsV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cordappDeploymentConfigs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cordappDeploymentConfigs` to be an array in the JSON string but got `%s`", jsonObj.get("cordappDeploymentConfigs").toString())); + } + + JsonArray jsonArraycordappDeploymentConfigs = jsonObj.getAsJsonArray("cordappDeploymentConfigs"); + // validate the required field `cordappDeploymentConfigs` (array) + for (int i = 0; i < jsonArraycordappDeploymentConfigs.size(); i++) { + CordappDeploymentConfig.validateJsonObject(jsonArraycordappDeploymentConfigs.get(i).getAsJsonObject()); + }; + // ensure the required json array is present + if (jsonObj.get("jarFiles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("jarFiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `jarFiles` to be an array in the JSON string but got `%s`", jsonObj.get("jarFiles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJarsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJarsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJarsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJarsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJarsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJarsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJarsV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractJarsV1Request + */ + public static DeployContractJarsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJarsV1Request.class); + } + + /** + * Convert an instance of DeployContractJarsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java new file mode 100644 index 0000000000..daadddccd8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java @@ -0,0 +1,219 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DiagnoseNodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DiagnoseNodeV1Request { + public static final String SERIALIZED_NAME_NODE_IDS = "nodeIds"; + @SerializedName(SERIALIZED_NAME_NODE_IDS) + private List nodeIds = null; + + public DiagnoseNodeV1Request() { + } + + public DiagnoseNodeV1Request nodeIds(List nodeIds) { + + this.nodeIds = nodeIds; + return this; + } + + public DiagnoseNodeV1Request addNodeIdsItem(String nodeIdsItem) { + if (this.nodeIds == null) { + this.nodeIds = null; + } + this.nodeIds.add(nodeIdsItem); + return this; + } + + /** + * Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). + * @return nodeIds + **/ + @javax.annotation.Nullable + public List getNodeIds() { + return nodeIds; + } + + + public void setNodeIds(List nodeIds) { + this.nodeIds = nodeIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiagnoseNodeV1Request diagnoseNodeV1Request = (DiagnoseNodeV1Request) o; + return Objects.equals(this.nodeIds, diagnoseNodeV1Request.nodeIds); + } + + @Override + public int hashCode() { + return Objects.hash(nodeIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiagnoseNodeV1Request {\n"); + sb.append(" nodeIds: ").append(toIndentedString(nodeIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DiagnoseNodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DiagnoseNodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DiagnoseNodeV1Request is not found in the empty JSON string", DiagnoseNodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DiagnoseNodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DiagnoseNodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("nodeIds") != null && !jsonObj.get("nodeIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeIds` to be an array in the JSON string but got `%s`", jsonObj.get("nodeIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiagnoseNodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiagnoseNodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DiagnoseNodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DiagnoseNodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DiagnoseNodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DiagnoseNodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiagnoseNodeV1Request + * @throws IOException if the JSON string is invalid with respect to DiagnoseNodeV1Request + */ + public static DiagnoseNodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiagnoseNodeV1Request.class); + } + + /** + * Convert an instance of DiagnoseNodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java new file mode 100644 index 0000000000..e06e489a11 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NodeDiagnosticInfo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DiagnoseNodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DiagnoseNodeV1Response { + public static final String SERIALIZED_NAME_NODE_DIAGNOSTIC_INFO = "nodeDiagnosticInfo"; + @SerializedName(SERIALIZED_NAME_NODE_DIAGNOSTIC_INFO) + private NodeDiagnosticInfo nodeDiagnosticInfo; + + public DiagnoseNodeV1Response() { + } + + public DiagnoseNodeV1Response nodeDiagnosticInfo(NodeDiagnosticInfo nodeDiagnosticInfo) { + + this.nodeDiagnosticInfo = nodeDiagnosticInfo; + return this; + } + + /** + * Get nodeDiagnosticInfo + * @return nodeDiagnosticInfo + **/ + @javax.annotation.Nonnull + public NodeDiagnosticInfo getNodeDiagnosticInfo() { + return nodeDiagnosticInfo; + } + + + public void setNodeDiagnosticInfo(NodeDiagnosticInfo nodeDiagnosticInfo) { + this.nodeDiagnosticInfo = nodeDiagnosticInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiagnoseNodeV1Response diagnoseNodeV1Response = (DiagnoseNodeV1Response) o; + return Objects.equals(this.nodeDiagnosticInfo, diagnoseNodeV1Response.nodeDiagnosticInfo); + } + + @Override + public int hashCode() { + return Objects.hash(nodeDiagnosticInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiagnoseNodeV1Response {\n"); + sb.append(" nodeDiagnosticInfo: ").append(toIndentedString(nodeDiagnosticInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeDiagnosticInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nodeDiagnosticInfo"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DiagnoseNodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DiagnoseNodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DiagnoseNodeV1Response is not found in the empty JSON string", DiagnoseNodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DiagnoseNodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DiagnoseNodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DiagnoseNodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `nodeDiagnosticInfo` + NodeDiagnosticInfo.validateJsonObject(jsonObj.getAsJsonObject("nodeDiagnosticInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiagnoseNodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiagnoseNodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DiagnoseNodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DiagnoseNodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DiagnoseNodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DiagnoseNodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiagnoseNodeV1Response + * @throws IOException if the JSON string is invalid with respect to DiagnoseNodeV1Response + */ + public static DiagnoseNodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiagnoseNodeV1Response.class); + } + + /** + * Convert an instance of DiagnoseNodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java new file mode 100644 index 0000000000..0991f49ce9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Determines which flow starting method will be used on the back-end when invoking the flow. Based on the value here the plugin back-end might invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() method. Streamed responses are aggregated and returned in a single response to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. do. + */ +@JsonAdapter(FlowInvocationType.Adapter.class) +public enum FlowInvocationType { + + TRACKED_FLOW_DYNAMIC("TRACKED_FLOW_DYNAMIC"), + + FLOW_DYNAMIC("FLOW_DYNAMIC"); + + private String value; + + FlowInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FlowInvocationType fromValue(String value) { + for (FlowInvocationType b : FlowInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FlowInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FlowInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FlowInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java new file mode 100644 index 0000000000..a186aa4b23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetMonitorTransactionsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMonitorTransactionsV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public GetMonitorTransactionsV1Request() { + } + + public GetMonitorTransactionsV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public GetMonitorTransactionsV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMonitorTransactionsV1Request getMonitorTransactionsV1Request = (GetMonitorTransactionsV1Request) o; + return Objects.equals(this.clientAppId, getMonitorTransactionsV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, getMonitorTransactionsV1Request.stateFullClassName); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMonitorTransactionsV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetMonitorTransactionsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMonitorTransactionsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMonitorTransactionsV1Request is not found in the empty JSON string", GetMonitorTransactionsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMonitorTransactionsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMonitorTransactionsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMonitorTransactionsV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMonitorTransactionsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMonitorTransactionsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMonitorTransactionsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMonitorTransactionsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMonitorTransactionsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMonitorTransactionsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMonitorTransactionsV1Request + * @throws IOException if the JSON string is invalid with respect to GetMonitorTransactionsV1Request + */ + public static GetMonitorTransactionsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMonitorTransactionsV1Request.class); + } + + /** + * Convert an instance of GetMonitorTransactionsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java new file mode 100644 index 0000000000..d6c5e4b894 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java @@ -0,0 +1,329 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.GetMonitorTransactionsV1ResponseTxInner; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetMonitorTransactionsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMonitorTransactionsV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public static final String SERIALIZED_NAME_TX = "tx"; + @SerializedName(SERIALIZED_NAME_TX) + private List tx = null; + + public GetMonitorTransactionsV1Response() { + } + + public GetMonitorTransactionsV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if operation completed correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public GetMonitorTransactionsV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + public GetMonitorTransactionsV1Response stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nullable + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + public GetMonitorTransactionsV1Response tx(List tx) { + + this.tx = tx; + return this; + } + + public GetMonitorTransactionsV1Response addTxItem(GetMonitorTransactionsV1ResponseTxInner txItem) { + if (this.tx == null) { + this.tx = null; + } + this.tx.add(txItem); + return this; + } + + /** + * Get tx + * @return tx + **/ + @javax.annotation.Nullable + public List getTx() { + return tx; + } + + + public void setTx(List tx) { + this.tx = tx; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMonitorTransactionsV1Response getMonitorTransactionsV1Response = (GetMonitorTransactionsV1Response) o; + return Objects.equals(this.success, getMonitorTransactionsV1Response.success) && + Objects.equals(this.msg, getMonitorTransactionsV1Response.msg) && + Objects.equals(this.stateFullClassName, getMonitorTransactionsV1Response.stateFullClassName) && + Objects.equals(this.tx, getMonitorTransactionsV1Response.tx); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg, stateFullClassName, tx); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMonitorTransactionsV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append(" tx: ").append(toIndentedString(tx)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + openapiFields.add("stateFullClassName"); + openapiFields.add("tx"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetMonitorTransactionsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMonitorTransactionsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMonitorTransactionsV1Response is not found in the empty JSON string", GetMonitorTransactionsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMonitorTransactionsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMonitorTransactionsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMonitorTransactionsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + if ((jsonObj.get("stateFullClassName") != null && !jsonObj.get("stateFullClassName").isJsonNull()) && !jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + if (jsonObj.get("tx") != null && !jsonObj.get("tx").isJsonNull()) { + JsonArray jsonArraytx = jsonObj.getAsJsonArray("tx"); + if (jsonArraytx != null) { + // ensure the json data is an array + if (!jsonObj.get("tx").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tx` to be an array in the JSON string but got `%s`", jsonObj.get("tx").toString())); + } + + // validate the optional field `tx` (array) + for (int i = 0; i < jsonArraytx.size(); i++) { + GetMonitorTransactionsV1ResponseTxInner.validateJsonObject(jsonArraytx.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMonitorTransactionsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMonitorTransactionsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMonitorTransactionsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMonitorTransactionsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMonitorTransactionsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMonitorTransactionsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMonitorTransactionsV1Response + * @throws IOException if the JSON string is invalid with respect to GetMonitorTransactionsV1Response + */ + public static GetMonitorTransactionsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMonitorTransactionsV1Response.class); + } + + /** + * Convert an instance of GetMonitorTransactionsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java new file mode 100644 index 0000000000..6a1869aa61 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java @@ -0,0 +1,239 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetMonitorTransactionsV1ResponseTxInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMonitorTransactionsV1ResponseTxInner { + public static final String SERIALIZED_NAME_INDEX = "index"; + @SerializedName(SERIALIZED_NAME_INDEX) + private String index; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public GetMonitorTransactionsV1ResponseTxInner() { + } + + public GetMonitorTransactionsV1ResponseTxInner index(String index) { + + this.index = index; + return this; + } + + /** + * Get index + * @return index + **/ + @javax.annotation.Nullable + public String getIndex() { + return index; + } + + + public void setIndex(String index) { + this.index = index; + } + + + public GetMonitorTransactionsV1ResponseTxInner data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMonitorTransactionsV1ResponseTxInner getMonitorTransactionsV1ResponseTxInner = (GetMonitorTransactionsV1ResponseTxInner) o; + return Objects.equals(this.index, getMonitorTransactionsV1ResponseTxInner.index) && + Objects.equals(this.data, getMonitorTransactionsV1ResponseTxInner.data); + } + + @Override + public int hashCode() { + return Objects.hash(index, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMonitorTransactionsV1ResponseTxInner {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("index"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetMonitorTransactionsV1ResponseTxInner + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMonitorTransactionsV1ResponseTxInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMonitorTransactionsV1ResponseTxInner is not found in the empty JSON string", GetMonitorTransactionsV1ResponseTxInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMonitorTransactionsV1ResponseTxInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMonitorTransactionsV1ResponseTxInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("index") != null && !jsonObj.get("index").isJsonNull()) && !jsonObj.get("index").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `index` to be a primitive type in the JSON string but got `%s`", jsonObj.get("index").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMonitorTransactionsV1ResponseTxInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMonitorTransactionsV1ResponseTxInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMonitorTransactionsV1ResponseTxInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMonitorTransactionsV1ResponseTxInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMonitorTransactionsV1ResponseTxInner read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMonitorTransactionsV1ResponseTxInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMonitorTransactionsV1ResponseTxInner + * @throws IOException if the JSON string is invalid with respect to GetMonitorTransactionsV1ResponseTxInner + */ + public static GetMonitorTransactionsV1ResponseTxInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMonitorTransactionsV1ResponseTxInner.class); + } + + /** + * Convert an instance of GetMonitorTransactionsV1ResponseTxInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 0000000000..ac72d4cc0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.FlowInvocationType; +import org.openapitools.client.model.JvmObject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_FLOW_FULL_CLASS_NAME = "flowFullClassName"; + @SerializedName(SERIALIZED_NAME_FLOW_FULL_CLASS_NAME) + private String flowFullClassName; + + public static final String SERIALIZED_NAME_FLOW_INVOCATION_TYPE = "flowInvocationType"; + @SerializedName(SERIALIZED_NAME_FLOW_INVOCATION_TYPE) + private FlowInvocationType flowInvocationType; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private Integer timeoutMs = 60000; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request flowFullClassName(String flowFullClassName) { + + this.flowFullClassName = flowFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda flow to invoke + * @return flowFullClassName + **/ + @javax.annotation.Nonnull + public String getFlowFullClassName() { + return flowFullClassName; + } + + + public void setFlowFullClassName(String flowFullClassName) { + this.flowFullClassName = flowFullClassName; + } + + + public InvokeContractV1Request flowInvocationType(FlowInvocationType flowInvocationType) { + + this.flowInvocationType = flowInvocationType; + return this; + } + + /** + * Get flowInvocationType + * @return flowInvocationType + **/ + @javax.annotation.Nonnull + public FlowInvocationType getFlowInvocationType() { + return flowInvocationType; + } + + + public void setFlowInvocationType(FlowInvocationType flowInvocationType) { + this.flowInvocationType = flowInvocationType; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(JvmObject paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request timeoutMs(Integer timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public Integer getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.flowFullClassName, invokeContractV1Request.flowFullClassName) && + Objects.equals(this.flowInvocationType, invokeContractV1Request.flowInvocationType) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(flowFullClassName, flowInvocationType, params, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" flowFullClassName: ").append(toIndentedString(flowFullClassName)).append("\n"); + sb.append(" flowInvocationType: ").append(toIndentedString(flowInvocationType)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("flowFullClassName"); + openapiFields.add("flowInvocationType"); + openapiFields.add("params"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("flowFullClassName"); + openapiRequiredFields.add("flowInvocationType"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("flowFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `flowFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flowFullClassName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + + JsonArray jsonArrayparams = jsonObj.getAsJsonArray("params"); + // validate the required field `params` (array) + for (int i = 0; i < jsonArrayparams.size(); i++) { + JvmObject.validateJsonObject(jsonArrayparams.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..65c355485a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,347 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public static final String SERIALIZED_NAME_PROGRESS = "progress"; + @SerializedName(SERIALIZED_NAME_PROGRESS) + private List progress = null; + + public static final String SERIALIZED_NAME_FLOW_ID = "flowId"; + @SerializedName(SERIALIZED_NAME_FLOW_ID) + private String flowId; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Data returned from the JVM when no transaction is running + * @return callOutput + **/ + @javax.annotation.Nonnull + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * The net.corda.core.flows.StateMachineRunId value returned by the flow execution. + * @return transactionId + **/ + @javax.annotation.Nullable + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + public InvokeContractV1Response progress(List progress) { + + this.progress = progress; + return this; + } + + public InvokeContractV1Response addProgressItem(String progressItem) { + if (this.progress == null) { + this.progress = null; + } + this.progress.add(progressItem); + return this; + } + + /** + * An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. + * @return progress + **/ + @javax.annotation.Nullable + public List getProgress() { + return progress; + } + + + public void setProgress(List progress) { + this.progress = progress; + } + + + public InvokeContractV1Response flowId(String flowId) { + + this.flowId = flowId; + return this; + } + + /** + * The id for the flow handle + * @return flowId + **/ + @javax.annotation.Nonnull + public String getFlowId() { + return flowId; + } + + + public void setFlowId(String flowId) { + this.flowId = flowId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.success, invokeContractV1Response.success) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.transactionId, invokeContractV1Response.transactionId) && + Objects.equals(this.progress, invokeContractV1Response.progress) && + Objects.equals(this.flowId, invokeContractV1Response.flowId); + } + + @Override + public int hashCode() { + return Objects.hash(success, callOutput, transactionId, progress, flowId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" progress: ").append(toIndentedString(progress)).append("\n"); + sb.append(" flowId: ").append(toIndentedString(flowId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("callOutput"); + openapiFields.add("transactionId"); + openapiFields.add("progress"); + openapiFields.add("flowId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("callOutput"); + openapiRequiredFields.add("flowId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("transactionId") != null && !jsonObj.get("transactionId").isJsonNull()) && !jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("progress") != null && !jsonObj.get("progress").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `progress` to be an array in the JSON string but got `%s`", jsonObj.get("progress").toString())); + } + if (!jsonObj.get("flowId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `flowId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flowId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java new file mode 100644 index 0000000000..efb56ca9ff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java @@ -0,0 +1,352 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * JarFile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JarFile { + public static final String SERIALIZED_NAME_FILENAME = "filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + private String filename; + + public static final String SERIALIZED_NAME_HAS_DB_MIGRATIONS = "hasDbMigrations"; + @SerializedName(SERIALIZED_NAME_HAS_DB_MIGRATIONS) + private Boolean hasDbMigrations; + + public static final String SERIALIZED_NAME_CONTENT_BASE64 = "contentBase64"; + @SerializedName(SERIALIZED_NAME_CONTENT_BASE64) + private String contentBase64; + + public JarFile() { + } + + public JarFile filename(String filename) { + + this.filename = filename; + return this; + } + + /** + * Get filename + * @return filename + **/ + @javax.annotation.Nonnull + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public JarFile hasDbMigrations(Boolean hasDbMigrations) { + + this.hasDbMigrations = hasDbMigrations; + return this; + } + + /** + * Indicates whether the cordapp jar in question contains any embedded migrations that Cactus can/should execute between copying the jar into the cordapp directory and starting the node back up. + * @return hasDbMigrations + **/ + @javax.annotation.Nonnull + public Boolean getHasDbMigrations() { + return hasDbMigrations; + } + + + public void setHasDbMigrations(Boolean hasDbMigrations) { + this.hasDbMigrations = hasDbMigrations; + } + + + public JarFile contentBase64(String contentBase64) { + + this.contentBase64 = contentBase64; + return this; + } + + /** + * Get contentBase64 + * @return contentBase64 + **/ + @javax.annotation.Nonnull + public String getContentBase64() { + return contentBase64; + } + + + public void setContentBase64(String contentBase64) { + this.contentBase64 = contentBase64; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JarFile instance itself + */ + public JarFile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JarFile jarFile = (JarFile) o; + return Objects.equals(this.filename, jarFile.filename) && + Objects.equals(this.hasDbMigrations, jarFile.hasDbMigrations) && + Objects.equals(this.contentBase64, jarFile.contentBase64)&& + Objects.equals(this.additionalProperties, jarFile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filename, hasDbMigrations, contentBase64, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JarFile {\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" hasDbMigrations: ").append(toIndentedString(hasDbMigrations)).append("\n"); + sb.append(" contentBase64: ").append(toIndentedString(contentBase64)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filename"); + openapiFields.add("hasDbMigrations"); + openapiFields.add("contentBase64"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filename"); + openapiRequiredFields.add("hasDbMigrations"); + openapiRequiredFields.add("contentBase64"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JarFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JarFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JarFile is not found in the empty JSON string", JarFile.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JarFile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("filename").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); + } + if (!jsonObj.get("contentBase64").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contentBase64` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentBase64").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JarFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JarFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JarFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JarFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JarFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + JarFile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JarFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of JarFile + * @throws IOException if the JSON string is invalid with respect to JarFile + */ + public static JarFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JarFile.class); + } + + /** + * Convert an instance of JarFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java new file mode 100644 index 0000000000..4bfd7ff3af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java @@ -0,0 +1,326 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.JvmType; +import org.openapitools.client.model.JvmTypeKind; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Can represent JVM primitive and reference types as well. The jvmTypeKind field indicates which one is being stored. If the jvmTypeKind field is set to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property is filled with a primitive data type supported by the JSON standard such as strings, booleans, numbers, etc. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JvmObject { + public static final String SERIALIZED_NAME_JVM_TYPE_KIND = "jvmTypeKind"; + @SerializedName(SERIALIZED_NAME_JVM_TYPE_KIND) + private JvmTypeKind jvmTypeKind; + + public static final String SERIALIZED_NAME_PRIMITIVE_VALUE = "primitiveValue"; + @SerializedName(SERIALIZED_NAME_PRIMITIVE_VALUE) + private Object primitiveValue; + + public static final String SERIALIZED_NAME_JVM_CTOR_ARGS = "jvmCtorArgs"; + @SerializedName(SERIALIZED_NAME_JVM_CTOR_ARGS) + private List jvmCtorArgs = null; + + public static final String SERIALIZED_NAME_JVM_TYPE = "jvmType"; + @SerializedName(SERIALIZED_NAME_JVM_TYPE) + private JvmType jvmType; + + public JvmObject() { + } + + public JvmObject jvmTypeKind(JvmTypeKind jvmTypeKind) { + + this.jvmTypeKind = jvmTypeKind; + return this; + } + + /** + * Get jvmTypeKind + * @return jvmTypeKind + **/ + @javax.annotation.Nonnull + public JvmTypeKind getJvmTypeKind() { + return jvmTypeKind; + } + + + public void setJvmTypeKind(JvmTypeKind jvmTypeKind) { + this.jvmTypeKind = jvmTypeKind; + } + + + public JvmObject primitiveValue(Object primitiveValue) { + + this.primitiveValue = primitiveValue; + return this; + } + + /** + * Get primitiveValue + * @return primitiveValue + **/ + @javax.annotation.Nullable + public Object getPrimitiveValue() { + return primitiveValue; + } + + + public void setPrimitiveValue(Object primitiveValue) { + this.primitiveValue = primitiveValue; + } + + + public JvmObject jvmCtorArgs(List jvmCtorArgs) { + + this.jvmCtorArgs = jvmCtorArgs; + return this; + } + + public JvmObject addJvmCtorArgsItem(JvmObject jvmCtorArgsItem) { + if (this.jvmCtorArgs == null) { + this.jvmCtorArgs = null; + } + this.jvmCtorArgs.add(jvmCtorArgsItem); + return this; + } + + /** + * Get jvmCtorArgs + * @return jvmCtorArgs + **/ + @javax.annotation.Nullable + public List getJvmCtorArgs() { + return jvmCtorArgs; + } + + + public void setJvmCtorArgs(List jvmCtorArgs) { + this.jvmCtorArgs = jvmCtorArgs; + } + + + public JvmObject jvmType(JvmType jvmType) { + + this.jvmType = jvmType; + return this; + } + + /** + * Get jvmType + * @return jvmType + **/ + @javax.annotation.Nonnull + public JvmType getJvmType() { + return jvmType; + } + + + public void setJvmType(JvmType jvmType) { + this.jvmType = jvmType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JvmObject jvmObject = (JvmObject) o; + return Objects.equals(this.jvmTypeKind, jvmObject.jvmTypeKind) && + Objects.equals(this.primitiveValue, jvmObject.primitiveValue) && + Objects.equals(this.jvmCtorArgs, jvmObject.jvmCtorArgs) && + Objects.equals(this.jvmType, jvmObject.jvmType); + } + + @Override + public int hashCode() { + return Objects.hash(jvmTypeKind, primitiveValue, jvmCtorArgs, jvmType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JvmObject {\n"); + sb.append(" jvmTypeKind: ").append(toIndentedString(jvmTypeKind)).append("\n"); + sb.append(" primitiveValue: ").append(toIndentedString(primitiveValue)).append("\n"); + sb.append(" jvmCtorArgs: ").append(toIndentedString(jvmCtorArgs)).append("\n"); + sb.append(" jvmType: ").append(toIndentedString(jvmType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jvmTypeKind"); + openapiFields.add("primitiveValue"); + openapiFields.add("jvmCtorArgs"); + openapiFields.add("jvmType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jvmTypeKind"); + openapiRequiredFields.add("jvmType"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JvmObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JvmObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JvmObject is not found in the empty JSON string", JvmObject.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JvmObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JvmObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JvmObject.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("jvmCtorArgs") != null && !jsonObj.get("jvmCtorArgs").isJsonNull()) { + JsonArray jsonArrayjvmCtorArgs = jsonObj.getAsJsonArray("jvmCtorArgs"); + if (jsonArrayjvmCtorArgs != null) { + // ensure the json data is an array + if (!jsonObj.get("jvmCtorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `jvmCtorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("jvmCtorArgs").toString())); + } + + // validate the optional field `jvmCtorArgs` (array) + for (int i = 0; i < jsonArrayjvmCtorArgs.size(); i++) { + JvmObject.validateJsonObject(jsonArrayjvmCtorArgs.get(i).getAsJsonObject()); + }; + } + } + // validate the required field `jvmType` + JvmType.validateJsonObject(jsonObj.getAsJsonObject("jvmType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JvmObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JvmObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JvmObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JvmObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JvmObject read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JvmObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of JvmObject + * @throws IOException if the JSON string is invalid with respect to JvmObject + */ + public static JvmObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JvmObject.class); + } + + /** + * Convert an instance of JvmObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java new file mode 100644 index 0000000000..dd62bdf598 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JvmObject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Represents a reference to a JVM type (such as a Java class) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JvmType { + public static final String SERIALIZED_NAME_FQ_CLASS_NAME = "fqClassName"; + @SerializedName(SERIALIZED_NAME_FQ_CLASS_NAME) + private String fqClassName; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_NAME = "constructorName"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_NAME) + private String constructorName; + + public static final String SERIALIZED_NAME_INVOCATION_TARGET = "invocationTarget"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TARGET) + private JvmObject invocationTarget; + + public JvmType() { + } + + public JvmType fqClassName(String fqClassName) { + + this.fqClassName = fqClassName; + return this; + } + + /** + * Get fqClassName + * @return fqClassName + **/ + @javax.annotation.Nonnull + public String getFqClassName() { + return fqClassName; + } + + + public void setFqClassName(String fqClassName) { + this.fqClassName = fqClassName; + } + + + public JvmType constructorName(String constructorName) { + + this.constructorName = constructorName; + return this; + } + + /** + * This parameter is used to specify that the function used to construct this JvmType is not a constructor function but instead is a factory function. Setting this parameter will cause the plugin to look up methods of the class denoted by fqClassName instead of its constructors. + * @return constructorName + **/ + @javax.annotation.Nullable + public String getConstructorName() { + return constructorName; + } + + + public void setConstructorName(String constructorName) { + this.constructorName = constructorName; + } + + + public JvmType invocationTarget(JvmObject invocationTarget) { + + this.invocationTarget = invocationTarget; + return this; + } + + /** + * Get invocationTarget + * @return invocationTarget + **/ + @javax.annotation.Nullable + public JvmObject getInvocationTarget() { + return invocationTarget; + } + + + public void setInvocationTarget(JvmObject invocationTarget) { + this.invocationTarget = invocationTarget; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JvmType jvmType = (JvmType) o; + return Objects.equals(this.fqClassName, jvmType.fqClassName) && + Objects.equals(this.constructorName, jvmType.constructorName) && + Objects.equals(this.invocationTarget, jvmType.invocationTarget); + } + + @Override + public int hashCode() { + return Objects.hash(fqClassName, constructorName, invocationTarget); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JvmType {\n"); + sb.append(" fqClassName: ").append(toIndentedString(fqClassName)).append("\n"); + sb.append(" constructorName: ").append(toIndentedString(constructorName)).append("\n"); + sb.append(" invocationTarget: ").append(toIndentedString(invocationTarget)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fqClassName"); + openapiFields.add("constructorName"); + openapiFields.add("invocationTarget"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fqClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JvmType + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JvmType.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JvmType is not found in the empty JSON string", JvmType.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JvmType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JvmType` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JvmType.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("fqClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fqClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fqClassName").toString())); + } + if ((jsonObj.get("constructorName") != null && !jsonObj.get("constructorName").isJsonNull()) && !jsonObj.get("constructorName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("constructorName").toString())); + } + // validate the optional field `invocationTarget` + if (jsonObj.get("invocationTarget") != null && !jsonObj.get("invocationTarget").isJsonNull()) { + JvmObject.validateJsonObject(jsonObj.getAsJsonObject("invocationTarget")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JvmType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JvmType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JvmType.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JvmType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JvmType read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JvmType given an JSON string + * + * @param jsonString JSON string + * @return An instance of JvmType + * @throws IOException if the JSON string is invalid with respect to JvmType + */ + public static JvmType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JvmType.class); + } + + /** + * Convert an instance of JvmType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java new file mode 100644 index 0000000000..a40efbc27a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets JvmTypeKind + */ +@JsonAdapter(JvmTypeKind.Adapter.class) +public enum JvmTypeKind { + + PRIMITIVE("PRIMITIVE"), + + REFERENCE("REFERENCE"); + + private String value; + + JvmTypeKind(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static JvmTypeKind fromValue(String value) { + for (JvmTypeKind b : JvmTypeKind.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final JvmTypeKind enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public JvmTypeKind read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return JvmTypeKind.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java new file mode 100644 index 0000000000..e2dcae5797 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java @@ -0,0 +1,208 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ListFlowsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFlowsV1Request { + public static final String SERIALIZED_NAME_FILTER = "filter"; + @SerializedName(SERIALIZED_NAME_FILTER) + private String filter; + + public ListFlowsV1Request() { + } + + public ListFlowsV1Request filter(String filter) { + + this.filter = filter; + return this; + } + + /** + * Get filter + * @return filter + **/ + @javax.annotation.Nullable + public String getFilter() { + return filter; + } + + + public void setFilter(String filter) { + this.filter = filter; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFlowsV1Request listFlowsV1Request = (ListFlowsV1Request) o; + return Objects.equals(this.filter, listFlowsV1Request.filter); + } + + @Override + public int hashCode() { + return Objects.hash(filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFlowsV1Request {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListFlowsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListFlowsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListFlowsV1Request is not found in the empty JSON string", ListFlowsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListFlowsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListFlowsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("filter") != null && !jsonObj.get("filter").isJsonNull()) && !jsonObj.get("filter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filter").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFlowsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFlowsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFlowsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFlowsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFlowsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListFlowsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFlowsV1Request + * @throws IOException if the JSON string is invalid with respect to ListFlowsV1Request + */ + public static ListFlowsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFlowsV1Request.class); + } + + /** + * Convert an instance of ListFlowsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java new file mode 100644 index 0000000000..0859908cd7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ListFlowsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFlowsV1Response { + public static final String SERIALIZED_NAME_FLOW_NAMES = "flowNames"; + @SerializedName(SERIALIZED_NAME_FLOW_NAMES) + private List flowNames = null; + + public ListFlowsV1Response() { + } + + public ListFlowsV1Response flowNames(List flowNames) { + + this.flowNames = flowNames; + return this; + } + + public ListFlowsV1Response addFlowNamesItem(String flowNamesItem) { + if (this.flowNames == null) { + this.flowNames = null; + } + this.flowNames.add(flowNamesItem); + return this; + } + + /** + * An array of strings storing the names of the flows as returned by the flowList Corda RPC. + * @return flowNames + **/ + @javax.annotation.Nonnull + public List getFlowNames() { + return flowNames; + } + + + public void setFlowNames(List flowNames) { + this.flowNames = flowNames; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFlowsV1Response listFlowsV1Response = (ListFlowsV1Response) o; + return Objects.equals(this.flowNames, listFlowsV1Response.flowNames); + } + + @Override + public int hashCode() { + return Objects.hash(flowNames); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFlowsV1Response {\n"); + sb.append(" flowNames: ").append(toIndentedString(flowNames)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("flowNames"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("flowNames"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListFlowsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListFlowsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListFlowsV1Response is not found in the empty JSON string", ListFlowsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListFlowsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListFlowsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListFlowsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("flowNames") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("flowNames").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `flowNames` to be an array in the JSON string but got `%s`", jsonObj.get("flowNames").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFlowsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFlowsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFlowsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFlowsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFlowsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListFlowsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFlowsV1Response + * @throws IOException if the JSON string is invalid with respect to ListFlowsV1Response + */ + public static ListFlowsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFlowsV1Response.class); + } + + /** + * Convert an instance of ListFlowsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java new file mode 100644 index 0000000000..5cf9a89a9b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NetworkHostAndPort + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NetworkHostAndPort { + public static final String SERIALIZED_NAME_HOST = "host"; + @SerializedName(SERIALIZED_NAME_HOST) + private String host; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + private BigDecimal port; + + public NetworkHostAndPort() { + } + + public NetworkHostAndPort host(String host) { + + this.host = host; + return this; + } + + /** + * Get host + * @return host + **/ + @javax.annotation.Nonnull + public String getHost() { + return host; + } + + + public void setHost(String host) { + this.host = host; + } + + + public NetworkHostAndPort port(BigDecimal port) { + + this.port = port; + return this; + } + + /** + * Get port + * @return port + **/ + @javax.annotation.Nonnull + public BigDecimal getPort() { + return port; + } + + + public void setPort(BigDecimal port) { + this.port = port; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkHostAndPort networkHostAndPort = (NetworkHostAndPort) o; + return Objects.equals(this.host, networkHostAndPort.host) && + Objects.equals(this.port, networkHostAndPort.port); + } + + @Override + public int hashCode() { + return Objects.hash(host, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkHostAndPort {\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("host"); + openapiFields.add("port"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("host"); + openapiRequiredFields.add("port"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NetworkHostAndPort + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NetworkHostAndPort.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NetworkHostAndPort is not found in the empty JSON string", NetworkHostAndPort.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NetworkHostAndPort.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NetworkHostAndPort` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NetworkHostAndPort.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("host").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkHostAndPort.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkHostAndPort' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NetworkHostAndPort.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkHostAndPort value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkHostAndPort read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkHostAndPort given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkHostAndPort + * @throws IOException if the JSON string is invalid with respect to NetworkHostAndPort + */ + public static NetworkHostAndPort fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkHostAndPort.class); + } + + /** + * Convert an instance of NetworkHostAndPort to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java new file mode 100644 index 0000000000..de2888e836 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java @@ -0,0 +1,359 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CordappInfo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A NodeDiagnosticInfo holds information about the current node version. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NodeDiagnosticInfo { + public static final String SERIALIZED_NAME_CORDAPPS = "cordapps"; + @SerializedName(SERIALIZED_NAME_CORDAPPS) + private List cordapps = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLATFORM_VERSION = "platformVersion"; + @SerializedName(SERIALIZED_NAME_PLATFORM_VERSION) + private Integer platformVersion; + + public static final String SERIALIZED_NAME_REVISION = "revision"; + @SerializedName(SERIALIZED_NAME_REVISION) + private String revision; + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + @SerializedName(SERIALIZED_NAME_VENDOR) + private String vendor; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public NodeDiagnosticInfo() { + } + + public NodeDiagnosticInfo cordapps(List cordapps) { + + this.cordapps = cordapps; + return this; + } + + public NodeDiagnosticInfo addCordappsItem(CordappInfo cordappsItem) { + if (this.cordapps == null) { + this.cordapps = new ArrayList<>(); + } + this.cordapps.add(cordappsItem); + return this; + } + + /** + * A list of CorDapps currently installed on this node + * @return cordapps + **/ + @javax.annotation.Nonnull + public List getCordapps() { + return cordapps; + } + + + public void setCordapps(List cordapps) { + this.cordapps = cordapps; + } + + + public NodeDiagnosticInfo platformVersion(Integer platformVersion) { + + this.platformVersion = platformVersion; + return this; + } + + /** + * The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists) + * @return platformVersion + **/ + @javax.annotation.Nonnull + public Integer getPlatformVersion() { + return platformVersion; + } + + + public void setPlatformVersion(Integer platformVersion) { + this.platformVersion = platformVersion; + } + + + public NodeDiagnosticInfo revision(String revision) { + + this.revision = revision; + return this; + } + + /** + * The git commit hash this node was built from + * @return revision + **/ + @javax.annotation.Nonnull + public String getRevision() { + return revision; + } + + + public void setRevision(String revision) { + this.revision = revision; + } + + + public NodeDiagnosticInfo vendor(String vendor) { + + this.vendor = vendor; + return this; + } + + /** + * The vendor of this node + * @return vendor + **/ + @javax.annotation.Nonnull + public String getVendor() { + return vendor; + } + + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + + public NodeDiagnosticInfo version(String version) { + + this.version = version; + return this; + } + + /** + * The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NodeDiagnosticInfo nodeDiagnosticInfo = (NodeDiagnosticInfo) o; + return Objects.equals(this.cordapps, nodeDiagnosticInfo.cordapps) && + Objects.equals(this.platformVersion, nodeDiagnosticInfo.platformVersion) && + Objects.equals(this.revision, nodeDiagnosticInfo.revision) && + Objects.equals(this.vendor, nodeDiagnosticInfo.vendor) && + Objects.equals(this.version, nodeDiagnosticInfo.version); + } + + @Override + public int hashCode() { + return Objects.hash(cordapps, platformVersion, revision, vendor, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NodeDiagnosticInfo {\n"); + sb.append(" cordapps: ").append(toIndentedString(cordapps)).append("\n"); + sb.append(" platformVersion: ").append(toIndentedString(platformVersion)).append("\n"); + sb.append(" revision: ").append(toIndentedString(revision)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cordapps"); + openapiFields.add("platformVersion"); + openapiFields.add("revision"); + openapiFields.add("vendor"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cordapps"); + openapiRequiredFields.add("platformVersion"); + openapiRequiredFields.add("revision"); + openapiRequiredFields.add("vendor"); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDiagnosticInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NodeDiagnosticInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDiagnosticInfo is not found in the empty JSON string", NodeDiagnosticInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDiagnosticInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDiagnosticInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NodeDiagnosticInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cordapps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cordapps` to be an array in the JSON string but got `%s`", jsonObj.get("cordapps").toString())); + } + + JsonArray jsonArraycordapps = jsonObj.getAsJsonArray("cordapps"); + // validate the required field `cordapps` (array) + for (int i = 0; i < jsonArraycordapps.size(); i++) { + CordappInfo.validateJsonObject(jsonArraycordapps.get(i).getAsJsonObject()); + }; + if (!jsonObj.get("revision").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revision` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revision").toString())); + } + if (!jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDiagnosticInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDiagnosticInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDiagnosticInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDiagnosticInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDiagnosticInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDiagnosticInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDiagnosticInfo + * @throws IOException if the JSON string is invalid with respect to NodeDiagnosticInfo + */ + public static NodeDiagnosticInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDiagnosticInfo.class); + } + + /** + * Convert an instance of NodeDiagnosticInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java new file mode 100644 index 0000000000..6f2708aceb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java @@ -0,0 +1,384 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.NetworkHostAndPort; +import org.openapitools.client.model.Party; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NodeInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NodeInfo { + public static final String SERIALIZED_NAME_ADDRESSES = "addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + private List addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLATFORM_VERSION = "platformVersion"; + @SerializedName(SERIALIZED_NAME_PLATFORM_VERSION) + private Integer platformVersion; + + public static final String SERIALIZED_NAME_SERIAL = "serial"; + @SerializedName(SERIALIZED_NAME_SERIAL) + private BigDecimal serial; + + public static final String SERIALIZED_NAME_LEGAL_IDENTITIES = "legalIdentities"; + @SerializedName(SERIALIZED_NAME_LEGAL_IDENTITIES) + private List legalIdentities = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LEGAL_IDENTITIES_AND_CERTS = "legalIdentitiesAndCerts"; + @SerializedName(SERIALIZED_NAME_LEGAL_IDENTITIES_AND_CERTS) + private List legalIdentitiesAndCerts = new ArrayList<>(); + + public NodeInfo() { + } + + public NodeInfo addresses(List addresses) { + + this.addresses = addresses; + return this; + } + + public NodeInfo addAddressesItem(NetworkHostAndPort addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + **/ + @javax.annotation.Nonnull + public List getAddresses() { + return addresses; + } + + + public void setAddresses(List addresses) { + this.addresses = addresses; + } + + + public NodeInfo platformVersion(Integer platformVersion) { + + this.platformVersion = platformVersion; + return this; + } + + /** + * Get platformVersion + * @return platformVersion + **/ + @javax.annotation.Nonnull + public Integer getPlatformVersion() { + return platformVersion; + } + + + public void setPlatformVersion(Integer platformVersion) { + this.platformVersion = platformVersion; + } + + + public NodeInfo serial(BigDecimal serial) { + + this.serial = serial; + return this; + } + + /** + * Get serial + * @return serial + **/ + @javax.annotation.Nonnull + public BigDecimal getSerial() { + return serial; + } + + + public void setSerial(BigDecimal serial) { + this.serial = serial; + } + + + public NodeInfo legalIdentities(List legalIdentities) { + + this.legalIdentities = legalIdentities; + return this; + } + + public NodeInfo addLegalIdentitiesItem(Party legalIdentitiesItem) { + if (this.legalIdentities == null) { + this.legalIdentities = new ArrayList<>(); + } + this.legalIdentities.add(legalIdentitiesItem); + return this; + } + + /** + * Get legalIdentities + * @return legalIdentities + **/ + @javax.annotation.Nonnull + public List getLegalIdentities() { + return legalIdentities; + } + + + public void setLegalIdentities(List legalIdentities) { + this.legalIdentities = legalIdentities; + } + + + public NodeInfo legalIdentitiesAndCerts(List legalIdentitiesAndCerts) { + + this.legalIdentitiesAndCerts = legalIdentitiesAndCerts; + return this; + } + + public NodeInfo addLegalIdentitiesAndCertsItem(Object legalIdentitiesAndCertsItem) { + if (this.legalIdentitiesAndCerts == null) { + this.legalIdentitiesAndCerts = new ArrayList<>(); + } + this.legalIdentitiesAndCerts.add(legalIdentitiesAndCertsItem); + return this; + } + + /** + * Get legalIdentitiesAndCerts + * @return legalIdentitiesAndCerts + **/ + @javax.annotation.Nonnull + public List getLegalIdentitiesAndCerts() { + return legalIdentitiesAndCerts; + } + + + public void setLegalIdentitiesAndCerts(List legalIdentitiesAndCerts) { + this.legalIdentitiesAndCerts = legalIdentitiesAndCerts; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NodeInfo nodeInfo = (NodeInfo) o; + return Objects.equals(this.addresses, nodeInfo.addresses) && + Objects.equals(this.platformVersion, nodeInfo.platformVersion) && + Objects.equals(this.serial, nodeInfo.serial) && + Objects.equals(this.legalIdentities, nodeInfo.legalIdentities) && + Objects.equals(this.legalIdentitiesAndCerts, nodeInfo.legalIdentitiesAndCerts); + } + + @Override + public int hashCode() { + return Objects.hash(addresses, platformVersion, serial, legalIdentities, legalIdentitiesAndCerts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NodeInfo {\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" platformVersion: ").append(toIndentedString(platformVersion)).append("\n"); + sb.append(" serial: ").append(toIndentedString(serial)).append("\n"); + sb.append(" legalIdentities: ").append(toIndentedString(legalIdentities)).append("\n"); + sb.append(" legalIdentitiesAndCerts: ").append(toIndentedString(legalIdentitiesAndCerts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("addresses"); + openapiFields.add("platformVersion"); + openapiFields.add("serial"); + openapiFields.add("legalIdentities"); + openapiFields.add("legalIdentitiesAndCerts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("addresses"); + openapiRequiredFields.add("platformVersion"); + openapiRequiredFields.add("serial"); + openapiRequiredFields.add("legalIdentities"); + openapiRequiredFields.add("legalIdentitiesAndCerts"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NodeInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeInfo is not found in the empty JSON string", NodeInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NodeInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `addresses` to be an array in the JSON string but got `%s`", jsonObj.get("addresses").toString())); + } + + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("addresses"); + // validate the required field `addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + NetworkHostAndPort.validateJsonObject(jsonArrayaddresses.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("legalIdentities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `legalIdentities` to be an array in the JSON string but got `%s`", jsonObj.get("legalIdentities").toString())); + } + + JsonArray jsonArraylegalIdentities = jsonObj.getAsJsonArray("legalIdentities"); + // validate the required field `legalIdentities` (array) + for (int i = 0; i < jsonArraylegalIdentities.size(); i++) { + Party.validateJsonObject(jsonArraylegalIdentities.get(i).getAsJsonObject()); + }; + // ensure the required json array is present + if (jsonObj.get("legalIdentitiesAndCerts") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("legalIdentitiesAndCerts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `legalIdentitiesAndCerts` to be an array in the JSON string but got `%s`", jsonObj.get("legalIdentitiesAndCerts").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeInfo + * @throws IOException if the JSON string is invalid with respect to NodeInfo + */ + public static NodeInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeInfo.class); + } + + /** + * Convert an instance of NodeInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java new file mode 100644 index 0000000000..8cba8cd97a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.CordaX500Name; +import org.openapitools.client.model.PublicKey; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Party + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Party { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private CordaX500Name name; + + public static final String SERIALIZED_NAME_OWNING_KEY = "owningKey"; + @SerializedName(SERIALIZED_NAME_OWNING_KEY) + private PublicKey owningKey; + + public Party() { + } + + public Party name(CordaX500Name name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public CordaX500Name getName() { + return name; + } + + + public void setName(CordaX500Name name) { + this.name = name; + } + + + public Party owningKey(PublicKey owningKey) { + + this.owningKey = owningKey; + return this; + } + + /** + * Get owningKey + * @return owningKey + **/ + @javax.annotation.Nonnull + public PublicKey getOwningKey() { + return owningKey; + } + + + public void setOwningKey(PublicKey owningKey) { + this.owningKey = owningKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Party party = (Party) o; + return Objects.equals(this.name, party.name) && + Objects.equals(this.owningKey, party.owningKey); + } + + @Override + public int hashCode() { + return Objects.hash(name, owningKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Party {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owningKey: ").append(toIndentedString(owningKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("owningKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("owningKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Party + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Party.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Party is not found in the empty JSON string", Party.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Party.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Party` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Party.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `name` + CordaX500Name.validateJsonObject(jsonObj.getAsJsonObject("name")); + // validate the required field `owningKey` + PublicKey.validateJsonObject(jsonObj.getAsJsonObject("owningKey")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Party.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Party' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Party.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Party value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Party read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Party given an JSON string + * + * @param jsonString JSON string + * @return An instance of Party + * @throws IOException if the JSON string is invalid with respect to Party + */ + public static Party fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Party.class); + } + + /** + * Convert an instance of Party to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java new file mode 100644 index 0000000000..238bdbf270 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * An instance of a java.security.PublicKey (which is an interface) implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PublicKey { + public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; + @SerializedName(SERIALIZED_NAME_ALGORITHM) + private String algorithm; + + public static final String SERIALIZED_NAME_FORMAT = "format"; + @SerializedName(SERIALIZED_NAME_FORMAT) + private String format; + + public static final String SERIALIZED_NAME_ENCODED = "encoded"; + @SerializedName(SERIALIZED_NAME_ENCODED) + private String encoded; + + public PublicKey() { + } + + public PublicKey algorithm(String algorithm) { + + this.algorithm = algorithm; + return this; + } + + /** + * Get algorithm + * @return algorithm + **/ + @javax.annotation.Nonnull + public String getAlgorithm() { + return algorithm; + } + + + public void setAlgorithm(String algorithm) { + this.algorithm = algorithm; + } + + + public PublicKey format(String format) { + + this.format = format; + return this; + } + + /** + * Get format + * @return format + **/ + @javax.annotation.Nonnull + public String getFormat() { + return format; + } + + + public void setFormat(String format) { + this.format = format; + } + + + public PublicKey encoded(String encoded) { + + this.encoded = encoded; + return this; + } + + /** + * Get encoded + * @return encoded + **/ + @javax.annotation.Nonnull + public String getEncoded() { + return encoded; + } + + + public void setEncoded(String encoded) { + this.encoded = encoded; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKey publicKey = (PublicKey) o; + return Objects.equals(this.algorithm, publicKey.algorithm) && + Objects.equals(this.format, publicKey.format) && + Objects.equals(this.encoded, publicKey.encoded); + } + + @Override + public int hashCode() { + return Objects.hash(algorithm, format, encoded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKey {\n"); + sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" encoded: ").append(toIndentedString(encoded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algorithm"); + openapiFields.add("format"); + openapiFields.add("encoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("algorithm"); + openapiRequiredFields.add("format"); + openapiRequiredFields.add("encoded"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PublicKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PublicKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKey is not found in the empty JSON string", PublicKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PublicKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PublicKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKey.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("algorithm").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `algorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("algorithm").toString())); + } + if (!jsonObj.get("format").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("format").toString())); + } + if (!jsonObj.get("encoded").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encoded` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encoded").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PublicKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKey + * @throws IOException if the JSON string is invalid with respect to PublicKey + */ + public static PublicKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKey.class); + } + + /** + * Convert an instance of PublicKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java new file mode 100644 index 0000000000..5f4f5bd14f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java @@ -0,0 +1,274 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SHA256 { + public static final String SERIALIZED_NAME_BYTES = "bytes"; + @SerializedName(SERIALIZED_NAME_BYTES) + private String bytes; + + public static final String SERIALIZED_NAME_OFFSET = "offset"; + @SerializedName(SERIALIZED_NAME_OFFSET) + private Integer offset; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Integer size; + + public SHA256() { + } + + public SHA256 bytes(String bytes) { + + this.bytes = bytes; + return this; + } + + /** + * Get bytes + * @return bytes + **/ + @javax.annotation.Nonnull + public String getBytes() { + return bytes; + } + + + public void setBytes(String bytes) { + this.bytes = bytes; + } + + + public SHA256 offset(Integer offset) { + + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + **/ + @javax.annotation.Nonnull + public Integer getOffset() { + return offset; + } + + + public void setOffset(Integer offset) { + this.offset = offset; + } + + + public SHA256 size(Integer size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nonnull + public Integer getSize() { + return size; + } + + + public void setSize(Integer size) { + this.size = size; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SHA256 SHA256 = (SHA256) o; + return Objects.equals(this.bytes, SHA256.bytes) && + Objects.equals(this.offset, SHA256.offset) && + Objects.equals(this.size, SHA256.size); + } + + @Override + public int hashCode() { + return Objects.hash(bytes, offset, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SHA256 {\n"); + sb.append(" bytes: ").append(toIndentedString(bytes)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bytes"); + openapiFields.add("offset"); + openapiFields.add("size"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("bytes"); + openapiRequiredFields.add("offset"); + openapiRequiredFields.add("size"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SHA256 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SHA256.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SHA256 is not found in the empty JSON string", SHA256.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SHA256.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SHA256` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SHA256.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("bytes").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SHA256.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SHA256' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SHA256.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SHA256 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SHA256 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SHA256 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SHA256 + * @throws IOException if the JSON string is invalid with respect to SHA256 + */ + public static SHA256 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SHA256.class); + } + + /** + * Convert an instance of SHA256 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java new file mode 100644 index 0000000000..96b4f89a9f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StartMonitorV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMonitorV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public StartMonitorV1Request() { + } + + public StartMonitorV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public StartMonitorV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMonitorV1Request startMonitorV1Request = (StartMonitorV1Request) o; + return Objects.equals(this.clientAppId, startMonitorV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, startMonitorV1Request.stateFullClassName); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMonitorV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StartMonitorV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StartMonitorV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StartMonitorV1Request is not found in the empty JSON string", StartMonitorV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StartMonitorV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StartMonitorV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartMonitorV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartMonitorV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMonitorV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMonitorV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMonitorV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMonitorV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMonitorV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMonitorV1Request + * @throws IOException if the JSON string is invalid with respect to StartMonitorV1Request + */ + public static StartMonitorV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMonitorV1Request.class); + } + + /** + * Convert an instance of StartMonitorV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java new file mode 100644 index 0000000000..93f960b61d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StartMonitorV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMonitorV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public StartMonitorV1Response() { + } + + public StartMonitorV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if monitoring started correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public StartMonitorV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMonitorV1Response startMonitorV1Response = (StartMonitorV1Response) o; + return Objects.equals(this.success, startMonitorV1Response.success) && + Objects.equals(this.msg, startMonitorV1Response.msg); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMonitorV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StartMonitorV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StartMonitorV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StartMonitorV1Response is not found in the empty JSON string", StartMonitorV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StartMonitorV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StartMonitorV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartMonitorV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartMonitorV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMonitorV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMonitorV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMonitorV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMonitorV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMonitorV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMonitorV1Response + * @throws IOException if the JSON string is invalid with respect to StartMonitorV1Response + */ + public static StartMonitorV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMonitorV1Response.class); + } + + /** + * Convert an instance of StartMonitorV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java new file mode 100644 index 0000000000..52d5e84f2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StopMonitorV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StopMonitorV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public StopMonitorV1Request() { + } + + public StopMonitorV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public StopMonitorV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopMonitorV1Request stopMonitorV1Request = (StopMonitorV1Request) o; + return Objects.equals(this.clientAppId, stopMonitorV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, stopMonitorV1Request.stateFullClassName); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StopMonitorV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StopMonitorV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StopMonitorV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StopMonitorV1Request is not found in the empty JSON string", StopMonitorV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StopMonitorV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StopMonitorV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StopMonitorV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StopMonitorV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StopMonitorV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StopMonitorV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StopMonitorV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StopMonitorV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StopMonitorV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of StopMonitorV1Request + * @throws IOException if the JSON string is invalid with respect to StopMonitorV1Request + */ + public static StopMonitorV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StopMonitorV1Request.class); + } + + /** + * Convert an instance of StopMonitorV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java new file mode 100644 index 0000000000..c9f137776e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StopMonitorV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StopMonitorV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public StopMonitorV1Response() { + } + + public StopMonitorV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if operation completed correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public StopMonitorV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopMonitorV1Response stopMonitorV1Response = (StopMonitorV1Response) o; + return Objects.equals(this.success, stopMonitorV1Response.success) && + Objects.equals(this.msg, stopMonitorV1Response.msg); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StopMonitorV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StopMonitorV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StopMonitorV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StopMonitorV1Response is not found in the empty JSON string", StopMonitorV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StopMonitorV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StopMonitorV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StopMonitorV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StopMonitorV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StopMonitorV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StopMonitorV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StopMonitorV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StopMonitorV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StopMonitorV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of StopMonitorV1Response + * @throws IOException if the JSON string is invalid with respect to StopMonitorV1Response + */ + public static StopMonitorV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StopMonitorV1Response.class); + } + + /** + * Convert an instance of StopMonitorV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java new file mode 100644 index 0000000000..0d9a86dab0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * X500Principal + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class X500Principal { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ENCODED = "encoded"; + @SerializedName(SERIALIZED_NAME_ENCODED) + private String encoded; + + public X500Principal() { + } + + public X500Principal name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public X500Principal encoded(String encoded) { + + this.encoded = encoded; + return this; + } + + /** + * Base64 encoded public key + * @return encoded + **/ + @javax.annotation.Nonnull + public String getEncoded() { + return encoded; + } + + + public void setEncoded(String encoded) { + this.encoded = encoded; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + X500Principal x500Principal = (X500Principal) o; + return Objects.equals(this.name, x500Principal.name) && + Objects.equals(this.encoded, x500Principal.encoded); + } + + @Override + public int hashCode() { + return Objects.hash(name, encoded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class X500Principal {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" encoded: ").append(toIndentedString(encoded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("encoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("encoded"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to X500Principal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!X500Principal.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in X500Principal is not found in the empty JSON string", X500Principal.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!X500Principal.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `X500Principal` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : X500Principal.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("encoded").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encoded` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encoded").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!X500Principal.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'X500Principal' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(X500Principal.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, X500Principal value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public X500Principal read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of X500Principal given an JSON string + * + * @param jsonString JSON string + * @return An instance of X500Principal + * @throws IOException if the JSON string is invalid with respect to X500Principal + */ + public static X500Principal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, X500Principal.class); + } + + /** + * Convert an instance of X500Principal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..c67dcada3f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,170 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.ClearMonitorTransactionsV1Request; +import org.openapitools.client.model.ClearMonitorTransactionsV1Response; +import org.openapitools.client.model.DeployContractJarsBadRequestV1Response; +import org.openapitools.client.model.DeployContractJarsSuccessV1Response; +import org.openapitools.client.model.DeployContractJarsV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Response; +import org.openapitools.client.model.GetMonitorTransactionsV1Request; +import org.openapitools.client.model.GetMonitorTransactionsV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.ListFlowsV1Request; +import org.openapitools.client.model.ListFlowsV1Response; +import org.openapitools.client.model.NodeInfo; +import org.openapitools.client.model.StartMonitorV1Request; +import org.openapitools.client.model.StartMonitorV1Response; +import org.openapitools.client.model.StopMonitorV1Request; +import org.openapitools.client.model.StopMonitorV1Response; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @throws ApiException if the Api call fails + */ + @Test + public void clearMonitorTransactionsV1Test() throws ApiException { + ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request = null; + ClearMonitorTransactionsV1Response response = api.clearMonitorTransactionsV1(clearMonitorTransactionsV1Request); + // TODO: test validations + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractJarsV1Test() throws ApiException { + DeployContractJarsV1Request deployContractJarsV1Request = null; + DeployContractJarsSuccessV1Response response = api.deployContractJarsV1(deployContractJarsV1Request); + // TODO: test validations + } + + /** + * Responds with diagnostic information about the Corda node + * + * @throws ApiException if the Api call fails + */ + @Test + public void diagnoseNodeV1Test() throws ApiException { + DiagnoseNodeV1Request diagnoseNodeV1Request = null; + DiagnoseNodeV1Response response = api.diagnoseNodeV1(diagnoseNodeV1Request); + // TODO: test validations + } + + /** + * Get transactions for monitored state classes. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getMonitorTransactionsV1Test() throws ApiException { + GetMonitorTransactionsV1Request getMonitorTransactionsV1Request = null; + GetMonitorTransactionsV1Response response = api.getMonitorTransactionsV1(getMonitorTransactionsV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Responds with a list of the flows on the Corda node. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listFlowsV1Test() throws ApiException { + ListFlowsV1Request listFlowsV1Request = null; + ListFlowsV1Response response = api.listFlowsV1(listFlowsV1Request); + // TODO: test validations + } + + /** + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * + * @throws ApiException if the Api call fails + */ + @Test + public void networkMapV1Test() throws ApiException { + Object body = null; + List response = api.networkMapV1(body); + // TODO: test validations + } + + /** + * Start monitoring corda changes (transactions) of given state class + * + * @throws ApiException if the Api call fails + */ + @Test + public void startMonitorV1Test() throws ApiException { + StartMonitorV1Request startMonitorV1Request = null; + StartMonitorV1Response response = api.startMonitorV1(startMonitorV1Request); + // TODO: test validations + } + + /** + * Stop monitoring corda changes (transactions) of given state class + * + * @throws ApiException if the Api call fails + */ + @Test + public void stopMonitorV1Test() throws ApiException { + StopMonitorV1Request stopMonitorV1Request = null; + StopMonitorV1Response response = api.stopMonitorV1(stopMonitorV1Request); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java new file mode 100644 index 0000000000..d4442b0975 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClearMonitorTransactionsV1Request + */ +public class ClearMonitorTransactionsV1RequestTest { + private final ClearMonitorTransactionsV1Request model = new ClearMonitorTransactionsV1Request(); + + /** + * Model tests for ClearMonitorTransactionsV1Request + */ + @Test + public void testClearMonitorTransactionsV1Request() { + // TODO: test ClearMonitorTransactionsV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + + /** + * Test the property 'txIndexes' + */ + @Test + public void txIndexesTest() { + // TODO: test txIndexes + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java new file mode 100644 index 0000000000..7f6905298d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClearMonitorTransactionsV1Response + */ +public class ClearMonitorTransactionsV1ResponseTest { + private final ClearMonitorTransactionsV1Response model = new ClearMonitorTransactionsV1Response(); + + /** + * Model tests for ClearMonitorTransactionsV1Response + */ + @Test + public void testClearMonitorTransactionsV1Response() { + // TODO: test ClearMonitorTransactionsV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java new file mode 100644 index 0000000000..10add752cd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordaNodeSshCredentials + */ +public class CordaNodeSshCredentialsTest { + private final CordaNodeSshCredentials model = new CordaNodeSshCredentials(); + + /** + * Model tests for CordaNodeSshCredentials + */ + @Test + public void testCordaNodeSshCredentials() { + // TODO: test CordaNodeSshCredentials + } + + /** + * Test the property 'hostKeyEntry' + */ + @Test + public void hostKeyEntryTest() { + // TODO: test hostKeyEntry + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'hostname' + */ + @Test + public void hostnameTest() { + // TODO: test hostname + } + + /** + * Test the property 'port' + */ + @Test + public void portTest() { + // TODO: test port + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java new file mode 100644 index 0000000000..15ad00ddcf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordaRpcCredentials + */ +public class CordaRpcCredentialsTest { + private final CordaRpcCredentials model = new CordaRpcCredentials(); + + /** + * Model tests for CordaRpcCredentials + */ + @Test + public void testCordaRpcCredentials() { + // TODO: test CordaRpcCredentials + } + + /** + * Test the property 'hostname' + */ + @Test + public void hostnameTest() { + // TODO: test hostname + } + + /** + * Test the property 'port' + */ + @Test + public void portTest() { + // TODO: test port + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java new file mode 100644 index 0000000000..c0d5dd8249 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java @@ -0,0 +1,97 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.X500Principal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordaX500Name + */ +public class CordaX500NameTest { + private final CordaX500Name model = new CordaX500Name(); + + /** + * Model tests for CordaX500Name + */ + @Test + public void testCordaX500Name() { + // TODO: test CordaX500Name + } + + /** + * Test the property 'commonName' + */ + @Test + public void commonNameTest() { + // TODO: test commonName + } + + /** + * Test the property 'organisationUnit' + */ + @Test + public void organisationUnitTest() { + // TODO: test organisationUnit + } + + /** + * Test the property 'organisation' + */ + @Test + public void organisationTest() { + // TODO: test organisation + } + + /** + * Test the property 'locality' + */ + @Test + public void localityTest() { + // TODO: test locality + } + + /** + * Test the property 'state' + */ + @Test + public void stateTest() { + // TODO: test state + } + + /** + * Test the property 'country' + */ + @Test + public void countryTest() { + // TODO: test country + } + + /** + * Test the property 'x500Principal' + */ + @Test + public void x500PrincipalTest() { + // TODO: test x500Principal + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java new file mode 100644 index 0000000000..6b512c46f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.CordaNodeSshCredentials; +import org.openapitools.client.model.CordaRpcCredentials; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordappDeploymentConfig + */ +public class CordappDeploymentConfigTest { + private final CordappDeploymentConfig model = new CordappDeploymentConfig(); + + /** + * Model tests for CordappDeploymentConfig + */ + @Test + public void testCordappDeploymentConfig() { + // TODO: test CordappDeploymentConfig + } + + /** + * Test the property 'sshCredentials' + */ + @Test + public void sshCredentialsTest() { + // TODO: test sshCredentials + } + + /** + * Test the property 'rpcCredentials' + */ + @Test + public void rpcCredentialsTest() { + // TODO: test rpcCredentials + } + + /** + * Test the property 'cordaNodeStartCmd' + */ + @Test + public void cordaNodeStartCmdTest() { + // TODO: test cordaNodeStartCmd + } + + /** + * Test the property 'cordappDir' + */ + @Test + public void cordappDirTest() { + // TODO: test cordappDir + } + + /** + * Test the property 'cordaJarPath' + */ + @Test + public void cordaJarPathTest() { + // TODO: test cordaJarPath + } + + /** + * Test the property 'nodeBaseDirPath' + */ + @Test + public void nodeBaseDirPathTest() { + // TODO: test nodeBaseDirPath + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java new file mode 100644 index 0000000000..99572e3f0d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java @@ -0,0 +1,113 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.SHA256; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordappInfo + */ +public class CordappInfoTest { + private final CordappInfo model = new CordappInfo(); + + /** + * Model tests for CordappInfo + */ + @Test + public void testCordappInfo() { + // TODO: test CordappInfo + } + + /** + * Test the property 'jarHash' + */ + @Test + public void jarHashTest() { + // TODO: test jarHash + } + + /** + * Test the property 'licence' + */ + @Test + public void licenceTest() { + // TODO: test licence + } + + /** + * Test the property 'minimumPlatformVersion' + */ + @Test + public void minimumPlatformVersionTest() { + // TODO: test minimumPlatformVersion + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'shortName' + */ + @Test + public void shortNameTest() { + // TODO: test shortName + } + + /** + * Test the property 'targetPlatformVersion' + */ + @Test + public void targetPlatformVersionTest() { + // TODO: test targetPlatformVersion + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'vendor' + */ + @Test + public void vendorTest() { + // TODO: test vendor + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java new file mode 100644 index 0000000000..54d73f2617 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJarsBadRequestV1Response + */ +public class DeployContractJarsBadRequestV1ResponseTest { + private final DeployContractJarsBadRequestV1Response model = new DeployContractJarsBadRequestV1Response(); + + /** + * Model tests for DeployContractJarsBadRequestV1Response + */ + @Test + public void testDeployContractJarsBadRequestV1Response() { + // TODO: test DeployContractJarsBadRequestV1Response + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java new file mode 100644 index 0000000000..6221bc8e3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJarsSuccessV1Response + */ +public class DeployContractJarsSuccessV1ResponseTest { + private final DeployContractJarsSuccessV1Response model = new DeployContractJarsSuccessV1Response(); + + /** + * Model tests for DeployContractJarsSuccessV1Response + */ + @Test + public void testDeployContractJarsSuccessV1Response() { + // TODO: test DeployContractJarsSuccessV1Response + } + + /** + * Test the property 'deployedJarFiles' + */ + @Test + public void deployedJarFilesTest() { + // TODO: test deployedJarFiles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java new file mode 100644 index 0000000000..0c733a4cad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java @@ -0,0 +1,60 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CordappDeploymentConfig; +import org.openapitools.client.model.JarFile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJarsV1Request + */ +public class DeployContractJarsV1RequestTest { + private final DeployContractJarsV1Request model = new DeployContractJarsV1Request(); + + /** + * Model tests for DeployContractJarsV1Request + */ + @Test + public void testDeployContractJarsV1Request() { + // TODO: test DeployContractJarsV1Request + } + + /** + * Test the property 'cordappDeploymentConfigs' + */ + @Test + public void cordappDeploymentConfigsTest() { + // TODO: test cordappDeploymentConfigs + } + + /** + * Test the property 'jarFiles' + */ + @Test + public void jarFilesTest() { + // TODO: test jarFiles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java new file mode 100644 index 0000000000..871088691e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DiagnoseNodeV1Request + */ +public class DiagnoseNodeV1RequestTest { + private final DiagnoseNodeV1Request model = new DiagnoseNodeV1Request(); + + /** + * Model tests for DiagnoseNodeV1Request + */ + @Test + public void testDiagnoseNodeV1Request() { + // TODO: test DiagnoseNodeV1Request + } + + /** + * Test the property 'nodeIds' + */ + @Test + public void nodeIdsTest() { + // TODO: test nodeIds + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java new file mode 100644 index 0000000000..b7ec785d20 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NodeDiagnosticInfo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DiagnoseNodeV1Response + */ +public class DiagnoseNodeV1ResponseTest { + private final DiagnoseNodeV1Response model = new DiagnoseNodeV1Response(); + + /** + * Model tests for DiagnoseNodeV1Response + */ + @Test + public void testDiagnoseNodeV1Response() { + // TODO: test DiagnoseNodeV1Response + } + + /** + * Test the property 'nodeDiagnosticInfo' + */ + @Test + public void nodeDiagnosticInfoTest() { + // TODO: test nodeDiagnosticInfo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java new file mode 100644 index 0000000000..8a67cfbc3c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FlowInvocationType + */ +public class FlowInvocationTypeTest { + /** + * Model tests for FlowInvocationType + */ + @Test + public void testFlowInvocationType() { + // TODO: test FlowInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java new file mode 100644 index 0000000000..0fe4f2408e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetMonitorTransactionsV1Request + */ +public class GetMonitorTransactionsV1RequestTest { + private final GetMonitorTransactionsV1Request model = new GetMonitorTransactionsV1Request(); + + /** + * Model tests for GetMonitorTransactionsV1Request + */ + @Test + public void testGetMonitorTransactionsV1Request() { + // TODO: test GetMonitorTransactionsV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java new file mode 100644 index 0000000000..a10a26f27d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.GetMonitorTransactionsV1ResponseTxInner; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetMonitorTransactionsV1Response + */ +public class GetMonitorTransactionsV1ResponseTest { + private final GetMonitorTransactionsV1Response model = new GetMonitorTransactionsV1Response(); + + /** + * Model tests for GetMonitorTransactionsV1Response + */ + @Test + public void testGetMonitorTransactionsV1Response() { + // TODO: test GetMonitorTransactionsV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + + /** + * Test the property 'tx' + */ + @Test + public void txTest() { + // TODO: test tx + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java new file mode 100644 index 0000000000..79c8a00663 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetMonitorTransactionsV1ResponseTxInner + */ +public class GetMonitorTransactionsV1ResponseTxInnerTest { + private final GetMonitorTransactionsV1ResponseTxInner model = new GetMonitorTransactionsV1ResponseTxInner(); + + /** + * Model tests for GetMonitorTransactionsV1ResponseTxInner + */ + @Test + public void testGetMonitorTransactionsV1ResponseTxInner() { + // TODO: test GetMonitorTransactionsV1ResponseTxInner + } + + /** + * Test the property 'index' + */ + @Test + public void indexTest() { + // TODO: test index + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 0000000000..219c8c569f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.FlowInvocationType; +import org.openapitools.client.model.JvmObject; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'flowFullClassName' + */ + @Test + public void flowFullClassNameTest() { + // TODO: test flowFullClassName + } + + /** + * Test the property 'flowInvocationType' + */ + @Test + public void flowInvocationTypeTest() { + // TODO: test flowInvocationType + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..fd4ab34c8c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + + /** + * Test the property 'progress' + */ + @Test + public void progressTest() { + // TODO: test progress + } + + /** + * Test the property 'flowId' + */ + @Test + public void flowIdTest() { + // TODO: test flowId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java new file mode 100644 index 0000000000..8c3f86ce39 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JarFile + */ +public class JarFileTest { + private final JarFile model = new JarFile(); + + /** + * Model tests for JarFile + */ + @Test + public void testJarFile() { + // TODO: test JarFile + } + + /** + * Test the property 'filename' + */ + @Test + public void filenameTest() { + // TODO: test filename + } + + /** + * Test the property 'hasDbMigrations' + */ + @Test + public void hasDbMigrationsTest() { + // TODO: test hasDbMigrations + } + + /** + * Test the property 'contentBase64' + */ + @Test + public void contentBase64Test() { + // TODO: test contentBase64 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java new file mode 100644 index 0000000000..30b24cc4ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.JvmType; +import org.openapitools.client.model.JvmTypeKind; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JvmObject + */ +public class JvmObjectTest { + private final JvmObject model = new JvmObject(); + + /** + * Model tests for JvmObject + */ + @Test + public void testJvmObject() { + // TODO: test JvmObject + } + + /** + * Test the property 'jvmTypeKind' + */ + @Test + public void jvmTypeKindTest() { + // TODO: test jvmTypeKind + } + + /** + * Test the property 'primitiveValue' + */ + @Test + public void primitiveValueTest() { + // TODO: test primitiveValue + } + + /** + * Test the property 'jvmCtorArgs' + */ + @Test + public void jvmCtorArgsTest() { + // TODO: test jvmCtorArgs + } + + /** + * Test the property 'jvmType' + */ + @Test + public void jvmTypeTest() { + // TODO: test jvmType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java new file mode 100644 index 0000000000..47e2fd4d32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JvmTypeKind + */ +public class JvmTypeKindTest { + /** + * Model tests for JvmTypeKind + */ + @Test + public void testJvmTypeKind() { + // TODO: test JvmTypeKind + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java new file mode 100644 index 0000000000..a51cbd65d0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JvmObject; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JvmType + */ +public class JvmTypeTest { + private final JvmType model = new JvmType(); + + /** + * Model tests for JvmType + */ + @Test + public void testJvmType() { + // TODO: test JvmType + } + + /** + * Test the property 'fqClassName' + */ + @Test + public void fqClassNameTest() { + // TODO: test fqClassName + } + + /** + * Test the property 'constructorName' + */ + @Test + public void constructorNameTest() { + // TODO: test constructorName + } + + /** + * Test the property 'invocationTarget' + */ + @Test + public void invocationTargetTest() { + // TODO: test invocationTarget + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java new file mode 100644 index 0000000000..cc2d0a3a83 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ListFlowsV1Request + */ +public class ListFlowsV1RequestTest { + private final ListFlowsV1Request model = new ListFlowsV1Request(); + + /** + * Model tests for ListFlowsV1Request + */ + @Test + public void testListFlowsV1Request() { + // TODO: test ListFlowsV1Request + } + + /** + * Test the property 'filter' + */ + @Test + public void filterTest() { + // TODO: test filter + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java new file mode 100644 index 0000000000..e2b1deb029 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ListFlowsV1Response + */ +public class ListFlowsV1ResponseTest { + private final ListFlowsV1Response model = new ListFlowsV1Response(); + + /** + * Model tests for ListFlowsV1Response + */ + @Test + public void testListFlowsV1Response() { + // TODO: test ListFlowsV1Response + } + + /** + * Test the property 'flowNames' + */ + @Test + public void flowNamesTest() { + // TODO: test flowNames + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java new file mode 100644 index 0000000000..b629557568 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NetworkHostAndPort + */ +public class NetworkHostAndPortTest { + private final NetworkHostAndPort model = new NetworkHostAndPort(); + + /** + * Model tests for NetworkHostAndPort + */ + @Test + public void testNetworkHostAndPort() { + // TODO: test NetworkHostAndPort + } + + /** + * Test the property 'host' + */ + @Test + public void hostTest() { + // TODO: test host + } + + /** + * Test the property 'port' + */ + @Test + public void portTest() { + // TODO: test port + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java new file mode 100644 index 0000000000..ba2dc2db57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CordappInfo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NodeDiagnosticInfo + */ +public class NodeDiagnosticInfoTest { + private final NodeDiagnosticInfo model = new NodeDiagnosticInfo(); + + /** + * Model tests for NodeDiagnosticInfo + */ + @Test + public void testNodeDiagnosticInfo() { + // TODO: test NodeDiagnosticInfo + } + + /** + * Test the property 'cordapps' + */ + @Test + public void cordappsTest() { + // TODO: test cordapps + } + + /** + * Test the property 'platformVersion' + */ + @Test + public void platformVersionTest() { + // TODO: test platformVersion + } + + /** + * Test the property 'revision' + */ + @Test + public void revisionTest() { + // TODO: test revision + } + + /** + * Test the property 'vendor' + */ + @Test + public void vendorTest() { + // TODO: test vendor + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java new file mode 100644 index 0000000000..6c98c8cf5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.NetworkHostAndPort; +import org.openapitools.client.model.Party; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NodeInfo + */ +public class NodeInfoTest { + private final NodeInfo model = new NodeInfo(); + + /** + * Model tests for NodeInfo + */ + @Test + public void testNodeInfo() { + // TODO: test NodeInfo + } + + /** + * Test the property 'addresses' + */ + @Test + public void addressesTest() { + // TODO: test addresses + } + + /** + * Test the property 'platformVersion' + */ + @Test + public void platformVersionTest() { + // TODO: test platformVersion + } + + /** + * Test the property 'serial' + */ + @Test + public void serialTest() { + // TODO: test serial + } + + /** + * Test the property 'legalIdentities' + */ + @Test + public void legalIdentitiesTest() { + // TODO: test legalIdentities + } + + /** + * Test the property 'legalIdentitiesAndCerts' + */ + @Test + public void legalIdentitiesAndCertsTest() { + // TODO: test legalIdentitiesAndCerts + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java new file mode 100644 index 0000000000..8147bd7d3f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.CordaX500Name; +import org.openapitools.client.model.PublicKey; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Party + */ +public class PartyTest { + private final Party model = new Party(); + + /** + * Model tests for Party + */ + @Test + public void testParty() { + // TODO: test Party + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'owningKey' + */ + @Test + public void owningKeyTest() { + // TODO: test owningKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java new file mode 100644 index 0000000000..eb7e8e2c93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PublicKey + */ +public class PublicKeyTest { + private final PublicKey model = new PublicKey(); + + /** + * Model tests for PublicKey + */ + @Test + public void testPublicKey() { + // TODO: test PublicKey + } + + /** + * Test the property 'algorithm' + */ + @Test + public void algorithmTest() { + // TODO: test algorithm + } + + /** + * Test the property 'format' + */ + @Test + public void formatTest() { + // TODO: test format + } + + /** + * Test the property 'encoded' + */ + @Test + public void encodedTest() { + // TODO: test encoded + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java new file mode 100644 index 0000000000..8111bf605b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SHA256 + */ +public class SHA256Test { + private final SHA256 model = new SHA256(); + + /** + * Model tests for SHA256 + */ + @Test + public void testSHA256() { + // TODO: test SHA256 + } + + /** + * Test the property 'bytes' + */ + @Test + public void bytesTest() { + // TODO: test bytes + } + + /** + * Test the property 'offset' + */ + @Test + public void offsetTest() { + // TODO: test offset + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java new file mode 100644 index 0000000000..fc7c84f48b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StartMonitorV1Request + */ +public class StartMonitorV1RequestTest { + private final StartMonitorV1Request model = new StartMonitorV1Request(); + + /** + * Model tests for StartMonitorV1Request + */ + @Test + public void testStartMonitorV1Request() { + // TODO: test StartMonitorV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java new file mode 100644 index 0000000000..62686e3d9f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StartMonitorV1Response + */ +public class StartMonitorV1ResponseTest { + private final StartMonitorV1Response model = new StartMonitorV1Response(); + + /** + * Model tests for StartMonitorV1Response + */ + @Test + public void testStartMonitorV1Response() { + // TODO: test StartMonitorV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java new file mode 100644 index 0000000000..bd9daeadc2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StopMonitorV1Request + */ +public class StopMonitorV1RequestTest { + private final StopMonitorV1Request model = new StopMonitorV1Request(); + + /** + * Model tests for StopMonitorV1Request + */ + @Test + public void testStopMonitorV1Request() { + // TODO: test StopMonitorV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java new file mode 100644 index 0000000000..4fff34a439 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StopMonitorV1Response + */ +public class StopMonitorV1ResponseTest { + private final StopMonitorV1Response model = new StopMonitorV1Response(); + + /** + * Model tests for StopMonitorV1Response + */ + @Test + public void testStopMonitorV1Response() { + // TODO: test StopMonitorV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java new file mode 100644 index 0000000000..ac67ca9388 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for X500Principal + */ +public class X500PrincipalTest { + private final X500Principal model = new X500Principal(); + + /** + * Model tests for X500Principal + */ + @Test + public void testX500Principal() { + // TODO: test X500Principal + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'encoded' + */ + @Test + public void encodedTest() { + // TODO: test encoded + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/package.json b/packages/cactus-plugin-ledger-connector-ethereum/package.json index 37450f88bb..4281defb1f 100644 --- a/packages/cactus-plugin-ledger-connector-ethereum/package.json +++ b/packages/cactus-plugin-ledger-connector-ethereum/package.json @@ -57,7 +57,9 @@ "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: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..56088241db --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,49 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_contract_json.go +model_deploy_contract_solidity_bytecode_json_object_v1_request.go +model_deploy_contract_solidity_bytecode_v1_request.go +model_deploy_contract_solidity_bytecode_v1_response.go +model_eth_contract_invocation_type.go +model_eth_contract_invocation_web3_method.go +model_ethereum_transaction_config.go +model_gas_transaction_config.go +model_gas_transaction_config_eip1559.go +model_gas_transaction_config_legacy.go +model_invoke_contract_json_object_v1_request.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_invoke_raw_web3_eth_contract_v1_request.go +model_invoke_raw_web3_eth_contract_v1_response.go +model_invoke_raw_web3_eth_method_v1_request.go +model_invoke_raw_web3_eth_method_v1_response.go +model_run_transaction_request.go +model_run_transaction_response.go +model_solidity_contract_json_artifact.go +model_solidity_contract_json_artifact_compiler.go +model_solidity_contract_json_artifact_gas_estimates.go +model_solidity_contract_json_artifact_gas_estimates_creation.go +model_watch_blocks_v1.go +model_watch_blocks_v1_block_data.go +model_watch_blocks_v1_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_cactus_keychain_ref.go +model_web3_signing_credential_geth_keychain_password.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction.go +model_web3_transaction_receipt.go +response.go +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 0000000000..e7e42a4b58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /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 0000000000..3935b54bca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,155 @@ +# Go API client for cactus-plugin-ledger-connector-ethereum + +Can perform basic tasks on a Ethereum ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-ethereum "github.com/hyperledger/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractSolBytecodeJsonObjectV1**](docs/DefaultApi.md#deploycontractsolbytecodejsonobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**DeployContractSolBytecodeV1**](docs/DefaultApi.md#deploycontractsolbytecodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/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-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* | [**InvokeContractV1NoKeychain**](docs/DefaultApi.md#invokecontractv1nokeychain) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object | 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) + - [DeployContractSolidityBytecodeJsonObjectV1Request](docs/DeployContractSolidityBytecodeJsonObjectV1Request.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.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) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1BlockDataTimestamp](docs/WatchBlocksV1BlockDataTimestamp.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation For Authorization + + Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-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 0000000000..a9ce6e3b70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1226 @@ +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 Cactus Plugin - Connector Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractSolBytecodeJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object + /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 + summary: Executes a transaction on a ethereum ledger + x-hyperledger-cactus: + 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 + summary: Invokes a contract on an ethereum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object: + post: + operationId: invokeContractV1NoKeychain + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on an ethereum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object + /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-cactus: + 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 + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cactus: + 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 + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + 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 + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - bytecode + - contractName + type: object + RunTransactionRequest: + additionalProperties: false + example: + 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 + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + gasConfig: null + keychainId: keychainId + timeoutMs: 0.14658129805029452 + constructorArgs: + - "" + - "" + contractAbi: + - "" + - "" + web3SigningCredential: + type: null + contractName: contractName + nonce: 0.8008281904610115 + value: 6.027456183070403 + contractJSON: "{}" + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + nonce: + nullable: false + type: number + value: + nullable: false + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + description: "For use when not using keychain, pass the contract in as this\ + \ variable" + nullable: false + type: object + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + 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 + DeployContractSolidityBytecodeJsonObjectV1Request: + additionalProperties: false + example: + gasConfig: null + timeoutMs: 0.08008281904610115 + constructorArgs: + - "" + - "" + web3SigningCredential: + type: 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' + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + gasConfig: null + invocationType: null + keychainId: keychainId + timeoutMs: 0.08008281904610115 + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: value + nonce: nonce + 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: + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + nonce: + type: string + 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: + gasConfig: null + invocationType: null + timeoutMs: 0.08008281904610115 + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: value + nonce: nonce + 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: + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + nonce: + type: string + 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 + 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 + 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 + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: string + parentHash: + type: string + sha3Uncles: + type: string + transactionsRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + gasLimit: + type: string + gasUsed: + type: string + stateRoot: + type: string + logsBloom: + type: string + extraData: + type: string + nonce: + type: string + timestamp: + type: string + required: + - gasLimit + - gasUsed + - sha3Uncles + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: string + blockHash: + type: string + blockNumber: + type: string + transactionIndex: + type: string + from: + type: string + to: + type: string + value: + type: string + gasPrice: + type: string + gas: + type: string + input: + type: string + type: + type: string + chainId: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - chainId + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - type + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: string + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: string + gasUsed: + type: string + timestamp: + $ref: '#/components/schemas/WatchBlocksV1BlockData_timestamp' + size: + type: string + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + baseFeePerGas: + type: string + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + 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 + 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 0000000000..f91a7f9dd3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,855 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractSolBytecodeJsonObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeJsonObjectV1Request *DeployContractSolidityBytecodeJsonObjectV1Request +} + +func (r ApiDeployContractSolBytecodeJsonObjectV1Request) DeployContractSolidityBytecodeJsonObjectV1Request(deployContractSolidityBytecodeJsonObjectV1Request DeployContractSolidityBytecodeJsonObjectV1Request) ApiDeployContractSolBytecodeJsonObjectV1Request { + r.deployContractSolidityBytecodeJsonObjectV1Request = &deployContractSolidityBytecodeJsonObjectV1Request + return r +} + +func (r ApiDeployContractSolBytecodeJsonObjectV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeJsonObjectV1Execute(r) +} + +/* +DeployContractSolBytecodeJsonObjectV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeJsonObjectV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeJsonObjectV1(ctx context.Context) ApiDeployContractSolBytecodeJsonObjectV1Request { + return ApiDeployContractSolBytecodeJsonObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeJsonObjectV1Execute(r ApiDeployContractSolBytecodeJsonObjectV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeJsonObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type 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-ethereum/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 := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on an ethereum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1NoKeychainRequest struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractJsonObjectV1Request *InvokeContractJsonObjectV1Request +} + +func (r ApiInvokeContractV1NoKeychainRequest) InvokeContractJsonObjectV1Request(invokeContractJsonObjectV1Request InvokeContractJsonObjectV1Request) ApiInvokeContractV1NoKeychainRequest { + r.invokeContractJsonObjectV1Request = &invokeContractJsonObjectV1Request + return r +} + +func (r ApiInvokeContractV1NoKeychainRequest) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1NoKeychainExecute(r) +} + +/* +InvokeContractV1NoKeychain Invokes a contract on an ethereum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1NoKeychainRequest +*/ +func (a *DefaultApiService) InvokeContractV1NoKeychain(ctx context.Context) ApiInvokeContractV1NoKeychainRequest { + return ApiInvokeContractV1NoKeychainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1NoKeychainExecute(r ApiInvokeContractV1NoKeychainRequest) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1NoKeychain") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/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 := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type 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"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + 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"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthMethodV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a ethereum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + 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 0000000000..10499ea9ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,655 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Ethereum API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToQuery adds the provided object to the url query supporting deep object syntax +func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..3f0dc80c58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..3893f77f03 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..3999793dfe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client + +go 1.13 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 0000000000..c966c8ddfd --- /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 0000000000..1c387e9d79 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json.go @@ -0,0 +1,579 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the ContractJSON type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJSON{} + +// ContractJSON struct for ContractJSON +type ContractJSON struct { + ContractName string `json:"contractName"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The application binary interface of the solidity contract, optional parameter + Abi []interface{} `json:"abi,omitempty"` + Metadata *string `json:"metadata,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler map[string]interface{} `json:"compiler,omitempty"` + Networks map[string]interface{} `json:"networks,omitempty"` + Ast map[string]interface{} `json:"ast,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates map[string]interface{} `json:"gasEstimates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContractJSON ContractJSON + +// NewContractJSON instantiates a new ContractJSON object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractJSON(contractName string, bytecode string) *ContractJSON { + this := ContractJSON{} + this.ContractName = contractName + this.Bytecode = bytecode + return &this +} + +// NewContractJSONWithDefaults instantiates a new ContractJSON object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJSONWithDefaults() *ContractJSON { + this := ContractJSON{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractJSON) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractJSON) SetContractName(v string) { + o.ContractName = v +} + +// GetBytecode returns the Bytecode field value +func (o *ContractJSON) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *ContractJSON) SetBytecode(v string) { + o.Bytecode = v +} + +// GetAbi returns the Abi field value if set, zero value otherwise. +func (o *ContractJSON) GetAbi() []interface{} { + if o == nil || isNil(o.Abi) { + var ret []interface{} + return ret + } + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAbiOk() ([]interface{}, bool) { + if o == nil || isNil(o.Abi) { + return nil, false + } + return o.Abi, true +} + +// HasAbi returns a boolean if a field has been set. +func (o *ContractJSON) HasAbi() bool { + if o != nil && !isNil(o.Abi) { + return true + } + + return false +} + +// SetAbi gets a reference to the given []interface{} and assigns it to the Abi field. +func (o *ContractJSON) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ContractJSON) GetMetadata() string { + if o == nil || isNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetMetadataOk() (*string, bool) { + if o == nil || isNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ContractJSON) HasMetadata() bool { + if o != nil && !isNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *ContractJSON) SetMetadata(v string) { + o.Metadata = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedBytecode() string { + if o == nil || isNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || isNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedBytecode() bool { + if o != nil && !isNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *ContractJSON) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetSourceMap() string { + if o == nil || isNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourceMapOk() (*string, bool) { + if o == nil || isNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasSourceMap() bool { + if o != nil && !isNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *ContractJSON) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedSourceMap() string { + if o == nil || isNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || isNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedSourceMap() bool { + if o != nil && !isNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *ContractJSON) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *ContractJSON) GetSourcePath() string { + if o == nil || isNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourcePathOk() (*string, bool) { + if o == nil || isNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *ContractJSON) HasSourcePath() bool { + if o != nil && !isNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *ContractJSON) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *ContractJSON) GetCompiler() map[string]interface{} { + if o == nil || isNil(o.Compiler) { + var ret map[string]interface{} + return ret + } + return o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetCompilerOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Compiler) { + return map[string]interface{}{}, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *ContractJSON) HasCompiler() bool { + if o != nil && !isNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given map[string]interface{} and assigns it to the Compiler field. +func (o *ContractJSON) SetCompiler(v map[string]interface{}) { + o.Compiler = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *ContractJSON) GetNetworks() map[string]interface{} { + if o == nil || isNil(o.Networks) { + var ret map[string]interface{} + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetNetworksOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Networks) { + return map[string]interface{}{}, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *ContractJSON) HasNetworks() bool { + if o != nil && !isNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given map[string]interface{} and assigns it to the Networks field. +func (o *ContractJSON) SetNetworks(v map[string]interface{}) { + o.Networks = v +} + +// GetAst returns the Ast field value if set, zero value otherwise. +func (o *ContractJSON) GetAst() map[string]interface{} { + if o == nil || isNil(o.Ast) { + var ret map[string]interface{} + return ret + } + return o.Ast +} + +// GetAstOk returns a tuple with the Ast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAstOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Ast) { + return map[string]interface{}{}, false + } + return o.Ast, true +} + +// HasAst returns a boolean if a field has been set. +func (o *ContractJSON) HasAst() bool { + if o != nil && !isNil(o.Ast) { + return true + } + + return false +} + +// SetAst gets a reference to the given map[string]interface{} and assigns it to the Ast field. +func (o *ContractJSON) SetAst(v map[string]interface{}) { + o.Ast = v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *ContractJSON) GetFunctionHashes() map[string]interface{} { + if o == nil || isNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *ContractJSON) HasFunctionHashes() bool { + if o != nil && !isNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *ContractJSON) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *ContractJSON) GetGasEstimates() map[string]interface{} { + if o == nil || isNil(o.GasEstimates) { + var ret map[string]interface{} + return ret + } + return o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetGasEstimatesOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.GasEstimates) { + return map[string]interface{}{}, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *ContractJSON) HasGasEstimates() bool { + if o != nil && !isNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given map[string]interface{} and assigns it to the GasEstimates field. +func (o *ContractJSON) SetGasEstimates(v map[string]interface{}) { + o.GasEstimates = v +} + +func (o ContractJSON) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJSON) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["bytecode"] = o.Bytecode + if !isNil(o.Abi) { + toSerialize["abi"] = o.Abi + } + if !isNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !isNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !isNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !isNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !isNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !isNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !isNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !isNil(o.Ast) { + toSerialize["ast"] = o.Ast + } + if !isNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !isNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContractJSON) UnmarshalJSON(bytes []byte) (err error) { + varContractJSON := _ContractJSON{} + + if err = json.Unmarshal(bytes, &varContractJSON); err == nil { + *o = ContractJSON(varContractJSON) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contractName") + delete(additionalProperties, "bytecode") + delete(additionalProperties, "abi") + delete(additionalProperties, "metadata") + delete(additionalProperties, "deployedBytecode") + delete(additionalProperties, "sourceMap") + delete(additionalProperties, "deployedSourceMap") + delete(additionalProperties, "sourcePath") + delete(additionalProperties, "compiler") + delete(additionalProperties, "networks") + delete(additionalProperties, "ast") + delete(additionalProperties, "functionHashes") + delete(additionalProperties, "gasEstimates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContractJSON struct { + value *ContractJSON + isSet bool +} + +func (v NullableContractJSON) Get() *ContractJSON { + return v.value +} + +func (v *NullableContractJSON) Set(val *ContractJSON) { + v.value = val + v.isSet = true +} + +func (v NullableContractJSON) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJSON) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJSON(val *ContractJSON) *NullableContractJSON { + return &NullableContractJSON{value: val, isSet: true} +} + +func (v NullableContractJSON) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJSON) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go new file mode 100644 index 0000000000..14aeb46091 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go @@ -0,0 +1,258 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeJsonObjectV1Request{} + +// DeployContractSolidityBytecodeJsonObjectV1Request struct for DeployContractSolidityBytecodeJsonObjectV1Request +type DeployContractSolidityBytecodeJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` +} + +// NewDeployContractSolidityBytecodeJsonObjectV1Request instantiates a new DeployContractSolidityBytecodeJsonObjectV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeJsonObjectV1Request(web3SigningCredential Web3SigningCredential, contractJSON ContractJSON) *DeployContractSolidityBytecodeJsonObjectV1Request { + this := DeployContractSolidityBytecodeJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewDeployContractSolidityBytecodeJsonObjectV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeJsonObjectV1RequestWithDefaults() *DeployContractSolidityBytecodeJsonObjectV1Request { + this := DeployContractSolidityBytecodeJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) 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 *DeployContractSolidityBytecodeJsonObjectV1Request) 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 *DeployContractSolidityBytecodeJsonObjectV1Request) 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 *DeployContractSolidityBytecodeJsonObjectV1Request) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || isNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || isNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !isNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetConstructorArgs() []interface{} { + if o == nil || isNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || isNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasConstructorArgs() bool { + if o != nil && !isNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +func (o DeployContractSolidityBytecodeJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !isNil(o.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + if !isNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !isNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeJsonObjectV1Request struct { + value *DeployContractSolidityBytecodeJsonObjectV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) Get() *DeployContractSolidityBytecodeJsonObjectV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) Set(val *DeployContractSolidityBytecodeJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeJsonObjectV1Request(val *DeployContractSolidityBytecodeJsonObjectV1Request) *NullableDeployContractSolidityBytecodeJsonObjectV1Request { + return &NullableDeployContractSolidityBytecodeJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go new file mode 100644 index 0000000000..339751ec32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go @@ -0,0 +1,470 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Request{} + +// DeployContractSolidityBytecodeV1Request struct for DeployContractSolidityBytecodeV1Request +type DeployContractSolidityBytecodeV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + // The application binary interface of the solidity contract + ContractAbi []interface{} `json:"contractAbi,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode *string `json:"bytecode,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Value *float32 `json:"value,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // For use when not using keychain, pass the contract in as this variable + ContractJSON map[string]interface{} `json:"contractJSON,omitempty"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` +} + +// NewDeployContractSolidityBytecodeV1Request instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Request(contractName string, web3SigningCredential Web3SigningCredential, keychainId string) *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractSolidityBytecodeV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1RequestWithDefaults() *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetContractAbi returns the ContractAbi field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbi() []interface{} { + if o == nil || isNil(o.ContractAbi) { + var ret []interface{} + return ret + } + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil || isNil(o.ContractAbi) { + return nil, false + } + return o.ContractAbi, true +} + +// HasContractAbi returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasContractAbi() bool { + if o != nil && !isNil(o.ContractAbi) { + return true + } + + return false +} + +// SetContractAbi gets a reference to the given []interface{} and assigns it to the ContractAbi field. +func (o *DeployContractSolidityBytecodeV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecode() string { + if o == nil || isNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecodeOk() (*string, bool) { + if o == nil || isNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasBytecode() bool { + if o != nil && !isNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *DeployContractSolidityBytecodeV1Request) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) 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 *DeployContractSolidityBytecodeV1Request) 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 *DeployContractSolidityBytecodeV1Request) 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 *DeployContractSolidityBytecodeV1Request) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetNonce() float32 { + if o == nil || isNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetNonceOk() (*float32, bool) { + if o == nil || isNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasNonce() bool { + if o != nil && !isNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *DeployContractSolidityBytecodeV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetValue() float32 { + if o == nil || isNil(o.Value) { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetValueOk() (*float32, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *DeployContractSolidityBytecodeV1Request) SetValue(v float32) { + o.Value = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMs() float32 { + if o == nil || isNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || isNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasTimeoutMs() bool { + if o != nil && !isNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetContractJSON() map[string]interface{} { + if o == nil || isNil(o.ContractJSON) { + var ret map[string]interface{} + return ret + } + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractJSONOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.ContractJSON) { + return map[string]interface{}{}, false + } + return o.ContractJSON, true +} + +// HasContractJSON returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasContractJSON() bool { + if o != nil && !isNil(o.ContractJSON) { + return true + } + + return false +} + +// SetContractJSON gets a reference to the given map[string]interface{} and assigns it to the ContractJSON field. +func (o *DeployContractSolidityBytecodeV1Request) SetContractJSON(v map[string]interface{}) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgs() []interface{} { + if o == nil || isNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || isNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasConstructorArgs() bool { + if o != nil && !isNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractSolidityBytecodeV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +func (o DeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !isNil(o.ContractAbi) { + toSerialize["contractAbi"] = o.ContractAbi + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !isNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + toSerialize["keychainId"] = o.KeychainId + if !isNil(o.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + if !isNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !isNil(o.Value) { + toSerialize["value"] = o.Value + } + if !isNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !isNil(o.ContractJSON) { + toSerialize["contractJSON"] = o.ContractJSON + } + if !isNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + 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-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go new file mode 100644 index 0000000000..b1b4dd3a21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the 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-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 0000000000..7cbe66b6ec --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go new file mode 100644 index 0000000000..eef198be63 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationWeb3Method the model 'EthContractInvocationWeb3Method' +type EthContractInvocationWeb3Method string + +// List of EthContractInvocationWeb3Method +const ( + SEND EthContractInvocationWeb3Method = "send" + CALL EthContractInvocationWeb3Method = "call" + ENCODE_ABI EthContractInvocationWeb3Method = "encodeABI" + ESTIMATE_GAS EthContractInvocationWeb3Method = "estimateGas" +) + +// All allowed values of EthContractInvocationWeb3Method enum +var AllowedEthContractInvocationWeb3MethodEnumValues = []EthContractInvocationWeb3Method{ + "send", + "call", + "encodeABI", + "estimateGas", +} + +func (v *EthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationWeb3Method(value) + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationWeb3Method", value) +} + +// NewEthContractInvocationWeb3MethodFromValue returns a pointer to a valid EthContractInvocationWeb3Method +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationWeb3MethodFromValue(v string) (*EthContractInvocationWeb3Method, error) { + ev := EthContractInvocationWeb3Method(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationWeb3Method: valid values are %v", v, AllowedEthContractInvocationWeb3MethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationWeb3Method) IsValid() bool { + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationWeb3Method value +func (v EthContractInvocationWeb3Method) Ptr() *EthContractInvocationWeb3Method { + return &v +} + +type NullableEthContractInvocationWeb3Method struct { + value *EthContractInvocationWeb3Method + isSet bool +} + +func (v NullableEthContractInvocationWeb3Method) Get() *EthContractInvocationWeb3Method { + return v.value +} + +func (v *NullableEthContractInvocationWeb3Method) Set(val *EthContractInvocationWeb3Method) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationWeb3Method) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationWeb3Method) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationWeb3Method(val *EthContractInvocationWeb3Method) *NullableEthContractInvocationWeb3Method { + return &NullableEthContractInvocationWeb3Method{value: val, isSet: true} +} + +func (v NullableEthContractInvocationWeb3Method) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_ethereum_transaction_config.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_ethereum_transaction_config.go new file mode 100644 index 0000000000..2be86c784b --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the EthereumTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EthereumTransactionConfig{} + +// EthereumTransactionConfig struct for EthereumTransactionConfig +type EthereumTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *string `json:"from,omitempty"` + To *string `json:"to,omitempty"` + Value *string `json:"value,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Data *string `json:"data,omitempty"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` +} + +// NewEthereumTransactionConfig instantiates a new EthereumTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEthereumTransactionConfig() *EthereumTransactionConfig { + this := EthereumTransactionConfig{} + return &this +} + +// NewEthereumTransactionConfigWithDefaults instantiates a new EthereumTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEthereumTransactionConfigWithDefaults() *EthereumTransactionConfig { + this := EthereumTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetRawTransaction() string { + if o == nil || isNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || isNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasRawTransaction() bool { + if o != nil && !isNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *EthereumTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetFrom() string { + if o == nil || isNil(o.From) { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetFromOk() (*string, bool) { + if o == nil || isNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasFrom() bool { + if o != nil && !isNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *EthereumTransactionConfig) SetFrom(v string) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetTo() string { + if o == nil || isNil(o.To) { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetToOk() (*string, bool) { + if o == nil || isNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasTo() bool { + if o != nil && !isNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *EthereumTransactionConfig) SetTo(v string) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetValue() string { + if o == nil || isNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetValueOk() (*string, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EthereumTransactionConfig) SetValue(v string) { + o.Value = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetNonce() string { + if o == nil || isNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetNonceOk() (*string, bool) { + if o == nil || isNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasNonce() bool { + if o != nil && !isNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *EthereumTransactionConfig) SetNonce(v string) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetData() string { + if o == nil || isNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetDataOk() (*string, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasData() bool { + if o != nil && !isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *EthereumTransactionConfig) SetData(v string) { + o.Data = &v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetGasConfig() GasTransactionConfig { + if o == nil || isNil(o.GasConfig) { + var ret GasTransactionConfig + return ret + } + return *o.GasConfig +} + +// GetGasConfigOk returns a tuple with the GasConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetGasConfigOk() (*GasTransactionConfig, bool) { + if o == nil || isNil(o.GasConfig) { + return nil, false + } + return o.GasConfig, true +} + +// HasGasConfig returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasGasConfig() bool { + if o != nil && !isNil(o.GasConfig) { + return true + } + + return false +} + +// SetGasConfig gets a reference to the given GasTransactionConfig and assigns it to the GasConfig field. +func (o *EthereumTransactionConfig) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +func (o EthereumTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EthereumTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !isNil(o.From) { + toSerialize["from"] = o.From + } + if !isNil(o.To) { + toSerialize["to"] = o.To + } + if !isNil(o.Value) { + toSerialize["value"] = o.Value + } + if !isNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !isNil(o.Data) { + toSerialize["data"] = o.Data + } + if !isNil(o.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + return toSerialize, nil +} + +type NullableEthereumTransactionConfig struct { + value *EthereumTransactionConfig + isSet bool +} + +func (v NullableEthereumTransactionConfig) Get() *EthereumTransactionConfig { + return v.value +} + +func (v *NullableEthereumTransactionConfig) Set(val *EthereumTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableEthereumTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableEthereumTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthereumTransactionConfig(val *EthereumTransactionConfig) *NullableEthereumTransactionConfig { + return &NullableEthereumTransactionConfig{value: val, isSet: true} +} + +func (v NullableEthereumTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthereumTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config.go new file mode 100644 index 0000000000..53b91b798a --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// GasTransactionConfig - Transaction gas settings. +type GasTransactionConfig struct { + GasTransactionConfigEIP1559 *GasTransactionConfigEIP1559 + GasTransactionConfigLegacy *GasTransactionConfigLegacy +} + +// GasTransactionConfigEIP1559AsGasTransactionConfig is a convenience function that returns GasTransactionConfigEIP1559 wrapped in GasTransactionConfig +func GasTransactionConfigEIP1559AsGasTransactionConfig(v *GasTransactionConfigEIP1559) GasTransactionConfig { + return GasTransactionConfig{ + GasTransactionConfigEIP1559: v, + } +} + +// GasTransactionConfigLegacyAsGasTransactionConfig is a convenience function that returns GasTransactionConfigLegacy wrapped in GasTransactionConfig +func GasTransactionConfigLegacyAsGasTransactionConfig(v *GasTransactionConfigLegacy) GasTransactionConfig { + return GasTransactionConfig{ + GasTransactionConfigLegacy: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GasTransactionConfig) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into GasTransactionConfigEIP1559 + err = newStrictDecoder(data).Decode(&dst.GasTransactionConfigEIP1559) + if err == nil { + jsonGasTransactionConfigEIP1559, _ := json.Marshal(dst.GasTransactionConfigEIP1559) + if string(jsonGasTransactionConfigEIP1559) == "{}" { // empty struct + dst.GasTransactionConfigEIP1559 = nil + } else { + match++ + } + } else { + dst.GasTransactionConfigEIP1559 = nil + } + + // try to unmarshal data into GasTransactionConfigLegacy + err = newStrictDecoder(data).Decode(&dst.GasTransactionConfigLegacy) + if err == nil { + jsonGasTransactionConfigLegacy, _ := json.Marshal(dst.GasTransactionConfigLegacy) + if string(jsonGasTransactionConfigLegacy) == "{}" { // empty struct + dst.GasTransactionConfigLegacy = nil + } else { + match++ + } + } else { + dst.GasTransactionConfigLegacy = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.GasTransactionConfigEIP1559 = nil + dst.GasTransactionConfigLegacy = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GasTransactionConfig)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GasTransactionConfig)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GasTransactionConfig) MarshalJSON() ([]byte, error) { + if src.GasTransactionConfigEIP1559 != nil { + return json.Marshal(&src.GasTransactionConfigEIP1559) + } + + if src.GasTransactionConfigLegacy != nil { + return json.Marshal(&src.GasTransactionConfigLegacy) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GasTransactionConfig) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.GasTransactionConfigEIP1559 != nil { + return obj.GasTransactionConfigEIP1559 + } + + if obj.GasTransactionConfigLegacy != nil { + return obj.GasTransactionConfigLegacy + } + + // all schemas are nil + return nil +} + +type NullableGasTransactionConfig struct { + value *GasTransactionConfig + isSet bool +} + +func (v NullableGasTransactionConfig) Get() *GasTransactionConfig { + return v.value +} + +func (v *NullableGasTransactionConfig) Set(val *GasTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableGasTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableGasTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasTransactionConfig(val *GasTransactionConfig) *NullableGasTransactionConfig { + return &NullableGasTransactionConfig{value: val, isSet: true} +} + +func (v NullableGasTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_eip1559.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_eip1559.go new file mode 100644 index 0000000000..285fb59ae1 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the GasTransactionConfigEIP1559 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GasTransactionConfigEIP1559{} + +// GasTransactionConfigEIP1559 Transaction gas settings in networks after EIP-1559 (London fork). +type GasTransactionConfigEIP1559 struct { + // A maximum amount of gas a user is willing to provide for the execution of the transaction. + GasLimit *string `json:"gasLimit,omitempty"` + // A maximum fee (including the base fee and the tip) a user is willing to pay per unit of gas. + MaxFeePerGas *string `json:"maxFeePerGas,omitempty"` + // A maximum tip amount a user is willing to pay per unit of gas. + MaxPriorityFeePerGas *string `json:"maxPriorityFeePerGas,omitempty"` +} + +// NewGasTransactionConfigEIP1559 instantiates a new GasTransactionConfigEIP1559 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGasTransactionConfigEIP1559() *GasTransactionConfigEIP1559 { + this := GasTransactionConfigEIP1559{} + return &this +} + +// NewGasTransactionConfigEIP1559WithDefaults instantiates a new GasTransactionConfigEIP1559 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGasTransactionConfigEIP1559WithDefaults() *GasTransactionConfigEIP1559 { + this := GasTransactionConfigEIP1559{} + return &this +} + +// GetGasLimit returns the GasLimit field value if set, zero value otherwise. +func (o *GasTransactionConfigEIP1559) GetGasLimit() string { + if o == nil || isNil(o.GasLimit) { + var ret string + return ret + } + return *o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigEIP1559) GetGasLimitOk() (*string, bool) { + if o == nil || isNil(o.GasLimit) { + return nil, false + } + return o.GasLimit, true +} + +// HasGasLimit returns a boolean if a field has been set. +func (o *GasTransactionConfigEIP1559) HasGasLimit() bool { + if o != nil && !isNil(o.GasLimit) { + return true + } + + return false +} + +// SetGasLimit gets a reference to the given string and assigns it to the GasLimit field. +func (o *GasTransactionConfigEIP1559) SetGasLimit(v string) { + o.GasLimit = &v +} + +// GetMaxFeePerGas returns the MaxFeePerGas field value if set, zero value otherwise. +func (o *GasTransactionConfigEIP1559) GetMaxFeePerGas() string { + if o == nil || isNil(o.MaxFeePerGas) { + var ret string + return ret + } + return *o.MaxFeePerGas +} + +// GetMaxFeePerGasOk returns a tuple with the MaxFeePerGas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigEIP1559) GetMaxFeePerGasOk() (*string, bool) { + if o == nil || isNil(o.MaxFeePerGas) { + return nil, false + } + return o.MaxFeePerGas, true +} + +// HasMaxFeePerGas returns a boolean if a field has been set. +func (o *GasTransactionConfigEIP1559) HasMaxFeePerGas() bool { + if o != nil && !isNil(o.MaxFeePerGas) { + return true + } + + return false +} + +// SetMaxFeePerGas gets a reference to the given string and assigns it to the MaxFeePerGas field. +func (o *GasTransactionConfigEIP1559) SetMaxFeePerGas(v string) { + o.MaxFeePerGas = &v +} + +// GetMaxPriorityFeePerGas returns the MaxPriorityFeePerGas field value if set, zero value otherwise. +func (o *GasTransactionConfigEIP1559) GetMaxPriorityFeePerGas() string { + if o == nil || isNil(o.MaxPriorityFeePerGas) { + var ret string + return ret + } + return *o.MaxPriorityFeePerGas +} + +// GetMaxPriorityFeePerGasOk returns a tuple with the MaxPriorityFeePerGas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigEIP1559) GetMaxPriorityFeePerGasOk() (*string, bool) { + if o == nil || isNil(o.MaxPriorityFeePerGas) { + return nil, false + } + return o.MaxPriorityFeePerGas, true +} + +// HasMaxPriorityFeePerGas returns a boolean if a field has been set. +func (o *GasTransactionConfigEIP1559) HasMaxPriorityFeePerGas() bool { + if o != nil && !isNil(o.MaxPriorityFeePerGas) { + return true + } + + return false +} + +// SetMaxPriorityFeePerGas gets a reference to the given string and assigns it to the MaxPriorityFeePerGas field. +func (o *GasTransactionConfigEIP1559) SetMaxPriorityFeePerGas(v string) { + o.MaxPriorityFeePerGas = &v +} + +func (o GasTransactionConfigEIP1559) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GasTransactionConfigEIP1559) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.GasLimit) { + toSerialize["gasLimit"] = o.GasLimit + } + if !isNil(o.MaxFeePerGas) { + toSerialize["maxFeePerGas"] = o.MaxFeePerGas + } + if !isNil(o.MaxPriorityFeePerGas) { + toSerialize["maxPriorityFeePerGas"] = o.MaxPriorityFeePerGas + } + return toSerialize, nil +} + +type NullableGasTransactionConfigEIP1559 struct { + value *GasTransactionConfigEIP1559 + isSet bool +} + +func (v NullableGasTransactionConfigEIP1559) Get() *GasTransactionConfigEIP1559 { + return v.value +} + +func (v *NullableGasTransactionConfigEIP1559) Set(val *GasTransactionConfigEIP1559) { + v.value = val + v.isSet = true +} + +func (v NullableGasTransactionConfigEIP1559) IsSet() bool { + return v.isSet +} + +func (v *NullableGasTransactionConfigEIP1559) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasTransactionConfigEIP1559(val *GasTransactionConfigEIP1559) *NullableGasTransactionConfigEIP1559 { + return &NullableGasTransactionConfigEIP1559{value: val, isSet: true} +} + +func (v NullableGasTransactionConfigEIP1559) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasTransactionConfigEIP1559) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_legacy.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_legacy.go new file mode 100644 index 0000000000..3a0393bbe3 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the GasTransactionConfigLegacy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GasTransactionConfigLegacy{} + +// GasTransactionConfigLegacy Transaction gas settings in networks before EIP-1559 (London fork). +type GasTransactionConfigLegacy struct { + // A maximum amount of gas a user is willing to provide for the execution of the transaction. (gasLimit) + Gas *string `json:"gas,omitempty"` + // A price (in Wei) a user is willing to pay for each unit of gas used during the execution of the transaction. In EIP-1559 (London fork) networks, it will be set as both maxFeePerGas and maxPriorityFeePerGas. + GasPrice *string `json:"gasPrice,omitempty"` +} + +// NewGasTransactionConfigLegacy instantiates a new GasTransactionConfigLegacy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGasTransactionConfigLegacy() *GasTransactionConfigLegacy { + this := GasTransactionConfigLegacy{} + return &this +} + +// NewGasTransactionConfigLegacyWithDefaults instantiates a new GasTransactionConfigLegacy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGasTransactionConfigLegacyWithDefaults() *GasTransactionConfigLegacy { + this := GasTransactionConfigLegacy{} + return &this +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *GasTransactionConfigLegacy) GetGas() string { + if o == nil || isNil(o.Gas) { + var ret string + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigLegacy) GetGasOk() (*string, bool) { + if o == nil || isNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *GasTransactionConfigLegacy) HasGas() bool { + if o != nil && !isNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given string and assigns it to the Gas field. +func (o *GasTransactionConfigLegacy) SetGas(v string) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *GasTransactionConfigLegacy) GetGasPrice() string { + if o == nil || isNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigLegacy) GetGasPriceOk() (*string, bool) { + if o == nil || isNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *GasTransactionConfigLegacy) HasGasPrice() bool { + if o != nil && !isNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *GasTransactionConfigLegacy) SetGasPrice(v string) { + o.GasPrice = &v +} + +func (o GasTransactionConfigLegacy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GasTransactionConfigLegacy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !isNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + return toSerialize, nil +} + +type NullableGasTransactionConfigLegacy struct { + value *GasTransactionConfigLegacy + isSet bool +} + +func (v NullableGasTransactionConfigLegacy) Get() *GasTransactionConfigLegacy { + return v.value +} + +func (v *NullableGasTransactionConfigLegacy) Set(val *GasTransactionConfigLegacy) { + v.value = val + v.isSet = true +} + +func (v NullableGasTransactionConfigLegacy) IsSet() bool { + return v.isSet +} + +func (v *NullableGasTransactionConfigLegacy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasTransactionConfigLegacy(val *GasTransactionConfigLegacy) *NullableGasTransactionConfigLegacy { + return &NullableGasTransactionConfigLegacy{value: val, isSet: true} +} + +func (v NullableGasTransactionConfigLegacy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasTransactionConfigLegacy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go new file mode 100644 index 0000000000..6a6e7522d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go @@ -0,0 +1,404 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the 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 *string `json:"value,omitempty"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` + Nonce *string `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() 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 *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) SetValue(v string) { + o.Value = &v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) 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 *InvokeContractJsonObjectV1Request) SetNonce(v string) { + 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.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + 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-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 0000000000..5e44a9df23 --- /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,405 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // 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 *string `json:"value,omitempty"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` + Nonce *string `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() 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 +} + +// 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 +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) 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 *InvokeContractV1Request) 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 *InvokeContractV1Request) 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 *InvokeContractV1Request) SetNonce(v string) { + 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.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + 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-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 0000000000..c93d45ba61 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || isNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || isNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !isNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || isNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && isNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go new file mode 100644 index 0000000000..8a971410eb --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Request{} + +// InvokeRawWeb3EthContractV1Request struct for InvokeRawWeb3EthContractV1Request +type InvokeRawWeb3EthContractV1Request struct { + // The application binary interface of the solidity contract + Abi interface{} `json:"abi"` + // Deployed solidity contract address + Address string `json:"address"` + InvocationType EthContractInvocationWeb3Method `json:"invocationType"` + // The list of arguments for contract invocation method (send, call, etc...) + InvocationParams map[string]interface{} `json:"invocationParams,omitempty"` + // Method of deployed solidity contract to execute + ContractMethod string `json:"contractMethod"` + // The list of arguments for deployed solidity contract method + ContractMethodArgs []interface{} `json:"contractMethodArgs,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Request instantiates a new InvokeRawWeb3EthContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Request(abi interface{}, address string, invocationType EthContractInvocationWeb3Method, contractMethod string) *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + this.Abi = abi + this.Address = address + this.InvocationType = invocationType + this.ContractMethod = contractMethod + return &this +} + +// NewInvokeRawWeb3EthContractV1RequestWithDefaults instantiates a new InvokeRawWeb3EthContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1RequestWithDefaults() *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + return &this +} + +// GetAbi returns the Abi field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *InvokeRawWeb3EthContractV1Request) GetAbi() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthContractV1Request) GetAbiOk() (*interface{}, bool) { + if o == nil || isNil(o.Abi) { + return nil, false + } + return &o.Abi, true +} + +// SetAbi sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAbi(v interface{}) { + o.Abi = v +} + +// GetAddress returns the Address field value +func (o *InvokeRawWeb3EthContractV1Request) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAddress(v string) { + o.Address = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationType() EthContractInvocationWeb3Method { + if o == nil { + var ret EthContractInvocationWeb3Method + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationTypeOk() (*EthContractInvocationWeb3Method, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationType(v EthContractInvocationWeb3Method) { + o.InvocationType = v +} + +// GetInvocationParams returns the InvocationParams field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParams() map[string]interface{} { + if o == nil || isNil(o.InvocationParams) { + var ret map[string]interface{} + return ret + } + return o.InvocationParams +} + +// GetInvocationParamsOk returns a tuple with the InvocationParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParamsOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.InvocationParams) { + return map[string]interface{}{}, false + } + return o.InvocationParams, true +} + +// HasInvocationParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasInvocationParams() bool { + if o != nil && !isNil(o.InvocationParams) { + return true + } + + return false +} + +// SetInvocationParams gets a reference to the given map[string]interface{} and assigns it to the InvocationParams field. +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationParams(v map[string]interface{}) { + o.InvocationParams = v +} + +// GetContractMethod returns the ContractMethod field value +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethod() string { + if o == nil { + var ret string + return ret + } + + return o.ContractMethod +} + +// GetContractMethodOk returns a tuple with the ContractMethod field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractMethod, true +} + +// SetContractMethod sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethod(v string) { + o.ContractMethod = v +} + +// GetContractMethodArgs returns the ContractMethodArgs field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgs() []interface{} { + if o == nil || isNil(o.ContractMethodArgs) { + var ret []interface{} + return ret + } + return o.ContractMethodArgs +} + +// GetContractMethodArgsOk returns a tuple with the ContractMethodArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgsOk() ([]interface{}, bool) { + if o == nil || isNil(o.ContractMethodArgs) { + return nil, false + } + return o.ContractMethodArgs, true +} + +// HasContractMethodArgs returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasContractMethodArgs() bool { + if o != nil && !isNil(o.ContractMethodArgs) { + return true + } + + return false +} + +// SetContractMethodArgs gets a reference to the given []interface{} and assigns it to the ContractMethodArgs field. +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethodArgs(v []interface{}) { + o.ContractMethodArgs = v +} + +func (o InvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Abi != nil { + toSerialize["abi"] = o.Abi + } + toSerialize["address"] = o.Address + toSerialize["invocationType"] = o.InvocationType + if !isNil(o.InvocationParams) { + toSerialize["invocationParams"] = o.InvocationParams + } + toSerialize["contractMethod"] = o.ContractMethod + if !isNil(o.ContractMethodArgs) { + toSerialize["contractMethodArgs"] = o.ContractMethodArgs + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Request struct { + value *InvokeRawWeb3EthContractV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Request) Get() *InvokeRawWeb3EthContractV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Set(val *InvokeRawWeb3EthContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Request(val *InvokeRawWeb3EthContractV1Request) *NullableInvokeRawWeb3EthContractV1Request { + return &NullableInvokeRawWeb3EthContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go new file mode 100644 index 0000000000..8a82ffb632 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Response{} + +// InvokeRawWeb3EthContractV1Response struct for InvokeRawWeb3EthContractV1Response +type InvokeRawWeb3EthContractV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of contract invocation method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Response instantiates a new InvokeRawWeb3EthContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Response(status float32) *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthContractV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1ResponseWithDefaults() *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthContractV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthContractV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthContractV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthContractV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasData() bool { + if o != nil && isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthContractV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetail() string { + if o == nil || isNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || isNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasErrorDetail() bool { + if o != nil && !isNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthContractV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !isNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Response struct { + value *InvokeRawWeb3EthContractV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Response) Get() *InvokeRawWeb3EthContractV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Set(val *InvokeRawWeb3EthContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Response(val *InvokeRawWeb3EthContractV1Response) *NullableInvokeRawWeb3EthContractV1Response { + return &NullableInvokeRawWeb3EthContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go new file mode 100644 index 0000000000..e8b30ac9c5 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Request{} + +// InvokeRawWeb3EthMethodV1Request struct for InvokeRawWeb3EthMethodV1Request +type InvokeRawWeb3EthMethodV1Request struct { + // The name of the web3.eth method to invoke + MethodName string `json:"methodName"` + // The list of arguments to pass to web3.eth method specified in methodName + Params []interface{} `json:"params,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Request instantiates a new InvokeRawWeb3EthMethodV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Request(methodName string) *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + this.MethodName = methodName + return &this +} + +// NewInvokeRawWeb3EthMethodV1RequestWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1RequestWithDefaults() *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + return &this +} + +// GetMethodName returns the MethodName field value +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeRawWeb3EthMethodV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Request) GetParams() []interface{} { + if o == nil || isNil(o.Params) { + var ret []interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil || isNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Request) HasParams() bool { + if o != nil && !isNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []interface{} and assigns it to the Params field. +func (o *InvokeRawWeb3EthMethodV1Request) SetParams(v []interface{}) { + o.Params = v +} + +func (o InvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["methodName"] = o.MethodName + if !isNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Request struct { + value *InvokeRawWeb3EthMethodV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) Get() *InvokeRawWeb3EthMethodV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Set(val *InvokeRawWeb3EthMethodV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Request(val *InvokeRawWeb3EthMethodV1Request) *NullableInvokeRawWeb3EthMethodV1Request { + return &NullableInvokeRawWeb3EthMethodV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go new file mode 100644 index 0000000000..4a179dcb77 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Response{} + +// InvokeRawWeb3EthMethodV1Response struct for InvokeRawWeb3EthMethodV1Response +type InvokeRawWeb3EthMethodV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of requested web3.eth method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Response instantiates a new InvokeRawWeb3EthMethodV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Response(status float32) *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthMethodV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1ResponseWithDefaults() *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthMethodV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthMethodV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthMethodV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthMethodV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasData() bool { + if o != nil && isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthMethodV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetail() string { + if o == nil || isNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || isNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasErrorDetail() bool { + if o != nil && !isNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthMethodV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !isNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Response struct { + value *InvokeRawWeb3EthMethodV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) Get() *InvokeRawWeb3EthMethodV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Set(val *InvokeRawWeb3EthMethodV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Response(val *InvokeRawWeb3EthMethodV1Response) *NullableInvokeRawWeb3EthMethodV1Response { + return &NullableInvokeRawWeb3EthMethodV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 0000000000..1243619525 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig EthereumTransactionConfig `json:"transactionConfig"` + // The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig EthereumTransactionConfig) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionRequest) GetTransactionConfig() EthereumTransactionConfig { + if o == nil { + var ret EthereumTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTransactionConfigOk() (*EthereumTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v EthereumTransactionConfig) { + o.TransactionConfig = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetTimeoutMs() float32 { + if o == nil || isNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTimeoutMsOk() (*float32, bool) { + if o == nil || isNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasTimeoutMs() bool { + if o != nil && !isNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *RunTransactionRequest) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + if !isNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 0000000000..7585133d8d --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 0000000000..3afe5c631d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the 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-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 0000000000..45797da92d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the 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-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 0000000000..9bf3631c60 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the 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-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 0000000000..70cb437130 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the 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-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 0000000000..75eb3abfbd --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Error", + "org.hyperledger.cactus.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 0000000000..9c17c28a4f --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1BlockData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1BlockData{} + +// WatchBlocksV1BlockData struct for WatchBlocksV1BlockData +type WatchBlocksV1BlockData struct { + Number string `json:"number"` + Hash *string `json:"hash,omitempty"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom *string `json:"logsBloom,omitempty"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot string `json:"stateRoot"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit string `json:"gasLimit"` + GasUsed string `json:"gasUsed"` + Timestamp WatchBlocksV1BlockDataTimestamp `json:"timestamp"` + Size string `json:"size"` + TotalDifficulty string `json:"totalDifficulty"` + Uncles []string `json:"uncles"` + BaseFeePerGas *string `json:"baseFeePerGas,omitempty"` + Transactions []Web3Transaction `json:"transactions"` +} + +// NewWatchBlocksV1BlockData instantiates a new WatchBlocksV1BlockData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1BlockData(number string, parentHash string, nonce string, sha3Uncles string, stateRoot string, miner string, extraData string, gasLimit string, gasUsed string, timestamp WatchBlocksV1BlockDataTimestamp, size string, totalDifficulty string, uncles []string, transactions []Web3Transaction) *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + this.Number = number + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.StateRoot = stateRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + this.Size = size + this.TotalDifficulty = totalDifficulty + this.Uncles = uncles + this.Transactions = transactions + return &this +} + +// NewWatchBlocksV1BlockDataWithDefaults instantiates a new WatchBlocksV1BlockData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1BlockDataWithDefaults() *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + return &this +} + +// GetNumber returns the Number field value +func (o *WatchBlocksV1BlockData) GetNumber() string { + if o == nil { + var ret string + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *WatchBlocksV1BlockData) SetNumber(v string) { + o.Number = v +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetHash() string { + if o == nil || isNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetHashOk() (*string, bool) { + if o == nil || isNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasHash() bool { + if o != nil && !isNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *WatchBlocksV1BlockData) SetHash(v string) { + o.Hash = &v +} + +// GetParentHash returns the ParentHash field value +func (o *WatchBlocksV1BlockData) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *WatchBlocksV1BlockData) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *WatchBlocksV1BlockData) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *WatchBlocksV1BlockData) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *WatchBlocksV1BlockData) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *WatchBlocksV1BlockData) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetLogsBloom() string { + if o == nil || isNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetLogsBloomOk() (*string, bool) { + if o == nil || isNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasLogsBloom() bool { + if o != nil && !isNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *WatchBlocksV1BlockData) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetTransactionsRoot() string { + if o == nil || isNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsRootOk() (*string, bool) { + if o == nil || isNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasTransactionsRoot() bool { + if o != nil && !isNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *WatchBlocksV1BlockData) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value +func (o *WatchBlocksV1BlockData) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *WatchBlocksV1BlockData) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetReceiptsRoot() string { + if o == nil || isNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetReceiptsRootOk() (*string, bool) { + if o == nil || isNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasReceiptsRoot() bool { + if o != nil && !isNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *WatchBlocksV1BlockData) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetDifficulty() string { + if o == nil || isNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetDifficultyOk() (*string, bool) { + if o == nil || isNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasDifficulty() bool { + if o != nil && !isNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *WatchBlocksV1BlockData) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetMixHash() string { + if o == nil || isNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMixHashOk() (*string, bool) { + if o == nil || isNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasMixHash() bool { + if o != nil && !isNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *WatchBlocksV1BlockData) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value +func (o *WatchBlocksV1BlockData) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *WatchBlocksV1BlockData) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *WatchBlocksV1BlockData) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *WatchBlocksV1BlockData) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *WatchBlocksV1BlockData) GetGasLimit() string { + if o == nil { + var ret string + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasLimitOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *WatchBlocksV1BlockData) SetGasLimit(v string) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *WatchBlocksV1BlockData) GetGasUsed() string { + if o == nil { + var ret string + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasUsedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *WatchBlocksV1BlockData) SetGasUsed(v string) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *WatchBlocksV1BlockData) GetTimestamp() WatchBlocksV1BlockDataTimestamp { + if o == nil { + var ret WatchBlocksV1BlockDataTimestamp + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTimestampOk() (*WatchBlocksV1BlockDataTimestamp, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *WatchBlocksV1BlockData) SetTimestamp(v WatchBlocksV1BlockDataTimestamp) { + o.Timestamp = v +} + +// GetSize returns the Size field value +func (o *WatchBlocksV1BlockData) GetSize() string { + if o == nil { + var ret string + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSizeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *WatchBlocksV1BlockData) SetSize(v string) { + o.Size = v +} + +// GetTotalDifficulty returns the TotalDifficulty field value +func (o *WatchBlocksV1BlockData) GetTotalDifficulty() string { + if o == nil { + var ret string + return ret + } + + return o.TotalDifficulty +} + +// GetTotalDifficultyOk returns a tuple with the TotalDifficulty field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTotalDifficultyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TotalDifficulty, true +} + +// SetTotalDifficulty sets field value +func (o *WatchBlocksV1BlockData) SetTotalDifficulty(v string) { + o.TotalDifficulty = v +} + +// GetUncles returns the Uncles field value +func (o *WatchBlocksV1BlockData) GetUncles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Uncles +} + +// GetUnclesOk returns a tuple with the Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetUnclesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Uncles, true +} + +// SetUncles sets field value +func (o *WatchBlocksV1BlockData) SetUncles(v []string) { + o.Uncles = v +} + +// GetBaseFeePerGas returns the BaseFeePerGas field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetBaseFeePerGas() string { + if o == nil || isNil(o.BaseFeePerGas) { + var ret string + return ret + } + return *o.BaseFeePerGas +} + +// GetBaseFeePerGasOk returns a tuple with the BaseFeePerGas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetBaseFeePerGasOk() (*string, bool) { + if o == nil || isNil(o.BaseFeePerGas) { + return nil, false + } + return o.BaseFeePerGas, true +} + +// HasBaseFeePerGas returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasBaseFeePerGas() bool { + if o != nil && !isNil(o.BaseFeePerGas) { + return true + } + + return false +} + +// SetBaseFeePerGas gets a reference to the given string and assigns it to the BaseFeePerGas field. +func (o *WatchBlocksV1BlockData) SetBaseFeePerGas(v string) { + o.BaseFeePerGas = &v +} + +// GetTransactions returns the Transactions field value +func (o *WatchBlocksV1BlockData) GetTransactions() []Web3Transaction { + if o == nil { + var ret []Web3Transaction + return ret + } + + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsOk() ([]Web3Transaction, bool) { + if o == nil { + return nil, false + } + return o.Transactions, true +} + +// SetTransactions sets field value +func (o *WatchBlocksV1BlockData) SetTransactions(v []Web3Transaction) { + o.Transactions = v +} + +func (o WatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1BlockData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + if !isNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + if !isNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !isNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + toSerialize["stateRoot"] = o.StateRoot + if !isNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !isNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !isNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + toSerialize["size"] = o.Size + toSerialize["totalDifficulty"] = o.TotalDifficulty + toSerialize["uncles"] = o.Uncles + if !isNil(o.BaseFeePerGas) { + toSerialize["baseFeePerGas"] = o.BaseFeePerGas + } + toSerialize["transactions"] = o.Transactions + return toSerialize, nil +} + +type NullableWatchBlocksV1BlockData struct { + value *WatchBlocksV1BlockData + isSet bool +} + +func (v NullableWatchBlocksV1BlockData) Get() *WatchBlocksV1BlockData { + return v.value +} + +func (v *NullableWatchBlocksV1BlockData) Set(val *WatchBlocksV1BlockData) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1BlockData) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1BlockData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1BlockData(val *WatchBlocksV1BlockData) *NullableWatchBlocksV1BlockData { + return &NullableWatchBlocksV1BlockData{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1BlockData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data_timestamp.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data_timestamp.go new file mode 100644 index 0000000000..5d114414c9 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1BlockDataTimestamp - struct for WatchBlocksV1BlockDataTimestamp +type WatchBlocksV1BlockDataTimestamp struct { + Float32 *float32 + String *string +} + +// float32AsWatchBlocksV1BlockDataTimestamp is a convenience function that returns float32 wrapped in WatchBlocksV1BlockDataTimestamp +func Float32AsWatchBlocksV1BlockDataTimestamp(v *float32) WatchBlocksV1BlockDataTimestamp { + return WatchBlocksV1BlockDataTimestamp{ + Float32: v, + } +} + +// stringAsWatchBlocksV1BlockDataTimestamp is a convenience function that returns string wrapped in WatchBlocksV1BlockDataTimestamp +func StringAsWatchBlocksV1BlockDataTimestamp(v *string) WatchBlocksV1BlockDataTimestamp { + return WatchBlocksV1BlockDataTimestamp{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksV1BlockDataTimestamp) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksV1BlockDataTimestamp)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksV1BlockDataTimestamp)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksV1BlockDataTimestamp) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksV1BlockDataTimestamp) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksV1BlockDataTimestamp struct { + value *WatchBlocksV1BlockDataTimestamp + isSet bool +} + +func (v NullableWatchBlocksV1BlockDataTimestamp) Get() *WatchBlocksV1BlockDataTimestamp { + return v.value +} + +func (v *NullableWatchBlocksV1BlockDataTimestamp) Set(val *WatchBlocksV1BlockDataTimestamp) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1BlockDataTimestamp) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1BlockDataTimestamp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1BlockDataTimestamp(val *WatchBlocksV1BlockDataTimestamp) *NullableWatchBlocksV1BlockDataTimestamp { + return &NullableWatchBlocksV1BlockDataTimestamp{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1BlockDataTimestamp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1BlockDataTimestamp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go new file mode 100644 index 0000000000..6c2ef48159 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Options type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Options{} + +// WatchBlocksV1Options struct for WatchBlocksV1Options +type WatchBlocksV1Options struct { + GetBlockData *bool `json:"getBlockData,omitempty"` +} + +// NewWatchBlocksV1Options instantiates a new WatchBlocksV1Options object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1Options() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// NewWatchBlocksV1OptionsWithDefaults instantiates a new WatchBlocksV1Options object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1OptionsWithDefaults() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// GetGetBlockData returns the GetBlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetGetBlockData() bool { + if o == nil || isNil(o.GetBlockData) { + var ret bool + return ret + } + return *o.GetBlockData +} + +// GetGetBlockDataOk returns a tuple with the GetBlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetGetBlockDataOk() (*bool, bool) { + if o == nil || isNil(o.GetBlockData) { + return nil, false + } + return o.GetBlockData, true +} + +// HasGetBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasGetBlockData() bool { + if o != nil && !isNil(o.GetBlockData) { + return true + } + + return false +} + +// SetGetBlockData gets a reference to the given bool and assigns it to the GetBlockData field. +func (o *WatchBlocksV1Options) SetGetBlockData(v bool) { + o.GetBlockData = &v +} + +func (o WatchBlocksV1Options) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Options) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.GetBlockData) { + toSerialize["getBlockData"] = o.GetBlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Options struct { + value *WatchBlocksV1Options + isSet bool +} + +func (v NullableWatchBlocksV1Options) Get() *WatchBlocksV1Options { + return v.value +} + +func (v *NullableWatchBlocksV1Options) Set(val *WatchBlocksV1Options) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Options) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Options) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Options(val *WatchBlocksV1Options) *NullableWatchBlocksV1Options { + return &NullableWatchBlocksV1Options{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Options) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Options) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 0000000000..c52db763ca --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Progress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Progress{} + +// WatchBlocksV1Progress struct for WatchBlocksV1Progress +type WatchBlocksV1Progress struct { + BlockHeader *Web3BlockHeader `json:"blockHeader,omitempty"` + BlockData *WatchBlocksV1BlockData `json:"blockData,omitempty"` +} + +// NewWatchBlocksV1Progress instantiates a new WatchBlocksV1Progress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1Progress() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// NewWatchBlocksV1ProgressWithDefaults instantiates a new WatchBlocksV1Progress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// GetBlockHeader returns the BlockHeader field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader { + if o == nil || isNil(o.BlockHeader) { + var ret Web3BlockHeader + return ret + } + return *o.BlockHeader +} + +// GetBlockHeaderOk returns a tuple with the BlockHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool) { + if o == nil || isNil(o.BlockHeader) { + return nil, false + } + return o.BlockHeader, true +} + +// HasBlockHeader returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockHeader() bool { + if o != nil && !isNil(o.BlockHeader) { + return true + } + + return false +} + +// SetBlockHeader gets a reference to the given Web3BlockHeader and assigns it to the BlockHeader field. +func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader) { + o.BlockHeader = &v +} + +// GetBlockData returns the BlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockData() WatchBlocksV1BlockData { + if o == nil || isNil(o.BlockData) { + var ret WatchBlocksV1BlockData + return ret + } + return *o.BlockData +} + +// GetBlockDataOk returns a tuple with the BlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockDataOk() (*WatchBlocksV1BlockData, bool) { + if o == nil || isNil(o.BlockData) { + return nil, false + } + return o.BlockData, true +} + +// HasBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockData() bool { + if o != nil && !isNil(o.BlockData) { + return true + } + + return false +} + +// SetBlockData gets a reference to the given WatchBlocksV1BlockData and assigns it to the BlockData field. +func (o *WatchBlocksV1Progress) SetBlockData(v WatchBlocksV1BlockData) { + o.BlockData = &v +} + +func (o WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Progress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BlockHeader) { + toSerialize["blockHeader"] = o.BlockHeader + } + if !isNil(o.BlockData) { + toSerialize["blockData"] = o.BlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_block_header.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_block_header.go new file mode 100644 index 0000000000..42147a10be --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3BlockHeader type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3BlockHeader{} + +// Web3BlockHeader struct for Web3BlockHeader +type Web3BlockHeader struct { + Number *string `json:"number,omitempty"` + ParentHash *string `json:"parentHash,omitempty"` + Sha3Uncles string `json:"sha3Uncles"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner *string `json:"miner,omitempty"` + GasLimit string `json:"gasLimit"` + GasUsed string `json:"gasUsed"` + StateRoot *string `json:"stateRoot,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + ExtraData *string `json:"extraData,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +// NewWeb3BlockHeader instantiates a new Web3BlockHeader object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3BlockHeader(sha3Uncles string, gasLimit string, gasUsed string) *Web3BlockHeader { + this := Web3BlockHeader{} + this.Sha3Uncles = sha3Uncles + this.GasLimit = gasLimit + this.GasUsed = gasUsed + return &this +} + +// NewWeb3BlockHeaderWithDefaults instantiates a new Web3BlockHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader { + this := Web3BlockHeader{} + return &this +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetNumber() string { + if o == nil || isNil(o.Number) { + var ret string + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNumberOk() (*string, bool) { + if o == nil || isNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasNumber() bool { + if o != nil && !isNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given string and assigns it to the Number field. +func (o *Web3BlockHeader) SetNumber(v string) { + o.Number = &v +} + +// GetParentHash returns the ParentHash field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetParentHash() string { + if o == nil || isNil(o.ParentHash) { + var ret string + return ret + } + return *o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetParentHashOk() (*string, bool) { + if o == nil || isNil(o.ParentHash) { + return nil, false + } + return o.ParentHash, true +} + +// HasParentHash returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasParentHash() bool { + if o != nil && !isNil(o.ParentHash) { + return true + } + + return false +} + +// SetParentHash gets a reference to the given string and assigns it to the ParentHash field. +func (o *Web3BlockHeader) SetParentHash(v string) { + o.ParentHash = &v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *Web3BlockHeader) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *Web3BlockHeader) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetTransactionsRoot() string { + if o == nil || isNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTransactionsRootOk() (*string, bool) { + if o == nil || isNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasTransactionsRoot() bool { + if o != nil && !isNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *Web3BlockHeader) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetReceiptsRoot() string { + if o == nil || isNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetReceiptsRootOk() (*string, bool) { + if o == nil || isNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasReceiptsRoot() bool { + if o != nil && !isNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *Web3BlockHeader) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetDifficulty() string { + if o == nil || isNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetDifficultyOk() (*string, bool) { + if o == nil || isNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasDifficulty() bool { + if o != nil && !isNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *Web3BlockHeader) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetMixHash() string { + if o == nil || isNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMixHashOk() (*string, bool) { + if o == nil || isNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasMixHash() bool { + if o != nil && !isNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *Web3BlockHeader) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetMiner() string { + if o == nil || isNil(o.Miner) { + var ret string + return ret + } + return *o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMinerOk() (*string, bool) { + if o == nil || isNil(o.Miner) { + return nil, false + } + return o.Miner, true +} + +// HasMiner returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasMiner() bool { + if o != nil && !isNil(o.Miner) { + return true + } + + return false +} + +// SetMiner gets a reference to the given string and assigns it to the Miner field. +func (o *Web3BlockHeader) SetMiner(v string) { + o.Miner = &v +} + +// GetGasLimit returns the GasLimit field value +func (o *Web3BlockHeader) GetGasLimit() string { + if o == nil { + var ret string + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasLimitOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *Web3BlockHeader) SetGasLimit(v string) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3BlockHeader) GetGasUsed() string { + if o == nil { + var ret string + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasUsedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3BlockHeader) SetGasUsed(v string) { + o.GasUsed = v +} + +// GetStateRoot returns the StateRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetStateRoot() string { + if o == nil || isNil(o.StateRoot) { + var ret string + return ret + } + return *o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetStateRootOk() (*string, bool) { + if o == nil || isNil(o.StateRoot) { + return nil, false + } + return o.StateRoot, true +} + +// HasStateRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasStateRoot() bool { + if o != nil && !isNil(o.StateRoot) { + return true + } + + return false +} + +// SetStateRoot gets a reference to the given string and assigns it to the StateRoot field. +func (o *Web3BlockHeader) SetStateRoot(v string) { + o.StateRoot = &v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetLogsBloom() string { + if o == nil || isNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool) { + if o == nil || isNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasLogsBloom() bool { + if o != nil && !isNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *Web3BlockHeader) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetExtraData returns the ExtraData field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetExtraData() string { + if o == nil || isNil(o.ExtraData) { + var ret string + return ret + } + return *o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool) { + if o == nil || isNil(o.ExtraData) { + return nil, false + } + return o.ExtraData, true +} + +// HasExtraData returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasExtraData() bool { + if o != nil && !isNil(o.ExtraData) { + return true + } + + return false +} + +// SetExtraData gets a reference to the given string and assigns it to the ExtraData field. +func (o *Web3BlockHeader) SetExtraData(v string) { + o.ExtraData = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetNonce() string { + if o == nil || isNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNonceOk() (*string, bool) { + if o == nil || isNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasNonce() bool { + if o != nil && !isNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *Web3BlockHeader) SetNonce(v string) { + o.Nonce = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetTimestamp() string { + if o == nil || isNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTimestampOk() (*string, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *Web3BlockHeader) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o Web3BlockHeader) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3BlockHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Number) { + toSerialize["number"] = o.Number + } + if !isNil(o.ParentHash) { + toSerialize["parentHash"] = o.ParentHash + } + toSerialize["sha3Uncles"] = o.Sha3Uncles + if !isNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + if !isNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !isNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !isNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + if !isNil(o.Miner) { + toSerialize["miner"] = o.Miner + } + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + if !isNil(o.StateRoot) { + toSerialize["stateRoot"] = o.StateRoot + } + if !isNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !isNil(o.ExtraData) { + toSerialize["extraData"] = o.ExtraData + } + if !isNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableWeb3BlockHeader struct { + value *Web3BlockHeader + isSet bool +} + +func (v NullableWeb3BlockHeader) Get() *Web3BlockHeader { + return v.value +} + +func (v *NullableWeb3BlockHeader) Set(val *Web3BlockHeader) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeader(val *Web3BlockHeader) *NullableWeb3BlockHeader { + return &NullableWeb3BlockHeader{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..b473e0be9f --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialGethKeychainPassword *Web3SigningCredentialGethKeychainPassword + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialGethKeychainPassword wrapped in Web3SigningCredential +func Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential(v *Web3SigningCredentialGethKeychainPassword) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialGethKeychainPassword: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialGethKeychainPassword + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialGethKeychainPassword) + if err == nil { + jsonWeb3SigningCredentialGethKeychainPassword, _ := json.Marshal(dst.Web3SigningCredentialGethKeychainPassword) + if string(jsonWeb3SigningCredentialGethKeychainPassword) == "{}" { // empty struct + dst.Web3SigningCredentialGethKeychainPassword = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialGethKeychainPassword = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialGethKeychainPassword = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialGethKeychainPassword != nil { + return json.Marshal(&src.Web3SigningCredentialGethKeychainPassword) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialGethKeychainPassword != nil { + return obj.Web3SigningCredentialGethKeychainPassword + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..291b057c87 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,210 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId *string `json:"keychainId,omitempty"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value if set, zero value otherwise. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil || isNil(o.KeychainId) { + var ret string + return ret + } + return *o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil || isNil(o.KeychainId) { + return nil, false + } + return o.KeychainId, true +} + +// HasKeychainId returns a boolean if a field has been set. +func (o *Web3SigningCredentialCactusKeychainRef) HasKeychainId() bool { + if o != nil && !isNil(o.KeychainId) { + return true + } + + return false +} + +// SetKeychainId gets a reference to the given string and assigns it to the KeychainId field. +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = &v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + if !isNil(o.KeychainId) { + toSerialize["keychainId"] = o.KeychainId + } + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-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 0000000000..b0143e8192 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialGethKeychainPassword type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialGethKeychainPassword{} + +// Web3SigningCredentialGethKeychainPassword struct for Web3SigningCredentialGethKeychainPassword +type Web3SigningCredentialGethKeychainPassword struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // A geth keychain unlock password. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialGethKeychainPassword instantiates a new Web3SigningCredentialGethKeychainPassword object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialGethKeychainPassword(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialGethKeychainPasswordWithDefaults instantiates a new Web3SigningCredentialGethKeychainPassword object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialGethKeychainPasswordWithDefaults() *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialGethKeychainPassword) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialGethKeychainPassword) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialGethKeychainPassword) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialGethKeychainPassword struct { + value *Web3SigningCredentialGethKeychainPassword + isSet bool +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) Get() *Web3SigningCredentialGethKeychainPassword { + return v.value +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Set(val *Web3SigningCredentialGethKeychainPassword) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialGethKeychainPassword(val *Web3SigningCredentialGethKeychainPassword) *NullableWeb3SigningCredentialGethKeychainPassword { + return &NullableWeb3SigningCredentialGethKeychainPassword{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..7addd02b5e --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..fb401981d8 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..8f7ed33f73 --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + 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-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 0000000000..d020acfaea --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3Transaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3Transaction{} + +// Web3Transaction struct for Web3Transaction +type Web3Transaction struct { + Hash string `json:"hash"` + Nonce string `json:"nonce"` + BlockHash string `json:"blockHash"` + BlockNumber string `json:"blockNumber"` + TransactionIndex string `json:"transactionIndex"` + From string `json:"from"` + To string `json:"to"` + Value string `json:"value"` + GasPrice string `json:"gasPrice"` + Gas string `json:"gas"` + Input string `json:"input"` + Type string `json:"type"` + ChainId string `json:"chainId"` + V *string `json:"v,omitempty"` + R *string `json:"r,omitempty"` + S *string `json:"s,omitempty"` +} + +// NewWeb3Transaction instantiates a new Web3Transaction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3Transaction(hash string, nonce string, blockHash string, blockNumber string, transactionIndex string, from string, to string, value string, gasPrice string, gas string, input string, type_ string, chainId string) *Web3Transaction { + this := Web3Transaction{} + this.Hash = hash + this.Nonce = nonce + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.TransactionIndex = transactionIndex + this.From = from + this.To = to + this.Value = value + this.GasPrice = gasPrice + this.Gas = gas + this.Input = input + this.Type = type_ + this.ChainId = chainId + return &this +} + +// NewWeb3TransactionWithDefaults instantiates a new Web3Transaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionWithDefaults() *Web3Transaction { + this := Web3Transaction{} + return &this +} + +// GetHash returns the Hash field value +func (o *Web3Transaction) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3Transaction) SetHash(v string) { + o.Hash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3Transaction) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3Transaction) SetNonce(v string) { + o.Nonce = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3Transaction) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3Transaction) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3Transaction) GetBlockNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetBlockNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3Transaction) SetBlockNumber(v string) { + o.BlockNumber = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3Transaction) GetTransactionIndex() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetTransactionIndexOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3Transaction) SetTransactionIndex(v string) { + o.TransactionIndex = v +} + +// GetFrom returns the From field value +func (o *Web3Transaction) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3Transaction) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3Transaction) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3Transaction) SetTo(v string) { + o.To = v +} + +// GetValue returns the Value field value +func (o *Web3Transaction) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Web3Transaction) SetValue(v string) { + o.Value = v +} + +// GetGasPrice returns the GasPrice field value +func (o *Web3Transaction) GetGasPrice() string { + if o == nil { + var ret string + return ret + } + + return o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasPriceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasPrice, true +} + +// SetGasPrice sets field value +func (o *Web3Transaction) SetGasPrice(v string) { + o.GasPrice = v +} + +// GetGas returns the Gas field value +func (o *Web3Transaction) GetGas() string { + if o == nil { + var ret string + return ret + } + + return o.Gas +} + +// GetGasOk returns a tuple with the Gas field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Gas, true +} + +// SetGas sets field value +func (o *Web3Transaction) SetGas(v string) { + o.Gas = v +} + +// GetInput returns the Input field value +func (o *Web3Transaction) GetInput() string { + if o == nil { + var ret string + return ret + } + + return o.Input +} + +// GetInputOk returns a tuple with the Input field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetInputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *Web3Transaction) SetInput(v string) { + o.Input = v +} + +// GetType returns the Type field value +func (o *Web3Transaction) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3Transaction) SetType(v string) { + o.Type = v +} + +// GetChainId returns the ChainId field value +func (o *Web3Transaction) GetChainId() string { + if o == nil { + var ret string + return ret + } + + return o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetChainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainId, true +} + +// SetChainId sets field value +func (o *Web3Transaction) SetChainId(v string) { + o.ChainId = v +} + +// GetV returns the V field value if set, zero value otherwise. +func (o *Web3Transaction) GetV() string { + if o == nil || isNil(o.V) { + var ret string + return ret + } + return *o.V +} + +// GetVOk returns a tuple with the V field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetVOk() (*string, bool) { + if o == nil || isNil(o.V) { + return nil, false + } + return o.V, true +} + +// HasV returns a boolean if a field has been set. +func (o *Web3Transaction) HasV() bool { + if o != nil && !isNil(o.V) { + return true + } + + return false +} + +// SetV gets a reference to the given string and assigns it to the V field. +func (o *Web3Transaction) SetV(v string) { + o.V = &v +} + +// GetR returns the R field value if set, zero value otherwise. +func (o *Web3Transaction) GetR() string { + if o == nil || isNil(o.R) { + var ret string + return ret + } + return *o.R +} + +// GetROk returns a tuple with the R field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetROk() (*string, bool) { + if o == nil || isNil(o.R) { + return nil, false + } + return o.R, true +} + +// HasR returns a boolean if a field has been set. +func (o *Web3Transaction) HasR() bool { + if o != nil && !isNil(o.R) { + return true + } + + return false +} + +// SetR gets a reference to the given string and assigns it to the R field. +func (o *Web3Transaction) SetR(v string) { + o.R = &v +} + +// GetS returns the S field value if set, zero value otherwise. +func (o *Web3Transaction) GetS() string { + if o == nil || isNil(o.S) { + var ret string + return ret + } + return *o.S +} + +// GetSOk returns a tuple with the S field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetSOk() (*string, bool) { + if o == nil || isNil(o.S) { + return nil, false + } + return o.S, true +} + +// HasS returns a boolean if a field has been set. +func (o *Web3Transaction) HasS() bool { + if o != nil && !isNil(o.S) { + return true + } + + return false +} + +// SetS gets a reference to the given string and assigns it to the S field. +func (o *Web3Transaction) SetS(v string) { + o.S = &v +} + +func (o Web3Transaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["nonce"] = o.Nonce + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["from"] = o.From + toSerialize["to"] = o.To + toSerialize["value"] = o.Value + toSerialize["gasPrice"] = o.GasPrice + toSerialize["gas"] = o.Gas + toSerialize["input"] = o.Input + toSerialize["type"] = o.Type + toSerialize["chainId"] = o.ChainId + if !isNil(o.V) { + toSerialize["v"] = o.V + } + if !isNil(o.R) { + toSerialize["r"] = o.R + } + if !isNil(o.S) { + toSerialize["s"] = o.S + } + return toSerialize, nil +} + +type NullableWeb3Transaction struct { + value *Web3Transaction + isSet bool +} + +func (v NullableWeb3Transaction) Get() *Web3Transaction { + return v.value +} + +func (v *NullableWeb3Transaction) Set(val *Web3Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3Transaction) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3Transaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3Transaction(val *Web3Transaction) *NullableWeb3Transaction { + return &NullableWeb3Transaction{value: val, isSet: true} +} + +func (v NullableWeb3Transaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3Transaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 0000000000..7fffc455ec --- /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 Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex string `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber string `json:"blockNumber"` + GasUsed string `json:"gasUsed"` + EffectiveGasPrice *string `json:"effectiveGasPrice,omitempty"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + Logs []interface{} `json:"logs,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + RevertReason *string `json:"revertReason,omitempty"` + Output *string `json:"output,omitempty"` + CommitmentHash *string `json:"commitmentHash,omitempty"` + CumulativeGasUsed *string `json:"cumulativeGasUsed,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex string, blockHash string, blockNumber string, gasUsed string, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v string) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v string) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() string { + if o == nil { + var ret string + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v string) { + o.GasUsed = v +} + +// GetEffectiveGasPrice returns the EffectiveGasPrice field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetEffectiveGasPrice() string { + if o == nil || isNil(o.EffectiveGasPrice) { + var ret string + return ret + } + return *o.EffectiveGasPrice +} + +// GetEffectiveGasPriceOk returns a tuple with the EffectiveGasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetEffectiveGasPriceOk() (*string, bool) { + if o == nil || isNil(o.EffectiveGasPrice) { + return nil, false + } + return o.EffectiveGasPrice, true +} + +// HasEffectiveGasPrice returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasEffectiveGasPrice() bool { + if o != nil && !isNil(o.EffectiveGasPrice) { + return true + } + + return false +} + +// SetEffectiveGasPrice gets a reference to the given string and assigns it to the EffectiveGasPrice field. +func (o *Web3TransactionReceipt) SetEffectiveGasPrice(v string) { + o.EffectiveGasPrice = &v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || isNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogs() []interface{} { + if o == nil || isNil(o.Logs) { + var ret []interface{} + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsOk() ([]interface{}, bool) { + if o == nil || isNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogs() bool { + if o != nil && !isNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given []interface{} and assigns it to the Logs field. +func (o *Web3TransactionReceipt) SetLogs(v []interface{}) { + o.Logs = v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogsBloom() string { + if o == nil || isNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsBloomOk() (*string, bool) { + if o == nil || isNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogsBloom() bool { + if o != nil && !isNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *Web3TransactionReceipt) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetRevertReason returns the RevertReason field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetRevertReason() string { + if o == nil || isNil(o.RevertReason) { + var ret string + return ret + } + return *o.RevertReason +} + +// GetRevertReasonOk returns a tuple with the RevertReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetRevertReasonOk() (*string, bool) { + if o == nil || isNil(o.RevertReason) { + return nil, false + } + return o.RevertReason, true +} + +// HasRevertReason returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasRevertReason() bool { + if o != nil && !isNil(o.RevertReason) { + return true + } + + return false +} + +// SetRevertReason gets a reference to the given string and assigns it to the RevertReason field. +func (o *Web3TransactionReceipt) SetRevertReason(v string) { + o.RevertReason = &v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetOutput() string { + if o == nil || isNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetOutputOk() (*string, bool) { + if o == nil || isNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasOutput() bool { + if o != nil && !isNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *Web3TransactionReceipt) SetOutput(v string) { + o.Output = &v +} + +// GetCommitmentHash returns the CommitmentHash field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCommitmentHash() string { + if o == nil || isNil(o.CommitmentHash) { + var ret string + return ret + } + return *o.CommitmentHash +} + +// GetCommitmentHashOk returns a tuple with the CommitmentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCommitmentHashOk() (*string, bool) { + if o == nil || isNil(o.CommitmentHash) { + return nil, false + } + return o.CommitmentHash, true +} + +// HasCommitmentHash returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCommitmentHash() bool { + if o != nil && !isNil(o.CommitmentHash) { + return true + } + + return false +} + +// SetCommitmentHash gets a reference to the given string and assigns it to the CommitmentHash field. +func (o *Web3TransactionReceipt) SetCommitmentHash(v string) { + o.CommitmentHash = &v +} + +// GetCumulativeGasUsed returns the CumulativeGasUsed field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCumulativeGasUsed() string { + if o == nil || isNil(o.CumulativeGasUsed) { + var ret string + return ret + } + return *o.CumulativeGasUsed +} + +// GetCumulativeGasUsedOk returns a tuple with the CumulativeGasUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCumulativeGasUsedOk() (*string, bool) { + if o == nil || isNil(o.CumulativeGasUsed) { + return nil, false + } + return o.CumulativeGasUsed, true +} + +// HasCumulativeGasUsed returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCumulativeGasUsed() bool { + if o != nil && !isNil(o.CumulativeGasUsed) { + return true + } + + return false +} + +// SetCumulativeGasUsed gets a reference to the given string and assigns it to the CumulativeGasUsed field. +func (o *Web3TransactionReceipt) SetCumulativeGasUsed(v string) { + o.CumulativeGasUsed = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Web3TransactionReceipt) SetType(v string) { + o.Type = &v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if !isNil(o.EffectiveGasPrice) { + toSerialize["effectiveGasPrice"] = o.EffectiveGasPrice + } + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + if !isNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + if !isNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !isNil(o.RevertReason) { + toSerialize["revertReason"] = o.RevertReason + } + if !isNil(o.Output) { + toSerialize["output"] = o.Output + } + if !isNil(o.CommitmentHash) { + toSerialize["commitmentHash"] = o.CommitmentHash + } + if !isNil(o.CumulativeGasUsed) { + toSerialize["cumulativeGasUsed"] = o.CumulativeGasUsed + } + if !isNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "effectiveGasPrice") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "logs") + delete(additionalProperties, "logsBloom") + delete(additionalProperties, "revertReason") + delete(additionalProperties, "output") + delete(additionalProperties, "commitmentHash") + delete(additionalProperties, "cumulativeGasUsed") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..5ba7d6cc54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..ee7b76cf8c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus 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 DeployContractSolBytecodeJsonObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeJsonObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DeployContractSolBytecodeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1NoKeychain", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1NoKeychain(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeRawWeb3EthContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeRawWeb3EthContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeWeb3EthMethodV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeWeb3EthMethodV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-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 0000000000..1e7d70e59c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..d287c40b8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Ethereum + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..1aef449389 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,70 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ContractJSON.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java +src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java +src/main/java/org/openapitools/client/model/GasTransactionConfig.java +src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java +src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java +src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java +src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/Web3BlockHeader.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3Transaction.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..e7e42a4b58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..c83af34dc9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,179 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Ethereum +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Ethereum ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = new DeployContractSolidityBytecodeJsonObjectV1Request(); // DeployContractSolidityBytecodeJsonObjectV1Request | + try { + DeployContractSolidityBytecodeV1Response result = apiInstance.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractSolBytecodeJsonObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractSolBytecodeJsonObjectV1**](docs/DefaultApi.md#deployContractSolBytecodeJsonObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**deployContractSolBytecodeV1**](docs/DefaultApi.md#deployContractSolBytecodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/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-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* | [**invokeContractV1NoKeychain**](docs/DefaultApi.md#invokeContractV1NoKeychain) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object | 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) + - [DeployContractSolidityBytecodeJsonObjectV1Request](docs/DeployContractSolidityBytecodeJsonObjectV1Request.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.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) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1BlockDataTimestamp](docs/WatchBlocksV1BlockDataTimestamp.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation for Authorization + +All endpoints do not require authorization. +Authentication schemes defined for the API: + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..01dbe1dff8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1242 @@ +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 Cactus Plugin - Connector Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractSolBytecodeJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a ethereum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on an ethereum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object: + post: + operationId: invokeContractV1NoKeychain + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on an ethereum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method + x-content-type: application/json + x-accepts: text/plain + /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 + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract + x-content-type: application/json + x-accepts: text/plain +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + 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 + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - bytecode + - contractName + type: object + RunTransactionRequest: + additionalProperties: false + example: + 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 + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + gasConfig: null + keychainId: keychainId + timeoutMs: 0.14658129805029452 + constructorArgs: + - "" + - "" + contractAbi: + - "" + - "" + web3SigningCredential: + type: null + contractName: contractName + nonce: 0.8008281904610115 + value: 6.027456183070403 + contractJSON: "{}" + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + nonce: + nullable: false + type: number + value: + nullable: false + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + description: "For use when not using keychain, pass the contract in as this\ + \ variable" + nullable: false + type: object + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + 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 + DeployContractSolidityBytecodeJsonObjectV1Request: + additionalProperties: false + example: + gasConfig: null + timeoutMs: 0.08008281904610115 + constructorArgs: + - "" + - "" + web3SigningCredential: + type: 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' + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + gasConfig: null + invocationType: null + keychainId: keychainId + timeoutMs: 0.08008281904610115 + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: value + nonce: nonce + 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: + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + nonce: + type: string + 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: + gasConfig: null + invocationType: null + timeoutMs: 0.08008281904610115 + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: value + nonce: nonce + 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: + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + nonce: + type: string + 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 + 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 + 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 + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: string + parentHash: + type: string + sha3Uncles: + type: string + transactionsRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + gasLimit: + type: string + gasUsed: + type: string + stateRoot: + type: string + logsBloom: + type: string + extraData: + type: string + nonce: + type: string + timestamp: + type: string + required: + - gasLimit + - gasUsed + - sha3Uncles + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: string + blockHash: + type: string + blockNumber: + type: string + transactionIndex: + type: string + from: + type: string + to: + type: string + value: + type: string + gasPrice: + type: string + gas: + type: string + input: + type: string + type: + type: string + chainId: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - chainId + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - type + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: string + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: string + gasUsed: + type: string + timestamp: + $ref: '#/components/schemas/WatchBlocksV1BlockData_timestamp' + size: + type: string + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + baseFeePerGas: + type: string + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + 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 + WatchBlocksV1BlockData_timestamp: + oneOf: + - type: string + - type: number + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..8135510869 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..4e5f1034c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..be00ac975c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.4 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..ae390a73e4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..32fd89793c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1546 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..f54fd573e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..296228e971 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..587a6417af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..776f44bb6c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,446 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialGethKeychainPassword", org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ContractJSON.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EthereumTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GasTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GasTransactionConfigEIP1559.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GasTransactionConfigLegacy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1BlockData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1BlockDataTimestamp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Options.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3Transaction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..87cd543afe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..bd208f677a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..8a889c9b26 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..719d2474c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..595e000e25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1026 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deployContractSolBytecodeJsonObjectV1 + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeJsonObjectV1Call(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode-json-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeJsonObjectV1Call(deployContractSolidityBytecodeJsonObjectV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeJsonObjectV1(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeJsonObjectV1WithHttpInfo(deployContractSolidityBytecodeJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeJsonObjectV1WithHttpInfo(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(deployContractSolidityBytecodeJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeJsonObjectV1Async(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(deployContractSolidityBytecodeJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractSolBytecodeV1 + * @param deployContractSolidityBytecodeV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Call(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract-solidity-bytecode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractSolBytecodeV1ValidateBeforeCall(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeV1Call(deployContractSolidityBytecodeV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeV1(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeV1WithHttpInfo(deployContractSolidityBytecodeV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeV1WithHttpInfo(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Async(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on an ethereum ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on an ethereum ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on an ethereum ledger (asynchronously) + * + * @param invokeContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1NoKeychain + * @param invokeContractJsonObjectV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1NoKeychainCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract-json-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1NoKeychainValidateBeforeCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1NoKeychainCall(invokeContractJsonObjectV1Request, _callback); + + } + + /** + * Invokes a contract on an ethereum ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1NoKeychain(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1NoKeychainWithHttpInfo(invokeContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on an ethereum ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1NoKeychainWithHttpInfo(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1NoKeychainValidateBeforeCall(invokeContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on an ethereum ledger (asynchronously) + * + * @param invokeContractJsonObjectV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1NoKeychainAsync(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1NoKeychainValidateBeforeCall(invokeContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeRawWeb3EthContractV1 + * @param invokeRawWeb3EthContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Call(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeRawWeb3EthContractV1ValidateBeforeCall(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeRawWeb3EthContractV1Call(invokeRawWeb3EthContractV1Request, _callback); + + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return InvokeRawWeb3EthContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeRawWeb3EthContractV1WithHttpInfo(invokeRawWeb3EthContractV1Request); + return localVarResp.getData(); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeRawWeb3EthContractV1WithHttpInfo(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. (asynchronously) + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Async(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeWeb3EthMethodV1 + * @param invokeRawWeb3EthMethodV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Call(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthMethodV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeWeb3EthMethodV1ValidateBeforeCall(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + return invokeWeb3EthMethodV1Call(invokeRawWeb3EthMethodV1Request, _callback); + + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return InvokeRawWeb3EthMethodV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeRawWeb3EthMethodV1Response invokeWeb3EthMethodV1(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + ApiResponse localVarResp = invokeWeb3EthMethodV1WithHttpInfo(invokeRawWeb3EthMethodV1Request); + return localVarResp.getData(); + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthMethodV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeWeb3EthMethodV1WithHttpInfo(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invoke any method from web3.eth (low-level) (asynchronously) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Async(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Executes a transaction on a ethereum ledger + * + * @param runTransactionRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a ethereum ledger + * + * @param runTransactionRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a ethereum ledger (asynchronously) + * + * @param runTransactionRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..29a4e68b31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..84c38d6ac3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..b4dbc014d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..624b2888bd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..19fdd21f4c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java new file mode 100644 index 0000000000..1cd302e241 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java @@ -0,0 +1,669 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJSON + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJSON { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi = null; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private Object compiler; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + @SerializedName(SERIALIZED_NAME_NETWORKS) + private Object networks; + + public static final String SERIALIZED_NAME_AST = "ast"; + @SerializedName(SERIALIZED_NAME_AST) + private Object ast; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Object functionHashes; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private Object gasEstimates; + + public ContractJSON() { + } + + public ContractJSON contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractJSON bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public ContractJSON abi(List abi) { + + this.abi = abi; + return this; + } + + public ContractJSON addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return abi + **/ + @javax.annotation.Nullable + + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public ContractJSON metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public ContractJSON deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public ContractJSON sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public ContractJSON deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public ContractJSON sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public ContractJSON compiler(Object compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + + public Object getCompiler() { + return compiler; + } + + + public void setCompiler(Object compiler) { + this.compiler = compiler; + } + + + public ContractJSON networks(Object networks) { + + this.networks = networks; + return this; + } + + /** + * Get networks + * @return networks + **/ + @javax.annotation.Nullable + + public Object getNetworks() { + return networks; + } + + + public void setNetworks(Object networks) { + this.networks = networks; + } + + + public ContractJSON ast(Object ast) { + + this.ast = ast; + return this; + } + + /** + * Get ast + * @return ast + **/ + @javax.annotation.Nullable + + public Object getAst() { + return ast; + } + + + public void setAst(Object ast) { + this.ast = ast; + } + + + public ContractJSON functionHashes(Object functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + + public Object getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Object functionHashes) { + this.functionHashes = functionHashes; + } + + + public ContractJSON gasEstimates(Object gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + + public Object getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(Object gasEstimates) { + this.gasEstimates = gasEstimates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ContractJSON instance itself + */ + public ContractJSON putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJSON contractJSON = (ContractJSON) o; + return Objects.equals(this.contractName, contractJSON.contractName) && + Objects.equals(this.bytecode, contractJSON.bytecode) && + Objects.equals(this.abi, contractJSON.abi) && + Objects.equals(this.metadata, contractJSON.metadata) && + Objects.equals(this.deployedBytecode, contractJSON.deployedBytecode) && + Objects.equals(this.sourceMap, contractJSON.sourceMap) && + Objects.equals(this.deployedSourceMap, contractJSON.deployedSourceMap) && + Objects.equals(this.sourcePath, contractJSON.sourcePath) && + Objects.equals(this.compiler, contractJSON.compiler) && + Objects.equals(this.networks, contractJSON.networks) && + Objects.equals(this.ast, contractJSON.ast) && + Objects.equals(this.functionHashes, contractJSON.functionHashes) && + Objects.equals(this.gasEstimates, contractJSON.gasEstimates)&& + Objects.equals(this.additionalProperties, contractJSON.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, bytecode, abi, metadata, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, networks, ast, functionHashes, gasEstimates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJSON {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ast: ").append(toIndentedString(ast)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("bytecode"); + openapiFields.add("abi"); + openapiFields.add("metadata"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("networks"); + openapiFields.add("ast"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("bytecode"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJSON + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJSON.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJSON is not found in the empty JSON string", ContractJSON.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJSON.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("abi") != null && !jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJSON.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJSON' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJSON.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJSON value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ContractJSON read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ContractJSON instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJSON given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJSON + * @throws IOException if the JSON string is invalid with respect to ContractJSON + */ + public static ContractJSON fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJSON.class); + } + + /** + * Convert an instance of ContractJSON to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java new file mode 100644 index 0000000000..69b52e72c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java @@ -0,0 +1,352 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public DeployContractSolidityBytecodeJsonObjectV1Request() { + } + + public DeployContractSolidityBytecodeJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeJsonObjectV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = (DeployContractSolidityBytecodeJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.gasConfig, deployContractSolidityBytecodeJsonObjectV1Request.gasConfig) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractSolidityBytecodeJsonObjectV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeJsonObjectV1Request.constructorArgs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, gasConfig, timeoutMs, contractJSON, constructorArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gasConfig"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeJsonObjectV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeJsonObjectV1Request + */ + public static DeployContractSolidityBytecodeJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeJsonObjectV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java new file mode 100644 index 0000000000..0351d00c42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private BigDecimal value; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private Object contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public DeployContractSolidityBytecodeV1Request() { + } + + public DeployContractSolidityBytecodeV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractSolidityBytecodeV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public DeployContractSolidityBytecodeV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return contractAbi + **/ + @javax.annotation.Nullable + + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public DeployContractSolidityBytecodeV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeV1Request bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public DeployContractSolidityBytecodeV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractSolidityBytecodeV1Request gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + public DeployContractSolidityBytecodeV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public DeployContractSolidityBytecodeV1Request value(BigDecimal value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + + public BigDecimal getValue() { + return value; + } + + + public void setValue(BigDecimal value) { + this.value = value; + } + + + public DeployContractSolidityBytecodeV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeV1Request contractJSON(Object contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * For use when not using keychain, pass the contract in as this variable + * @return contractJSON + **/ + @javax.annotation.Nullable + + public Object getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(Object contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractSolidityBytecodeV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = (DeployContractSolidityBytecodeV1Request) o; + return Objects.equals(this.contractName, deployContractSolidityBytecodeV1Request.contractName) && + Objects.equals(this.contractAbi, deployContractSolidityBytecodeV1Request.contractAbi) && + Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeV1Request.web3SigningCredential) && + Objects.equals(this.bytecode, deployContractSolidityBytecodeV1Request.bytecode) && + Objects.equals(this.keychainId, deployContractSolidityBytecodeV1Request.keychainId) && + Objects.equals(this.gasConfig, deployContractSolidityBytecodeV1Request.gasConfig) && + Objects.equals(this.nonce, deployContractSolidityBytecodeV1Request.nonce) && + Objects.equals(this.value, deployContractSolidityBytecodeV1Request.value) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractSolidityBytecodeV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeV1Request.constructorArgs); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, contractAbi, web3SigningCredential, bytecode, keychainId, gasConfig, nonce, value, timeoutMs, contractJSON, constructorArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("contractAbi"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("bytecode"); + openapiFields.add("keychainId"); + openapiFields.add("gasConfig"); + openapiFields.add("nonce"); + openapiFields.add("value"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractAbi") != null && !jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static DeployContractSolidityBytecodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java new file mode 100644 index 0000000000..a791fdbf5b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java @@ -0,0 +1,211 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractSolidityBytecodeV1Response() { + } + + public DeployContractSolidityBytecodeV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Response deployContractSolidityBytecodeV1Response = (DeployContractSolidityBytecodeV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractSolidityBytecodeV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Response is not found in the empty JSON string", DeployContractSolidityBytecodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static DeployContractSolidityBytecodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Response.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 0000000000..7b98c84ea7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java new file mode 100644 index 0000000000..87eb8cd37e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationWeb3Method + */ +@JsonAdapter(EthContractInvocationWeb3Method.Adapter.class) +public enum EthContractInvocationWeb3Method { + + SEND("send"), + + CALL("call"), + + ENCODEABI("encodeABI"), + + ESTIMATEGAS("estimateGas"); + + private String value; + + EthContractInvocationWeb3Method(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationWeb3Method fromValue(String value) { + for (EthContractInvocationWeb3Method b : EthContractInvocationWeb3Method.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationWeb3Method enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationWeb3Method read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationWeb3Method.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java new file mode 100644 index 0000000000..ddae62dd49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java @@ -0,0 +1,399 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GasTransactionConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EthereumTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EthereumTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public EthereumTransactionConfig() { + } + + public EthereumTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public EthereumTransactionConfig from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public EthereumTransactionConfig to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public EthereumTransactionConfig value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public EthereumTransactionConfig nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public EthereumTransactionConfig data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + public EthereumTransactionConfig gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EthereumTransactionConfig ethereumTransactionConfig = (EthereumTransactionConfig) o; + return Objects.equals(this.rawTransaction, ethereumTransactionConfig.rawTransaction) && + Objects.equals(this.from, ethereumTransactionConfig.from) && + Objects.equals(this.to, ethereumTransactionConfig.to) && + Objects.equals(this.value, ethereumTransactionConfig.value) && + Objects.equals(this.nonce, ethereumTransactionConfig.nonce) && + Objects.equals(this.data, ethereumTransactionConfig.data) && + Objects.equals(this.gasConfig, ethereumTransactionConfig.gasConfig); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, nonce, data, gasConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EthereumTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("nonce"); + openapiFields.add("data"); + openapiFields.add("gasConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EthereumTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EthereumTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EthereumTransactionConfig is not found in the empty JSON string", EthereumTransactionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EthereumTransactionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EthereumTransactionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) && !jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EthereumTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EthereumTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EthereumTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EthereumTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EthereumTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EthereumTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of EthereumTransactionConfig + * @throws IOException if the JSON string is invalid with respect to EthereumTransactionConfig + */ + public static EthereumTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EthereumTransactionConfig.class); + } + + /** + * Convert an instance of EthereumTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfigFrom.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfigFrom.java new file mode 100644 index 0000000000..a10d2b7148 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfigFrom.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-09-27T17:17:17.535635551+05:30[Asia/Kolkata]") +public class EthereumTransactionConfigFrom extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EthereumTransactionConfigFrom.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EthereumTransactionConfigFrom.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EthereumTransactionConfigFrom' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EthereumTransactionConfigFrom value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public EthereumTransactionConfigFrom read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + EthereumTransactionConfigFrom ret = new EthereumTransactionConfigFrom(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for EthereumTransactionConfigFrom: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public EthereumTransactionConfigFrom() { + super("oneOf", Boolean.FALSE); + } + + public EthereumTransactionConfigFrom(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EthereumTransactionConfigFrom(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return EthereumTransactionConfigFrom.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EthereumTransactionConfigFrom + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for EthereumTransactionConfigFrom with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of EthereumTransactionConfigFrom given an JSON string + * + * @param jsonString JSON string + * @return An instance of EthereumTransactionConfigFrom + * @throws IOException if the JSON string is invalid with respect to EthereumTransactionConfigFrom + */ + public static EthereumTransactionConfigFrom fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EthereumTransactionConfigFrom.class); + } + + /** + * Convert an instance of EthereumTransactionConfigFrom to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfigTo.java new file mode 100644 index 0000000000..bebf77b564 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-09-27T17:17:17.535635551+05:30[Asia/Kolkata]") +public class EthereumTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EthereumTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EthereumTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EthereumTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EthereumTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public EthereumTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + EthereumTransactionConfigTo ret = new EthereumTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for EthereumTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public EthereumTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public EthereumTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return EthereumTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EthereumTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for EthereumTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of EthereumTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of EthereumTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to EthereumTransactionConfigTo + */ + public static EthereumTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EthereumTransactionConfigTo.class); + } + + /** + * Convert an instance of EthereumTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java new file mode 100644 index 0000000000..aa7480f576 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GasTransactionConfigEIP1559; +import org.openapitools.client.model.GasTransactionConfigLegacy; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GasTransactionConfig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GasTransactionConfig.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GasTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GasTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterGasTransactionConfigEIP1559 = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigEIP1559.class)); + final TypeAdapter adapterGasTransactionConfigLegacy = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigLegacy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GasTransactionConfig value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `GasTransactionConfigEIP1559` + if (value.getActualInstance() instanceof GasTransactionConfigEIP1559) { + JsonObject obj = adapterGasTransactionConfigEIP1559.toJsonTree((GasTransactionConfigEIP1559)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GasTransactionConfigLegacy` + if (value.getActualInstance() instanceof GasTransactionConfigLegacy) { + JsonObject obj = adapterGasTransactionConfigLegacy.toJsonTree((GasTransactionConfigLegacy)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: GasTransactionConfigEIP1559, GasTransactionConfigLegacy"); + } + + @Override + public GasTransactionConfig read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize GasTransactionConfigEIP1559 + try { + // validate the JSON object to see if any exception is thrown + GasTransactionConfigEIP1559.validateJsonObject(jsonObject); + actualAdapter = adapterGasTransactionConfigEIP1559; + match++; + log.log(Level.FINER, "Input data matches schema 'GasTransactionConfigEIP1559'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GasTransactionConfigEIP1559 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GasTransactionConfigEIP1559'", e); + } + + // deserialize GasTransactionConfigLegacy + try { + // validate the JSON object to see if any exception is thrown + GasTransactionConfigLegacy.validateJsonObject(jsonObject); + actualAdapter = adapterGasTransactionConfigLegacy; + match++; + log.log(Level.FINER, "Input data matches schema 'GasTransactionConfigLegacy'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GasTransactionConfigLegacy failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GasTransactionConfigLegacy'", e); + } + + if (match == 1) { + GasTransactionConfig ret = new GasTransactionConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GasTransactionConfig: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GasTransactionConfig() { + super("oneOf", Boolean.FALSE); + } + + public GasTransactionConfig(GasTransactionConfigEIP1559 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GasTransactionConfig(GasTransactionConfigLegacy o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("GasTransactionConfigEIP1559", new GenericType() { + }); + schemas.put("GasTransactionConfigLegacy", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GasTransactionConfig.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * GasTransactionConfigEIP1559, GasTransactionConfigLegacy + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof GasTransactionConfigEIP1559) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GasTransactionConfigLegacy) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be GasTransactionConfigEIP1559, GasTransactionConfigLegacy"); + } + + /** + * Get the actual instance, which can be the following: + * GasTransactionConfigEIP1559, GasTransactionConfigLegacy + * + * @return The actual instance (GasTransactionConfigEIP1559, GasTransactionConfigLegacy) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GasTransactionConfigEIP1559`. If the actual instance is not `GasTransactionConfigEIP1559`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GasTransactionConfigEIP1559` + * @throws ClassCastException if the instance is not `GasTransactionConfigEIP1559` + */ + public GasTransactionConfigEIP1559 getGasTransactionConfigEIP1559() throws ClassCastException { + return (GasTransactionConfigEIP1559)super.getActualInstance(); + } + + /** + * Get the actual instance of `GasTransactionConfigLegacy`. If the actual instance is not `GasTransactionConfigLegacy`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GasTransactionConfigLegacy` + * @throws ClassCastException if the instance is not `GasTransactionConfigLegacy` + */ + public GasTransactionConfigLegacy getGasTransactionConfigLegacy() throws ClassCastException { + return (GasTransactionConfigLegacy)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GasTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with GasTransactionConfigEIP1559 + try { + GasTransactionConfigEIP1559.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GasTransactionConfigEIP1559 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GasTransactionConfigLegacy + try { + GasTransactionConfigLegacy.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GasTransactionConfigLegacy failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GasTransactionConfig with oneOf schemas: GasTransactionConfigEIP1559, GasTransactionConfigLegacy. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of GasTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of GasTransactionConfig + * @throws IOException if the JSON string is invalid with respect to GasTransactionConfig + */ + public static GasTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GasTransactionConfig.class); + } + + /** + * Convert an instance of GasTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java new file mode 100644 index 0000000000..f09dafb385 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java @@ -0,0 +1,269 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Transaction gas settings in networks after EIP-1559 (London fork). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GasTransactionConfigEIP1559 { + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private String gasLimit; + + public static final String SERIALIZED_NAME_MAX_FEE_PER_GAS = "maxFeePerGas"; + @SerializedName(SERIALIZED_NAME_MAX_FEE_PER_GAS) + private String maxFeePerGas; + + public static final String SERIALIZED_NAME_MAX_PRIORITY_FEE_PER_GAS = "maxPriorityFeePerGas"; + @SerializedName(SERIALIZED_NAME_MAX_PRIORITY_FEE_PER_GAS) + private String maxPriorityFeePerGas; + + public GasTransactionConfigEIP1559() { + } + + public GasTransactionConfigEIP1559 gasLimit(String gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * A maximum amount of gas a user is willing to provide for the execution of the transaction. + * @return gasLimit + **/ + @javax.annotation.Nullable + + public String getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(String gasLimit) { + this.gasLimit = gasLimit; + } + + + public GasTransactionConfigEIP1559 maxFeePerGas(String maxFeePerGas) { + + this.maxFeePerGas = maxFeePerGas; + return this; + } + + /** + * A maximum fee (including the base fee and the tip) a user is willing to pay per unit of gas. + * @return maxFeePerGas + **/ + @javax.annotation.Nullable + + public String getMaxFeePerGas() { + return maxFeePerGas; + } + + + public void setMaxFeePerGas(String maxFeePerGas) { + this.maxFeePerGas = maxFeePerGas; + } + + + public GasTransactionConfigEIP1559 maxPriorityFeePerGas(String maxPriorityFeePerGas) { + + this.maxPriorityFeePerGas = maxPriorityFeePerGas; + return this; + } + + /** + * A maximum tip amount a user is willing to pay per unit of gas. + * @return maxPriorityFeePerGas + **/ + @javax.annotation.Nullable + + public String getMaxPriorityFeePerGas() { + return maxPriorityFeePerGas; + } + + + public void setMaxPriorityFeePerGas(String maxPriorityFeePerGas) { + this.maxPriorityFeePerGas = maxPriorityFeePerGas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GasTransactionConfigEIP1559 gasTransactionConfigEIP1559 = (GasTransactionConfigEIP1559) o; + return Objects.equals(this.gasLimit, gasTransactionConfigEIP1559.gasLimit) && + Objects.equals(this.maxFeePerGas, gasTransactionConfigEIP1559.maxFeePerGas) && + Objects.equals(this.maxPriorityFeePerGas, gasTransactionConfigEIP1559.maxPriorityFeePerGas); + } + + @Override + public int hashCode() { + return Objects.hash(gasLimit, maxFeePerGas, maxPriorityFeePerGas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GasTransactionConfigEIP1559 {\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" maxFeePerGas: ").append(toIndentedString(maxFeePerGas)).append("\n"); + sb.append(" maxPriorityFeePerGas: ").append(toIndentedString(maxPriorityFeePerGas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("gasLimit"); + openapiFields.add("maxFeePerGas"); + openapiFields.add("maxPriorityFeePerGas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GasTransactionConfigEIP1559 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GasTransactionConfigEIP1559.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GasTransactionConfigEIP1559 is not found in the empty JSON string", GasTransactionConfigEIP1559.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GasTransactionConfigEIP1559.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GasTransactionConfigEIP1559` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("gasLimit") != null && !jsonObj.get("gasLimit").isJsonNull()) && !jsonObj.get("gasLimit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasLimit").toString())); + } + if ((jsonObj.get("maxFeePerGas") != null && !jsonObj.get("maxFeePerGas").isJsonNull()) && !jsonObj.get("maxFeePerGas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maxFeePerGas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxFeePerGas").toString())); + } + if ((jsonObj.get("maxPriorityFeePerGas") != null && !jsonObj.get("maxPriorityFeePerGas").isJsonNull()) && !jsonObj.get("maxPriorityFeePerGas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maxPriorityFeePerGas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxPriorityFeePerGas").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GasTransactionConfigEIP1559.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GasTransactionConfigEIP1559' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigEIP1559.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GasTransactionConfigEIP1559 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GasTransactionConfigEIP1559 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GasTransactionConfigEIP1559 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GasTransactionConfigEIP1559 + * @throws IOException if the JSON string is invalid with respect to GasTransactionConfigEIP1559 + */ + public static GasTransactionConfigEIP1559 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GasTransactionConfigEIP1559.class); + } + + /** + * Convert an instance of GasTransactionConfigEIP1559 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java new file mode 100644 index 0000000000..eb44559780 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java @@ -0,0 +1,237 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Transaction gas settings in networks before EIP-1559 (London fork). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GasTransactionConfigLegacy { + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private String gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public GasTransactionConfigLegacy() { + } + + public GasTransactionConfigLegacy gas(String gas) { + + this.gas = gas; + return this; + } + + /** + * A maximum amount of gas a user is willing to provide for the execution of the transaction. (gasLimit) + * @return gas + **/ + @javax.annotation.Nullable + + public String getGas() { + return gas; + } + + + public void setGas(String gas) { + this.gas = gas; + } + + + public GasTransactionConfigLegacy gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * A price (in Wei) a user is willing to pay for each unit of gas used during the execution of the transaction. In EIP-1559 (London fork) networks, it will be set as both maxFeePerGas and maxPriorityFeePerGas. + * @return gasPrice + **/ + @javax.annotation.Nullable + + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GasTransactionConfigLegacy gasTransactionConfigLegacy = (GasTransactionConfigLegacy) o; + return Objects.equals(this.gas, gasTransactionConfigLegacy.gas) && + Objects.equals(this.gasPrice, gasTransactionConfigLegacy.gasPrice); + } + + @Override + public int hashCode() { + return Objects.hash(gas, gasPrice); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GasTransactionConfigLegacy {\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GasTransactionConfigLegacy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GasTransactionConfigLegacy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GasTransactionConfigLegacy is not found in the empty JSON string", GasTransactionConfigLegacy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GasTransactionConfigLegacy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GasTransactionConfigLegacy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) && !jsonObj.get("gas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gas").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GasTransactionConfigLegacy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GasTransactionConfigLegacy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigLegacy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GasTransactionConfigLegacy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GasTransactionConfigLegacy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GasTransactionConfigLegacy given an JSON string + * + * @param jsonString JSON string + * @return An instance of GasTransactionConfigLegacy + * @throws IOException if the JSON string is invalid with respect to GasTransactionConfigLegacy + */ + public static GasTransactionConfigLegacy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GasTransactionConfigLegacy.class); + } + + /** + * Convert an instance of GasTransactionConfigLegacy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java new file mode 100644 index 0000000000..e52328cdb1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java @@ -0,0 +1,513 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public InvokeContractJsonObjectV1Request() { + } + + public InvokeContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractJsonObjectV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractJsonObjectV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractJsonObjectV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractJsonObjectV1Request addParamsItem(Object paramsItem) { + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractJsonObjectV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractJsonObjectV1Request value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public InvokeContractJsonObjectV1Request gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + public InvokeContractJsonObjectV1Request nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public InvokeContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = (InvokeContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, invokeContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractJsonObjectV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractJsonObjectV1Request.methodName) && + Objects.equals(this.params, invokeContractJsonObjectV1Request.params) && + Objects.equals(this.contractAddress, invokeContractJsonObjectV1Request.contractAddress) && + Objects.equals(this.value, invokeContractJsonObjectV1Request.value) && + Objects.equals(this.gasConfig, invokeContractJsonObjectV1Request.gasConfig) && + Objects.equals(this.nonce, invokeContractJsonObjectV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, invokeContractJsonObjectV1Request.contractJSON); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, invocationType, methodName, params, contractAddress, value, gasConfig, nonce, timeoutMs, contractJSON); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gasConfig"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractJsonObjectV1Request is not found in the empty JSON string", InvokeContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static InvokeContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of InvokeContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 0000000000..ab5db83b39 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,515 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name to find it in the keychain plugin + * @return contractName + **/ + @javax.annotation.Nonnull + + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public InvokeContractV1Request gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + public InvokeContractV1Request nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.web3SigningCredential, invokeContractV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gasConfig, invokeContractV1Request.gasConfig) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, web3SigningCredential, invocationType, methodName, params, value, gasConfig, nonce, timeoutMs, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gasConfig"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..1c4a5ae5cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,281 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java new file mode 100644 index 0000000000..50622986e6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java @@ -0,0 +1,379 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Request { + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private Object abi = null; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationWeb3Method invocationType; + + public static final String SERIALIZED_NAME_INVOCATION_PARAMS = "invocationParams"; + @SerializedName(SERIALIZED_NAME_INVOCATION_PARAMS) + private Object invocationParams = {}; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD = "contractMethod"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD) + private String contractMethod; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD_ARGS = "contractMethodArgs"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD_ARGS) + private List contractMethodArgs = null; + + public InvokeRawWeb3EthContractV1Request() { + } + + public InvokeRawWeb3EthContractV1Request abi(Object abi) { + + this.abi = abi; + return this; + } + + /** + * The application binary interface of the solidity contract + * @return abi + **/ + @javax.annotation.Nullable + + public Object getAbi() { + return abi; + } + + + public void setAbi(Object abi) { + this.abi = abi; + } + + + public InvokeRawWeb3EthContractV1Request address(String address) { + + this.address = address; + return this; + } + + /** + * Deployed solidity contract address + * @return address + **/ + @javax.annotation.Nonnull + + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public InvokeRawWeb3EthContractV1Request invocationType(EthContractInvocationWeb3Method invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + + public EthContractInvocationWeb3Method getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationWeb3Method invocationType) { + this.invocationType = invocationType; + } + + + public InvokeRawWeb3EthContractV1Request invocationParams(Object invocationParams) { + + this.invocationParams = invocationParams; + return this; + } + + /** + * The list of arguments for contract invocation method (send, call, etc...) + * @return invocationParams + **/ + @javax.annotation.Nullable + + public Object getInvocationParams() { + return invocationParams; + } + + + public void setInvocationParams(Object invocationParams) { + this.invocationParams = invocationParams; + } + + + public InvokeRawWeb3EthContractV1Request contractMethod(String contractMethod) { + + this.contractMethod = contractMethod; + return this; + } + + /** + * Method of deployed solidity contract to execute + * @return contractMethod + **/ + @javax.annotation.Nonnull + + public String getContractMethod() { + return contractMethod; + } + + + public void setContractMethod(String contractMethod) { + this.contractMethod = contractMethod; + } + + + public InvokeRawWeb3EthContractV1Request contractMethodArgs(List contractMethodArgs) { + + this.contractMethodArgs = contractMethodArgs; + return this; + } + + public InvokeRawWeb3EthContractV1Request addContractMethodArgsItem(Object contractMethodArgsItem) { + if (this.contractMethodArgs == null) { + this.contractMethodArgs = null; + } + this.contractMethodArgs.add(contractMethodArgsItem); + return this; + } + + /** + * The list of arguments for deployed solidity contract method + * @return contractMethodArgs + **/ + @javax.annotation.Nullable + + public List getContractMethodArgs() { + return contractMethodArgs; + } + + + public void setContractMethodArgs(List contractMethodArgs) { + this.contractMethodArgs = contractMethodArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = (InvokeRawWeb3EthContractV1Request) o; + return Objects.equals(this.abi, invokeRawWeb3EthContractV1Request.abi) && + Objects.equals(this.address, invokeRawWeb3EthContractV1Request.address) && + Objects.equals(this.invocationType, invokeRawWeb3EthContractV1Request.invocationType) && + Objects.equals(this.invocationParams, invokeRawWeb3EthContractV1Request.invocationParams) && + Objects.equals(this.contractMethod, invokeRawWeb3EthContractV1Request.contractMethod) && + Objects.equals(this.contractMethodArgs, invokeRawWeb3EthContractV1Request.contractMethodArgs); + } + + @Override + public int hashCode() { + return Objects.hash(abi, address, invocationType, invocationParams, contractMethod, contractMethodArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Request {\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" invocationParams: ").append(toIndentedString(invocationParams)).append("\n"); + sb.append(" contractMethod: ").append(toIndentedString(contractMethod)).append("\n"); + sb.append(" contractMethodArgs: ").append(toIndentedString(contractMethodArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("abi"); + openapiFields.add("address"); + openapiFields.add("invocationType"); + openapiFields.add("invocationParams"); + openapiFields.add("contractMethod"); + openapiFields.add("contractMethodArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("abi"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("contractMethod"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Request is not found in the empty JSON string", InvokeRawWeb3EthContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("contractMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractMethod").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractMethodArgs") != null && !jsonObj.get("contractMethodArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethodArgs` to be an array in the JSON string but got `%s`", jsonObj.get("contractMethodArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static InvokeRawWeb3EthContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java new file mode 100644 index 0000000000..30146d6322 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthContractV1Response() { + } + + public InvokeRawWeb3EthContractV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthContractV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of contract invocation method + * @return data + **/ + @javax.annotation.Nullable + + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthContractV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1Response = (InvokeRawWeb3EthContractV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthContractV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthContractV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthContractV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Response is not found in the empty JSON string", InvokeRawWeb3EthContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static InvokeRawWeb3EthContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java new file mode 100644 index 0000000000..e668127875 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Request { + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public InvokeRawWeb3EthMethodV1Request() { + } + + public InvokeRawWeb3EthMethodV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the web3.eth method to invoke + * @return methodName + **/ + @javax.annotation.Nonnull + + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeRawWeb3EthMethodV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeRawWeb3EthMethodV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass to web3.eth method specified in methodName + * @return params + **/ + @javax.annotation.Nullable + + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = (InvokeRawWeb3EthMethodV1Request) o; + return Objects.equals(this.methodName, invokeRawWeb3EthMethodV1Request.methodName) && + Objects.equals(this.params, invokeRawWeb3EthMethodV1Request.params); + } + + @Override + public int hashCode() { + return Objects.hash(methodName, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Request {\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("methodName"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("methodName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Request is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("params") != null && !jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static InvokeRawWeb3EthMethodV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java new file mode 100644 index 0000000000..d2e739a1fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthMethodV1Response() { + } + + public InvokeRawWeb3EthMethodV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthMethodV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of requested web3.eth method + * @return data + **/ + @javax.annotation.Nullable + + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthMethodV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Response invokeRawWeb3EthMethodV1Response = (InvokeRawWeb3EthMethodV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthMethodV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthMethodV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthMethodV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Response is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static InvokeRawWeb3EthMethodV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 0000000000..73918a4b7d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.EthereumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private EthereumTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public RunTransactionRequest() { + } + + public RunTransactionRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionRequest transactionConfig(EthereumTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + + public EthereumTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(EthereumTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionRequest timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.web3SigningCredential, runTransactionRequest.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionRequest.transactionConfig) && + Objects.equals(this.timeoutMs, runTransactionRequest.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `transactionConfig` + EthereumTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("transactionConfig")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..2c023505ee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,211 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 0000000000..3b199beedd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,508 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = null; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 0000000000..a52e77222f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,312 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 0000000000..144c0a80e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = null; + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 0000000000..adb40d4c29 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,269 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 0000000000..b5840c5e47 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.ethereum.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java new file mode 100644 index 0000000000..e2885b310e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java @@ -0,0 +1,889 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksV1BlockDataTimestamp; +import org.openapitools.client.model.Web3Transaction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1BlockData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1BlockData { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private String gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private String gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private WatchBlocksV1BlockDataTimestamp timestamp; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private String size; + + public static final String SERIALIZED_NAME_TOTAL_DIFFICULTY = "totalDifficulty"; + @SerializedName(SERIALIZED_NAME_TOTAL_DIFFICULTY) + private String totalDifficulty; + + public static final String SERIALIZED_NAME_UNCLES = "uncles"; + @SerializedName(SERIALIZED_NAME_UNCLES) + private List uncles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BASE_FEE_PER_GAS = "baseFeePerGas"; + @SerializedName(SERIALIZED_NAME_BASE_FEE_PER_GAS) + private String baseFeePerGas; + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions = new ArrayList<>(); + + public WatchBlocksV1BlockData() { + } + + public WatchBlocksV1BlockData number(String number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public WatchBlocksV1BlockData hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nullable + + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public WatchBlocksV1BlockData parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public WatchBlocksV1BlockData nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public WatchBlocksV1BlockData sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public WatchBlocksV1BlockData logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public WatchBlocksV1BlockData transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public WatchBlocksV1BlockData stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public WatchBlocksV1BlockData receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public WatchBlocksV1BlockData difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public WatchBlocksV1BlockData mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public WatchBlocksV1BlockData miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public WatchBlocksV1BlockData extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public WatchBlocksV1BlockData gasLimit(String gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + + public String getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(String gasLimit) { + this.gasLimit = gasLimit; + } + + + public WatchBlocksV1BlockData gasUsed(String gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + + public String getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(String gasUsed) { + this.gasUsed = gasUsed; + } + + + public WatchBlocksV1BlockData timestamp(WatchBlocksV1BlockDataTimestamp timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + + public WatchBlocksV1BlockDataTimestamp getTimestamp() { + return timestamp; + } + + + public void setTimestamp(WatchBlocksV1BlockDataTimestamp timestamp) { + this.timestamp = timestamp; + } + + + public WatchBlocksV1BlockData size(String size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nonnull + + public String getSize() { + return size; + } + + + public void setSize(String size) { + this.size = size; + } + + + public WatchBlocksV1BlockData totalDifficulty(String totalDifficulty) { + + this.totalDifficulty = totalDifficulty; + return this; + } + + /** + * Get totalDifficulty + * @return totalDifficulty + **/ + @javax.annotation.Nonnull + + public String getTotalDifficulty() { + return totalDifficulty; + } + + + public void setTotalDifficulty(String totalDifficulty) { + this.totalDifficulty = totalDifficulty; + } + + + public WatchBlocksV1BlockData uncles(List uncles) { + + this.uncles = uncles; + return this; + } + + public WatchBlocksV1BlockData addUnclesItem(String unclesItem) { + this.uncles.add(unclesItem); + return this; + } + + /** + * Get uncles + * @return uncles + **/ + @javax.annotation.Nonnull + + public List getUncles() { + return uncles; + } + + + public void setUncles(List uncles) { + this.uncles = uncles; + } + + + public WatchBlocksV1BlockData baseFeePerGas(String baseFeePerGas) { + + this.baseFeePerGas = baseFeePerGas; + return this; + } + + /** + * Get baseFeePerGas + * @return baseFeePerGas + **/ + @javax.annotation.Nullable + + public String getBaseFeePerGas() { + return baseFeePerGas; + } + + + public void setBaseFeePerGas(String baseFeePerGas) { + this.baseFeePerGas = baseFeePerGas; + } + + + public WatchBlocksV1BlockData transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public WatchBlocksV1BlockData addTransactionsItem(Web3Transaction transactionsItem) { + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nonnull + + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1BlockData watchBlocksV1BlockData = (WatchBlocksV1BlockData) o; + return Objects.equals(this.number, watchBlocksV1BlockData.number) && + Objects.equals(this.hash, watchBlocksV1BlockData.hash) && + Objects.equals(this.parentHash, watchBlocksV1BlockData.parentHash) && + Objects.equals(this.nonce, watchBlocksV1BlockData.nonce) && + Objects.equals(this.sha3Uncles, watchBlocksV1BlockData.sha3Uncles) && + Objects.equals(this.logsBloom, watchBlocksV1BlockData.logsBloom) && + Objects.equals(this.transactionsRoot, watchBlocksV1BlockData.transactionsRoot) && + Objects.equals(this.stateRoot, watchBlocksV1BlockData.stateRoot) && + Objects.equals(this.receiptsRoot, watchBlocksV1BlockData.receiptsRoot) && + Objects.equals(this.difficulty, watchBlocksV1BlockData.difficulty) && + Objects.equals(this.mixHash, watchBlocksV1BlockData.mixHash) && + Objects.equals(this.miner, watchBlocksV1BlockData.miner) && + Objects.equals(this.extraData, watchBlocksV1BlockData.extraData) && + Objects.equals(this.gasLimit, watchBlocksV1BlockData.gasLimit) && + Objects.equals(this.gasUsed, watchBlocksV1BlockData.gasUsed) && + Objects.equals(this.timestamp, watchBlocksV1BlockData.timestamp) && + Objects.equals(this.size, watchBlocksV1BlockData.size) && + Objects.equals(this.totalDifficulty, watchBlocksV1BlockData.totalDifficulty) && + Objects.equals(this.uncles, watchBlocksV1BlockData.uncles) && + Objects.equals(this.baseFeePerGas, watchBlocksV1BlockData.baseFeePerGas) && + Objects.equals(this.transactions, watchBlocksV1BlockData.transactions); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, receiptsRoot, difficulty, mixHash, miner, extraData, gasLimit, gasUsed, timestamp, size, totalDifficulty, uncles, baseFeePerGas, transactions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1BlockData {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" totalDifficulty: ").append(toIndentedString(totalDifficulty)).append("\n"); + sb.append(" uncles: ").append(toIndentedString(uncles)).append("\n"); + sb.append(" baseFeePerGas: ").append(toIndentedString(baseFeePerGas)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + openapiFields.add("size"); + openapiFields.add("totalDifficulty"); + openapiFields.add("uncles"); + openapiFields.add("baseFeePerGas"); + openapiFields.add("transactions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + openapiRequiredFields.add("size"); + openapiRequiredFields.add("totalDifficulty"); + openapiRequiredFields.add("uncles"); + openapiRequiredFields.add("transactions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1BlockData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1BlockData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1BlockData is not found in the empty JSON string", WatchBlocksV1BlockData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1BlockData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1BlockData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1BlockData.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + } + if ((jsonObj.get("hash") != null && !jsonObj.get("hash").isJsonNull()) && !jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + if (!jsonObj.get("gasLimit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasLimit").toString())); + } + if (!jsonObj.get("gasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasUsed").toString())); + } + // validate the required field `timestamp` + WatchBlocksV1BlockDataTimestamp.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + if (!jsonObj.get("size").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("size").toString())); + } + if (!jsonObj.get("totalDifficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalDifficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalDifficulty").toString())); + } + // ensure the required json array is present + if (jsonObj.get("uncles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("uncles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uncles` to be an array in the JSON string but got `%s`", jsonObj.get("uncles").toString())); + } + if ((jsonObj.get("baseFeePerGas") != null && !jsonObj.get("baseFeePerGas").isJsonNull()) && !jsonObj.get("baseFeePerGas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `baseFeePerGas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baseFeePerGas").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + + JsonArray jsonArraytransactions = jsonObj.getAsJsonArray("transactions"); + // validate the required field `transactions` (array) + for (int i = 0; i < jsonArraytransactions.size(); i++) { + Web3Transaction.validateJsonObject(jsonArraytransactions.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1BlockData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1BlockData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1BlockData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1BlockData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1BlockData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1BlockData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1BlockData + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1BlockData + */ + public static WatchBlocksV1BlockData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1BlockData.class); + } + + /** + * Convert an instance of WatchBlocksV1BlockData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java new file mode 100644 index 0000000000..4a959d4b60 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1BlockDataTimestamp extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksV1BlockDataTimestamp.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1BlockDataTimestamp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1BlockDataTimestamp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1BlockDataTimestamp value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public WatchBlocksV1BlockDataTimestamp read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + WatchBlocksV1BlockDataTimestamp ret = new WatchBlocksV1BlockDataTimestamp(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksV1BlockDataTimestamp: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksV1BlockDataTimestamp() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksV1BlockDataTimestamp(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksV1BlockDataTimestamp(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksV1BlockDataTimestamp.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1BlockDataTimestamp + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksV1BlockDataTimestamp with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksV1BlockDataTimestamp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1BlockDataTimestamp + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1BlockDataTimestamp + */ + public static WatchBlocksV1BlockDataTimestamp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1BlockDataTimestamp.class); + } + + /** + * Convert an instance of WatchBlocksV1BlockDataTimestamp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java new file mode 100644 index 0000000000..3ada42d69d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java @@ -0,0 +1,202 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Options + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Options { + public static final String SERIALIZED_NAME_GET_BLOCK_DATA = "getBlockData"; + @SerializedName(SERIALIZED_NAME_GET_BLOCK_DATA) + private Boolean getBlockData; + + public WatchBlocksV1Options() { + } + + public WatchBlocksV1Options getBlockData(Boolean getBlockData) { + + this.getBlockData = getBlockData; + return this; + } + + /** + * Get getBlockData + * @return getBlockData + **/ + @javax.annotation.Nullable + + public Boolean getGetBlockData() { + return getBlockData; + } + + + public void setGetBlockData(Boolean getBlockData) { + this.getBlockData = getBlockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Options watchBlocksV1Options = (WatchBlocksV1Options) o; + return Objects.equals(this.getBlockData, watchBlocksV1Options.getBlockData); + } + + @Override + public int hashCode() { + return Objects.hash(getBlockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Options {\n"); + sb.append(" getBlockData: ").append(toIndentedString(getBlockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("getBlockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Options + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Options.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Options is not found in the empty JSON string", WatchBlocksV1Options.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Options.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Options` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Options.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Options' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Options.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Options value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Options read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Options given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Options + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Options + */ + public static WatchBlocksV1Options fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Options.class); + } + + /** + * Convert an instance of WatchBlocksV1Options to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 0000000000..c426ffca19 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,241 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Progress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress { + public static final String SERIALIZED_NAME_BLOCK_HEADER = "blockHeader"; + @SerializedName(SERIALIZED_NAME_BLOCK_HEADER) + private Web3BlockHeader blockHeader; + + public static final String SERIALIZED_NAME_BLOCK_DATA = "blockData"; + @SerializedName(SERIALIZED_NAME_BLOCK_DATA) + private WatchBlocksV1BlockData blockData; + + public WatchBlocksV1Progress() { + } + + public WatchBlocksV1Progress blockHeader(Web3BlockHeader blockHeader) { + + this.blockHeader = blockHeader; + return this; + } + + /** + * Get blockHeader + * @return blockHeader + **/ + @javax.annotation.Nullable + + public Web3BlockHeader getBlockHeader() { + return blockHeader; + } + + + public void setBlockHeader(Web3BlockHeader blockHeader) { + this.blockHeader = blockHeader; + } + + + public WatchBlocksV1Progress blockData(WatchBlocksV1BlockData blockData) { + + this.blockData = blockData; + return this; + } + + /** + * Get blockData + * @return blockData + **/ + @javax.annotation.Nullable + + public WatchBlocksV1BlockData getBlockData() { + return blockData; + } + + + public void setBlockData(WatchBlocksV1BlockData blockData) { + this.blockData = blockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Progress watchBlocksV1Progress = (WatchBlocksV1Progress) o; + return Objects.equals(this.blockHeader, watchBlocksV1Progress.blockHeader) && + Objects.equals(this.blockData, watchBlocksV1Progress.blockData); + } + + @Override + public int hashCode() { + return Objects.hash(blockHeader, blockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Progress {\n"); + sb.append(" blockHeader: ").append(toIndentedString(blockHeader)).append("\n"); + sb.append(" blockData: ").append(toIndentedString(blockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHeader"); + openapiFields.add("blockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Progress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Progress is not found in the empty JSON string", WatchBlocksV1Progress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Progress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Progress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `blockHeader` + if (jsonObj.get("blockHeader") != null && !jsonObj.get("blockHeader").isJsonNull()) { + Web3BlockHeader.validateJsonObject(jsonObj.getAsJsonObject("blockHeader")); + } + // validate the optional field `blockData` + if (jsonObj.get("blockData") != null && !jsonObj.get("blockData").isJsonNull()) { + WatchBlocksV1BlockData.validateJsonObject(jsonObj.getAsJsonObject("blockData")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Progress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java new file mode 100644 index 0000000000..a5a7e93d12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java @@ -0,0 +1,663 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3BlockHeader + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeader { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private String gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private String gasUsed; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; + + public Web3BlockHeader() { + } + + public Web3BlockHeader number(String number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public Web3BlockHeader parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nullable + + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public Web3BlockHeader sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public Web3BlockHeader transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public Web3BlockHeader receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public Web3BlockHeader difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public Web3BlockHeader mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public Web3BlockHeader miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nullable + + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public Web3BlockHeader gasLimit(String gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + + public String getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(String gasLimit) { + this.gasLimit = gasLimit; + } + + + public Web3BlockHeader gasUsed(String gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + + public String getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(String gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3BlockHeader stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nullable + + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public Web3BlockHeader logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3BlockHeader extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nullable + + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public Web3BlockHeader nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3BlockHeader timestamp(String timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + + public String getTimestamp() { + return timestamp; + } + + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3BlockHeader web3BlockHeader = (Web3BlockHeader) o; + return Objects.equals(this.number, web3BlockHeader.number) && + Objects.equals(this.parentHash, web3BlockHeader.parentHash) && + Objects.equals(this.sha3Uncles, web3BlockHeader.sha3Uncles) && + Objects.equals(this.transactionsRoot, web3BlockHeader.transactionsRoot) && + Objects.equals(this.receiptsRoot, web3BlockHeader.receiptsRoot) && + Objects.equals(this.difficulty, web3BlockHeader.difficulty) && + Objects.equals(this.mixHash, web3BlockHeader.mixHash) && + Objects.equals(this.miner, web3BlockHeader.miner) && + Objects.equals(this.gasLimit, web3BlockHeader.gasLimit) && + Objects.equals(this.gasUsed, web3BlockHeader.gasUsed) && + Objects.equals(this.stateRoot, web3BlockHeader.stateRoot) && + Objects.equals(this.logsBloom, web3BlockHeader.logsBloom) && + Objects.equals(this.extraData, web3BlockHeader.extraData) && + Objects.equals(this.nonce, web3BlockHeader.nonce) && + Objects.equals(this.timestamp, web3BlockHeader.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(number, parentHash, sha3Uncles, transactionsRoot, receiptsRoot, difficulty, mixHash, miner, gasLimit, gasUsed, stateRoot, logsBloom, extraData, nonce, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3BlockHeader {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("parentHash"); + openapiFields.add("sha3Uncles"); + openapiFields.add("transactionsRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("stateRoot"); + openapiFields.add("logsBloom"); + openapiFields.add("extraData"); + openapiFields.add("nonce"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3BlockHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3BlockHeader is not found in the empty JSON string", Web3BlockHeader.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3BlockHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3BlockHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3BlockHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("number") != null && !jsonObj.get("number").isJsonNull()) && !jsonObj.get("number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + } + if ((jsonObj.get("parentHash") != null && !jsonObj.get("parentHash").isJsonNull()) && !jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if ((jsonObj.get("miner") != null && !jsonObj.get("miner").isJsonNull()) && !jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("gasLimit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasLimit").toString())); + } + if (!jsonObj.get("gasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasUsed").toString())); + } + if ((jsonObj.get("stateRoot") != null && !jsonObj.get("stateRoot").isJsonNull()) && !jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("extraData") != null && !jsonObj.get("extraData").isJsonNull()) && !jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonNull()) && !jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3BlockHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3BlockHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3BlockHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeader + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeader + */ + public static Web3BlockHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeader.class); + } + + /** + * Convert an instance of Web3BlockHeader to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..fe2be6629e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,391 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialGethKeychainPassword = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialGethKeychainPassword` + if (value.getActualInstance() instanceof Web3SigningCredentialGethKeychainPassword) { + JsonObject obj = adapterWeb3SigningCredentialGethKeychainPassword.toJsonTree((Web3SigningCredentialGethKeychainPassword)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialGethKeychainPassword + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialGethKeychainPassword; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialGethKeychainPassword'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialGethKeychainPassword'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialGethKeychainPassword o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialGethKeychainPassword", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialGethKeychainPassword) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialGethKeychainPassword`. If the actual instance is not `Web3SigningCredentialGethKeychainPassword`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialGethKeychainPassword` + * @throws ClassCastException if the instance is not `Web3SigningCredentialGethKeychainPassword` + */ + public Web3SigningCredentialGethKeychainPassword getWeb3SigningCredentialGethKeychainPassword() throws ClassCastException { + return (Web3SigningCredentialGethKeychainPassword)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialGethKeychainPassword + try { + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..22f03efa55 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nullable + + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if ((jsonObj.get("keychainId") != null && !jsonObj.get("keychainId").isJsonNull()) && !jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java new file mode 100644 index 0000000000..f81c968f32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialGethKeychainPassword + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialGethKeychainPassword { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialGethKeychainPassword() { + } + + public Web3SigningCredentialGethKeychainPassword type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialGethKeychainPassword ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialGethKeychainPassword secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * A geth keychain unlock password. + * @return secret + **/ + @javax.annotation.Nonnull + + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialGethKeychainPassword web3SigningCredentialGethKeychainPassword = (Web3SigningCredentialGethKeychainPassword) o; + return Objects.equals(this.type, web3SigningCredentialGethKeychainPassword.type) && + Objects.equals(this.ethAccount, web3SigningCredentialGethKeychainPassword.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialGethKeychainPassword.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialGethKeychainPassword {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialGethKeychainPassword is not found in the empty JSON string", Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialGethKeychainPassword.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialGethKeychainPassword` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialGethKeychainPassword.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialGethKeychainPassword.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialGethKeychainPassword' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialGethKeychainPassword value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialGethKeychainPassword read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialGethKeychainPassword given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialGethKeychainPassword + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static Web3SigningCredentialGethKeychainPassword fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialGethKeychainPassword.class); + } + + /** + * Convert an instance of Web3SigningCredentialGethKeychainPassword to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..aa464e6930 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,211 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..e6afaaf972 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..215dfad48c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java new file mode 100644 index 0000000000..a823bfc011 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java @@ -0,0 +1,705 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3Transaction + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3Transaction { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private String transactionIndex; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private String gas; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CHAIN_ID = "chainId"; + @SerializedName(SERIALIZED_NAME_CHAIN_ID) + private String chainId; + + public static final String SERIALIZED_NAME_V = "v"; + @SerializedName(SERIALIZED_NAME_V) + private String v; + + public static final String SERIALIZED_NAME_R = "r"; + @SerializedName(SERIALIZED_NAME_R) + private String r; + + public static final String SERIALIZED_NAME_S = "s"; + @SerializedName(SERIALIZED_NAME_S) + private String s; + + public Web3Transaction() { + } + + public Web3Transaction hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3Transaction nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3Transaction blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3Transaction blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3Transaction transactionIndex(String transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + + public String getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(String transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3Transaction from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3Transaction to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3Transaction value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public Web3Transaction gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nonnull + + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public Web3Transaction gas(String gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nonnull + + public String getGas() { + return gas; + } + + + public void setGas(String gas) { + this.gas = gas; + } + + + public Web3Transaction input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nonnull + + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + public Web3Transaction type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public Web3Transaction chainId(String chainId) { + + this.chainId = chainId; + return this; + } + + /** + * Get chainId + * @return chainId + **/ + @javax.annotation.Nonnull + + public String getChainId() { + return chainId; + } + + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + + public Web3Transaction v(String v) { + + this.v = v; + return this; + } + + /** + * Get v + * @return v + **/ + @javax.annotation.Nullable + + public String getV() { + return v; + } + + + public void setV(String v) { + this.v = v; + } + + + public Web3Transaction r(String r) { + + this.r = r; + return this; + } + + /** + * Get r + * @return r + **/ + @javax.annotation.Nullable + + public String getR() { + return r; + } + + + public void setR(String r) { + this.r = r; + } + + + public Web3Transaction s(String s) { + + this.s = s; + return this; + } + + /** + * Get s + * @return s + **/ + @javax.annotation.Nullable + + public String getS() { + return s; + } + + + public void setS(String s) { + this.s = s; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3Transaction web3Transaction = (Web3Transaction) o; + return Objects.equals(this.hash, web3Transaction.hash) && + Objects.equals(this.nonce, web3Transaction.nonce) && + Objects.equals(this.blockHash, web3Transaction.blockHash) && + Objects.equals(this.blockNumber, web3Transaction.blockNumber) && + Objects.equals(this.transactionIndex, web3Transaction.transactionIndex) && + Objects.equals(this.from, web3Transaction.from) && + Objects.equals(this.to, web3Transaction.to) && + Objects.equals(this.value, web3Transaction.value) && + Objects.equals(this.gasPrice, web3Transaction.gasPrice) && + Objects.equals(this.gas, web3Transaction.gas) && + Objects.equals(this.input, web3Transaction.input) && + Objects.equals(this.type, web3Transaction.type) && + Objects.equals(this.chainId, web3Transaction.chainId) && + Objects.equals(this.v, web3Transaction.v) && + Objects.equals(this.r, web3Transaction.r) && + Objects.equals(this.s, web3Transaction.s); + } + + @Override + public int hashCode() { + return Objects.hash(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gasPrice, gas, input, type, chainId, v, r, s); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3Transaction {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" chainId: ").append(toIndentedString(chainId)).append("\n"); + sb.append(" v: ").append(toIndentedString(v)).append("\n"); + sb.append(" r: ").append(toIndentedString(r)).append("\n"); + sb.append(" s: ").append(toIndentedString(s)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("nonce"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("transactionIndex"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gasPrice"); + openapiFields.add("gas"); + openapiFields.add("input"); + openapiFields.add("type"); + openapiFields.add("chainId"); + openapiFields.add("v"); + openapiFields.add("r"); + openapiFields.add("s"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("gasPrice"); + openapiRequiredFields.add("gas"); + openapiRequiredFields.add("input"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("chainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3Transaction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3Transaction.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3Transaction is not found in the empty JSON string", Web3Transaction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3Transaction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3Transaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3Transaction.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + if (!jsonObj.get("transactionIndex").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionIndex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionIndex").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if (!jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + if (!jsonObj.get("gas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gas").toString())); + } + if (!jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("chainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainId").toString())); + } + if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) && !jsonObj.get("v").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `v` to be a primitive type in the JSON string but got `%s`", jsonObj.get("v").toString())); + } + if ((jsonObj.get("r") != null && !jsonObj.get("r").isJsonNull()) && !jsonObj.get("r").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `r` to be a primitive type in the JSON string but got `%s`", jsonObj.get("r").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `s` to be a primitive type in the JSON string but got `%s`", jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3Transaction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3Transaction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3Transaction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3Transaction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3Transaction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3Transaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3Transaction + * @throws IOException if the JSON string is invalid with respect to Web3Transaction + */ + public static Web3Transaction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3Transaction.class); + } + + /** + * Convert an instance of Web3Transaction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 0000000000..3a29c6c423 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,827 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private String transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private String gasUsed; + + public static final String SERIALIZED_NAME_EFFECTIVE_GAS_PRICE = "effectiveGasPrice"; + @SerializedName(SERIALIZED_NAME_EFFECTIVE_GAS_PRICE) + private String effectiveGasPrice; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = null; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_REVERT_REASON = "revertReason"; + @SerializedName(SERIALIZED_NAME_REVERT_REASON) + private String revertReason; + + public static final String SERIALIZED_NAME_OUTPUT = "output"; + @SerializedName(SERIALIZED_NAME_OUTPUT) + private String output; + + public static final String SERIALIZED_NAME_COMMITMENT_HASH = "commitmentHash"; + @SerializedName(SERIALIZED_NAME_COMMITMENT_HASH) + private String commitmentHash; + + public static final String SERIALIZED_NAME_CUMULATIVE_GAS_USED = "cumulativeGasUsed"; + @SerializedName(SERIALIZED_NAME_CUMULATIVE_GAS_USED) + private String cumulativeGasUsed; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(String transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + + public String getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(String transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(String gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + + public String getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(String gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt effectiveGasPrice(String effectiveGasPrice) { + + this.effectiveGasPrice = effectiveGasPrice; + return this; + } + + /** + * Get effectiveGasPrice + * @return effectiveGasPrice + **/ + @javax.annotation.Nullable + + public String getEffectiveGasPrice() { + return effectiveGasPrice; + } + + + public void setEffectiveGasPrice(String effectiveGasPrice) { + this.effectiveGasPrice = effectiveGasPrice; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3TransactionReceipt logs(List logs) { + + this.logs = logs; + return this; + } + + public Web3TransactionReceipt addLogsItem(Object logsItem) { + if (this.logs == null) { + this.logs = null; + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nullable + + public List getLogs() { + return logs; + } + + + public void setLogs(List logs) { + this.logs = logs; + } + + + public Web3TransactionReceipt logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3TransactionReceipt revertReason(String revertReason) { + + this.revertReason = revertReason; + return this; + } + + /** + * Get revertReason + * @return revertReason + **/ + @javax.annotation.Nullable + + public String getRevertReason() { + return revertReason; + } + + + public void setRevertReason(String revertReason) { + this.revertReason = revertReason; + } + + + public Web3TransactionReceipt output(String output) { + + this.output = output; + return this; + } + + /** + * Get output + * @return output + **/ + @javax.annotation.Nullable + + public String getOutput() { + return output; + } + + + public void setOutput(String output) { + this.output = output; + } + + + public Web3TransactionReceipt commitmentHash(String commitmentHash) { + + this.commitmentHash = commitmentHash; + return this; + } + + /** + * Get commitmentHash + * @return commitmentHash + **/ + @javax.annotation.Nullable + + public String getCommitmentHash() { + return commitmentHash; + } + + + public void setCommitmentHash(String commitmentHash) { + this.commitmentHash = commitmentHash; + } + + + public Web3TransactionReceipt cumulativeGasUsed(String cumulativeGasUsed) { + + this.cumulativeGasUsed = cumulativeGasUsed; + return this; + } + + /** + * Get cumulativeGasUsed + * @return cumulativeGasUsed + **/ + @javax.annotation.Nullable + + public String getCumulativeGasUsed() { + return cumulativeGasUsed; + } + + + public void setCumulativeGasUsed(String cumulativeGasUsed) { + this.cumulativeGasUsed = cumulativeGasUsed; + } + + + public Web3TransactionReceipt type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.effectiveGasPrice, web3TransactionReceipt.effectiveGasPrice) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to) && + Objects.equals(this.logs, web3TransactionReceipt.logs) && + Objects.equals(this.logsBloom, web3TransactionReceipt.logsBloom) && + Objects.equals(this.revertReason, web3TransactionReceipt.revertReason) && + Objects.equals(this.output, web3TransactionReceipt.output) && + Objects.equals(this.commitmentHash, web3TransactionReceipt.commitmentHash) && + Objects.equals(this.cumulativeGasUsed, web3TransactionReceipt.cumulativeGasUsed) && + Objects.equals(this.type, web3TransactionReceipt.type)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, effectiveGasPrice, contractAddress, from, to, logs, logsBloom, revertReason, output, commitmentHash, cumulativeGasUsed, type, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" effectiveGasPrice: ").append(toIndentedString(effectiveGasPrice)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" revertReason: ").append(toIndentedString(revertReason)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" commitmentHash: ").append(toIndentedString(commitmentHash)).append("\n"); + sb.append(" cumulativeGasUsed: ").append(toIndentedString(cumulativeGasUsed)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("effectiveGasPrice"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("logs"); + openapiFields.add("logsBloom"); + openapiFields.add("revertReason"); + openapiFields.add("output"); + openapiFields.add("commitmentHash"); + openapiFields.add("cumulativeGasUsed"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("transactionIndex").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionIndex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionIndex").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + if (!jsonObj.get("gasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasUsed").toString())); + } + if ((jsonObj.get("effectiveGasPrice") != null && !jsonObj.get("effectiveGasPrice").isJsonNull()) && !jsonObj.get("effectiveGasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `effectiveGasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effectiveGasPrice").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("revertReason") != null && !jsonObj.get("revertReason").isJsonNull()) && !jsonObj.get("revertReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revertReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revertReason").toString())); + } + if ((jsonObj.get("output") != null && !jsonObj.get("output").isJsonNull()) && !jsonObj.get("output").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); + } + if ((jsonObj.get("commitmentHash") != null && !jsonObj.get("commitmentHash").isJsonNull()) && !jsonObj.get("commitmentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitmentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitmentHash").toString())); + } + if ((jsonObj.get("cumulativeGasUsed") != null && !jsonObj.get("cumulativeGasUsed").isJsonNull()) && !jsonObj.get("cumulativeGasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cumulativeGasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cumulativeGasUsed").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..fcce552e29 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,140 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeJsonObjectV1Test() throws ApiException { + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request); + // TODO: test validations + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeV1Test() throws ApiException { + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1NoKeychainTest() throws ApiException { + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = null; + InvokeContractV1Response response = api.invokeContractV1NoKeychain(invokeContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeRawWeb3EthContractV1Test() throws ApiException { + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = null; + InvokeRawWeb3EthContractV1Response response = api.invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request); + // TODO: test validations + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeWeb3EthMethodV1Test() throws ApiException { + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = null; + InvokeRawWeb3EthMethodV1Response response = api.invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a ethereum ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java new file mode 100644 index 0000000000..e98e470861 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java @@ -0,0 +1,146 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJSON + */ +public class ContractJSONTest { + private final ContractJSON model = new ContractJSON(); + + /** + * Model tests for ContractJSON + */ + @Test + public void testContractJSON() { + // TODO: test ContractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'networks' + */ + @Test + public void networksTest() { + // TODO: test networks + } + + /** + * Test the property 'ast' + */ + @Test + public void astTest() { + // TODO: test ast + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java new file mode 100644 index 0000000000..2f3dd05a23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java @@ -0,0 +1,93 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeJsonObjectV1Request + */ +public class DeployContractSolidityBytecodeJsonObjectV1RequestTest { + private final DeployContractSolidityBytecodeJsonObjectV1Request model = new DeployContractSolidityBytecodeJsonObjectV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeJsonObjectV1Request + */ + @Test + public void testDeployContractSolidityBytecodeJsonObjectV1Request() { + // TODO: test DeployContractSolidityBytecodeJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java new file mode 100644 index 0000000000..60741e6961 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java @@ -0,0 +1,140 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Request + */ +public class DeployContractSolidityBytecodeV1RequestTest { + private final DeployContractSolidityBytecodeV1Request model = new DeployContractSolidityBytecodeV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Request + */ + @Test + public void testDeployContractSolidityBytecodeV1Request() { + // TODO: test DeployContractSolidityBytecodeV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java new file mode 100644 index 0000000000..d69443b122 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Response + */ +public class DeployContractSolidityBytecodeV1ResponseTest { + private final DeployContractSolidityBytecodeV1Response model = new DeployContractSolidityBytecodeV1Response(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Response + */ + @Test + public void testDeployContractSolidityBytecodeV1Response() { + // TODO: test DeployContractSolidityBytecodeV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 0000000000..415c591002 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java new file mode 100644 index 0000000000..b04c42ef77 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationWeb3Method + */ +public class EthContractInvocationWeb3MethodTest { + /** + * Model tests for EthContractInvocationWeb3Method + */ + @Test + public void testEthContractInvocationWeb3Method() { + // TODO: test EthContractInvocationWeb3Method + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigFromTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigFromTest.java new file mode 100644 index 0000000000..544d037e89 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigFromTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthereumTransactionConfigFrom + */ +public class EthereumTransactionConfigFromTest { + private final EthereumTransactionConfigFrom model = new EthereumTransactionConfigFrom(); + + /** + * Model tests for EthereumTransactionConfigFrom + */ + @Test + public void testEthereumTransactionConfigFrom() { + // TODO: test EthereumTransactionConfigFrom + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java new file mode 100644 index 0000000000..f5317f6160 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.EthereumTransactionConfigFrom; +import org.openapitools.client.model.EthereumTransactionConfigTo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthereumTransactionConfig + */ +public class EthereumTransactionConfigTest { + private final EthereumTransactionConfig model = new EthereumTransactionConfig(); + + /** + * Model tests for EthereumTransactionConfig + */ + @Test + public void testEthereumTransactionConfig() { + // TODO: test EthereumTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigToTest.java new file mode 100644 index 0000000000..4523f53c3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthereumTransactionConfigTo + */ +public class EthereumTransactionConfigToTest { + private final EthereumTransactionConfigTo model = new EthereumTransactionConfigTo(); + + /** + * Model tests for EthereumTransactionConfigTo + */ + @Test + public void testEthereumTransactionConfigTo() { + // TODO: test EthereumTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java new file mode 100644 index 0000000000..ea2755c8d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GasTransactionConfigEIP1559 + */ +public class GasTransactionConfigEIP1559Test { + private final GasTransactionConfigEIP1559 model = new GasTransactionConfigEIP1559(); + + /** + * Model tests for GasTransactionConfigEIP1559 + */ + @Test + public void testGasTransactionConfigEIP1559() { + // TODO: test GasTransactionConfigEIP1559 + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'maxFeePerGas' + */ + @Test + public void maxFeePerGasTest() { + // TODO: test maxFeePerGas + } + + /** + * Test the property 'maxPriorityFeePerGas' + */ + @Test + public void maxPriorityFeePerGasTest() { + // TODO: test maxPriorityFeePerGas + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java new file mode 100644 index 0000000000..217c7ca939 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GasTransactionConfigLegacy + */ +public class GasTransactionConfigLegacyTest { + private final GasTransactionConfigLegacy model = new GasTransactionConfigLegacy(); + + /** + * Model tests for GasTransactionConfigLegacy + */ + @Test + public void testGasTransactionConfigLegacy() { + // TODO: test GasTransactionConfigLegacy + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java new file mode 100644 index 0000000000..ffd05a0802 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GasTransactionConfigEIP1559; +import org.openapitools.client.model.GasTransactionConfigLegacy; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GasTransactionConfig + */ +public class GasTransactionConfigTest { + private final GasTransactionConfig model = new GasTransactionConfig(); + + /** + * Model tests for GasTransactionConfig + */ + @Test + public void testGasTransactionConfig() { + // TODO: test GasTransactionConfig + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'maxFeePerGas' + */ + @Test + public void maxFeePerGasTest() { + // TODO: test maxFeePerGas + } + + /** + * Test the property 'maxPriorityFeePerGas' + */ + @Test + public void maxPriorityFeePerGasTest() { + // TODO: test maxPriorityFeePerGas + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java new file mode 100644 index 0000000000..3b544155a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java @@ -0,0 +1,135 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.EthereumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractJsonObjectV1Request + */ +public class InvokeContractJsonObjectV1RequestTest { + private final InvokeContractJsonObjectV1Request model = new InvokeContractJsonObjectV1Request(); + + /** + * Model tests for InvokeContractJsonObjectV1Request + */ + @Test + public void testInvokeContractJsonObjectV1Request() { + // TODO: test InvokeContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 0000000000..a2cbde74c9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.EthereumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..b8f535ab1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java new file mode 100644 index 0000000000..1c921fd4a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Request + */ +public class InvokeRawWeb3EthContractV1RequestTest { + private final InvokeRawWeb3EthContractV1Request model = new InvokeRawWeb3EthContractV1Request(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Request + */ + @Test + public void testInvokeRawWeb3EthContractV1Request() { + // TODO: test InvokeRawWeb3EthContractV1Request + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'invocationParams' + */ + @Test + public void invocationParamsTest() { + // TODO: test invocationParams + } + + /** + * Test the property 'contractMethod' + */ + @Test + public void contractMethodTest() { + // TODO: test contractMethod + } + + /** + * Test the property 'contractMethodArgs' + */ + @Test + public void contractMethodArgsTest() { + // TODO: test contractMethodArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java new file mode 100644 index 0000000000..0652bf96db --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Response + */ +public class InvokeRawWeb3EthContractV1ResponseTest { + private final InvokeRawWeb3EthContractV1Response model = new InvokeRawWeb3EthContractV1Response(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Response + */ + @Test + public void testInvokeRawWeb3EthContractV1Response() { + // TODO: test InvokeRawWeb3EthContractV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java new file mode 100644 index 0000000000..3f9ceb61ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ +public class InvokeRawWeb3EthMethodV1RequestTest { + private final InvokeRawWeb3EthMethodV1Request model = new InvokeRawWeb3EthMethodV1Request(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ + @Test + public void testInvokeRawWeb3EthMethodV1Request() { + // TODO: test InvokeRawWeb3EthMethodV1Request + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java new file mode 100644 index 0000000000..b9485f77e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ +public class InvokeRawWeb3EthMethodV1ResponseTest { + private final InvokeRawWeb3EthMethodV1Response model = new InvokeRawWeb3EthMethodV1Response(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ + @Test + public void testInvokeRawWeb3EthMethodV1Response() { + // TODO: test InvokeRawWeb3EthMethodV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 0000000000..05b284f7a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.EthereumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..8e6b15e022 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 0000000000..d1cce228e4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 0000000000..4b60606683 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 0000000000..797f027753 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 0000000000..2938d71860 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java new file mode 100644 index 0000000000..b85ea600d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java @@ -0,0 +1,205 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthereumTransactionConfigFrom; +import org.openapitools.client.model.Web3Transaction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1BlockData + */ +public class WatchBlocksV1BlockDataTest { + private final WatchBlocksV1BlockData model = new WatchBlocksV1BlockData(); + + /** + * Model tests for WatchBlocksV1BlockData + */ + @Test + public void testWatchBlocksV1BlockData() { + // TODO: test WatchBlocksV1BlockData + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'totalDifficulty' + */ + @Test + public void totalDifficultyTest() { + // TODO: test totalDifficulty + } + + /** + * Test the property 'uncles' + */ + @Test + public void unclesTest() { + // TODO: test uncles + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java new file mode 100644 index 0000000000..3f466f9273 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1BlockDataTimestamp + */ +public class WatchBlocksV1BlockDataTimestampTest { + private final WatchBlocksV1BlockDataTimestamp model = new WatchBlocksV1BlockDataTimestamp(); + + /** + * Model tests for WatchBlocksV1BlockDataTimestamp + */ + @Test + public void testWatchBlocksV1BlockDataTimestamp() { + // TODO: test WatchBlocksV1BlockDataTimestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java new file mode 100644 index 0000000000..afe389619d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Options + */ +public class WatchBlocksV1OptionsTest { + private final WatchBlocksV1Options model = new WatchBlocksV1Options(); + + /** + * Model tests for WatchBlocksV1Options + */ + @Test + public void testWatchBlocksV1Options() { + // TODO: test WatchBlocksV1Options + } + + /** + * Test the property 'getBlockData' + */ + @Test + public void getBlockDataTest() { + // TODO: test getBlockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 0000000000..8eb50ae7f3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'blockHeader' + */ + @Test + public void blockHeaderTest() { + // TODO: test blockHeader + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 0000000000..cd439dfc49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java new file mode 100644 index 0000000000..c49689da11 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java @@ -0,0 +1,170 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.EthereumTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeader + */ +public class Web3BlockHeaderTest { + private final Web3BlockHeader model = new Web3BlockHeader(); + + /** + * Model tests for Web3BlockHeader + */ + @Test + public void testWeb3BlockHeader() { + // TODO: test Web3BlockHeader + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..2de7638a78 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java new file mode 100644 index 0000000000..6f2583c187 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ +public class Web3SigningCredentialGethKeychainPasswordTest { + private final Web3SigningCredentialGethKeychainPassword model = new Web3SigningCredentialGethKeychainPassword(); + + /** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ + @Test + public void testWeb3SigningCredentialGethKeychainPassword() { + // TODO: test Web3SigningCredentialGethKeychainPassword + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..c0e60f8f66 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..59811cc6ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..de1b363a38 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..bc313fe1b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 0000000000..3ad787e7a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,164 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'revertReason' + */ + @Test + public void revertReasonTest() { + // TODO: test revertReason + } + + /** + * Test the property 'output' + */ + @Test + public void outputTest() { + // TODO: test output + } + + /** + * Test the property 'commitmentHash' + */ + @Test + public void commitmentHashTest() { + // TODO: test commitmentHash + } + + /** + * Test the property 'cumulativeGasUSed' + */ + @Test + public void cumulativeGasUSedTest() { + // TODO: test cumulativeGasUSed + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java new file mode 100644 index 0000000000..9301e1b75b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java @@ -0,0 +1,153 @@ +/* + * Hyperledger Cactus Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3Transaction + */ +public class Web3TransactionTest { + private final Web3Transaction model = new Web3Transaction(); + + /** + * Model tests for Web3Transaction + */ + @Test + public void testWeb3Transaction() { + // TODO: test Web3Transaction + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + + /** + * Test the property 'v' + */ + @Test + public void vTest() { + // TODO: test v + } + + /** + * Test the property 'r' + */ + @Test + public void rTest() { + // TODO: test r + } + + /** + * Test the property 's' + */ + @Test + public void sTest() { + // TODO: test s + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/package.json b/packages/cactus-plugin-ledger-connector-fabric/package.json index 054882e8aa..2213ccbd81 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/package.json +++ b/packages/cactus-plugin-ledger-connector-fabric/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..3db2da5b1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_chain_code_language_runtime.go +model_chain_code_life_cycle_command_responses.go +model_chain_code_programming_language.go +model_connection_profile.go +model_connection_profile_client.go +model_default_event_handler_strategy.go +model_deploy_contract_go_source_v1_501_response.go +model_deploy_contract_go_source_v1_request.go +model_deploy_contract_go_source_v1_request_constructor_args.go +model_deploy_contract_go_source_v1_response.go +model_deploy_contract_v1_request.go +model_deploy_contract_v1_response.go +model_deployment_target_org_fabric2x.go +model_deployment_target_organization.go +model_error_exception_response_v1.go +model_fabric_contract_invocation_type.go +model_fabric_signing_credential.go +model_fabric_signing_credential_type.go +model_file_base64.go +model_gateway_discovery_options.go +model_gateway_event_handler_options.go +model_gateway_options.go +model_gateway_options_wallet.go +model_get_block_request_v1.go +model_get_block_request_v1_query.go +model_get_block_request_v1_query_block_hash.go +model_get_block_response_decoded_v1.go +model_get_block_response_encoded_v1.go +model_get_block_response_v1.go +model_get_transaction_receipt_response.go +model_run_transaction_request.go +model_run_transaction_response.go +model_ssh_exec_command_response.go +model_transact_receipt_block_meta_data.go +model_transact_receipt_transaction_creator.go +model_transact_receipt_transaction_endorsement.go +model_vault_transit_key.go +model_watch_blocks_cactus_error_response_v1.go +model_watch_blocks_cactus_transactions_event_v1.go +model_watch_blocks_cactus_transactions_response_v1.go +model_watch_blocks_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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..3556c7bbf9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,164 @@ +# Go API client for cactus-plugin-ledger-connector-fabric + +Can perform basic tasks on a fabric ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-fabric "github.com/hyperledger/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractGoSourceV1**](docs/DefaultApi.md#deploycontractgosourcev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source | Deploys a chaincode contract in the form of a go sources. +*DefaultApi* | [**DeployContractV1**](docs/DefaultApi.md#deploycontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract | Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. +*DefaultApi* | [**GetBlockV1**](docs/DefaultApi.md#getblockv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block | Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**GetTransactionReceiptByTxIDV1**](docs/DefaultApi.md#gettransactionreceiptbytxidv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid | get a transaction receipt by tx id on a Fabric ledger. +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction | Runs a transaction on a Fabric ledger. + + +## Documentation For Models + + - [ChainCodeLanguageRuntime](docs/ChainCodeLanguageRuntime.md) + - [ChainCodeLifeCycleCommandResponses](docs/ChainCodeLifeCycleCommandResponses.md) + - [ChainCodeProgrammingLanguage](docs/ChainCodeProgrammingLanguage.md) + - [ConnectionProfile](docs/ConnectionProfile.md) + - [ConnectionProfileClient](docs/ConnectionProfileClient.md) + - [DefaultEventHandlerStrategy](docs/DefaultEventHandlerStrategy.md) + - [DeployContractGoSourceV1501Response](docs/DeployContractGoSourceV1501Response.md) + - [DeployContractGoSourceV1Request](docs/DeployContractGoSourceV1Request.md) + - [DeployContractGoSourceV1RequestConstructorArgs](docs/DeployContractGoSourceV1RequestConstructorArgs.md) + - [DeployContractGoSourceV1Response](docs/DeployContractGoSourceV1Response.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeploymentTargetOrgFabric2x](docs/DeploymentTargetOrgFabric2x.md) + - [DeploymentTargetOrganization](docs/DeploymentTargetOrganization.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [FabricContractInvocationType](docs/FabricContractInvocationType.md) + - [FabricSigningCredential](docs/FabricSigningCredential.md) + - [FabricSigningCredentialType](docs/FabricSigningCredentialType.md) + - [FileBase64](docs/FileBase64.md) + - [GatewayDiscoveryOptions](docs/GatewayDiscoveryOptions.md) + - [GatewayEventHandlerOptions](docs/GatewayEventHandlerOptions.md) + - [GatewayOptions](docs/GatewayOptions.md) + - [GatewayOptionsWallet](docs/GatewayOptionsWallet.md) + - [GetBlockRequestV1](docs/GetBlockRequestV1.md) + - [GetBlockRequestV1Query](docs/GetBlockRequestV1Query.md) + - [GetBlockRequestV1QueryBlockHash](docs/GetBlockRequestV1QueryBlockHash.md) + - [GetBlockResponseDecodedV1](docs/GetBlockResponseDecodedV1.md) + - [GetBlockResponseEncodedV1](docs/GetBlockResponseEncodedV1.md) + - [GetBlockResponseV1](docs/GetBlockResponseV1.md) + - [GetTransactionReceiptResponse](docs/GetTransactionReceiptResponse.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SSHExecCommandResponse](docs/SSHExecCommandResponse.md) + - [TransactReceiptBlockMetaData](docs/TransactReceiptBlockMetaData.md) + - [TransactReceiptTransactionCreator](docs/TransactReceiptTransactionCreator.md) + - [TransactReceiptTransactionEndorsement](docs/TransactReceiptTransactionEndorsement.md) + - [VaultTransitKey](docs/VaultTransitKey.md) + - [WatchBlocksCactusErrorResponseV1](docs/WatchBlocksCactusErrorResponseV1.md) + - [WatchBlocksCactusTransactionsEventV1](docs/WatchBlocksCactusTransactionsEventV1.md) + - [WatchBlocksCactusTransactionsResponseV1](docs/WatchBlocksCactusTransactionsResponseV1.md) + - [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 0000000000..7a4a9adeda --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1650 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a fabric ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Fabric + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction: + post: + description: "" + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "404": + description: "" + summary: Runs a transaction on a Fabric ledger. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + 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 + 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: responseType + transientData: "{}" + endorsingParties: + - endorsingParties + - endorsingParties + endorsingPeers: + - endorsingPeers + - endorsingPeers + 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 MSP IDs to set as the list of endorsing peers 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 + endorsingParties: + default: [] + items: + nullable: true + type: string + nullable: false + type: array + responseType: + type: string + required: + - channelName + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + RunTransactionResponse: + example: + success: true + functionOutput: functionOutput + transactionId: transactionId + properties: + functionOutput: + nullable: false + type: string + success: + nullable: false + type: boolean + transactionId: + nullable: false + type: string + required: + - functionOutput + - success + - transactionId + type: object + GetTransactionReceiptResponse: + example: + chainCodeVersion: chainCodeVersion + blockMetaData: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + transactionCreator: + mspid: mspid + creatorID: creatorID + blockNumber: blockNumber + chainCodeName: chainCodeName + transactionEndorsement: + - mspid: mspid + signature: signature + endorserID: endorserID + - mspid: mspid + signature: signature + endorserID: endorserID + responseStatus: responseStatus + channelID: channelID + rwsetWriteData: rwsetWriteData + rwsetKey: rwsetKey + properties: + blockNumber: + type: string + channelID: + type: string + transactionCreator: + $ref: '#/components/schemas/TransactReceiptTransactionCreator' + transactionEndorsement: + items: + $ref: '#/components/schemas/TransactReceiptTransactionEndorsement' + type: array + blockMetaData: + $ref: '#/components/schemas/TransactReceiptBlockMetaData' + chainCodeName: + type: string + chainCodeVersion: + type: string + responseStatus: + type: string + rwsetKey: + type: string + rwsetWriteData: + type: string + type: object + DeploymentTargetOrganization: + example: + CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + properties: + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeploymentTargetOrgFabric2x: + properties: + transient: + description: Transient map of arguments in JSON encoding + example: orderer.example.com:7050 + maxLength: 1073741824 + minLength: 1 + type: string + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeployContractGoSourceV1Request: + additionalProperties: false + example: + chainCodeVersion: 1.0.0 + pinnedDeps: + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + goSource: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + targetPeerAddresses: + - peer0.org1.example.com:7051 + goMod: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFiles: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + moduleName: hello-world-contract + policyDslSource: "AND('Org1MSP.member','Org2MSP.member')" + channelId: mychannel + modTidyOnly: true + properties: + policyDslSource: + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + tlsRootCertFiles: + description: The TLS root cert files that will be passed to the chaincode + instantiation command. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 65535 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + targetPeerAddresses: + description: An array of peer addresses where the contract will be instantiated. + Note that at present only the first item from this array will be used + which is the behavior taken from the official Fabric samples repository + and therefore it is assumed to be correct usage. + example: + - peer0.org1.example.com:7051 + items: + maxLength: 4096 + minLength: 1 + type: string + maxItems: 2048 + minItems: 1 + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + chainCodeVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + goSource: + $ref: '#/components/schemas/FileBase64' + goMod: + $ref: '#/components/schemas/FileBase64' + moduleName: + description: The go module name that will be used for the go compilation + process. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + pinnedDeps: + items: + example: github.com/hyperledger/fabric@v1.4.8 + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + modTidyOnly: + description: Indicates to the go chaincode compiler of Cactus if it should + do an actual go compilation with the contact source or if it should just + execute the go mod tidy command. + nullable: true + type: boolean + required: + - chainCodeVersion + - channelId + - goSource + - policyDslSource + - targetOrganizations + - targetPeerAddresses + - tlsRootCertFiles + type: object + DeployContractGoSourceV1Response: + example: + success: true + instantiationCommandResponse: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installationCommandResponses: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + success: + type: boolean + installationCommandResponses: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + type: array + instantiationCommandResponse: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - installationCommandResponses + - instantiationCommandResponse + - success + type: object + DeployContractV1Request: + additionalProperties: false + example: + ccVersion: 1.0.0 + ccLabel: hello-world-contract + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + ccLang: null + ccSequence: 1 + ccName: my-hello-world-contract + connTimeout: 0 + caFile: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + signaturePolicy: "AND('Org1MSP.member','Org2MSP.member')" + sourceFiles: + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + ordererTLSHostnameOverride: orderer.example.com:7050 + orderer: orderer.example.com:7050 + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + collectionsConfigFile: collectionsConfigFile + channelId: mychannel + properties: + ccLang: + $ref: '#/components/schemas/ChainCodeProgrammingLanguage' + caFile: + description: File-system path pointing at the CA file. + example: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + maxLength: 4096 + minLength: 1 + type: string + orderer: + description: Ordering service endpoint specified as : + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + ordererTLSHostnameOverride: + description: The hostname override to use when validating the TLS connection + to the orderer + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + connTimeout: + description: Timeout for client to connect (default 3s) + nullable: false + type: integer + signaturePolicy: + description: "Passed in to the peer via the --signature-policy argument\ + \ on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies" + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + collectionsConfigFile: + description: Name of the collections config file as present in the sourceFiles + array of the request. + maxLength: 255 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + ccSequence: + example: 1 + nullable: false + type: number + ccVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccName: + example: my-hello-world-contract + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccLabel: + description: Human readable label to uniquely identify the contract. Recommended + to include in this at least the contract name and the exact version in + order to make it easily distinguishable from other deployments of the + same contract. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + sourceFiles: + description: The your-smart-contract.go file where the functionality of + your contract is implemented. + items: + $ref: '#/components/schemas/FileBase64' + maxItems: 65535 + minItems: 1 + nullable: false + type: array + required: + - caFile + - ccLabel + - ccLang + - ccName + - ccSequence + - ccVersion + - channelId + - orderer + - ordererTLSHostnameOverride + - sourceFiles + - targetOrganizations + type: object + DeployContractV1Response: + example: + lifecycle: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + success: true + packageIds: + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + properties: + success: + type: boolean + packageIds: + items: + example: f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + lifecycle: + $ref: '#/components/schemas/ChainCodeLifeCycleCommandResponses' + required: + - lifecycle + - packageIds + - success + type: object + GetBlockRequestV1: + description: Request for GetBlock endpoint. + example: + gatewayOptions: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + query: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + skipDecode: false + channelName: channelName + connectionChannelName: connectionChannelName + properties: + channelName: + description: Fabric channel which we want to query. + maxLength: 100 + minLength: 1 + nullable: false + type: string + connectionChannelName: + description: "Fabric channel we want to connect to. If not provided, then\ + \ one from channelName parameter will be used" + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + query: + $ref: '#/components/schemas/GetBlockRequestV1_query' + skipDecode: + default: false + description: "If true, encoded buffer will be returned. Otherwise, entire\ + \ block object is returned." + nullable: false + type: boolean + required: + - channelName + - gatewayOptions + - query + type: object + FabricFullBlockDataV1: + description: Full hyperledger fabric block data. + GetBlockResponseDecodedV1: + description: When skipDecode is false (default) then decoded block object is + returned. + properties: + decodedBlock: + description: Full hyperledger fabric block data. + required: + - decodedBlock + type: object + GetBlockResponseEncodedV1: + description: When skipDecode is true then encoded block Buffer is returned. + properties: + encodedBlock: + type: string + required: + - encodedBlock + type: object + GetBlockResponseV1: + description: Response from GetBlock endpoint. + oneOf: + - $ref: '#/components/schemas/GetBlockResponseDecodedV1' + - $ref: '#/components/schemas/GetBlockResponseEncodedV1' + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.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 + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksListenerTypeV1: + description: "Response type from WatchBlocks. 'Cactus*' are custom views, others\ + \ correspond to fabric SDK call." + enum: + - filtered + - full + - private + - cactus:transactions + type: string + x-enum-varnames: + - Filtered + - Full + - Private + - CactusTransactions + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + channelName: + description: Hyperledger Fabric channel to connect to. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + type: + $ref: '#/components/schemas/WatchBlocksListenerTypeV1' + startBlock: + description: From which block start monitoring. Defaults to latest. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - channelName + - gatewayOptions + - type + type: object + WatchBlocksCactusTransactionsEventV1: + description: Transaction summary from commited block. + properties: + chaincodeId: + description: ChainCode containing function that was executed. + nullable: false + type: string + transactionId: + description: Transaction identifier. + nullable: false + type: string + functionName: + description: Function name that was executed. + nullable: false + type: string + functionArgs: + description: List of function arguments. + items: + minLength: 0 + nullable: false + type: string + type: array + required: + - chaincodeId + - functionArgs + - functionName + - transactionId + type: object + WatchBlocksCactusTransactionsResponseV1: + description: Custom response containing block transactions summary. Compatible + with legacy fabric-socketio connector monitoring. + properties: + cactusTransactionsEvents: + description: List of transactions summary + items: + $ref: '#/components/schemas/WatchBlocksCactusTransactionsEventV1' + type: array + required: + - cactusTransactionsEvents + type: object + WatchBlocksFullResponseV1: + description: Response that corresponds to Fabric SDK 'full' EventType. + properties: + fullBlock: + description: Full commited block. + nullable: false + required: + - fullBlock + type: object + WatchBlocksFilteredResponseV1: + description: Response that corresponds to Fabric SDK 'filtered' EventType. + properties: + filteredBlock: + description: Filtered commited block. + nullable: false + required: + - filteredBlock + type: object + WatchBlocksPrivateResponseV1: + description: Response that corresponds to Fabric SDK 'private' EventType. + properties: + privateBlock: + description: Private commited block. + nullable: false + required: + - privateBlock + type: object + WatchBlocksCactusErrorResponseV1: + description: Error response from WatchBlocks operation. + properties: + code: + description: Error code. + type: number + errorMessage: + description: Description of the error. + type: string + required: + - code + - errorMessage + type: object + WatchBlocksResponseV1: + description: Response block from WatchBlocks endpoint. Depends on 'type' passed + in subscription options. + oneOf: + - $ref: '#/components/schemas/WatchBlocksCactusTransactionsResponseV1' + - $ref: '#/components/schemas/WatchBlocksFullResponseV1' + - $ref: '#/components/schemas/WatchBlocksFilteredResponseV1' + - $ref: '#/components/schemas/WatchBlocksPrivateResponseV1' + - $ref: '#/components/schemas/WatchBlocksCactusErrorResponseV1' + deployContractGoSourceV1_501_response: + properties: + message: + maxLength: 2048 + minLength: 1 + nullable: false + type: string + type: object + ConnectionProfile_client: + example: + organization: Org1 + properties: + organization: + example: Org1 + type: string + type: object + GatewayOptions_wallet: + example: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + maxProperties: 1 + minProperties: 1 + properties: + keychain: + $ref: '#/components/schemas/FabricSigningCredential' + json: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + type: object + DeployContractGoSourceV1Request_constructorArgs: + example: "{} - An empty object literal can be sufficient if your contract does\ + \ not have parameters." + nullable: false + properties: + Args: + items: {} + maxLength: 2048 + minLength: 0 + type: array + type: object + GetBlockRequestV1_query_blockHash: + description: Select block by it's hash. + example: + buffer: buffer + encoding: encoding + nullable: false + properties: + encoding: + description: "NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...).\ + \ Passed directly to `Buffer.from()` call on hashBuffer. If not provided\ + \ then JSON buffer format is assumed." + nullable: false + type: string + buffer: + description: Buffer of blockHash. It's encoding should be described in `encoding` + parameter. + nullable: false + type: string + required: + - buffer + type: object + GetBlockRequestV1_query: + description: "Query selector, caller must provide at least one of them. First\ + \ found will be used, rest will be ignored, so it's recommended to pass single\ + \ selector." + example: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + properties: + blockNumber: + description: Select block by it's number. + nullable: false + type: string + blockHash: + $ref: '#/components/schemas/GetBlockRequestV1_query_blockHash' + transactionId: + description: Select block by id of transaction that it contains. + nullable: false + type: string + type: object diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..8b420b0597 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,685 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractGoSourceV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractGoSourceV1Request *DeployContractGoSourceV1Request +} + +func (r ApiDeployContractGoSourceV1Request) DeployContractGoSourceV1Request(deployContractGoSourceV1Request DeployContractGoSourceV1Request) ApiDeployContractGoSourceV1Request { + r.deployContractGoSourceV1Request = &deployContractGoSourceV1Request + return r +} + +func (r ApiDeployContractGoSourceV1Request) Execute() (*DeployContractGoSourceV1Response, *http.Response, error) { + return r.ApiService.DeployContractGoSourceV1Execute(r) +} + +/* +DeployContractGoSourceV1 Deploys a chaincode contract in the form of a go sources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractGoSourceV1Request +*/ +func (a *DefaultApiService) DeployContractGoSourceV1(ctx context.Context) ApiDeployContractGoSourceV1Request { + return ApiDeployContractGoSourceV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractGoSourceV1Response +func (a *DefaultApiService) DeployContractGoSourceV1Execute(r ApiDeployContractGoSourceV1Request) (*DeployContractGoSourceV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractGoSourceV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractGoSourceV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractGoSourceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 501 { + var v DeployContractGoSourceV1501Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractV1Request *DeployContractV1Request +} + +func (r ApiDeployContractV1Request) DeployContractV1Request(deployContractV1Request DeployContractV1Request) ApiDeployContractV1Request { + r.deployContractV1Request = &deployContractV1Request + return r +} + +func (r ApiDeployContractV1Request) Execute() (*DeployContractV1Response, *http.Response, error) { + return r.ApiService.DeployContractV1Execute(r) +} + +/* +DeployContractV1 Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractV1Request +*/ +func (a *DefaultApiService) DeployContractV1(ctx context.Context) ApiDeployContractV1Request { + return ApiDeployContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractV1Response +func (a *DefaultApiService) DeployContractV1Execute(r ApiDeployContractV1Request) (*DeployContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 501 { + var v DeployContractGoSourceV1501Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBlockV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBlockRequestV1 *GetBlockRequestV1 +} + +func (r ApiGetBlockV1Request) GetBlockRequestV1(getBlockRequestV1 GetBlockRequestV1) ApiGetBlockV1Request { + r.getBlockRequestV1 = &getBlockRequestV1 + return r +} + +func (r ApiGetBlockV1Request) Execute() (*GetBlockResponseV1, *http.Response, error) { + return r.ApiService.GetBlockV1Execute(r) +} + +/* +GetBlockV1 Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBlockV1Request +*/ +func (a *DefaultApiService) GetBlockV1(ctx context.Context) ApiGetBlockV1Request { + return ApiGetBlockV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBlockResponseV1 +func (a *DefaultApiService) GetBlockV1Execute(r ApiGetBlockV1Request) (*GetBlockResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBlockResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBlockV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBlockRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTransactionReceiptByTxIDV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiGetTransactionReceiptByTxIDV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiGetTransactionReceiptByTxIDV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiGetTransactionReceiptByTxIDV1Request) Execute() (*GetTransactionReceiptResponse, *http.Response, error) { + return r.ApiService.GetTransactionReceiptByTxIDV1Execute(r) +} + +/* +GetTransactionReceiptByTxIDV1 get a transaction receipt by tx id on a Fabric ledger. + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionReceiptByTxIDV1Request +*/ +func (a *DefaultApiService) GetTransactionReceiptByTxIDV1(ctx context.Context) ApiGetTransactionReceiptByTxIDV1Request { + return ApiGetTransactionReceiptByTxIDV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetTransactionReceiptResponse +func (a *DefaultApiService) GetTransactionReceiptByTxIDV1Execute(r ApiGetTransactionReceiptByTxIDV1Request) (*GetTransactionReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetTransactionReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionReceiptByTxIDV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.runTransactionRequest == nil { + return localVarReturnValue, nil, reportError("runTransactionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type 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, + } + 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 0000000000..9d664de79a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Fabric API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..d4c7a62489 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..d510592492 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..825dd71595 --- /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 0000000000..c966c8ddfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go new file mode 100644 index 0000000000..0763748344 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// ChainCodeLanguageRuntime Enumerates the supported programming language runtimes of Hyperledger Fabric +type ChainCodeLanguageRuntime string + +// List of ChainCodeLanguageRuntime +const ( + GOLANG ChainCodeLanguageRuntime = "golang" + NODE ChainCodeLanguageRuntime = "node" + JAVA ChainCodeLanguageRuntime = "java" +) + +// All allowed values of ChainCodeLanguageRuntime enum +var AllowedChainCodeLanguageRuntimeEnumValues = []ChainCodeLanguageRuntime{ + "golang", + "node", + "java", +} + +func (v *ChainCodeLanguageRuntime) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChainCodeLanguageRuntime(value) + for _, existing := range AllowedChainCodeLanguageRuntimeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChainCodeLanguageRuntime", value) +} + +// NewChainCodeLanguageRuntimeFromValue returns a pointer to a valid ChainCodeLanguageRuntime +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChainCodeLanguageRuntimeFromValue(v string) (*ChainCodeLanguageRuntime, error) { + ev := ChainCodeLanguageRuntime(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChainCodeLanguageRuntime: valid values are %v", v, AllowedChainCodeLanguageRuntimeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChainCodeLanguageRuntime) IsValid() bool { + for _, existing := range AllowedChainCodeLanguageRuntimeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChainCodeLanguageRuntime value +func (v ChainCodeLanguageRuntime) Ptr() *ChainCodeLanguageRuntime { + return &v +} + +type NullableChainCodeLanguageRuntime struct { + value *ChainCodeLanguageRuntime + isSet bool +} + +func (v NullableChainCodeLanguageRuntime) Get() *ChainCodeLanguageRuntime { + return v.value +} + +func (v *NullableChainCodeLanguageRuntime) Set(val *ChainCodeLanguageRuntime) { + v.value = val + v.isSet = true +} + +func (v NullableChainCodeLanguageRuntime) IsSet() bool { + return v.isSet +} + +func (v *NullableChainCodeLanguageRuntime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainCodeLanguageRuntime(val *ChainCodeLanguageRuntime) *NullableChainCodeLanguageRuntime { + return &NullableChainCodeLanguageRuntime{value: val, isSet: true} +} + +func (v NullableChainCodeLanguageRuntime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainCodeLanguageRuntime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go new file mode 100644 index 0000000000..258fc15cd3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ChainCodeLifeCycleCommandResponses type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChainCodeLifeCycleCommandResponses{} + +// ChainCodeLifeCycleCommandResponses struct for ChainCodeLifeCycleCommandResponses +type ChainCodeLifeCycleCommandResponses struct { + Packaging *SSHExecCommandResponse `json:"packaging,omitempty"` + InstallList []SSHExecCommandResponse `json:"installList"` + QueryInstalledList []SSHExecCommandResponse `json:"queryInstalledList"` + ApproveForMyOrgList []SSHExecCommandResponse `json:"approveForMyOrgList"` + Commit *SSHExecCommandResponse `json:"commit,omitempty"` + QueryCommitted *SSHExecCommandResponse `json:"queryCommitted,omitempty"` + Init *SSHExecCommandResponse `json:"init,omitempty"` +} + +// NewChainCodeLifeCycleCommandResponses instantiates a new ChainCodeLifeCycleCommandResponses object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChainCodeLifeCycleCommandResponses(installList []SSHExecCommandResponse, queryInstalledList []SSHExecCommandResponse, approveForMyOrgList []SSHExecCommandResponse) *ChainCodeLifeCycleCommandResponses { + this := ChainCodeLifeCycleCommandResponses{} + this.InstallList = installList + this.QueryInstalledList = queryInstalledList + this.ApproveForMyOrgList = approveForMyOrgList + return &this +} + +// NewChainCodeLifeCycleCommandResponsesWithDefaults instantiates a new ChainCodeLifeCycleCommandResponses object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainCodeLifeCycleCommandResponsesWithDefaults() *ChainCodeLifeCycleCommandResponses { + this := ChainCodeLifeCycleCommandResponses{} + return &this +} + +// GetPackaging returns the Packaging field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetPackaging() SSHExecCommandResponse { + if o == nil || IsNil(o.Packaging) { + var ret SSHExecCommandResponse + return ret + } + return *o.Packaging +} + +// GetPackagingOk returns a tuple with the Packaging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetPackagingOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.Packaging) { + return nil, false + } + return o.Packaging, true +} + +// HasPackaging returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasPackaging() bool { + if o != nil && !IsNil(o.Packaging) { + return true + } + + return false +} + +// SetPackaging gets a reference to the given SSHExecCommandResponse and assigns it to the Packaging field. +func (o *ChainCodeLifeCycleCommandResponses) SetPackaging(v SSHExecCommandResponse) { + o.Packaging = &v +} + +// GetInstallList returns the InstallList field value +func (o *ChainCodeLifeCycleCommandResponses) GetInstallList() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.InstallList +} + +// GetInstallListOk returns a tuple with the InstallList field value +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetInstallListOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.InstallList, true +} + +// SetInstallList sets field value +func (o *ChainCodeLifeCycleCommandResponses) SetInstallList(v []SSHExecCommandResponse) { + o.InstallList = v +} + +// GetQueryInstalledList returns the QueryInstalledList field value +func (o *ChainCodeLifeCycleCommandResponses) GetQueryInstalledList() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.QueryInstalledList +} + +// GetQueryInstalledListOk returns a tuple with the QueryInstalledList field value +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetQueryInstalledListOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.QueryInstalledList, true +} + +// SetQueryInstalledList sets field value +func (o *ChainCodeLifeCycleCommandResponses) SetQueryInstalledList(v []SSHExecCommandResponse) { + o.QueryInstalledList = v +} + +// GetApproveForMyOrgList returns the ApproveForMyOrgList field value +func (o *ChainCodeLifeCycleCommandResponses) GetApproveForMyOrgList() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.ApproveForMyOrgList +} + +// GetApproveForMyOrgListOk returns a tuple with the ApproveForMyOrgList field value +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetApproveForMyOrgListOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.ApproveForMyOrgList, true +} + +// SetApproveForMyOrgList sets field value +func (o *ChainCodeLifeCycleCommandResponses) SetApproveForMyOrgList(v []SSHExecCommandResponse) { + o.ApproveForMyOrgList = v +} + +// GetCommit returns the Commit field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetCommit() SSHExecCommandResponse { + if o == nil || IsNil(o.Commit) { + var ret SSHExecCommandResponse + return ret + } + return *o.Commit +} + +// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetCommitOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.Commit) { + return nil, false + } + return o.Commit, true +} + +// HasCommit returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasCommit() bool { + if o != nil && !IsNil(o.Commit) { + return true + } + + return false +} + +// SetCommit gets a reference to the given SSHExecCommandResponse and assigns it to the Commit field. +func (o *ChainCodeLifeCycleCommandResponses) SetCommit(v SSHExecCommandResponse) { + o.Commit = &v +} + +// GetQueryCommitted returns the QueryCommitted field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetQueryCommitted() SSHExecCommandResponse { + if o == nil || IsNil(o.QueryCommitted) { + var ret SSHExecCommandResponse + return ret + } + return *o.QueryCommitted +} + +// GetQueryCommittedOk returns a tuple with the QueryCommitted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetQueryCommittedOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.QueryCommitted) { + return nil, false + } + return o.QueryCommitted, true +} + +// HasQueryCommitted returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasQueryCommitted() bool { + if o != nil && !IsNil(o.QueryCommitted) { + return true + } + + return false +} + +// SetQueryCommitted gets a reference to the given SSHExecCommandResponse and assigns it to the QueryCommitted field. +func (o *ChainCodeLifeCycleCommandResponses) SetQueryCommitted(v SSHExecCommandResponse) { + o.QueryCommitted = &v +} + +// GetInit returns the Init field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetInit() SSHExecCommandResponse { + if o == nil || IsNil(o.Init) { + var ret SSHExecCommandResponse + return ret + } + return *o.Init +} + +// GetInitOk returns a tuple with the Init field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetInitOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.Init) { + return nil, false + } + return o.Init, true +} + +// HasInit returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasInit() bool { + if o != nil && !IsNil(o.Init) { + return true + } + + return false +} + +// SetInit gets a reference to the given SSHExecCommandResponse and assigns it to the Init field. +func (o *ChainCodeLifeCycleCommandResponses) SetInit(v SSHExecCommandResponse) { + o.Init = &v +} + +func (o ChainCodeLifeCycleCommandResponses) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChainCodeLifeCycleCommandResponses) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Packaging) { + toSerialize["packaging"] = o.Packaging + } + toSerialize["installList"] = o.InstallList + toSerialize["queryInstalledList"] = o.QueryInstalledList + toSerialize["approveForMyOrgList"] = o.ApproveForMyOrgList + if !IsNil(o.Commit) { + toSerialize["commit"] = o.Commit + } + if !IsNil(o.QueryCommitted) { + toSerialize["queryCommitted"] = o.QueryCommitted + } + if !IsNil(o.Init) { + toSerialize["init"] = o.Init + } + return toSerialize, nil +} + +type NullableChainCodeLifeCycleCommandResponses struct { + value *ChainCodeLifeCycleCommandResponses + isSet bool +} + +func (v NullableChainCodeLifeCycleCommandResponses) Get() *ChainCodeLifeCycleCommandResponses { + return v.value +} + +func (v *NullableChainCodeLifeCycleCommandResponses) Set(val *ChainCodeLifeCycleCommandResponses) { + v.value = val + v.isSet = true +} + +func (v NullableChainCodeLifeCycleCommandResponses) IsSet() bool { + return v.isSet +} + +func (v *NullableChainCodeLifeCycleCommandResponses) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainCodeLifeCycleCommandResponses(val *ChainCodeLifeCycleCommandResponses) *NullableChainCodeLifeCycleCommandResponses { + return &NullableChainCodeLifeCycleCommandResponses{value: val, isSet: true} +} + +func (v NullableChainCodeLifeCycleCommandResponses) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainCodeLifeCycleCommandResponses) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go new file mode 100644 index 0000000000..2645ca802e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// ChainCodeProgrammingLanguage Enumerates the supported source code programming languages of Hyperledger Fabric +type ChainCodeProgrammingLanguage string + +// List of ChainCodeProgrammingLanguage +const ( + GOLANG ChainCodeProgrammingLanguage = "golang" + JAVASCRIPT ChainCodeProgrammingLanguage = "javascript" + TYPESCRIPT ChainCodeProgrammingLanguage = "typescript" + JAVA ChainCodeProgrammingLanguage = "java" +) + +// All allowed values of ChainCodeProgrammingLanguage enum +var AllowedChainCodeProgrammingLanguageEnumValues = []ChainCodeProgrammingLanguage{ + "golang", + "javascript", + "typescript", + "java", +} + +func (v *ChainCodeProgrammingLanguage) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChainCodeProgrammingLanguage(value) + for _, existing := range AllowedChainCodeProgrammingLanguageEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChainCodeProgrammingLanguage", value) +} + +// NewChainCodeProgrammingLanguageFromValue returns a pointer to a valid ChainCodeProgrammingLanguage +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChainCodeProgrammingLanguageFromValue(v string) (*ChainCodeProgrammingLanguage, error) { + ev := ChainCodeProgrammingLanguage(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChainCodeProgrammingLanguage: valid values are %v", v, AllowedChainCodeProgrammingLanguageEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChainCodeProgrammingLanguage) IsValid() bool { + for _, existing := range AllowedChainCodeProgrammingLanguageEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChainCodeProgrammingLanguage value +func (v ChainCodeProgrammingLanguage) Ptr() *ChainCodeProgrammingLanguage { + return &v +} + +type NullableChainCodeProgrammingLanguage struct { + value *ChainCodeProgrammingLanguage + isSet bool +} + +func (v NullableChainCodeProgrammingLanguage) Get() *ChainCodeProgrammingLanguage { + return v.value +} + +func (v *NullableChainCodeProgrammingLanguage) Set(val *ChainCodeProgrammingLanguage) { + v.value = val + v.isSet = true +} + +func (v NullableChainCodeProgrammingLanguage) IsSet() bool { + return v.isSet +} + +func (v *NullableChainCodeProgrammingLanguage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainCodeProgrammingLanguage(val *ChainCodeProgrammingLanguage) *NullableChainCodeProgrammingLanguage { + return &NullableChainCodeProgrammingLanguage{value: val, isSet: true} +} + +func (v NullableChainCodeProgrammingLanguage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainCodeProgrammingLanguage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go new file mode 100644 index 0000000000..ec9e89674d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go @@ -0,0 +1,448 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ConnectionProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionProfile{} + +// ConnectionProfile struct for ConnectionProfile +type ConnectionProfile struct { + Name string `json:"name"` + XType *string `json:"x-type,omitempty"` + Description *string `json:"description,omitempty"` + Version string `json:"version"` + Client *ConnectionProfileClient `json:"client,omitempty"` + Channels map[string]interface{} `json:"channels,omitempty"` + Organizations map[string]interface{} `json:"organizations"` + Orderers map[string]interface{} `json:"orderers,omitempty"` + Peers map[string]interface{} `json:"peers"` + CertificateAuthorities map[string]interface{} `json:"certificateAuthorities,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConnectionProfile ConnectionProfile + +// NewConnectionProfile instantiates a new ConnectionProfile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionProfile(name string, version string, organizations map[string]interface{}, peers map[string]interface{}) *ConnectionProfile { + this := ConnectionProfile{} + this.Name = name + this.Version = version + this.Organizations = organizations + this.Peers = peers + return &this +} + +// NewConnectionProfileWithDefaults instantiates a new ConnectionProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionProfileWithDefaults() *ConnectionProfile { + this := ConnectionProfile{} + return &this +} + +// GetName returns the Name field value +func (o *ConnectionProfile) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConnectionProfile) SetName(v string) { + o.Name = v +} + +// GetXType returns the XType field value if set, zero value otherwise. +func (o *ConnectionProfile) GetXType() string { + if o == nil || IsNil(o.XType) { + var ret string + return ret + } + return *o.XType +} + +// GetXTypeOk returns a tuple with the XType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetXTypeOk() (*string, bool) { + if o == nil || IsNil(o.XType) { + return nil, false + } + return o.XType, true +} + +// HasXType returns a boolean if a field has been set. +func (o *ConnectionProfile) HasXType() bool { + if o != nil && !IsNil(o.XType) { + return true + } + + return false +} + +// SetXType gets a reference to the given string and assigns it to the XType field. +func (o *ConnectionProfile) SetXType(v string) { + o.XType = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConnectionProfile) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConnectionProfile) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConnectionProfile) SetDescription(v string) { + o.Description = &v +} + +// GetVersion returns the Version field value +func (o *ConnectionProfile) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ConnectionProfile) SetVersion(v string) { + o.Version = v +} + +// GetClient returns the Client field value if set, zero value otherwise. +func (o *ConnectionProfile) GetClient() ConnectionProfileClient { + if o == nil || IsNil(o.Client) { + var ret ConnectionProfileClient + return ret + } + return *o.Client +} + +// GetClientOk returns a tuple with the Client field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetClientOk() (*ConnectionProfileClient, bool) { + if o == nil || IsNil(o.Client) { + return nil, false + } + return o.Client, true +} + +// HasClient returns a boolean if a field has been set. +func (o *ConnectionProfile) HasClient() bool { + if o != nil && !IsNil(o.Client) { + return true + } + + return false +} + +// SetClient gets a reference to the given ConnectionProfileClient and assigns it to the Client field. +func (o *ConnectionProfile) SetClient(v ConnectionProfileClient) { + o.Client = &v +} + +// GetChannels returns the Channels field value if set, zero value otherwise. +func (o *ConnectionProfile) GetChannels() map[string]interface{} { + if o == nil || IsNil(o.Channels) { + var ret map[string]interface{} + return ret + } + return o.Channels +} + +// GetChannelsOk returns a tuple with the Channels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetChannelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Channels) { + return map[string]interface{}{}, false + } + return o.Channels, true +} + +// HasChannels returns a boolean if a field has been set. +func (o *ConnectionProfile) HasChannels() bool { + if o != nil && !IsNil(o.Channels) { + return true + } + + return false +} + +// SetChannels gets a reference to the given map[string]interface{} and assigns it to the Channels field. +func (o *ConnectionProfile) SetChannels(v map[string]interface{}) { + o.Channels = v +} + +// GetOrganizations returns the Organizations field value +func (o *ConnectionProfile) GetOrganizations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Organizations +} + +// GetOrganizationsOk returns a tuple with the Organizations field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetOrganizationsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Organizations, true +} + +// SetOrganizations sets field value +func (o *ConnectionProfile) SetOrganizations(v map[string]interface{}) { + o.Organizations = v +} + +// GetOrderers returns the Orderers field value if set, zero value otherwise. +func (o *ConnectionProfile) GetOrderers() map[string]interface{} { + if o == nil || IsNil(o.Orderers) { + var ret map[string]interface{} + return ret + } + return o.Orderers +} + +// GetOrderersOk returns a tuple with the Orderers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetOrderersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Orderers) { + return map[string]interface{}{}, false + } + return o.Orderers, true +} + +// HasOrderers returns a boolean if a field has been set. +func (o *ConnectionProfile) HasOrderers() bool { + if o != nil && !IsNil(o.Orderers) { + return true + } + + return false +} + +// SetOrderers gets a reference to the given map[string]interface{} and assigns it to the Orderers field. +func (o *ConnectionProfile) SetOrderers(v map[string]interface{}) { + o.Orderers = v +} + +// GetPeers returns the Peers field value +func (o *ConnectionProfile) GetPeers() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Peers +} + +// GetPeersOk returns a tuple with the Peers field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetPeersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Peers, true +} + +// SetPeers sets field value +func (o *ConnectionProfile) SetPeers(v map[string]interface{}) { + o.Peers = v +} + +// GetCertificateAuthorities returns the CertificateAuthorities field value if set, zero value otherwise. +func (o *ConnectionProfile) GetCertificateAuthorities() map[string]interface{} { + if o == nil || IsNil(o.CertificateAuthorities) { + var ret map[string]interface{} + return ret + } + return o.CertificateAuthorities +} + +// GetCertificateAuthoritiesOk returns a tuple with the CertificateAuthorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetCertificateAuthoritiesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CertificateAuthorities) { + return map[string]interface{}{}, false + } + return o.CertificateAuthorities, true +} + +// HasCertificateAuthorities returns a boolean if a field has been set. +func (o *ConnectionProfile) HasCertificateAuthorities() bool { + if o != nil && !IsNil(o.CertificateAuthorities) { + return true + } + + return false +} + +// SetCertificateAuthorities gets a reference to the given map[string]interface{} and assigns it to the CertificateAuthorities field. +func (o *ConnectionProfile) SetCertificateAuthorities(v map[string]interface{}) { + o.CertificateAuthorities = v +} + +func (o ConnectionProfile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.XType) { + toSerialize["x-type"] = o.XType + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["version"] = o.Version + if !IsNil(o.Client) { + toSerialize["client"] = o.Client + } + if !IsNil(o.Channels) { + toSerialize["channels"] = o.Channels + } + toSerialize["organizations"] = o.Organizations + if !IsNil(o.Orderers) { + toSerialize["orderers"] = o.Orderers + } + toSerialize["peers"] = o.Peers + if !IsNil(o.CertificateAuthorities) { + toSerialize["certificateAuthorities"] = o.CertificateAuthorities + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConnectionProfile) UnmarshalJSON(bytes []byte) (err error) { + varConnectionProfile := _ConnectionProfile{} + + if err = json.Unmarshal(bytes, &varConnectionProfile); err == nil { + *o = ConnectionProfile(varConnectionProfile) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "x-type") + delete(additionalProperties, "description") + delete(additionalProperties, "version") + delete(additionalProperties, "client") + delete(additionalProperties, "channels") + delete(additionalProperties, "organizations") + delete(additionalProperties, "orderers") + delete(additionalProperties, "peers") + delete(additionalProperties, "certificateAuthorities") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConnectionProfile struct { + value *ConnectionProfile + isSet bool +} + +func (v NullableConnectionProfile) Get() *ConnectionProfile { + return v.value +} + +func (v *NullableConnectionProfile) Set(val *ConnectionProfile) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionProfile(val *ConnectionProfile) *NullableConnectionProfile { + return &NullableConnectionProfile{value: val, isSet: true} +} + +func (v NullableConnectionProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go new file mode 100644 index 0000000000..fa0dbe0dc2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ConnectionProfileClient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionProfileClient{} + +// ConnectionProfileClient struct for ConnectionProfileClient +type ConnectionProfileClient struct { + Organization *string `json:"organization,omitempty"` +} + +// NewConnectionProfileClient instantiates a new ConnectionProfileClient object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionProfileClient() *ConnectionProfileClient { + this := ConnectionProfileClient{} + return &this +} + +// NewConnectionProfileClientWithDefaults instantiates a new ConnectionProfileClient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionProfileClientWithDefaults() *ConnectionProfileClient { + this := ConnectionProfileClient{} + return &this +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *ConnectionProfileClient) GetOrganization() string { + if o == nil || IsNil(o.Organization) { + var ret string + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfileClient) GetOrganizationOk() (*string, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *ConnectionProfileClient) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given string and assigns it to the Organization field. +func (o *ConnectionProfileClient) SetOrganization(v string) { + o.Organization = &v +} + +func (o ConnectionProfileClient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionProfileClient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + return toSerialize, nil +} + +type NullableConnectionProfileClient struct { + value *ConnectionProfileClient + isSet bool +} + +func (v NullableConnectionProfileClient) Get() *ConnectionProfileClient { + return v.value +} + +func (v *NullableConnectionProfileClient) Set(val *ConnectionProfileClient) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionProfileClient) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionProfileClient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionProfileClient(val *ConnectionProfileClient) *NullableConnectionProfileClient { + return &NullableConnectionProfileClient{value: val, isSet: true} +} + +func (v NullableConnectionProfileClient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionProfileClient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go new file mode 100644 index 0000000000..51ace2be48 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// DefaultEventHandlerStrategy the model 'DefaultEventHandlerStrategy' +type DefaultEventHandlerStrategy string + +// List of DefaultEventHandlerStrategy +const ( + MSPID_SCOPE_ALLFORTX DefaultEventHandlerStrategy = "MSPID_SCOPE_ALLFORTX" + MSPID_SCOPE_ANYFORTX DefaultEventHandlerStrategy = "MSPID_SCOPE_ANYFORTX" + NETWORK_SCOPE_ALLFORTX DefaultEventHandlerStrategy = "NETWORK_SCOPE_ALLFORTX" + NETWORK_SCOPE_ANYFORTX DefaultEventHandlerStrategy = "NETWORK_SCOPE_ANYFORTX" +) + +// All allowed values of DefaultEventHandlerStrategy enum +var AllowedDefaultEventHandlerStrategyEnumValues = []DefaultEventHandlerStrategy{ + "MSPID_SCOPE_ALLFORTX", + "MSPID_SCOPE_ANYFORTX", + "NETWORK_SCOPE_ALLFORTX", + "NETWORK_SCOPE_ANYFORTX", +} + +func (v *DefaultEventHandlerStrategy) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DefaultEventHandlerStrategy(value) + for _, existing := range AllowedDefaultEventHandlerStrategyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DefaultEventHandlerStrategy", value) +} + +// NewDefaultEventHandlerStrategyFromValue returns a pointer to a valid DefaultEventHandlerStrategy +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDefaultEventHandlerStrategyFromValue(v string) (*DefaultEventHandlerStrategy, error) { + ev := DefaultEventHandlerStrategy(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DefaultEventHandlerStrategy: valid values are %v", v, AllowedDefaultEventHandlerStrategyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DefaultEventHandlerStrategy) IsValid() bool { + for _, existing := range AllowedDefaultEventHandlerStrategyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DefaultEventHandlerStrategy value +func (v DefaultEventHandlerStrategy) Ptr() *DefaultEventHandlerStrategy { + return &v +} + +type NullableDefaultEventHandlerStrategy struct { + value *DefaultEventHandlerStrategy + isSet bool +} + +func (v NullableDefaultEventHandlerStrategy) Get() *DefaultEventHandlerStrategy { + return v.value +} + +func (v *NullableDefaultEventHandlerStrategy) Set(val *DefaultEventHandlerStrategy) { + v.value = val + v.isSet = true +} + +func (v NullableDefaultEventHandlerStrategy) IsSet() bool { + return v.isSet +} + +func (v *NullableDefaultEventHandlerStrategy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDefaultEventHandlerStrategy(val *DefaultEventHandlerStrategy) *NullableDefaultEventHandlerStrategy { + return &NullableDefaultEventHandlerStrategy{value: val, isSet: true} +} + +func (v NullableDefaultEventHandlerStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDefaultEventHandlerStrategy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go new file mode 100644 index 0000000000..3caaa6d7e6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1501Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1501Response{} + +// DeployContractGoSourceV1501Response struct for DeployContractGoSourceV1501Response +type DeployContractGoSourceV1501Response struct { + Message *string `json:"message,omitempty"` +} + +// NewDeployContractGoSourceV1501Response instantiates a new DeployContractGoSourceV1501Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1501Response() *DeployContractGoSourceV1501Response { + this := DeployContractGoSourceV1501Response{} + return &this +} + +// NewDeployContractGoSourceV1501ResponseWithDefaults instantiates a new DeployContractGoSourceV1501Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1501ResponseWithDefaults() *DeployContractGoSourceV1501Response { + this := DeployContractGoSourceV1501Response{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1501Response) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1501Response) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1501Response) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *DeployContractGoSourceV1501Response) SetMessage(v string) { + o.Message = &v +} + +func (o DeployContractGoSourceV1501Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1501Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1501Response struct { + value *DeployContractGoSourceV1501Response + isSet bool +} + +func (v NullableDeployContractGoSourceV1501Response) Get() *DeployContractGoSourceV1501Response { + return v.value +} + +func (v *NullableDeployContractGoSourceV1501Response) Set(val *DeployContractGoSourceV1501Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1501Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1501Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1501Response(val *DeployContractGoSourceV1501Response) *NullableDeployContractGoSourceV1501Response { + return &NullableDeployContractGoSourceV1501Response{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1501Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1501Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go new file mode 100644 index 0000000000..518c8bd1f2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go @@ -0,0 +1,474 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1Request{} + +// DeployContractGoSourceV1Request struct for DeployContractGoSourceV1Request +type DeployContractGoSourceV1Request struct { + PolicyDslSource string `json:"policyDslSource"` + // The TLS root cert files that will be passed to the chaincode instantiation command. + TlsRootCertFiles string `json:"tlsRootCertFiles"` + // The name of the Fabric channel where the contract will get instantiated. + ChannelId string `json:"channelId"` + TargetOrganizations []DeploymentTargetOrganization `json:"targetOrganizations"` + // An array of peer addresses where the contract will be instantiated. Note that at present only the first item from this array will be used which is the behavior taken from the official Fabric samples repository and therefore it is assumed to be correct usage. + TargetPeerAddresses []string `json:"targetPeerAddresses"` + ConstructorArgs *DeployContractGoSourceV1RequestConstructorArgs `json:"constructorArgs,omitempty"` + ChainCodeVersion string `json:"chainCodeVersion"` + GoSource FileBase64 `json:"goSource"` + GoMod *FileBase64 `json:"goMod,omitempty"` + // The go module name that will be used for the go compilation process. + ModuleName *string `json:"moduleName,omitempty"` + PinnedDeps []string `json:"pinnedDeps,omitempty"` + // Indicates to the go chaincode compiler of Cactus if it should do an actual go compilation with the contact source or if it should just execute the go mod tidy command. + ModTidyOnly NullableBool `json:"modTidyOnly,omitempty"` +} + +// NewDeployContractGoSourceV1Request instantiates a new DeployContractGoSourceV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1Request(policyDslSource string, tlsRootCertFiles string, channelId string, targetOrganizations []DeploymentTargetOrganization, targetPeerAddresses []string, chainCodeVersion string, goSource FileBase64) *DeployContractGoSourceV1Request { + this := DeployContractGoSourceV1Request{} + this.PolicyDslSource = policyDslSource + this.TlsRootCertFiles = tlsRootCertFiles + this.ChannelId = channelId + this.TargetOrganizations = targetOrganizations + this.TargetPeerAddresses = targetPeerAddresses + this.ChainCodeVersion = chainCodeVersion + this.GoSource = goSource + return &this +} + +// NewDeployContractGoSourceV1RequestWithDefaults instantiates a new DeployContractGoSourceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1RequestWithDefaults() *DeployContractGoSourceV1Request { + this := DeployContractGoSourceV1Request{} + return &this +} + +// GetPolicyDslSource returns the PolicyDslSource field value +func (o *DeployContractGoSourceV1Request) GetPolicyDslSource() string { + if o == nil { + var ret string + return ret + } + + return o.PolicyDslSource +} + +// GetPolicyDslSourceOk returns a tuple with the PolicyDslSource field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetPolicyDslSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PolicyDslSource, true +} + +// SetPolicyDslSource sets field value +func (o *DeployContractGoSourceV1Request) SetPolicyDslSource(v string) { + o.PolicyDslSource = v +} + +// GetTlsRootCertFiles returns the TlsRootCertFiles field value +func (o *DeployContractGoSourceV1Request) GetTlsRootCertFiles() string { + if o == nil { + var ret string + return ret + } + + return o.TlsRootCertFiles +} + +// GetTlsRootCertFilesOk returns a tuple with the TlsRootCertFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetTlsRootCertFilesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TlsRootCertFiles, true +} + +// SetTlsRootCertFiles sets field value +func (o *DeployContractGoSourceV1Request) SetTlsRootCertFiles(v string) { + o.TlsRootCertFiles = v +} + +// GetChannelId returns the ChannelId field value +func (o *DeployContractGoSourceV1Request) GetChannelId() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelId +} + +// GetChannelIdOk returns a tuple with the ChannelId field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetChannelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelId, true +} + +// SetChannelId sets field value +func (o *DeployContractGoSourceV1Request) SetChannelId(v string) { + o.ChannelId = v +} + +// GetTargetOrganizations returns the TargetOrganizations field value +func (o *DeployContractGoSourceV1Request) GetTargetOrganizations() []DeploymentTargetOrganization { + if o == nil { + var ret []DeploymentTargetOrganization + return ret + } + + return o.TargetOrganizations +} + +// GetTargetOrganizationsOk returns a tuple with the TargetOrganizations field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetTargetOrganizationsOk() ([]DeploymentTargetOrganization, bool) { + if o == nil { + return nil, false + } + return o.TargetOrganizations, true +} + +// SetTargetOrganizations sets field value +func (o *DeployContractGoSourceV1Request) SetTargetOrganizations(v []DeploymentTargetOrganization) { + o.TargetOrganizations = v +} + +// GetTargetPeerAddresses returns the TargetPeerAddresses field value +func (o *DeployContractGoSourceV1Request) GetTargetPeerAddresses() []string { + if o == nil { + var ret []string + return ret + } + + return o.TargetPeerAddresses +} + +// GetTargetPeerAddressesOk returns a tuple with the TargetPeerAddresses field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetTargetPeerAddressesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TargetPeerAddresses, true +} + +// SetTargetPeerAddresses sets field value +func (o *DeployContractGoSourceV1Request) SetTargetPeerAddresses(v []string) { + o.TargetPeerAddresses = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetConstructorArgs() DeployContractGoSourceV1RequestConstructorArgs { + if o == nil || IsNil(o.ConstructorArgs) { + var ret DeployContractGoSourceV1RequestConstructorArgs + return ret + } + return *o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetConstructorArgsOk() (*DeployContractGoSourceV1RequestConstructorArgs, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given DeployContractGoSourceV1RequestConstructorArgs and assigns it to the ConstructorArgs field. +func (o *DeployContractGoSourceV1Request) SetConstructorArgs(v DeployContractGoSourceV1RequestConstructorArgs) { + o.ConstructorArgs = &v +} + +// GetChainCodeVersion returns the ChainCodeVersion field value +func (o *DeployContractGoSourceV1Request) GetChainCodeVersion() string { + if o == nil { + var ret string + return ret + } + + return o.ChainCodeVersion +} + +// GetChainCodeVersionOk returns a tuple with the ChainCodeVersion field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetChainCodeVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainCodeVersion, true +} + +// SetChainCodeVersion sets field value +func (o *DeployContractGoSourceV1Request) SetChainCodeVersion(v string) { + o.ChainCodeVersion = v +} + +// GetGoSource returns the GoSource field value +func (o *DeployContractGoSourceV1Request) GetGoSource() FileBase64 { + if o == nil { + var ret FileBase64 + return ret + } + + return o.GoSource +} + +// GetGoSourceOk returns a tuple with the GoSource field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetGoSourceOk() (*FileBase64, bool) { + if o == nil { + return nil, false + } + return &o.GoSource, true +} + +// SetGoSource sets field value +func (o *DeployContractGoSourceV1Request) SetGoSource(v FileBase64) { + o.GoSource = v +} + +// GetGoMod returns the GoMod field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetGoMod() FileBase64 { + if o == nil || IsNil(o.GoMod) { + var ret FileBase64 + return ret + } + return *o.GoMod +} + +// GetGoModOk returns a tuple with the GoMod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetGoModOk() (*FileBase64, bool) { + if o == nil || IsNil(o.GoMod) { + return nil, false + } + return o.GoMod, true +} + +// HasGoMod returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasGoMod() bool { + if o != nil && !IsNil(o.GoMod) { + return true + } + + return false +} + +// SetGoMod gets a reference to the given FileBase64 and assigns it to the GoMod field. +func (o *DeployContractGoSourceV1Request) SetGoMod(v FileBase64) { + o.GoMod = &v +} + +// GetModuleName returns the ModuleName field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetModuleName() string { + if o == nil || IsNil(o.ModuleName) { + var ret string + return ret + } + return *o.ModuleName +} + +// GetModuleNameOk returns a tuple with the ModuleName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetModuleNameOk() (*string, bool) { + if o == nil || IsNil(o.ModuleName) { + return nil, false + } + return o.ModuleName, true +} + +// HasModuleName returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasModuleName() bool { + if o != nil && !IsNil(o.ModuleName) { + return true + } + + return false +} + +// SetModuleName gets a reference to the given string and assigns it to the ModuleName field. +func (o *DeployContractGoSourceV1Request) SetModuleName(v string) { + o.ModuleName = &v +} + +// GetPinnedDeps returns the PinnedDeps field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetPinnedDeps() []string { + if o == nil || IsNil(o.PinnedDeps) { + var ret []string + return ret + } + return o.PinnedDeps +} + +// GetPinnedDepsOk returns a tuple with the PinnedDeps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetPinnedDepsOk() ([]string, bool) { + if o == nil || IsNil(o.PinnedDeps) { + return nil, false + } + return o.PinnedDeps, true +} + +// HasPinnedDeps returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasPinnedDeps() bool { + if o != nil && !IsNil(o.PinnedDeps) { + return true + } + + return false +} + +// SetPinnedDeps gets a reference to the given []string and assigns it to the PinnedDeps field. +func (o *DeployContractGoSourceV1Request) SetPinnedDeps(v []string) { + o.PinnedDeps = v +} + +// GetModTidyOnly returns the ModTidyOnly field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeployContractGoSourceV1Request) GetModTidyOnly() bool { + if o == nil || IsNil(o.ModTidyOnly.Get()) { + var ret bool + return ret + } + return *o.ModTidyOnly.Get() +} + +// GetModTidyOnlyOk returns a tuple with the ModTidyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeployContractGoSourceV1Request) GetModTidyOnlyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ModTidyOnly.Get(), o.ModTidyOnly.IsSet() +} + +// HasModTidyOnly returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasModTidyOnly() bool { + if o != nil && o.ModTidyOnly.IsSet() { + return true + } + + return false +} + +// SetModTidyOnly gets a reference to the given NullableBool and assigns it to the ModTidyOnly field. +func (o *DeployContractGoSourceV1Request) SetModTidyOnly(v bool) { + o.ModTidyOnly.Set(&v) +} +// SetModTidyOnlyNil sets the value for ModTidyOnly to be an explicit nil +func (o *DeployContractGoSourceV1Request) SetModTidyOnlyNil() { + o.ModTidyOnly.Set(nil) +} + +// UnsetModTidyOnly ensures that no value is present for ModTidyOnly, not even an explicit nil +func (o *DeployContractGoSourceV1Request) UnsetModTidyOnly() { + o.ModTidyOnly.Unset() +} + +func (o DeployContractGoSourceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["policyDslSource"] = o.PolicyDslSource + toSerialize["tlsRootCertFiles"] = o.TlsRootCertFiles + toSerialize["channelId"] = o.ChannelId + toSerialize["targetOrganizations"] = o.TargetOrganizations + toSerialize["targetPeerAddresses"] = o.TargetPeerAddresses + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["chainCodeVersion"] = o.ChainCodeVersion + toSerialize["goSource"] = o.GoSource + if !IsNil(o.GoMod) { + toSerialize["goMod"] = o.GoMod + } + if !IsNil(o.ModuleName) { + toSerialize["moduleName"] = o.ModuleName + } + if !IsNil(o.PinnedDeps) { + toSerialize["pinnedDeps"] = o.PinnedDeps + } + if o.ModTidyOnly.IsSet() { + toSerialize["modTidyOnly"] = o.ModTidyOnly.Get() + } + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1Request struct { + value *DeployContractGoSourceV1Request + isSet bool +} + +func (v NullableDeployContractGoSourceV1Request) Get() *DeployContractGoSourceV1Request { + return v.value +} + +func (v *NullableDeployContractGoSourceV1Request) Set(val *DeployContractGoSourceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1Request(val *DeployContractGoSourceV1Request) *NullableDeployContractGoSourceV1Request { + return &NullableDeployContractGoSourceV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go new file mode 100644 index 0000000000..99102e68d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1RequestConstructorArgs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1RequestConstructorArgs{} + +// DeployContractGoSourceV1RequestConstructorArgs struct for DeployContractGoSourceV1RequestConstructorArgs +type DeployContractGoSourceV1RequestConstructorArgs struct { + Args []interface{} `json:"Args,omitempty"` +} + +// NewDeployContractGoSourceV1RequestConstructorArgs instantiates a new DeployContractGoSourceV1RequestConstructorArgs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1RequestConstructorArgs() *DeployContractGoSourceV1RequestConstructorArgs { + this := DeployContractGoSourceV1RequestConstructorArgs{} + return &this +} + +// NewDeployContractGoSourceV1RequestConstructorArgsWithDefaults instantiates a new DeployContractGoSourceV1RequestConstructorArgs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1RequestConstructorArgsWithDefaults() *DeployContractGoSourceV1RequestConstructorArgs { + this := DeployContractGoSourceV1RequestConstructorArgs{} + return &this +} + +// GetArgs returns the Args field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1RequestConstructorArgs) GetArgs() []interface{} { + if o == nil || IsNil(o.Args) { + var ret []interface{} + return ret + } + return o.Args +} + +// GetArgsOk returns a tuple with the Args field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1RequestConstructorArgs) GetArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Args) { + return nil, false + } + return o.Args, true +} + +// HasArgs returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1RequestConstructorArgs) HasArgs() bool { + if o != nil && !IsNil(o.Args) { + return true + } + + return false +} + +// SetArgs gets a reference to the given []interface{} and assigns it to the Args field. +func (o *DeployContractGoSourceV1RequestConstructorArgs) SetArgs(v []interface{}) { + o.Args = v +} + +func (o DeployContractGoSourceV1RequestConstructorArgs) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1RequestConstructorArgs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Args) { + toSerialize["Args"] = o.Args + } + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1RequestConstructorArgs struct { + value *DeployContractGoSourceV1RequestConstructorArgs + isSet bool +} + +func (v NullableDeployContractGoSourceV1RequestConstructorArgs) Get() *DeployContractGoSourceV1RequestConstructorArgs { + return v.value +} + +func (v *NullableDeployContractGoSourceV1RequestConstructorArgs) Set(val *DeployContractGoSourceV1RequestConstructorArgs) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1RequestConstructorArgs) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1RequestConstructorArgs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1RequestConstructorArgs(val *DeployContractGoSourceV1RequestConstructorArgs) *NullableDeployContractGoSourceV1RequestConstructorArgs { + return &NullableDeployContractGoSourceV1RequestConstructorArgs{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1RequestConstructorArgs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1RequestConstructorArgs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go new file mode 100644 index 0000000000..d15a10acb2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1Response{} + +// DeployContractGoSourceV1Response struct for DeployContractGoSourceV1Response +type DeployContractGoSourceV1Response struct { + Success bool `json:"success"` + InstallationCommandResponses []SSHExecCommandResponse `json:"installationCommandResponses"` + InstantiationCommandResponse SSHExecCommandResponse `json:"instantiationCommandResponse"` +} + +// NewDeployContractGoSourceV1Response instantiates a new DeployContractGoSourceV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1Response(success bool, installationCommandResponses []SSHExecCommandResponse, instantiationCommandResponse SSHExecCommandResponse) *DeployContractGoSourceV1Response { + this := DeployContractGoSourceV1Response{} + this.Success = success + this.InstallationCommandResponses = installationCommandResponses + this.InstantiationCommandResponse = instantiationCommandResponse + return &this +} + +// NewDeployContractGoSourceV1ResponseWithDefaults instantiates a new DeployContractGoSourceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1ResponseWithDefaults() *DeployContractGoSourceV1Response { + this := DeployContractGoSourceV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *DeployContractGoSourceV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *DeployContractGoSourceV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetInstallationCommandResponses returns the InstallationCommandResponses field value +func (o *DeployContractGoSourceV1Response) GetInstallationCommandResponses() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.InstallationCommandResponses +} + +// GetInstallationCommandResponsesOk returns a tuple with the InstallationCommandResponses field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Response) GetInstallationCommandResponsesOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.InstallationCommandResponses, true +} + +// SetInstallationCommandResponses sets field value +func (o *DeployContractGoSourceV1Response) SetInstallationCommandResponses(v []SSHExecCommandResponse) { + o.InstallationCommandResponses = v +} + +// GetInstantiationCommandResponse returns the InstantiationCommandResponse field value +func (o *DeployContractGoSourceV1Response) GetInstantiationCommandResponse() SSHExecCommandResponse { + if o == nil { + var ret SSHExecCommandResponse + return ret + } + + return o.InstantiationCommandResponse +} + +// GetInstantiationCommandResponseOk returns a tuple with the InstantiationCommandResponse field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Response) GetInstantiationCommandResponseOk() (*SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return &o.InstantiationCommandResponse, true +} + +// SetInstantiationCommandResponse sets field value +func (o *DeployContractGoSourceV1Response) SetInstantiationCommandResponse(v SSHExecCommandResponse) { + o.InstantiationCommandResponse = v +} + +func (o DeployContractGoSourceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["installationCommandResponses"] = o.InstallationCommandResponses + toSerialize["instantiationCommandResponse"] = o.InstantiationCommandResponse + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1Response struct { + value *DeployContractGoSourceV1Response + isSet bool +} + +func (v NullableDeployContractGoSourceV1Response) Get() *DeployContractGoSourceV1Response { + return v.value +} + +func (v *NullableDeployContractGoSourceV1Response) Set(val *DeployContractGoSourceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1Response(val *DeployContractGoSourceV1Response) *NullableDeployContractGoSourceV1Response { + return &NullableDeployContractGoSourceV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go new file mode 100644 index 0000000000..a111e7c6be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go @@ -0,0 +1,540 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Request{} + +// DeployContractV1Request struct for DeployContractV1Request +type DeployContractV1Request struct { + CcLang ChainCodeProgrammingLanguage `json:"ccLang"` + // File-system path pointing at the CA file. + CaFile string `json:"caFile"` + // Ordering service endpoint specified as : + Orderer string `json:"orderer"` + // The hostname override to use when validating the TLS connection to the orderer + OrdererTLSHostnameOverride string `json:"ordererTLSHostnameOverride"` + // Timeout for client to connect (default 3s) + ConnTimeout *int32 `json:"connTimeout,omitempty"` + // Passed in to the peer via the --signature-policy argument on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies + SignaturePolicy *string `json:"signaturePolicy,omitempty"` + // Name of the collections config file as present in the sourceFiles array of the request. + CollectionsConfigFile *string `json:"collectionsConfigFile,omitempty"` + // The name of the Fabric channel where the contract will get instantiated. + ChannelId string `json:"channelId"` + TargetOrganizations []DeploymentTargetOrganization `json:"targetOrganizations"` + ConstructorArgs *DeployContractGoSourceV1RequestConstructorArgs `json:"constructorArgs,omitempty"` + CcSequence float32 `json:"ccSequence"` + CcVersion string `json:"ccVersion"` + CcName string `json:"ccName"` + // Human readable label to uniquely identify the contract. Recommended to include in this at least the contract name and the exact version in order to make it easily distinguishable from other deployments of the same contract. + CcLabel string `json:"ccLabel"` + // The your-smart-contract.go file where the functionality of your contract is implemented. + SourceFiles []FileBase64 `json:"sourceFiles"` +} + +// NewDeployContractV1Request instantiates a new DeployContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractV1Request(ccLang ChainCodeProgrammingLanguage, caFile string, orderer string, ordererTLSHostnameOverride string, channelId string, targetOrganizations []DeploymentTargetOrganization, ccSequence float32, ccVersion string, ccName string, ccLabel string, sourceFiles []FileBase64) *DeployContractV1Request { + this := DeployContractV1Request{} + this.CcLang = ccLang + this.CaFile = caFile + this.Orderer = orderer + this.OrdererTLSHostnameOverride = ordererTLSHostnameOverride + this.ChannelId = channelId + this.TargetOrganizations = targetOrganizations + this.CcSequence = ccSequence + this.CcVersion = ccVersion + this.CcName = ccName + this.CcLabel = ccLabel + this.SourceFiles = sourceFiles + return &this +} + +// NewDeployContractV1RequestWithDefaults instantiates a new DeployContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1RequestWithDefaults() *DeployContractV1Request { + this := DeployContractV1Request{} + return &this +} + +// GetCcLang returns the CcLang field value +func (o *DeployContractV1Request) GetCcLang() ChainCodeProgrammingLanguage { + if o == nil { + var ret ChainCodeProgrammingLanguage + return ret + } + + return o.CcLang +} + +// GetCcLangOk returns a tuple with the CcLang field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcLangOk() (*ChainCodeProgrammingLanguage, bool) { + if o == nil { + return nil, false + } + return &o.CcLang, true +} + +// SetCcLang sets field value +func (o *DeployContractV1Request) SetCcLang(v ChainCodeProgrammingLanguage) { + o.CcLang = v +} + +// GetCaFile returns the CaFile field value +func (o *DeployContractV1Request) GetCaFile() string { + if o == nil { + var ret string + return ret + } + + return o.CaFile +} + +// GetCaFileOk returns a tuple with the CaFile field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCaFileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CaFile, true +} + +// SetCaFile sets field value +func (o *DeployContractV1Request) SetCaFile(v string) { + o.CaFile = v +} + +// GetOrderer returns the Orderer field value +func (o *DeployContractV1Request) GetOrderer() string { + if o == nil { + var ret string + return ret + } + + return o.Orderer +} + +// GetOrdererOk returns a tuple with the Orderer field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetOrdererOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Orderer, true +} + +// SetOrderer sets field value +func (o *DeployContractV1Request) SetOrderer(v string) { + o.Orderer = v +} + +// GetOrdererTLSHostnameOverride returns the OrdererTLSHostnameOverride field value +func (o *DeployContractV1Request) GetOrdererTLSHostnameOverride() string { + if o == nil { + var ret string + return ret + } + + return o.OrdererTLSHostnameOverride +} + +// GetOrdererTLSHostnameOverrideOk returns a tuple with the OrdererTLSHostnameOverride field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetOrdererTLSHostnameOverrideOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrdererTLSHostnameOverride, true +} + +// SetOrdererTLSHostnameOverride sets field value +func (o *DeployContractV1Request) SetOrdererTLSHostnameOverride(v string) { + o.OrdererTLSHostnameOverride = v +} + +// GetConnTimeout returns the ConnTimeout field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConnTimeout() int32 { + if o == nil || IsNil(o.ConnTimeout) { + var ret int32 + return ret + } + return *o.ConnTimeout +} + +// GetConnTimeoutOk returns a tuple with the ConnTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConnTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.ConnTimeout) { + return nil, false + } + return o.ConnTimeout, true +} + +// HasConnTimeout returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConnTimeout() bool { + if o != nil && !IsNil(o.ConnTimeout) { + return true + } + + return false +} + +// SetConnTimeout gets a reference to the given int32 and assigns it to the ConnTimeout field. +func (o *DeployContractV1Request) SetConnTimeout(v int32) { + o.ConnTimeout = &v +} + +// GetSignaturePolicy returns the SignaturePolicy field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetSignaturePolicy() string { + if o == nil || IsNil(o.SignaturePolicy) { + var ret string + return ret + } + return *o.SignaturePolicy +} + +// GetSignaturePolicyOk returns a tuple with the SignaturePolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetSignaturePolicyOk() (*string, bool) { + if o == nil || IsNil(o.SignaturePolicy) { + return nil, false + } + return o.SignaturePolicy, true +} + +// HasSignaturePolicy returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasSignaturePolicy() bool { + if o != nil && !IsNil(o.SignaturePolicy) { + return true + } + + return false +} + +// SetSignaturePolicy gets a reference to the given string and assigns it to the SignaturePolicy field. +func (o *DeployContractV1Request) SetSignaturePolicy(v string) { + o.SignaturePolicy = &v +} + +// GetCollectionsConfigFile returns the CollectionsConfigFile field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetCollectionsConfigFile() string { + if o == nil || IsNil(o.CollectionsConfigFile) { + var ret string + return ret + } + return *o.CollectionsConfigFile +} + +// GetCollectionsConfigFileOk returns a tuple with the CollectionsConfigFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCollectionsConfigFileOk() (*string, bool) { + if o == nil || IsNil(o.CollectionsConfigFile) { + return nil, false + } + return o.CollectionsConfigFile, true +} + +// HasCollectionsConfigFile returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasCollectionsConfigFile() bool { + if o != nil && !IsNil(o.CollectionsConfigFile) { + return true + } + + return false +} + +// SetCollectionsConfigFile gets a reference to the given string and assigns it to the CollectionsConfigFile field. +func (o *DeployContractV1Request) SetCollectionsConfigFile(v string) { + o.CollectionsConfigFile = &v +} + +// GetChannelId returns the ChannelId field value +func (o *DeployContractV1Request) GetChannelId() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelId +} + +// GetChannelIdOk returns a tuple with the ChannelId field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetChannelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelId, true +} + +// SetChannelId sets field value +func (o *DeployContractV1Request) SetChannelId(v string) { + o.ChannelId = v +} + +// GetTargetOrganizations returns the TargetOrganizations field value +func (o *DeployContractV1Request) GetTargetOrganizations() []DeploymentTargetOrganization { + if o == nil { + var ret []DeploymentTargetOrganization + return ret + } + + return o.TargetOrganizations +} + +// GetTargetOrganizationsOk returns a tuple with the TargetOrganizations field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetTargetOrganizationsOk() ([]DeploymentTargetOrganization, bool) { + if o == nil { + return nil, false + } + return o.TargetOrganizations, true +} + +// SetTargetOrganizations sets field value +func (o *DeployContractV1Request) SetTargetOrganizations(v []DeploymentTargetOrganization) { + o.TargetOrganizations = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConstructorArgs() DeployContractGoSourceV1RequestConstructorArgs { + if o == nil || IsNil(o.ConstructorArgs) { + var ret DeployContractGoSourceV1RequestConstructorArgs + return ret + } + return *o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConstructorArgsOk() (*DeployContractGoSourceV1RequestConstructorArgs, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given DeployContractGoSourceV1RequestConstructorArgs and assigns it to the ConstructorArgs field. +func (o *DeployContractV1Request) SetConstructorArgs(v DeployContractGoSourceV1RequestConstructorArgs) { + o.ConstructorArgs = &v +} + +// GetCcSequence returns the CcSequence field value +func (o *DeployContractV1Request) GetCcSequence() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CcSequence +} + +// GetCcSequenceOk returns a tuple with the CcSequence field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcSequenceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CcSequence, true +} + +// SetCcSequence sets field value +func (o *DeployContractV1Request) SetCcSequence(v float32) { + o.CcSequence = v +} + +// GetCcVersion returns the CcVersion field value +func (o *DeployContractV1Request) GetCcVersion() string { + if o == nil { + var ret string + return ret + } + + return o.CcVersion +} + +// GetCcVersionOk returns a tuple with the CcVersion field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CcVersion, true +} + +// SetCcVersion sets field value +func (o *DeployContractV1Request) SetCcVersion(v string) { + o.CcVersion = v +} + +// GetCcName returns the CcName field value +func (o *DeployContractV1Request) GetCcName() string { + if o == nil { + var ret string + return ret + } + + return o.CcName +} + +// GetCcNameOk returns a tuple with the CcName field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CcName, true +} + +// SetCcName sets field value +func (o *DeployContractV1Request) SetCcName(v string) { + o.CcName = v +} + +// GetCcLabel returns the CcLabel field value +func (o *DeployContractV1Request) GetCcLabel() string { + if o == nil { + var ret string + return ret + } + + return o.CcLabel +} + +// GetCcLabelOk returns a tuple with the CcLabel field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CcLabel, true +} + +// SetCcLabel sets field value +func (o *DeployContractV1Request) SetCcLabel(v string) { + o.CcLabel = v +} + +// GetSourceFiles returns the SourceFiles field value +func (o *DeployContractV1Request) GetSourceFiles() []FileBase64 { + if o == nil { + var ret []FileBase64 + return ret + } + + return o.SourceFiles +} + +// GetSourceFilesOk returns a tuple with the SourceFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetSourceFilesOk() ([]FileBase64, bool) { + if o == nil { + return nil, false + } + return o.SourceFiles, true +} + +// SetSourceFiles sets field value +func (o *DeployContractV1Request) SetSourceFiles(v []FileBase64) { + o.SourceFiles = v +} + +func (o DeployContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ccLang"] = o.CcLang + toSerialize["caFile"] = o.CaFile + toSerialize["orderer"] = o.Orderer + toSerialize["ordererTLSHostnameOverride"] = o.OrdererTLSHostnameOverride + if !IsNil(o.ConnTimeout) { + toSerialize["connTimeout"] = o.ConnTimeout + } + if !IsNil(o.SignaturePolicy) { + toSerialize["signaturePolicy"] = o.SignaturePolicy + } + if !IsNil(o.CollectionsConfigFile) { + toSerialize["collectionsConfigFile"] = o.CollectionsConfigFile + } + toSerialize["channelId"] = o.ChannelId + toSerialize["targetOrganizations"] = o.TargetOrganizations + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["ccSequence"] = o.CcSequence + toSerialize["ccVersion"] = o.CcVersion + toSerialize["ccName"] = o.CcName + toSerialize["ccLabel"] = o.CcLabel + toSerialize["sourceFiles"] = o.SourceFiles + return toSerialize, nil +} + +type NullableDeployContractV1Request struct { + value *DeployContractV1Request + isSet bool +} + +func (v NullableDeployContractV1Request) Get() *DeployContractV1Request { + return v.value +} + +func (v *NullableDeployContractV1Request) Set(val *DeployContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Request(val *DeployContractV1Request) *NullableDeployContractV1Request { + return &NullableDeployContractV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go new file mode 100644 index 0000000000..da5c210e78 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Response{} + +// DeployContractV1Response struct for DeployContractV1Response +type DeployContractV1Response struct { + Success bool `json:"success"` + PackageIds []string `json:"packageIds"` + Lifecycle ChainCodeLifeCycleCommandResponses `json:"lifecycle"` +} + +// NewDeployContractV1Response instantiates a new DeployContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractV1Response(success bool, packageIds []string, lifecycle ChainCodeLifeCycleCommandResponses) *DeployContractV1Response { + this := DeployContractV1Response{} + this.Success = success + this.PackageIds = packageIds + this.Lifecycle = lifecycle + return &this +} + +// NewDeployContractV1ResponseWithDefaults instantiates a new DeployContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1ResponseWithDefaults() *DeployContractV1Response { + this := DeployContractV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *DeployContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *DeployContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetPackageIds returns the PackageIds field value +func (o *DeployContractV1Response) GetPackageIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.PackageIds +} + +// GetPackageIdsOk returns a tuple with the PackageIds field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetPackageIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PackageIds, true +} + +// SetPackageIds sets field value +func (o *DeployContractV1Response) SetPackageIds(v []string) { + o.PackageIds = v +} + +// GetLifecycle returns the Lifecycle field value +func (o *DeployContractV1Response) GetLifecycle() ChainCodeLifeCycleCommandResponses { + if o == nil { + var ret ChainCodeLifeCycleCommandResponses + return ret + } + + return o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetLifecycleOk() (*ChainCodeLifeCycleCommandResponses, bool) { + if o == nil { + return nil, false + } + return &o.Lifecycle, true +} + +// SetLifecycle sets field value +func (o *DeployContractV1Response) SetLifecycle(v ChainCodeLifeCycleCommandResponses) { + o.Lifecycle = v +} + +func (o DeployContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["packageIds"] = o.PackageIds + toSerialize["lifecycle"] = o.Lifecycle + return toSerialize, nil +} + +type NullableDeployContractV1Response struct { + value *DeployContractV1Response + isSet bool +} + +func (v NullableDeployContractV1Response) Get() *DeployContractV1Response { + return v.value +} + +func (v *NullableDeployContractV1Response) Set(val *DeployContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Response(val *DeployContractV1Response) *NullableDeployContractV1Response { + return &NullableDeployContractV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go new file mode 100644 index 0000000000..dbf6245ed7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go @@ -0,0 +1,267 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeploymentTargetOrgFabric2x type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeploymentTargetOrgFabric2x{} + +// DeploymentTargetOrgFabric2x struct for DeploymentTargetOrgFabric2x +type DeploymentTargetOrgFabric2x struct { + // Transient map of arguments in JSON encoding + Transient *string `json:"transient,omitempty"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_LOCALMSPID string `json:"CORE_PEER_LOCALMSPID"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_ADDRESS string `json:"CORE_PEER_ADDRESS"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_MSPCONFIGPATH string `json:"CORE_PEER_MSPCONFIGPATH"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_TLS_ROOTCERT_FILE string `json:"CORE_PEER_TLS_ROOTCERT_FILE"` + // Mapped to environment variables of the Fabric CLI container. + ORDERER_TLS_ROOTCERT_FILE string `json:"ORDERER_TLS_ROOTCERT_FILE"` +} + +// NewDeploymentTargetOrgFabric2x instantiates a new DeploymentTargetOrgFabric2x object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeploymentTargetOrgFabric2x(cOREPEERLOCALMSPID string, cOREPEERADDRESS string, cOREPEERMSPCONFIGPATH string, cOREPEERTLSROOTCERTFILE string, oRDERERTLSROOTCERTFILE string) *DeploymentTargetOrgFabric2x { + this := DeploymentTargetOrgFabric2x{} + this.CORE_PEER_LOCALMSPID = cOREPEERLOCALMSPID + this.CORE_PEER_ADDRESS = cOREPEERADDRESS + this.CORE_PEER_MSPCONFIGPATH = cOREPEERMSPCONFIGPATH + this.CORE_PEER_TLS_ROOTCERT_FILE = cOREPEERTLSROOTCERTFILE + this.ORDERER_TLS_ROOTCERT_FILE = oRDERERTLSROOTCERTFILE + return &this +} + +// NewDeploymentTargetOrgFabric2xWithDefaults instantiates a new DeploymentTargetOrgFabric2x object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeploymentTargetOrgFabric2xWithDefaults() *DeploymentTargetOrgFabric2x { + this := DeploymentTargetOrgFabric2x{} + return &this +} + +// GetTransient returns the Transient field value if set, zero value otherwise. +func (o *DeploymentTargetOrgFabric2x) GetTransient() string { + if o == nil || IsNil(o.Transient) { + var ret string + return ret + } + return *o.Transient +} + +// GetTransientOk returns a tuple with the Transient field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetTransientOk() (*string, bool) { + if o == nil || IsNil(o.Transient) { + return nil, false + } + return o.Transient, true +} + +// HasTransient returns a boolean if a field has been set. +func (o *DeploymentTargetOrgFabric2x) HasTransient() bool { + if o != nil && !IsNil(o.Transient) { + return true + } + + return false +} + +// SetTransient gets a reference to the given string and assigns it to the Transient field. +func (o *DeploymentTargetOrgFabric2x) SetTransient(v string) { + o.Transient = &v +} + +// GetCORE_PEER_LOCALMSPID returns the CORE_PEER_LOCALMSPID field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_LOCALMSPID() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_LOCALMSPID +} + +// GetCORE_PEER_LOCALMSPIDOk returns a tuple with the CORE_PEER_LOCALMSPID field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_LOCALMSPIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_LOCALMSPID, true +} + +// SetCORE_PEER_LOCALMSPID sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_LOCALMSPID(v string) { + o.CORE_PEER_LOCALMSPID = v +} + +// GetCORE_PEER_ADDRESS returns the CORE_PEER_ADDRESS field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_ADDRESS() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_ADDRESS +} + +// GetCORE_PEER_ADDRESSOk returns a tuple with the CORE_PEER_ADDRESS field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_ADDRESSOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_ADDRESS, true +} + +// SetCORE_PEER_ADDRESS sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_ADDRESS(v string) { + o.CORE_PEER_ADDRESS = v +} + +// GetCORE_PEER_MSPCONFIGPATH returns the CORE_PEER_MSPCONFIGPATH field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_MSPCONFIGPATH() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_MSPCONFIGPATH +} + +// GetCORE_PEER_MSPCONFIGPATHOk returns a tuple with the CORE_PEER_MSPCONFIGPATH field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_MSPCONFIGPATHOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_MSPCONFIGPATH, true +} + +// SetCORE_PEER_MSPCONFIGPATH sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_MSPCONFIGPATH(v string) { + o.CORE_PEER_MSPCONFIGPATH = v +} + +// GetCORE_PEER_TLS_ROOTCERT_FILE returns the CORE_PEER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_TLS_ROOTCERT_FILE +} + +// GetCORE_PEER_TLS_ROOTCERT_FILEOk returns a tuple with the CORE_PEER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_TLS_ROOTCERT_FILE, true +} + +// SetCORE_PEER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_TLS_ROOTCERT_FILE(v string) { + o.CORE_PEER_TLS_ROOTCERT_FILE = v +} + +// GetORDERER_TLS_ROOTCERT_FILE returns the ORDERER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrgFabric2x) GetORDERER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.ORDERER_TLS_ROOTCERT_FILE +} + +// GetORDERER_TLS_ROOTCERT_FILEOk returns a tuple with the ORDERER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetORDERER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ORDERER_TLS_ROOTCERT_FILE, true +} + +// SetORDERER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrgFabric2x) SetORDERER_TLS_ROOTCERT_FILE(v string) { + o.ORDERER_TLS_ROOTCERT_FILE = v +} + +func (o DeploymentTargetOrgFabric2x) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeploymentTargetOrgFabric2x) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Transient) { + toSerialize["transient"] = o.Transient + } + toSerialize["CORE_PEER_LOCALMSPID"] = o.CORE_PEER_LOCALMSPID + toSerialize["CORE_PEER_ADDRESS"] = o.CORE_PEER_ADDRESS + toSerialize["CORE_PEER_MSPCONFIGPATH"] = o.CORE_PEER_MSPCONFIGPATH + toSerialize["CORE_PEER_TLS_ROOTCERT_FILE"] = o.CORE_PEER_TLS_ROOTCERT_FILE + toSerialize["ORDERER_TLS_ROOTCERT_FILE"] = o.ORDERER_TLS_ROOTCERT_FILE + return toSerialize, nil +} + +type NullableDeploymentTargetOrgFabric2x struct { + value *DeploymentTargetOrgFabric2x + isSet bool +} + +func (v NullableDeploymentTargetOrgFabric2x) Get() *DeploymentTargetOrgFabric2x { + return v.value +} + +func (v *NullableDeploymentTargetOrgFabric2x) Set(val *DeploymentTargetOrgFabric2x) { + v.value = val + v.isSet = true +} + +func (v NullableDeploymentTargetOrgFabric2x) IsSet() bool { + return v.isSet +} + +func (v *NullableDeploymentTargetOrgFabric2x) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeploymentTargetOrgFabric2x(val *DeploymentTargetOrgFabric2x) *NullableDeploymentTargetOrgFabric2x { + return &NullableDeploymentTargetOrgFabric2x{value: val, isSet: true} +} + +func (v NullableDeploymentTargetOrgFabric2x) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeploymentTargetOrgFabric2x) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go new file mode 100644 index 0000000000..efecb74487 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go @@ -0,0 +1,230 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeploymentTargetOrganization type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeploymentTargetOrganization{} + +// DeploymentTargetOrganization struct for DeploymentTargetOrganization +type DeploymentTargetOrganization struct { + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_LOCALMSPID string `json:"CORE_PEER_LOCALMSPID"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_ADDRESS string `json:"CORE_PEER_ADDRESS"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_MSPCONFIGPATH string `json:"CORE_PEER_MSPCONFIGPATH"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_TLS_ROOTCERT_FILE string `json:"CORE_PEER_TLS_ROOTCERT_FILE"` + // Mapped to environment variables of the Fabric CLI container. + ORDERER_TLS_ROOTCERT_FILE string `json:"ORDERER_TLS_ROOTCERT_FILE"` +} + +// NewDeploymentTargetOrganization instantiates a new DeploymentTargetOrganization object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeploymentTargetOrganization(cOREPEERLOCALMSPID string, cOREPEERADDRESS string, cOREPEERMSPCONFIGPATH string, cOREPEERTLSROOTCERTFILE string, oRDERERTLSROOTCERTFILE string) *DeploymentTargetOrganization { + this := DeploymentTargetOrganization{} + this.CORE_PEER_LOCALMSPID = cOREPEERLOCALMSPID + this.CORE_PEER_ADDRESS = cOREPEERADDRESS + this.CORE_PEER_MSPCONFIGPATH = cOREPEERMSPCONFIGPATH + this.CORE_PEER_TLS_ROOTCERT_FILE = cOREPEERTLSROOTCERTFILE + this.ORDERER_TLS_ROOTCERT_FILE = oRDERERTLSROOTCERTFILE + return &this +} + +// NewDeploymentTargetOrganizationWithDefaults instantiates a new DeploymentTargetOrganization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeploymentTargetOrganizationWithDefaults() *DeploymentTargetOrganization { + this := DeploymentTargetOrganization{} + return &this +} + +// GetCORE_PEER_LOCALMSPID returns the CORE_PEER_LOCALMSPID field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_LOCALMSPID() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_LOCALMSPID +} + +// GetCORE_PEER_LOCALMSPIDOk returns a tuple with the CORE_PEER_LOCALMSPID field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_LOCALMSPIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_LOCALMSPID, true +} + +// SetCORE_PEER_LOCALMSPID sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_LOCALMSPID(v string) { + o.CORE_PEER_LOCALMSPID = v +} + +// GetCORE_PEER_ADDRESS returns the CORE_PEER_ADDRESS field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_ADDRESS() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_ADDRESS +} + +// GetCORE_PEER_ADDRESSOk returns a tuple with the CORE_PEER_ADDRESS field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_ADDRESSOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_ADDRESS, true +} + +// SetCORE_PEER_ADDRESS sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_ADDRESS(v string) { + o.CORE_PEER_ADDRESS = v +} + +// GetCORE_PEER_MSPCONFIGPATH returns the CORE_PEER_MSPCONFIGPATH field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_MSPCONFIGPATH() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_MSPCONFIGPATH +} + +// GetCORE_PEER_MSPCONFIGPATHOk returns a tuple with the CORE_PEER_MSPCONFIGPATH field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_MSPCONFIGPATHOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_MSPCONFIGPATH, true +} + +// SetCORE_PEER_MSPCONFIGPATH sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_MSPCONFIGPATH(v string) { + o.CORE_PEER_MSPCONFIGPATH = v +} + +// GetCORE_PEER_TLS_ROOTCERT_FILE returns the CORE_PEER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_TLS_ROOTCERT_FILE +} + +// GetCORE_PEER_TLS_ROOTCERT_FILEOk returns a tuple with the CORE_PEER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_TLS_ROOTCERT_FILE, true +} + +// SetCORE_PEER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_TLS_ROOTCERT_FILE(v string) { + o.CORE_PEER_TLS_ROOTCERT_FILE = v +} + +// GetORDERER_TLS_ROOTCERT_FILE returns the ORDERER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrganization) GetORDERER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.ORDERER_TLS_ROOTCERT_FILE +} + +// GetORDERER_TLS_ROOTCERT_FILEOk returns a tuple with the ORDERER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetORDERER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ORDERER_TLS_ROOTCERT_FILE, true +} + +// SetORDERER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrganization) SetORDERER_TLS_ROOTCERT_FILE(v string) { + o.ORDERER_TLS_ROOTCERT_FILE = v +} + +func (o DeploymentTargetOrganization) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeploymentTargetOrganization) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["CORE_PEER_LOCALMSPID"] = o.CORE_PEER_LOCALMSPID + toSerialize["CORE_PEER_ADDRESS"] = o.CORE_PEER_ADDRESS + toSerialize["CORE_PEER_MSPCONFIGPATH"] = o.CORE_PEER_MSPCONFIGPATH + toSerialize["CORE_PEER_TLS_ROOTCERT_FILE"] = o.CORE_PEER_TLS_ROOTCERT_FILE + toSerialize["ORDERER_TLS_ROOTCERT_FILE"] = o.ORDERER_TLS_ROOTCERT_FILE + return toSerialize, nil +} + +type NullableDeploymentTargetOrganization struct { + value *DeploymentTargetOrganization + isSet bool +} + +func (v NullableDeploymentTargetOrganization) Get() *DeploymentTargetOrganization { + return v.value +} + +func (v *NullableDeploymentTargetOrganization) Set(val *DeploymentTargetOrganization) { + v.value = val + v.isSet = true +} + +func (v NullableDeploymentTargetOrganization) IsSet() bool { + return v.isSet +} + +func (v *NullableDeploymentTargetOrganization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeploymentTargetOrganization(val *DeploymentTargetOrganization) *NullableDeploymentTargetOrganization { + return &NullableDeploymentTargetOrganization{value: val, isSet: true} +} + +func (v NullableDeploymentTargetOrganization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeploymentTargetOrganization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 0000000000..f49e6ee405 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go new file mode 100644 index 0000000000..84b5b3e0e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// FabricContractInvocationType the model 'FabricContractInvocationType' +type FabricContractInvocationType string + +// List of FabricContractInvocationType +const ( + SEND FabricContractInvocationType = "FabricContractInvocationType.SEND" + CALL FabricContractInvocationType = "FabricContractInvocationType.CALL" + SENDPRIVATE FabricContractInvocationType = "FabricContractInvocationType.SENDPRIVATE" +) + +// All allowed values of FabricContractInvocationType enum +var AllowedFabricContractInvocationTypeEnumValues = []FabricContractInvocationType{ + "FabricContractInvocationType.SEND", + "FabricContractInvocationType.CALL", + "FabricContractInvocationType.SENDPRIVATE", +} + +func (v *FabricContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricContractInvocationType(value) + for _, existing := range AllowedFabricContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricContractInvocationType", value) +} + +// NewFabricContractInvocationTypeFromValue returns a pointer to a valid FabricContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricContractInvocationTypeFromValue(v string) (*FabricContractInvocationType, error) { + ev := FabricContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricContractInvocationType: valid values are %v", v, AllowedFabricContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricContractInvocationType) IsValid() bool { + for _, existing := range AllowedFabricContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricContractInvocationType value +func (v FabricContractInvocationType) Ptr() *FabricContractInvocationType { + return &v +} + +type NullableFabricContractInvocationType struct { + value *FabricContractInvocationType + isSet bool +} + +func (v NullableFabricContractInvocationType) Get() *FabricContractInvocationType { + return v.value +} + +func (v *NullableFabricContractInvocationType) Set(val *FabricContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableFabricContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricContractInvocationType(val *FabricContractInvocationType) *NullableFabricContractInvocationType { + return &NullableFabricContractInvocationType{value: val, isSet: true} +} + +func (v NullableFabricContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go new file mode 100644 index 0000000000..f13788b3c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FabricSigningCredential type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FabricSigningCredential{} + +// FabricSigningCredential struct for FabricSigningCredential +type FabricSigningCredential struct { + KeychainId string `json:"keychainId"` + KeychainRef string `json:"keychainRef"` + Type *FabricSigningCredentialType `json:"type,omitempty"` + VaultTransitKey *VaultTransitKey `json:"vaultTransitKey,omitempty"` + WebSocketKey *WebSocketKey `json:"webSocketKey,omitempty"` +} + +// NewFabricSigningCredential instantiates a new FabricSigningCredential object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFabricSigningCredential(keychainId string, keychainRef string) *FabricSigningCredential { + this := FabricSigningCredential{} + this.KeychainId = keychainId + this.KeychainRef = keychainRef + return &this +} + +// NewFabricSigningCredentialWithDefaults instantiates a new FabricSigningCredential object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFabricSigningCredentialWithDefaults() *FabricSigningCredential { + this := FabricSigningCredential{} + return &this +} + +// GetKeychainId returns the KeychainId field value +func (o *FabricSigningCredential) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *FabricSigningCredential) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetKeychainRef returns the KeychainRef field value +func (o *FabricSigningCredential) GetKeychainRef() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainRef +} + +// GetKeychainRefOk returns a tuple with the KeychainRef field value +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetKeychainRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainRef, true +} + +// SetKeychainRef sets field value +func (o *FabricSigningCredential) SetKeychainRef(v string) { + o.KeychainRef = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FabricSigningCredential) GetType() FabricSigningCredentialType { + if o == nil || IsNil(o.Type) { + var ret FabricSigningCredentialType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetTypeOk() (*FabricSigningCredentialType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FabricSigningCredential) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FabricSigningCredentialType and assigns it to the Type field. +func (o *FabricSigningCredential) SetType(v FabricSigningCredentialType) { + o.Type = &v +} + +// GetVaultTransitKey returns the VaultTransitKey field value if set, zero value otherwise. +func (o *FabricSigningCredential) GetVaultTransitKey() VaultTransitKey { + if o == nil || IsNil(o.VaultTransitKey) { + var ret VaultTransitKey + return ret + } + return *o.VaultTransitKey +} + +// GetVaultTransitKeyOk returns a tuple with the VaultTransitKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetVaultTransitKeyOk() (*VaultTransitKey, bool) { + if o == nil || IsNil(o.VaultTransitKey) { + return nil, false + } + return o.VaultTransitKey, true +} + +// HasVaultTransitKey returns a boolean if a field has been set. +func (o *FabricSigningCredential) HasVaultTransitKey() bool { + if o != nil && !IsNil(o.VaultTransitKey) { + return true + } + + return false +} + +// SetVaultTransitKey gets a reference to the given VaultTransitKey and assigns it to the VaultTransitKey field. +func (o *FabricSigningCredential) SetVaultTransitKey(v VaultTransitKey) { + o.VaultTransitKey = &v +} + +// GetWebSocketKey returns the WebSocketKey field value if set, zero value otherwise. +func (o *FabricSigningCredential) GetWebSocketKey() WebSocketKey { + if o == nil || IsNil(o.WebSocketKey) { + var ret WebSocketKey + return ret + } + return *o.WebSocketKey +} + +// GetWebSocketKeyOk returns a tuple with the WebSocketKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetWebSocketKeyOk() (*WebSocketKey, bool) { + if o == nil || IsNil(o.WebSocketKey) { + return nil, false + } + return o.WebSocketKey, true +} + +// HasWebSocketKey returns a boolean if a field has been set. +func (o *FabricSigningCredential) HasWebSocketKey() bool { + if o != nil && !IsNil(o.WebSocketKey) { + return true + } + + return false +} + +// SetWebSocketKey gets a reference to the given WebSocketKey and assigns it to the WebSocketKey field. +func (o *FabricSigningCredential) SetWebSocketKey(v WebSocketKey) { + o.WebSocketKey = &v +} + +func (o FabricSigningCredential) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FabricSigningCredential) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keychainId"] = o.KeychainId + toSerialize["keychainRef"] = o.KeychainRef + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.VaultTransitKey) { + toSerialize["vaultTransitKey"] = o.VaultTransitKey + } + if !IsNil(o.WebSocketKey) { + toSerialize["webSocketKey"] = o.WebSocketKey + } + return toSerialize, nil +} + +type NullableFabricSigningCredential struct { + value *FabricSigningCredential + isSet bool +} + +func (v NullableFabricSigningCredential) Get() *FabricSigningCredential { + return v.value +} + +func (v *NullableFabricSigningCredential) Set(val *FabricSigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableFabricSigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricSigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricSigningCredential(val *FabricSigningCredential) *NullableFabricSigningCredential { + return &NullableFabricSigningCredential{value: val, isSet: true} +} + +func (v NullableFabricSigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricSigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go new file mode 100644 index 0000000000..b48c4d1c3f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// FabricSigningCredentialType different type of identity provider for singing fabric messages supported by this package +type FabricSigningCredentialType string + +// List of FabricSigningCredentialType +const ( + X_509 FabricSigningCredentialType = "X.509" + VAULT_X_509 FabricSigningCredentialType = "Vault-X.509" + WS_X_509 FabricSigningCredentialType = "WS-X.509" +) + +// All allowed values of FabricSigningCredentialType enum +var AllowedFabricSigningCredentialTypeEnumValues = []FabricSigningCredentialType{ + "X.509", + "Vault-X.509", + "WS-X.509", +} + +func (v *FabricSigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricSigningCredentialType(value) + for _, existing := range AllowedFabricSigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricSigningCredentialType", value) +} + +// NewFabricSigningCredentialTypeFromValue returns a pointer to a valid FabricSigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricSigningCredentialTypeFromValue(v string) (*FabricSigningCredentialType, error) { + ev := FabricSigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricSigningCredentialType: valid values are %v", v, AllowedFabricSigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricSigningCredentialType) IsValid() bool { + for _, existing := range AllowedFabricSigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricSigningCredentialType value +func (v FabricSigningCredentialType) Ptr() *FabricSigningCredentialType { + return &v +} + +type NullableFabricSigningCredentialType struct { + value *FabricSigningCredentialType + isSet bool +} + +func (v NullableFabricSigningCredentialType) Get() *FabricSigningCredentialType { + return v.value +} + +func (v *NullableFabricSigningCredentialType) Set(val *FabricSigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableFabricSigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricSigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricSigningCredentialType(val *FabricSigningCredentialType) *NullableFabricSigningCredentialType { + return &NullableFabricSigningCredentialType{value: val, isSet: true} +} + +func (v NullableFabricSigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricSigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go new file mode 100644 index 0000000000..b84eca6705 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go @@ -0,0 +1,183 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FileBase64 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FileBase64{} + +// FileBase64 Represents a file-system file that has a name and a body which holds the file contents as a Base64 encoded string +type FileBase64 struct { + // The file's contents encoded as a Base64 string. + Body string `json:"body"` + // The name as referred to on a file system + Filename string `json:"filename"` + // The relative path of the file, if it should be placed in a sub-directory + Filepath *string `json:"filepath,omitempty"` +} + +// NewFileBase64 instantiates a new FileBase64 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFileBase64(body string, filename string) *FileBase64 { + this := FileBase64{} + this.Body = body + this.Filename = filename + return &this +} + +// NewFileBase64WithDefaults instantiates a new FileBase64 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileBase64WithDefaults() *FileBase64 { + this := FileBase64{} + return &this +} + +// GetBody returns the Body field value +func (o *FileBase64) GetBody() string { + if o == nil { + var ret string + return ret + } + + return o.Body +} + +// GetBodyOk returns a tuple with the Body field value +// and a boolean to check if the value has been set. +func (o *FileBase64) GetBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Body, true +} + +// SetBody sets field value +func (o *FileBase64) SetBody(v string) { + o.Body = v +} + +// GetFilename returns the Filename field value +func (o *FileBase64) GetFilename() string { + if o == nil { + var ret string + return ret + } + + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *FileBase64) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value +func (o *FileBase64) SetFilename(v string) { + o.Filename = v +} + +// GetFilepath returns the Filepath field value if set, zero value otherwise. +func (o *FileBase64) GetFilepath() string { + if o == nil || IsNil(o.Filepath) { + var ret string + return ret + } + return *o.Filepath +} + +// GetFilepathOk returns a tuple with the Filepath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileBase64) GetFilepathOk() (*string, bool) { + if o == nil || IsNil(o.Filepath) { + return nil, false + } + return o.Filepath, true +} + +// HasFilepath returns a boolean if a field has been set. +func (o *FileBase64) HasFilepath() bool { + if o != nil && !IsNil(o.Filepath) { + return true + } + + return false +} + +// SetFilepath gets a reference to the given string and assigns it to the Filepath field. +func (o *FileBase64) SetFilepath(v string) { + o.Filepath = &v +} + +func (o FileBase64) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FileBase64) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["body"] = o.Body + toSerialize["filename"] = o.Filename + if !IsNil(o.Filepath) { + toSerialize["filepath"] = o.Filepath + } + return toSerialize, nil +} + +type NullableFileBase64 struct { + value *FileBase64 + isSet bool +} + +func (v NullableFileBase64) Get() *FileBase64 { + return v.value +} + +func (v *NullableFileBase64) Set(val *FileBase64) { + v.value = val + v.isSet = true +} + +func (v NullableFileBase64) IsSet() bool { + return v.isSet +} + +func (v *NullableFileBase64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFileBase64(val *FileBase64) *NullableFileBase64 { + return &NullableFileBase64{value: val, isSet: true} +} + +func (v NullableFileBase64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFileBase64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go new file mode 100644 index 0000000000..eea7fa633f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayDiscoveryOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayDiscoveryOptions{} + +// GatewayDiscoveryOptions struct for GatewayDiscoveryOptions +type GatewayDiscoveryOptions struct { + AsLocalhost *bool `json:"asLocalhost,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// NewGatewayDiscoveryOptions instantiates a new GatewayDiscoveryOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGatewayDiscoveryOptions() *GatewayDiscoveryOptions { + this := GatewayDiscoveryOptions{} + return &this +} + +// NewGatewayDiscoveryOptionsWithDefaults instantiates a new GatewayDiscoveryOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayDiscoveryOptionsWithDefaults() *GatewayDiscoveryOptions { + this := GatewayDiscoveryOptions{} + return &this +} + +// GetAsLocalhost returns the AsLocalhost field value if set, zero value otherwise. +func (o *GatewayDiscoveryOptions) GetAsLocalhost() bool { + if o == nil || IsNil(o.AsLocalhost) { + var ret bool + return ret + } + return *o.AsLocalhost +} + +// GetAsLocalhostOk returns a tuple with the AsLocalhost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayDiscoveryOptions) GetAsLocalhostOk() (*bool, bool) { + if o == nil || IsNil(o.AsLocalhost) { + return nil, false + } + return o.AsLocalhost, true +} + +// HasAsLocalhost returns a boolean if a field has been set. +func (o *GatewayDiscoveryOptions) HasAsLocalhost() bool { + if o != nil && !IsNil(o.AsLocalhost) { + return true + } + + return false +} + +// SetAsLocalhost gets a reference to the given bool and assigns it to the AsLocalhost field. +func (o *GatewayDiscoveryOptions) SetAsLocalhost(v bool) { + o.AsLocalhost = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GatewayDiscoveryOptions) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayDiscoveryOptions) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *GatewayDiscoveryOptions) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *GatewayDiscoveryOptions) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o GatewayDiscoveryOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayDiscoveryOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AsLocalhost) { + toSerialize["asLocalhost"] = o.AsLocalhost + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableGatewayDiscoveryOptions struct { + value *GatewayDiscoveryOptions + isSet bool +} + +func (v NullableGatewayDiscoveryOptions) Get() *GatewayDiscoveryOptions { + return v.value +} + +func (v *NullableGatewayDiscoveryOptions) Set(val *GatewayDiscoveryOptions) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayDiscoveryOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayDiscoveryOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayDiscoveryOptions(val *GatewayDiscoveryOptions) *NullableGatewayDiscoveryOptions { + return &NullableGatewayDiscoveryOptions{value: val, isSet: true} +} + +func (v NullableGatewayDiscoveryOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayDiscoveryOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go new file mode 100644 index 0000000000..c9b025bdd5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayEventHandlerOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayEventHandlerOptions{} + +// GatewayEventHandlerOptions struct for GatewayEventHandlerOptions +type GatewayEventHandlerOptions struct { + CommitTimeout *float32 `json:"commitTimeout,omitempty"` + EndorseTimeout *float32 `json:"endorseTimeout,omitempty"` + Strategy DefaultEventHandlerStrategy `json:"strategy"` +} + +// NewGatewayEventHandlerOptions instantiates a new GatewayEventHandlerOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGatewayEventHandlerOptions(strategy DefaultEventHandlerStrategy) *GatewayEventHandlerOptions { + this := GatewayEventHandlerOptions{} + this.Strategy = strategy + return &this +} + +// NewGatewayEventHandlerOptionsWithDefaults instantiates a new GatewayEventHandlerOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayEventHandlerOptionsWithDefaults() *GatewayEventHandlerOptions { + this := GatewayEventHandlerOptions{} + return &this +} + +// GetCommitTimeout returns the CommitTimeout field value if set, zero value otherwise. +func (o *GatewayEventHandlerOptions) GetCommitTimeout() float32 { + if o == nil || IsNil(o.CommitTimeout) { + var ret float32 + return ret + } + return *o.CommitTimeout +} + +// GetCommitTimeoutOk returns a tuple with the CommitTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayEventHandlerOptions) GetCommitTimeoutOk() (*float32, bool) { + if o == nil || IsNil(o.CommitTimeout) { + return nil, false + } + return o.CommitTimeout, true +} + +// HasCommitTimeout returns a boolean if a field has been set. +func (o *GatewayEventHandlerOptions) HasCommitTimeout() bool { + if o != nil && !IsNil(o.CommitTimeout) { + return true + } + + return false +} + +// SetCommitTimeout gets a reference to the given float32 and assigns it to the CommitTimeout field. +func (o *GatewayEventHandlerOptions) SetCommitTimeout(v float32) { + o.CommitTimeout = &v +} + +// GetEndorseTimeout returns the EndorseTimeout field value if set, zero value otherwise. +func (o *GatewayEventHandlerOptions) GetEndorseTimeout() float32 { + if o == nil || IsNil(o.EndorseTimeout) { + var ret float32 + return ret + } + return *o.EndorseTimeout +} + +// GetEndorseTimeoutOk returns a tuple with the EndorseTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayEventHandlerOptions) GetEndorseTimeoutOk() (*float32, bool) { + if o == nil || IsNil(o.EndorseTimeout) { + return nil, false + } + return o.EndorseTimeout, true +} + +// HasEndorseTimeout returns a boolean if a field has been set. +func (o *GatewayEventHandlerOptions) HasEndorseTimeout() bool { + if o != nil && !IsNil(o.EndorseTimeout) { + return true + } + + return false +} + +// SetEndorseTimeout gets a reference to the given float32 and assigns it to the EndorseTimeout field. +func (o *GatewayEventHandlerOptions) SetEndorseTimeout(v float32) { + o.EndorseTimeout = &v +} + +// GetStrategy returns the Strategy field value +func (o *GatewayEventHandlerOptions) GetStrategy() DefaultEventHandlerStrategy { + if o == nil { + var ret DefaultEventHandlerStrategy + return ret + } + + return o.Strategy +} + +// GetStrategyOk returns a tuple with the Strategy field value +// and a boolean to check if the value has been set. +func (o *GatewayEventHandlerOptions) GetStrategyOk() (*DefaultEventHandlerStrategy, bool) { + if o == nil { + return nil, false + } + return &o.Strategy, true +} + +// SetStrategy sets field value +func (o *GatewayEventHandlerOptions) SetStrategy(v DefaultEventHandlerStrategy) { + o.Strategy = v +} + +func (o GatewayEventHandlerOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayEventHandlerOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CommitTimeout) { + toSerialize["commitTimeout"] = o.CommitTimeout + } + if !IsNil(o.EndorseTimeout) { + toSerialize["endorseTimeout"] = o.EndorseTimeout + } + toSerialize["strategy"] = o.Strategy + return toSerialize, nil +} + +type NullableGatewayEventHandlerOptions struct { + value *GatewayEventHandlerOptions + isSet bool +} + +func (v NullableGatewayEventHandlerOptions) Get() *GatewayEventHandlerOptions { + return v.value +} + +func (v *NullableGatewayEventHandlerOptions) Set(val *GatewayEventHandlerOptions) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayEventHandlerOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayEventHandlerOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayEventHandlerOptions(val *GatewayEventHandlerOptions) *NullableGatewayEventHandlerOptions { + return &NullableGatewayEventHandlerOptions{value: val, isSet: true} +} + +func (v NullableGatewayEventHandlerOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayEventHandlerOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go new file mode 100644 index 0000000000..729a35b702 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayOptions{} + +// GatewayOptions struct for GatewayOptions +type GatewayOptions struct { + ConnectionProfile *ConnectionProfile `json:"connectionProfile,omitempty"` + Discovery *GatewayDiscoveryOptions `json:"discovery,omitempty"` + EventHandlerOptions *GatewayEventHandlerOptions `json:"eventHandlerOptions,omitempty"` + Identity string `json:"identity"` + Wallet GatewayOptionsWallet `json:"wallet"` +} + +// NewGatewayOptions instantiates a new GatewayOptions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGatewayOptions(identity string, wallet GatewayOptionsWallet) *GatewayOptions { + this := GatewayOptions{} + this.Identity = identity + this.Wallet = wallet + return &this +} + +// NewGatewayOptionsWithDefaults instantiates a new GatewayOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayOptionsWithDefaults() *GatewayOptions { + this := GatewayOptions{} + return &this +} + +// GetConnectionProfile returns the ConnectionProfile field value if set, zero value otherwise. +func (o *GatewayOptions) GetConnectionProfile() ConnectionProfile { + if o == nil || IsNil(o.ConnectionProfile) { + var ret ConnectionProfile + return ret + } + return *o.ConnectionProfile +} + +// GetConnectionProfileOk returns a tuple with the ConnectionProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetConnectionProfileOk() (*ConnectionProfile, bool) { + if o == nil || IsNil(o.ConnectionProfile) { + return nil, false + } + return o.ConnectionProfile, true +} + +// HasConnectionProfile returns a boolean if a field has been set. +func (o *GatewayOptions) HasConnectionProfile() bool { + if o != nil && !IsNil(o.ConnectionProfile) { + return true + } + + return false +} + +// SetConnectionProfile gets a reference to the given ConnectionProfile and assigns it to the ConnectionProfile field. +func (o *GatewayOptions) SetConnectionProfile(v ConnectionProfile) { + o.ConnectionProfile = &v +} + +// GetDiscovery returns the Discovery field value if set, zero value otherwise. +func (o *GatewayOptions) GetDiscovery() GatewayDiscoveryOptions { + if o == nil || IsNil(o.Discovery) { + var ret GatewayDiscoveryOptions + return ret + } + return *o.Discovery +} + +// GetDiscoveryOk returns a tuple with the Discovery field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetDiscoveryOk() (*GatewayDiscoveryOptions, bool) { + if o == nil || IsNil(o.Discovery) { + return nil, false + } + return o.Discovery, true +} + +// HasDiscovery returns a boolean if a field has been set. +func (o *GatewayOptions) HasDiscovery() bool { + if o != nil && !IsNil(o.Discovery) { + return true + } + + return false +} + +// SetDiscovery gets a reference to the given GatewayDiscoveryOptions and assigns it to the Discovery field. +func (o *GatewayOptions) SetDiscovery(v GatewayDiscoveryOptions) { + o.Discovery = &v +} + +// GetEventHandlerOptions returns the EventHandlerOptions field value if set, zero value otherwise. +func (o *GatewayOptions) GetEventHandlerOptions() GatewayEventHandlerOptions { + if o == nil || IsNil(o.EventHandlerOptions) { + var ret GatewayEventHandlerOptions + return ret + } + return *o.EventHandlerOptions +} + +// GetEventHandlerOptionsOk returns a tuple with the EventHandlerOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetEventHandlerOptionsOk() (*GatewayEventHandlerOptions, bool) { + if o == nil || IsNil(o.EventHandlerOptions) { + return nil, false + } + return o.EventHandlerOptions, true +} + +// HasEventHandlerOptions returns a boolean if a field has been set. +func (o *GatewayOptions) HasEventHandlerOptions() bool { + if o != nil && !IsNil(o.EventHandlerOptions) { + return true + } + + return false +} + +// SetEventHandlerOptions gets a reference to the given GatewayEventHandlerOptions and assigns it to the EventHandlerOptions field. +func (o *GatewayOptions) SetEventHandlerOptions(v GatewayEventHandlerOptions) { + o.EventHandlerOptions = &v +} + +// GetIdentity returns the Identity field value +func (o *GatewayOptions) GetIdentity() string { + if o == nil { + var ret string + return ret + } + + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetIdentityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identity, true +} + +// SetIdentity sets field value +func (o *GatewayOptions) SetIdentity(v string) { + o.Identity = v +} + +// GetWallet returns the Wallet field value +func (o *GatewayOptions) GetWallet() GatewayOptionsWallet { + if o == nil { + var ret GatewayOptionsWallet + return ret + } + + return o.Wallet +} + +// GetWalletOk returns a tuple with the Wallet field value +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetWalletOk() (*GatewayOptionsWallet, bool) { + if o == nil { + return nil, false + } + return &o.Wallet, true +} + +// SetWallet sets field value +func (o *GatewayOptions) SetWallet(v GatewayOptionsWallet) { + o.Wallet = v +} + +func (o GatewayOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectionProfile) { + toSerialize["connectionProfile"] = o.ConnectionProfile + } + if !IsNil(o.Discovery) { + toSerialize["discovery"] = o.Discovery + } + if !IsNil(o.EventHandlerOptions) { + toSerialize["eventHandlerOptions"] = o.EventHandlerOptions + } + toSerialize["identity"] = o.Identity + toSerialize["wallet"] = o.Wallet + return toSerialize, nil +} + +type NullableGatewayOptions struct { + value *GatewayOptions + isSet bool +} + +func (v NullableGatewayOptions) Get() *GatewayOptions { + return v.value +} + +func (v *NullableGatewayOptions) Set(val *GatewayOptions) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayOptions(val *GatewayOptions) *NullableGatewayOptions { + return &NullableGatewayOptions{value: val, isSet: true} +} + +func (v NullableGatewayOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go new file mode 100644 index 0000000000..a79aaa6a8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayOptionsWallet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayOptionsWallet{} + +// GatewayOptionsWallet struct for GatewayOptionsWallet +type GatewayOptionsWallet struct { + Keychain *FabricSigningCredential `json:"keychain,omitempty"` + Json *string `json:"json,omitempty"` +} + +// NewGatewayOptionsWallet instantiates a new GatewayOptionsWallet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGatewayOptionsWallet() *GatewayOptionsWallet { + this := GatewayOptionsWallet{} + return &this +} + +// NewGatewayOptionsWalletWithDefaults instantiates a new GatewayOptionsWallet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayOptionsWalletWithDefaults() *GatewayOptionsWallet { + this := GatewayOptionsWallet{} + return &this +} + +// GetKeychain returns the Keychain field value if set, zero value otherwise. +func (o *GatewayOptionsWallet) GetKeychain() FabricSigningCredential { + if o == nil || IsNil(o.Keychain) { + var ret FabricSigningCredential + return ret + } + return *o.Keychain +} + +// GetKeychainOk returns a tuple with the Keychain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptionsWallet) GetKeychainOk() (*FabricSigningCredential, bool) { + if o == nil || IsNil(o.Keychain) { + return nil, false + } + return o.Keychain, true +} + +// HasKeychain returns a boolean if a field has been set. +func (o *GatewayOptionsWallet) HasKeychain() bool { + if o != nil && !IsNil(o.Keychain) { + return true + } + + return false +} + +// SetKeychain gets a reference to the given FabricSigningCredential and assigns it to the Keychain field. +func (o *GatewayOptionsWallet) SetKeychain(v FabricSigningCredential) { + o.Keychain = &v +} + +// GetJson returns the Json field value if set, zero value otherwise. +func (o *GatewayOptionsWallet) GetJson() string { + if o == nil || IsNil(o.Json) { + var ret string + return ret + } + return *o.Json +} + +// GetJsonOk returns a tuple with the Json field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptionsWallet) GetJsonOk() (*string, bool) { + if o == nil || IsNil(o.Json) { + return nil, false + } + return o.Json, true +} + +// HasJson returns a boolean if a field has been set. +func (o *GatewayOptionsWallet) HasJson() bool { + if o != nil && !IsNil(o.Json) { + return true + } + + return false +} + +// SetJson gets a reference to the given string and assigns it to the Json field. +func (o *GatewayOptionsWallet) SetJson(v string) { + o.Json = &v +} + +func (o GatewayOptionsWallet) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayOptionsWallet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Keychain) { + toSerialize["keychain"] = o.Keychain + } + if !IsNil(o.Json) { + toSerialize["json"] = o.Json + } + return toSerialize, nil +} + +type NullableGatewayOptionsWallet struct { + value *GatewayOptionsWallet + isSet bool +} + +func (v NullableGatewayOptionsWallet) Get() *GatewayOptionsWallet { + return v.value +} + +func (v *NullableGatewayOptionsWallet) Set(val *GatewayOptionsWallet) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayOptionsWallet) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayOptionsWallet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayOptionsWallet(val *GatewayOptionsWallet) *NullableGatewayOptionsWallet { + return &NullableGatewayOptionsWallet{value: val, isSet: true} +} + +func (v NullableGatewayOptionsWallet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayOptionsWallet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go new file mode 100644 index 0000000000..752cf543d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go @@ -0,0 +1,250 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestV1{} + +// GetBlockRequestV1 Request for GetBlock endpoint. +type GetBlockRequestV1 struct { + // Fabric channel which we want to query. + ChannelName string `json:"channelName"` + // Fabric channel we want to connect to. If not provided, then one from channelName parameter will be used + ConnectionChannelName *string `json:"connectionChannelName,omitempty"` + GatewayOptions GatewayOptions `json:"gatewayOptions"` + Query GetBlockRequestV1Query `json:"query"` + // If true, encoded buffer will be returned. Otherwise, entire block object is returned. + SkipDecode *bool `json:"skipDecode,omitempty"` +} + +// NewGetBlockRequestV1 instantiates a new GetBlockRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockRequestV1(channelName string, gatewayOptions GatewayOptions, query GetBlockRequestV1Query) *GetBlockRequestV1 { + this := GetBlockRequestV1{} + this.ChannelName = channelName + this.GatewayOptions = gatewayOptions + this.Query = query + var skipDecode bool = false + this.SkipDecode = &skipDecode + return &this +} + +// NewGetBlockRequestV1WithDefaults instantiates a new GetBlockRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestV1WithDefaults() *GetBlockRequestV1 { + this := GetBlockRequestV1{} + var skipDecode bool = false + this.SkipDecode = &skipDecode + return &this +} + +// GetChannelName returns the ChannelName field value +func (o *GetBlockRequestV1) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *GetBlockRequestV1) SetChannelName(v string) { + o.ChannelName = v +} + +// GetConnectionChannelName returns the ConnectionChannelName field value if set, zero value otherwise. +func (o *GetBlockRequestV1) GetConnectionChannelName() string { + if o == nil || IsNil(o.ConnectionChannelName) { + var ret string + return ret + } + return *o.ConnectionChannelName +} + +// GetConnectionChannelNameOk returns a tuple with the ConnectionChannelName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetConnectionChannelNameOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionChannelName) { + return nil, false + } + return o.ConnectionChannelName, true +} + +// HasConnectionChannelName returns a boolean if a field has been set. +func (o *GetBlockRequestV1) HasConnectionChannelName() bool { + if o != nil && !IsNil(o.ConnectionChannelName) { + return true + } + + return false +} + +// SetConnectionChannelName gets a reference to the given string and assigns it to the ConnectionChannelName field. +func (o *GetBlockRequestV1) SetConnectionChannelName(v string) { + o.ConnectionChannelName = &v +} + +// GetGatewayOptions returns the GatewayOptions field value +func (o *GetBlockRequestV1) GetGatewayOptions() GatewayOptions { + if o == nil { + var ret GatewayOptions + return ret + } + + return o.GatewayOptions +} + +// GetGatewayOptionsOk returns a tuple with the GatewayOptions field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetGatewayOptionsOk() (*GatewayOptions, bool) { + if o == nil { + return nil, false + } + return &o.GatewayOptions, true +} + +// SetGatewayOptions sets field value +func (o *GetBlockRequestV1) SetGatewayOptions(v GatewayOptions) { + o.GatewayOptions = v +} + +// GetQuery returns the Query field value +func (o *GetBlockRequestV1) GetQuery() GetBlockRequestV1Query { + if o == nil { + var ret GetBlockRequestV1Query + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetQueryOk() (*GetBlockRequestV1Query, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *GetBlockRequestV1) SetQuery(v GetBlockRequestV1Query) { + o.Query = v +} + +// GetSkipDecode returns the SkipDecode field value if set, zero value otherwise. +func (o *GetBlockRequestV1) GetSkipDecode() bool { + if o == nil || IsNil(o.SkipDecode) { + var ret bool + return ret + } + return *o.SkipDecode +} + +// GetSkipDecodeOk returns a tuple with the SkipDecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetSkipDecodeOk() (*bool, bool) { + if o == nil || IsNil(o.SkipDecode) { + return nil, false + } + return o.SkipDecode, true +} + +// HasSkipDecode returns a boolean if a field has been set. +func (o *GetBlockRequestV1) HasSkipDecode() bool { + if o != nil && !IsNil(o.SkipDecode) { + return true + } + + return false +} + +// SetSkipDecode gets a reference to the given bool and assigns it to the SkipDecode field. +func (o *GetBlockRequestV1) SetSkipDecode(v bool) { + o.SkipDecode = &v +} + +func (o GetBlockRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channelName"] = o.ChannelName + if !IsNil(o.ConnectionChannelName) { + toSerialize["connectionChannelName"] = o.ConnectionChannelName + } + toSerialize["gatewayOptions"] = o.GatewayOptions + toSerialize["query"] = o.Query + if !IsNil(o.SkipDecode) { + toSerialize["skipDecode"] = o.SkipDecode + } + return toSerialize, nil +} + +type NullableGetBlockRequestV1 struct { + value *GetBlockRequestV1 + isSet bool +} + +func (v NullableGetBlockRequestV1) Get() *GetBlockRequestV1 { + return v.value +} + +func (v *NullableGetBlockRequestV1) Set(val *GetBlockRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestV1(val *GetBlockRequestV1) *NullableGetBlockRequestV1 { + return &NullableGetBlockRequestV1{value: val, isSet: true} +} + +func (v NullableGetBlockRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go new file mode 100644 index 0000000000..37073b77e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go @@ -0,0 +1,200 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestV1Query type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestV1Query{} + +// GetBlockRequestV1Query Query selector, caller must provide at least one of them. First found will be used, rest will be ignored, so it's recommended to pass single selector. +type GetBlockRequestV1Query struct { + // Select block by it's number. + BlockNumber *string `json:"blockNumber,omitempty"` + BlockHash *GetBlockRequestV1QueryBlockHash `json:"blockHash,omitempty"` + // Select block by id of transaction that it contains. + TransactionId *string `json:"transactionId,omitempty"` +} + +// NewGetBlockRequestV1Query instantiates a new GetBlockRequestV1Query object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockRequestV1Query() *GetBlockRequestV1Query { + this := GetBlockRequestV1Query{} + return &this +} + +// NewGetBlockRequestV1QueryWithDefaults instantiates a new GetBlockRequestV1Query object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestV1QueryWithDefaults() *GetBlockRequestV1Query { + this := GetBlockRequestV1Query{} + return &this +} + +// GetBlockNumber returns the BlockNumber field value if set, zero value otherwise. +func (o *GetBlockRequestV1Query) GetBlockNumber() string { + if o == nil || IsNil(o.BlockNumber) { + var ret string + return ret + } + return *o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1Query) GetBlockNumberOk() (*string, bool) { + if o == nil || IsNil(o.BlockNumber) { + return nil, false + } + return o.BlockNumber, true +} + +// HasBlockNumber returns a boolean if a field has been set. +func (o *GetBlockRequestV1Query) HasBlockNumber() bool { + if o != nil && !IsNil(o.BlockNumber) { + return true + } + + return false +} + +// SetBlockNumber gets a reference to the given string and assigns it to the BlockNumber field. +func (o *GetBlockRequestV1Query) SetBlockNumber(v string) { + o.BlockNumber = &v +} + +// GetBlockHash returns the BlockHash field value if set, zero value otherwise. +func (o *GetBlockRequestV1Query) GetBlockHash() GetBlockRequestV1QueryBlockHash { + if o == nil || IsNil(o.BlockHash) { + var ret GetBlockRequestV1QueryBlockHash + return ret + } + return *o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1Query) GetBlockHashOk() (*GetBlockRequestV1QueryBlockHash, bool) { + if o == nil || IsNil(o.BlockHash) { + return nil, false + } + return o.BlockHash, true +} + +// HasBlockHash returns a boolean if a field has been set. +func (o *GetBlockRequestV1Query) HasBlockHash() bool { + if o != nil && !IsNil(o.BlockHash) { + return true + } + + return false +} + +// SetBlockHash gets a reference to the given GetBlockRequestV1QueryBlockHash and assigns it to the BlockHash field. +func (o *GetBlockRequestV1Query) SetBlockHash(v GetBlockRequestV1QueryBlockHash) { + o.BlockHash = &v +} + +// GetTransactionId returns the TransactionId field value if set, zero value otherwise. +func (o *GetBlockRequestV1Query) GetTransactionId() string { + if o == nil || IsNil(o.TransactionId) { + var ret string + return ret + } + return *o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1Query) GetTransactionIdOk() (*string, bool) { + if o == nil || IsNil(o.TransactionId) { + return nil, false + } + return o.TransactionId, true +} + +// HasTransactionId returns a boolean if a field has been set. +func (o *GetBlockRequestV1Query) HasTransactionId() bool { + if o != nil && !IsNil(o.TransactionId) { + return true + } + + return false +} + +// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field. +func (o *GetBlockRequestV1Query) SetTransactionId(v string) { + o.TransactionId = &v +} + +func (o GetBlockRequestV1Query) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestV1Query) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockNumber) { + toSerialize["blockNumber"] = o.BlockNumber + } + if !IsNil(o.BlockHash) { + toSerialize["blockHash"] = o.BlockHash + } + if !IsNil(o.TransactionId) { + toSerialize["transactionId"] = o.TransactionId + } + return toSerialize, nil +} + +type NullableGetBlockRequestV1Query struct { + value *GetBlockRequestV1Query + isSet bool +} + +func (v NullableGetBlockRequestV1Query) Get() *GetBlockRequestV1Query { + return v.value +} + +func (v *NullableGetBlockRequestV1Query) Set(val *GetBlockRequestV1Query) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestV1Query) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestV1Query) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestV1Query(val *GetBlockRequestV1Query) *NullableGetBlockRequestV1Query { + return &NullableGetBlockRequestV1Query{value: val, isSet: true} +} + +func (v NullableGetBlockRequestV1Query) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestV1Query) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go new file mode 100644 index 0000000000..246b71482d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestV1QueryBlockHash type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestV1QueryBlockHash{} + +// GetBlockRequestV1QueryBlockHash Select block by it's hash. +type GetBlockRequestV1QueryBlockHash struct { + // NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...). Passed directly to `Buffer.from()` call on hashBuffer. If not provided then JSON buffer format is assumed. + Encoding *string `json:"encoding,omitempty"` + // Buffer of blockHash. It's encoding should be described in `encoding` parameter. + Buffer string `json:"buffer"` +} + +// NewGetBlockRequestV1QueryBlockHash instantiates a new GetBlockRequestV1QueryBlockHash object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockRequestV1QueryBlockHash(buffer string) *GetBlockRequestV1QueryBlockHash { + this := GetBlockRequestV1QueryBlockHash{} + this.Buffer = buffer + return &this +} + +// NewGetBlockRequestV1QueryBlockHashWithDefaults instantiates a new GetBlockRequestV1QueryBlockHash object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestV1QueryBlockHashWithDefaults() *GetBlockRequestV1QueryBlockHash { + this := GetBlockRequestV1QueryBlockHash{} + return &this +} + +// GetEncoding returns the Encoding field value if set, zero value otherwise. +func (o *GetBlockRequestV1QueryBlockHash) GetEncoding() string { + if o == nil || IsNil(o.Encoding) { + var ret string + return ret + } + return *o.Encoding +} + +// GetEncodingOk returns a tuple with the Encoding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1QueryBlockHash) GetEncodingOk() (*string, bool) { + if o == nil || IsNil(o.Encoding) { + return nil, false + } + return o.Encoding, true +} + +// HasEncoding returns a boolean if a field has been set. +func (o *GetBlockRequestV1QueryBlockHash) HasEncoding() bool { + if o != nil && !IsNil(o.Encoding) { + return true + } + + return false +} + +// SetEncoding gets a reference to the given string and assigns it to the Encoding field. +func (o *GetBlockRequestV1QueryBlockHash) SetEncoding(v string) { + o.Encoding = &v +} + +// GetBuffer returns the Buffer field value +func (o *GetBlockRequestV1QueryBlockHash) GetBuffer() string { + if o == nil { + var ret string + return ret + } + + return o.Buffer +} + +// GetBufferOk returns a tuple with the Buffer field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1QueryBlockHash) GetBufferOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Buffer, true +} + +// SetBuffer sets field value +func (o *GetBlockRequestV1QueryBlockHash) SetBuffer(v string) { + o.Buffer = v +} + +func (o GetBlockRequestV1QueryBlockHash) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestV1QueryBlockHash) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Encoding) { + toSerialize["encoding"] = o.Encoding + } + toSerialize["buffer"] = o.Buffer + return toSerialize, nil +} + +type NullableGetBlockRequestV1QueryBlockHash struct { + value *GetBlockRequestV1QueryBlockHash + isSet bool +} + +func (v NullableGetBlockRequestV1QueryBlockHash) Get() *GetBlockRequestV1QueryBlockHash { + return v.value +} + +func (v *NullableGetBlockRequestV1QueryBlockHash) Set(val *GetBlockRequestV1QueryBlockHash) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestV1QueryBlockHash) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestV1QueryBlockHash) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestV1QueryBlockHash(val *GetBlockRequestV1QueryBlockHash) *NullableGetBlockRequestV1QueryBlockHash { + return &NullableGetBlockRequestV1QueryBlockHash{value: val, isSet: true} +} + +func (v NullableGetBlockRequestV1QueryBlockHash) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestV1QueryBlockHash) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go new file mode 100644 index 0000000000..987e3662e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockResponseDecodedV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockResponseDecodedV1{} + +// GetBlockResponseDecodedV1 When skipDecode is false (default) then decoded block object is returned. +type GetBlockResponseDecodedV1 struct { + // Full hyperledger fabric block data. + DecodedBlock interface{} `json:"decodedBlock"` +} + +// NewGetBlockResponseDecodedV1 instantiates a new GetBlockResponseDecodedV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockResponseDecodedV1(decodedBlock interface{}) *GetBlockResponseDecodedV1 { + this := GetBlockResponseDecodedV1{} + this.DecodedBlock = decodedBlock + return &this +} + +// NewGetBlockResponseDecodedV1WithDefaults instantiates a new GetBlockResponseDecodedV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockResponseDecodedV1WithDefaults() *GetBlockResponseDecodedV1 { + this := GetBlockResponseDecodedV1{} + return &this +} + +// GetDecodedBlock returns the DecodedBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *GetBlockResponseDecodedV1) GetDecodedBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.DecodedBlock +} + +// GetDecodedBlockOk returns a tuple with the DecodedBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBlockResponseDecodedV1) GetDecodedBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.DecodedBlock) { + return nil, false + } + return &o.DecodedBlock, true +} + +// SetDecodedBlock sets field value +func (o *GetBlockResponseDecodedV1) SetDecodedBlock(v interface{}) { + o.DecodedBlock = v +} + +func (o GetBlockResponseDecodedV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockResponseDecodedV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DecodedBlock != nil { + toSerialize["decodedBlock"] = o.DecodedBlock + } + return toSerialize, nil +} + +type NullableGetBlockResponseDecodedV1 struct { + value *GetBlockResponseDecodedV1 + isSet bool +} + +func (v NullableGetBlockResponseDecodedV1) Get() *GetBlockResponseDecodedV1 { + return v.value +} + +func (v *NullableGetBlockResponseDecodedV1) Set(val *GetBlockResponseDecodedV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseDecodedV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseDecodedV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseDecodedV1(val *GetBlockResponseDecodedV1) *NullableGetBlockResponseDecodedV1 { + return &NullableGetBlockResponseDecodedV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseDecodedV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseDecodedV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go new file mode 100644 index 0000000000..cd74e31dc8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockResponseEncodedV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockResponseEncodedV1{} + +// GetBlockResponseEncodedV1 When skipDecode is true then encoded block Buffer is returned. +type GetBlockResponseEncodedV1 struct { + EncodedBlock string `json:"encodedBlock"` +} + +// NewGetBlockResponseEncodedV1 instantiates a new GetBlockResponseEncodedV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockResponseEncodedV1(encodedBlock string) *GetBlockResponseEncodedV1 { + this := GetBlockResponseEncodedV1{} + this.EncodedBlock = encodedBlock + return &this +} + +// NewGetBlockResponseEncodedV1WithDefaults instantiates a new GetBlockResponseEncodedV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockResponseEncodedV1WithDefaults() *GetBlockResponseEncodedV1 { + this := GetBlockResponseEncodedV1{} + return &this +} + +// GetEncodedBlock returns the EncodedBlock field value +func (o *GetBlockResponseEncodedV1) GetEncodedBlock() string { + if o == nil { + var ret string + return ret + } + + return o.EncodedBlock +} + +// GetEncodedBlockOk returns a tuple with the EncodedBlock field value +// and a boolean to check if the value has been set. +func (o *GetBlockResponseEncodedV1) GetEncodedBlockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncodedBlock, true +} + +// SetEncodedBlock sets field value +func (o *GetBlockResponseEncodedV1) SetEncodedBlock(v string) { + o.EncodedBlock = v +} + +func (o GetBlockResponseEncodedV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockResponseEncodedV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encodedBlock"] = o.EncodedBlock + return toSerialize, nil +} + +type NullableGetBlockResponseEncodedV1 struct { + value *GetBlockResponseEncodedV1 + isSet bool +} + +func (v NullableGetBlockResponseEncodedV1) Get() *GetBlockResponseEncodedV1 { + return v.value +} + +func (v *NullableGetBlockResponseEncodedV1) Set(val *GetBlockResponseEncodedV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseEncodedV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseEncodedV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseEncodedV1(val *GetBlockResponseEncodedV1) *NullableGetBlockResponseEncodedV1 { + return &NullableGetBlockResponseEncodedV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseEncodedV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseEncodedV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go new file mode 100644 index 0000000000..aef478f029 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// GetBlockResponseV1 - Response from GetBlock endpoint. +type GetBlockResponseV1 struct { + GetBlockResponseDecodedV1 *GetBlockResponseDecodedV1 + GetBlockResponseEncodedV1 *GetBlockResponseEncodedV1 +} + +// GetBlockResponseDecodedV1AsGetBlockResponseV1 is a convenience function that returns GetBlockResponseDecodedV1 wrapped in GetBlockResponseV1 +func GetBlockResponseDecodedV1AsGetBlockResponseV1(v *GetBlockResponseDecodedV1) GetBlockResponseV1 { + return GetBlockResponseV1{ + GetBlockResponseDecodedV1: v, + } +} + +// GetBlockResponseEncodedV1AsGetBlockResponseV1 is a convenience function that returns GetBlockResponseEncodedV1 wrapped in GetBlockResponseV1 +func GetBlockResponseEncodedV1AsGetBlockResponseV1(v *GetBlockResponseEncodedV1) GetBlockResponseV1 { + return GetBlockResponseV1{ + GetBlockResponseEncodedV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GetBlockResponseV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into GetBlockResponseDecodedV1 + err = newStrictDecoder(data).Decode(&dst.GetBlockResponseDecodedV1) + if err == nil { + jsonGetBlockResponseDecodedV1, _ := json.Marshal(dst.GetBlockResponseDecodedV1) + if string(jsonGetBlockResponseDecodedV1) == "{}" { // empty struct + dst.GetBlockResponseDecodedV1 = nil + } else { + match++ + } + } else { + dst.GetBlockResponseDecodedV1 = nil + } + + // try to unmarshal data into GetBlockResponseEncodedV1 + err = newStrictDecoder(data).Decode(&dst.GetBlockResponseEncodedV1) + if err == nil { + jsonGetBlockResponseEncodedV1, _ := json.Marshal(dst.GetBlockResponseEncodedV1) + if string(jsonGetBlockResponseEncodedV1) == "{}" { // empty struct + dst.GetBlockResponseEncodedV1 = nil + } else { + match++ + } + } else { + dst.GetBlockResponseEncodedV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.GetBlockResponseDecodedV1 = nil + dst.GetBlockResponseEncodedV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GetBlockResponseV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GetBlockResponseV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GetBlockResponseV1) MarshalJSON() ([]byte, error) { + if src.GetBlockResponseDecodedV1 != nil { + return json.Marshal(&src.GetBlockResponseDecodedV1) + } + + if src.GetBlockResponseEncodedV1 != nil { + return json.Marshal(&src.GetBlockResponseEncodedV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GetBlockResponseV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.GetBlockResponseDecodedV1 != nil { + return obj.GetBlockResponseDecodedV1 + } + + if obj.GetBlockResponseEncodedV1 != nil { + return obj.GetBlockResponseEncodedV1 + } + + // all schemas are nil + return nil +} + +type NullableGetBlockResponseV1 struct { + value *GetBlockResponseV1 + isSet bool +} + +func (v NullableGetBlockResponseV1) Get() *GetBlockResponseV1 { + return v.value +} + +func (v *NullableGetBlockResponseV1) Set(val *GetBlockResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseV1(val *GetBlockResponseV1) *NullableGetBlockResponseV1 { + return &NullableGetBlockResponseV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go new file mode 100644 index 0000000000..a95f65a1d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go @@ -0,0 +1,450 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetTransactionReceiptResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionReceiptResponse{} + +// GetTransactionReceiptResponse struct for GetTransactionReceiptResponse +type GetTransactionReceiptResponse struct { + BlockNumber *string `json:"blockNumber,omitempty"` + ChannelID *string `json:"channelID,omitempty"` + TransactionCreator *TransactReceiptTransactionCreator `json:"transactionCreator,omitempty"` + TransactionEndorsement []TransactReceiptTransactionEndorsement `json:"transactionEndorsement,omitempty"` + BlockMetaData *TransactReceiptBlockMetaData `json:"blockMetaData,omitempty"` + ChainCodeName *string `json:"chainCodeName,omitempty"` + ChainCodeVersion *string `json:"chainCodeVersion,omitempty"` + ResponseStatus *string `json:"responseStatus,omitempty"` + RwsetKey *string `json:"rwsetKey,omitempty"` + RwsetWriteData *string `json:"rwsetWriteData,omitempty"` +} + +// NewGetTransactionReceiptResponse instantiates a new GetTransactionReceiptResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTransactionReceiptResponse() *GetTransactionReceiptResponse { + this := GetTransactionReceiptResponse{} + return &this +} + +// NewGetTransactionReceiptResponseWithDefaults instantiates a new GetTransactionReceiptResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionReceiptResponseWithDefaults() *GetTransactionReceiptResponse { + this := GetTransactionReceiptResponse{} + return &this +} + +// GetBlockNumber returns the BlockNumber field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetBlockNumber() string { + if o == nil || IsNil(o.BlockNumber) { + var ret string + return ret + } + return *o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetBlockNumberOk() (*string, bool) { + if o == nil || IsNil(o.BlockNumber) { + return nil, false + } + return o.BlockNumber, true +} + +// HasBlockNumber returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasBlockNumber() bool { + if o != nil && !IsNil(o.BlockNumber) { + return true + } + + return false +} + +// SetBlockNumber gets a reference to the given string and assigns it to the BlockNumber field. +func (o *GetTransactionReceiptResponse) SetBlockNumber(v string) { + o.BlockNumber = &v +} + +// GetChannelID returns the ChannelID field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetChannelID() string { + if o == nil || IsNil(o.ChannelID) { + var ret string + return ret + } + return *o.ChannelID +} + +// GetChannelIDOk returns a tuple with the ChannelID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetChannelIDOk() (*string, bool) { + if o == nil || IsNil(o.ChannelID) { + return nil, false + } + return o.ChannelID, true +} + +// HasChannelID returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasChannelID() bool { + if o != nil && !IsNil(o.ChannelID) { + return true + } + + return false +} + +// SetChannelID gets a reference to the given string and assigns it to the ChannelID field. +func (o *GetTransactionReceiptResponse) SetChannelID(v string) { + o.ChannelID = &v +} + +// GetTransactionCreator returns the TransactionCreator field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetTransactionCreator() TransactReceiptTransactionCreator { + if o == nil || IsNil(o.TransactionCreator) { + var ret TransactReceiptTransactionCreator + return ret + } + return *o.TransactionCreator +} + +// GetTransactionCreatorOk returns a tuple with the TransactionCreator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetTransactionCreatorOk() (*TransactReceiptTransactionCreator, bool) { + if o == nil || IsNil(o.TransactionCreator) { + return nil, false + } + return o.TransactionCreator, true +} + +// HasTransactionCreator returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasTransactionCreator() bool { + if o != nil && !IsNil(o.TransactionCreator) { + return true + } + + return false +} + +// SetTransactionCreator gets a reference to the given TransactReceiptTransactionCreator and assigns it to the TransactionCreator field. +func (o *GetTransactionReceiptResponse) SetTransactionCreator(v TransactReceiptTransactionCreator) { + o.TransactionCreator = &v +} + +// GetTransactionEndorsement returns the TransactionEndorsement field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetTransactionEndorsement() []TransactReceiptTransactionEndorsement { + if o == nil || IsNil(o.TransactionEndorsement) { + var ret []TransactReceiptTransactionEndorsement + return ret + } + return o.TransactionEndorsement +} + +// GetTransactionEndorsementOk returns a tuple with the TransactionEndorsement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetTransactionEndorsementOk() ([]TransactReceiptTransactionEndorsement, bool) { + if o == nil || IsNil(o.TransactionEndorsement) { + return nil, false + } + return o.TransactionEndorsement, true +} + +// HasTransactionEndorsement returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasTransactionEndorsement() bool { + if o != nil && !IsNil(o.TransactionEndorsement) { + return true + } + + return false +} + +// SetTransactionEndorsement gets a reference to the given []TransactReceiptTransactionEndorsement and assigns it to the TransactionEndorsement field. +func (o *GetTransactionReceiptResponse) SetTransactionEndorsement(v []TransactReceiptTransactionEndorsement) { + o.TransactionEndorsement = v +} + +// GetBlockMetaData returns the BlockMetaData field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetBlockMetaData() TransactReceiptBlockMetaData { + if o == nil || IsNil(o.BlockMetaData) { + var ret TransactReceiptBlockMetaData + return ret + } + return *o.BlockMetaData +} + +// GetBlockMetaDataOk returns a tuple with the BlockMetaData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetBlockMetaDataOk() (*TransactReceiptBlockMetaData, bool) { + if o == nil || IsNil(o.BlockMetaData) { + return nil, false + } + return o.BlockMetaData, true +} + +// HasBlockMetaData returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasBlockMetaData() bool { + if o != nil && !IsNil(o.BlockMetaData) { + return true + } + + return false +} + +// SetBlockMetaData gets a reference to the given TransactReceiptBlockMetaData and assigns it to the BlockMetaData field. +func (o *GetTransactionReceiptResponse) SetBlockMetaData(v TransactReceiptBlockMetaData) { + o.BlockMetaData = &v +} + +// GetChainCodeName returns the ChainCodeName field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetChainCodeName() string { + if o == nil || IsNil(o.ChainCodeName) { + var ret string + return ret + } + return *o.ChainCodeName +} + +// GetChainCodeNameOk returns a tuple with the ChainCodeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetChainCodeNameOk() (*string, bool) { + if o == nil || IsNil(o.ChainCodeName) { + return nil, false + } + return o.ChainCodeName, true +} + +// HasChainCodeName returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasChainCodeName() bool { + if o != nil && !IsNil(o.ChainCodeName) { + return true + } + + return false +} + +// SetChainCodeName gets a reference to the given string and assigns it to the ChainCodeName field. +func (o *GetTransactionReceiptResponse) SetChainCodeName(v string) { + o.ChainCodeName = &v +} + +// GetChainCodeVersion returns the ChainCodeVersion field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetChainCodeVersion() string { + if o == nil || IsNil(o.ChainCodeVersion) { + var ret string + return ret + } + return *o.ChainCodeVersion +} + +// GetChainCodeVersionOk returns a tuple with the ChainCodeVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetChainCodeVersionOk() (*string, bool) { + if o == nil || IsNil(o.ChainCodeVersion) { + return nil, false + } + return o.ChainCodeVersion, true +} + +// HasChainCodeVersion returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasChainCodeVersion() bool { + if o != nil && !IsNil(o.ChainCodeVersion) { + return true + } + + return false +} + +// SetChainCodeVersion gets a reference to the given string and assigns it to the ChainCodeVersion field. +func (o *GetTransactionReceiptResponse) SetChainCodeVersion(v string) { + o.ChainCodeVersion = &v +} + +// GetResponseStatus returns the ResponseStatus field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetResponseStatus() string { + if o == nil || IsNil(o.ResponseStatus) { + var ret string + return ret + } + return *o.ResponseStatus +} + +// GetResponseStatusOk returns a tuple with the ResponseStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetResponseStatusOk() (*string, bool) { + if o == nil || IsNil(o.ResponseStatus) { + return nil, false + } + return o.ResponseStatus, true +} + +// HasResponseStatus returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasResponseStatus() bool { + if o != nil && !IsNil(o.ResponseStatus) { + return true + } + + return false +} + +// SetResponseStatus gets a reference to the given string and assigns it to the ResponseStatus field. +func (o *GetTransactionReceiptResponse) SetResponseStatus(v string) { + o.ResponseStatus = &v +} + +// GetRwsetKey returns the RwsetKey field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetRwsetKey() string { + if o == nil || IsNil(o.RwsetKey) { + var ret string + return ret + } + return *o.RwsetKey +} + +// GetRwsetKeyOk returns a tuple with the RwsetKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetRwsetKeyOk() (*string, bool) { + if o == nil || IsNil(o.RwsetKey) { + return nil, false + } + return o.RwsetKey, true +} + +// HasRwsetKey returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasRwsetKey() bool { + if o != nil && !IsNil(o.RwsetKey) { + return true + } + + return false +} + +// SetRwsetKey gets a reference to the given string and assigns it to the RwsetKey field. +func (o *GetTransactionReceiptResponse) SetRwsetKey(v string) { + o.RwsetKey = &v +} + +// GetRwsetWriteData returns the RwsetWriteData field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetRwsetWriteData() string { + if o == nil || IsNil(o.RwsetWriteData) { + var ret string + return ret + } + return *o.RwsetWriteData +} + +// GetRwsetWriteDataOk returns a tuple with the RwsetWriteData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetRwsetWriteDataOk() (*string, bool) { + if o == nil || IsNil(o.RwsetWriteData) { + return nil, false + } + return o.RwsetWriteData, true +} + +// HasRwsetWriteData returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasRwsetWriteData() bool { + if o != nil && !IsNil(o.RwsetWriteData) { + return true + } + + return false +} + +// SetRwsetWriteData gets a reference to the given string and assigns it to the RwsetWriteData field. +func (o *GetTransactionReceiptResponse) SetRwsetWriteData(v string) { + o.RwsetWriteData = &v +} + +func (o GetTransactionReceiptResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionReceiptResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockNumber) { + toSerialize["blockNumber"] = o.BlockNumber + } + if !IsNil(o.ChannelID) { + toSerialize["channelID"] = o.ChannelID + } + if !IsNil(o.TransactionCreator) { + toSerialize["transactionCreator"] = o.TransactionCreator + } + if !IsNil(o.TransactionEndorsement) { + toSerialize["transactionEndorsement"] = o.TransactionEndorsement + } + if !IsNil(o.BlockMetaData) { + toSerialize["blockMetaData"] = o.BlockMetaData + } + if !IsNil(o.ChainCodeName) { + toSerialize["chainCodeName"] = o.ChainCodeName + } + if !IsNil(o.ChainCodeVersion) { + toSerialize["chainCodeVersion"] = o.ChainCodeVersion + } + if !IsNil(o.ResponseStatus) { + toSerialize["responseStatus"] = o.ResponseStatus + } + if !IsNil(o.RwsetKey) { + toSerialize["rwsetKey"] = o.RwsetKey + } + if !IsNil(o.RwsetWriteData) { + toSerialize["rwsetWriteData"] = o.RwsetWriteData + } + return toSerialize, nil +} + +type NullableGetTransactionReceiptResponse struct { + value *GetTransactionReceiptResponse + isSet bool +} + +func (v NullableGetTransactionReceiptResponse) Get() *GetTransactionReceiptResponse { + return v.value +} + +func (v *NullableGetTransactionReceiptResponse) Set(val *GetTransactionReceiptResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionReceiptResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionReceiptResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionReceiptResponse(val *GetTransactionReceiptResponse) *NullableGetTransactionReceiptResponse { + return &NullableGetTransactionReceiptResponse{value: val, isSet: true} +} + +func (v NullableGetTransactionReceiptResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionReceiptResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_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 0000000000..902d819a51 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,434 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + // An array of MSP IDs to set as the list of endorsing peers for the transaction. + EndorsingPeers []string `json:"endorsingPeers,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"` + EndorsingParties []*string `json:"endorsingParties,omitempty"` + ResponseType *string `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 +} + +// 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 +} + +// GetEndorsingParties returns the EndorsingParties field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetEndorsingParties() []*string { + if o == nil || IsNil(o.EndorsingParties) { + var ret []*string + return ret + } + return o.EndorsingParties +} + +// GetEndorsingPartiesOk returns a tuple with the EndorsingParties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetEndorsingPartiesOk() ([]*string, bool) { + if o == nil || IsNil(o.EndorsingParties) { + return nil, false + } + return o.EndorsingParties, true +} + +// HasEndorsingParties returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasEndorsingParties() bool { + if o != nil && !IsNil(o.EndorsingParties) { + return true + } + + return false +} + +// SetEndorsingParties gets a reference to the given []*string and assigns it to the EndorsingParties field. +func (o *RunTransactionRequest) SetEndorsingParties(v []*string) { + o.EndorsingParties = v +} + +// GetResponseType returns the ResponseType field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetResponseType() string { + if o == nil || IsNil(o.ResponseType) { + var ret string + 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() (*string, 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 string and assigns it to the ResponseType field. +func (o *RunTransactionRequest) SetResponseType(v string) { + 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 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.EndorsingParties) { + toSerialize["endorsingParties"] = o.EndorsingParties + } + 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 0000000000..5f372a49b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + FunctionOutput string `json:"functionOutput"` + Success bool `json:"success"` + 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, success bool, transactionId string) *RunTransactionResponse { + this := RunTransactionResponse{} + this.FunctionOutput = functionOutput + this.Success = success + 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 +} + +// 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 +} + +// 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["success"] = o.Success + 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_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 0000000000..e50c47a344 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_ssh_exec_command_response.go @@ -0,0 +1,202 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the SSHExecCommandResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHExecCommandResponse{} + +// SSHExecCommandResponse struct for SSHExecCommandResponse +type SSHExecCommandResponse struct { + Stdout string `json:"stdout"` + Stderr string `json:"stderr"` + Code NullableInt32 `json:"code"` + Signal NullableString `json:"signal"` +} + +// NewSSHExecCommandResponse instantiates a new SSHExecCommandResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSHExecCommandResponse(stdout string, stderr string, code NullableInt32, signal NullableString) *SSHExecCommandResponse { + this := SSHExecCommandResponse{} + this.Stdout = stdout + this.Stderr = stderr + this.Code = code + this.Signal = signal + return &this +} + +// NewSSHExecCommandResponseWithDefaults instantiates a new SSHExecCommandResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSHExecCommandResponseWithDefaults() *SSHExecCommandResponse { + this := SSHExecCommandResponse{} + return &this +} + +// GetStdout returns the Stdout field value +func (o *SSHExecCommandResponse) GetStdout() string { + if o == nil { + var ret string + return ret + } + + return o.Stdout +} + +// GetStdoutOk returns a tuple with the Stdout field value +// and a boolean to check if the value has been set. +func (o *SSHExecCommandResponse) GetStdoutOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stdout, true +} + +// SetStdout sets field value +func (o *SSHExecCommandResponse) SetStdout(v string) { + o.Stdout = v +} + +// GetStderr returns the Stderr field value +func (o *SSHExecCommandResponse) GetStderr() string { + if o == nil { + var ret string + return ret + } + + return o.Stderr +} + +// GetStderrOk returns a tuple with the Stderr field value +// and a boolean to check if the value has been set. +func (o *SSHExecCommandResponse) GetStderrOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stderr, true +} + +// SetStderr sets field value +func (o *SSHExecCommandResponse) SetStderr(v string) { + o.Stderr = v +} + +// GetCode returns the Code field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *SSHExecCommandResponse) GetCode() int32 { + if o == nil || o.Code.Get() == nil { + var ret int32 + return ret + } + + return *o.Code.Get() +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SSHExecCommandResponse) GetCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Code.Get(), o.Code.IsSet() +} + +// SetCode sets field value +func (o *SSHExecCommandResponse) SetCode(v int32) { + o.Code.Set(&v) +} + +// GetSignal returns the Signal field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SSHExecCommandResponse) GetSignal() string { + if o == nil || o.Signal.Get() == nil { + var ret string + return ret + } + + return *o.Signal.Get() +} + +// GetSignalOk returns a tuple with the Signal field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SSHExecCommandResponse) GetSignalOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Signal.Get(), o.Signal.IsSet() +} + +// SetSignal sets field value +func (o *SSHExecCommandResponse) SetSignal(v string) { + o.Signal.Set(&v) +} + +func (o SSHExecCommandResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHExecCommandResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["stdout"] = o.Stdout + toSerialize["stderr"] = o.Stderr + toSerialize["code"] = o.Code.Get() + toSerialize["signal"] = o.Signal.Get() + return toSerialize, nil +} + +type NullableSSHExecCommandResponse struct { + value *SSHExecCommandResponse + isSet bool +} + +func (v NullableSSHExecCommandResponse) Get() *SSHExecCommandResponse { + return v.value +} + +func (v *NullableSSHExecCommandResponse) Set(val *SSHExecCommandResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSSHExecCommandResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHExecCommandResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHExecCommandResponse(val *SSHExecCommandResponse) *NullableSSHExecCommandResponse { + return &NullableSSHExecCommandResponse{value: val, isSet: true} +} + +func (v NullableSSHExecCommandResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHExecCommandResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go new file mode 100644 index 0000000000..e1bf1a63dd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the TransactReceiptBlockMetaData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactReceiptBlockMetaData{} + +// TransactReceiptBlockMetaData struct for TransactReceiptBlockMetaData +type TransactReceiptBlockMetaData struct { + Mspid *string `json:"mspid,omitempty"` + BlockCreatorID *string `json:"blockCreatorID,omitempty"` + Signature *string `json:"signature,omitempty"` +} + +// NewTransactReceiptBlockMetaData instantiates a new TransactReceiptBlockMetaData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactReceiptBlockMetaData() *TransactReceiptBlockMetaData { + this := TransactReceiptBlockMetaData{} + return &this +} + +// NewTransactReceiptBlockMetaDataWithDefaults instantiates a new TransactReceiptBlockMetaData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactReceiptBlockMetaDataWithDefaults() *TransactReceiptBlockMetaData { + this := TransactReceiptBlockMetaData{} + return &this +} + +// GetMspid returns the Mspid field value if set, zero value otherwise. +func (o *TransactReceiptBlockMetaData) GetMspid() string { + if o == nil || IsNil(o.Mspid) { + var ret string + return ret + } + return *o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptBlockMetaData) GetMspidOk() (*string, bool) { + if o == nil || IsNil(o.Mspid) { + return nil, false + } + return o.Mspid, true +} + +// HasMspid returns a boolean if a field has been set. +func (o *TransactReceiptBlockMetaData) HasMspid() bool { + if o != nil && !IsNil(o.Mspid) { + return true + } + + return false +} + +// SetMspid gets a reference to the given string and assigns it to the Mspid field. +func (o *TransactReceiptBlockMetaData) SetMspid(v string) { + o.Mspid = &v +} + +// GetBlockCreatorID returns the BlockCreatorID field value if set, zero value otherwise. +func (o *TransactReceiptBlockMetaData) GetBlockCreatorID() string { + if o == nil || IsNil(o.BlockCreatorID) { + var ret string + return ret + } + return *o.BlockCreatorID +} + +// GetBlockCreatorIDOk returns a tuple with the BlockCreatorID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptBlockMetaData) GetBlockCreatorIDOk() (*string, bool) { + if o == nil || IsNil(o.BlockCreatorID) { + return nil, false + } + return o.BlockCreatorID, true +} + +// HasBlockCreatorID returns a boolean if a field has been set. +func (o *TransactReceiptBlockMetaData) HasBlockCreatorID() bool { + if o != nil && !IsNil(o.BlockCreatorID) { + return true + } + + return false +} + +// SetBlockCreatorID gets a reference to the given string and assigns it to the BlockCreatorID field. +func (o *TransactReceiptBlockMetaData) SetBlockCreatorID(v string) { + o.BlockCreatorID = &v +} + +// GetSignature returns the Signature field value if set, zero value otherwise. +func (o *TransactReceiptBlockMetaData) GetSignature() string { + if o == nil || IsNil(o.Signature) { + var ret string + return ret + } + return *o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptBlockMetaData) GetSignatureOk() (*string, bool) { + if o == nil || IsNil(o.Signature) { + return nil, false + } + return o.Signature, true +} + +// HasSignature returns a boolean if a field has been set. +func (o *TransactReceiptBlockMetaData) HasSignature() bool { + if o != nil && !IsNil(o.Signature) { + return true + } + + return false +} + +// SetSignature gets a reference to the given string and assigns it to the Signature field. +func (o *TransactReceiptBlockMetaData) SetSignature(v string) { + o.Signature = &v +} + +func (o TransactReceiptBlockMetaData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactReceiptBlockMetaData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mspid) { + toSerialize["mspid"] = o.Mspid + } + if !IsNil(o.BlockCreatorID) { + toSerialize["blockCreatorID"] = o.BlockCreatorID + } + if !IsNil(o.Signature) { + toSerialize["signature"] = o.Signature + } + return toSerialize, nil +} + +type NullableTransactReceiptBlockMetaData struct { + value *TransactReceiptBlockMetaData + isSet bool +} + +func (v NullableTransactReceiptBlockMetaData) Get() *TransactReceiptBlockMetaData { + return v.value +} + +func (v *NullableTransactReceiptBlockMetaData) Set(val *TransactReceiptBlockMetaData) { + v.value = val + v.isSet = true +} + +func (v NullableTransactReceiptBlockMetaData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactReceiptBlockMetaData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactReceiptBlockMetaData(val *TransactReceiptBlockMetaData) *NullableTransactReceiptBlockMetaData { + return &NullableTransactReceiptBlockMetaData{value: val, isSet: true} +} + +func (v NullableTransactReceiptBlockMetaData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactReceiptBlockMetaData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go new file mode 100644 index 0000000000..06e9b6ac95 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the TransactReceiptTransactionCreator type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactReceiptTransactionCreator{} + +// TransactReceiptTransactionCreator struct for TransactReceiptTransactionCreator +type TransactReceiptTransactionCreator struct { + Mspid *string `json:"mspid,omitempty"` + CreatorID *string `json:"creatorID,omitempty"` +} + +// NewTransactReceiptTransactionCreator instantiates a new TransactReceiptTransactionCreator object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactReceiptTransactionCreator() *TransactReceiptTransactionCreator { + this := TransactReceiptTransactionCreator{} + return &this +} + +// NewTransactReceiptTransactionCreatorWithDefaults instantiates a new TransactReceiptTransactionCreator object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactReceiptTransactionCreatorWithDefaults() *TransactReceiptTransactionCreator { + this := TransactReceiptTransactionCreator{} + return &this +} + +// GetMspid returns the Mspid field value if set, zero value otherwise. +func (o *TransactReceiptTransactionCreator) GetMspid() string { + if o == nil || IsNil(o.Mspid) { + var ret string + return ret + } + return *o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionCreator) GetMspidOk() (*string, bool) { + if o == nil || IsNil(o.Mspid) { + return nil, false + } + return o.Mspid, true +} + +// HasMspid returns a boolean if a field has been set. +func (o *TransactReceiptTransactionCreator) HasMspid() bool { + if o != nil && !IsNil(o.Mspid) { + return true + } + + return false +} + +// SetMspid gets a reference to the given string and assigns it to the Mspid field. +func (o *TransactReceiptTransactionCreator) SetMspid(v string) { + o.Mspid = &v +} + +// GetCreatorID returns the CreatorID field value if set, zero value otherwise. +func (o *TransactReceiptTransactionCreator) GetCreatorID() string { + if o == nil || IsNil(o.CreatorID) { + var ret string + return ret + } + return *o.CreatorID +} + +// GetCreatorIDOk returns a tuple with the CreatorID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionCreator) GetCreatorIDOk() (*string, bool) { + if o == nil || IsNil(o.CreatorID) { + return nil, false + } + return o.CreatorID, true +} + +// HasCreatorID returns a boolean if a field has been set. +func (o *TransactReceiptTransactionCreator) HasCreatorID() bool { + if o != nil && !IsNil(o.CreatorID) { + return true + } + + return false +} + +// SetCreatorID gets a reference to the given string and assigns it to the CreatorID field. +func (o *TransactReceiptTransactionCreator) SetCreatorID(v string) { + o.CreatorID = &v +} + +func (o TransactReceiptTransactionCreator) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactReceiptTransactionCreator) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mspid) { + toSerialize["mspid"] = o.Mspid + } + if !IsNil(o.CreatorID) { + toSerialize["creatorID"] = o.CreatorID + } + return toSerialize, nil +} + +type NullableTransactReceiptTransactionCreator struct { + value *TransactReceiptTransactionCreator + isSet bool +} + +func (v NullableTransactReceiptTransactionCreator) Get() *TransactReceiptTransactionCreator { + return v.value +} + +func (v *NullableTransactReceiptTransactionCreator) Set(val *TransactReceiptTransactionCreator) { + v.value = val + v.isSet = true +} + +func (v NullableTransactReceiptTransactionCreator) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactReceiptTransactionCreator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactReceiptTransactionCreator(val *TransactReceiptTransactionCreator) *NullableTransactReceiptTransactionCreator { + return &NullableTransactReceiptTransactionCreator{value: val, isSet: true} +} + +func (v NullableTransactReceiptTransactionCreator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactReceiptTransactionCreator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go new file mode 100644 index 0000000000..5544859e0d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the TransactReceiptTransactionEndorsement type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactReceiptTransactionEndorsement{} + +// TransactReceiptTransactionEndorsement struct for TransactReceiptTransactionEndorsement +type TransactReceiptTransactionEndorsement struct { + Mspid *string `json:"mspid,omitempty"` + EndorserID *string `json:"endorserID,omitempty"` + Signature *string `json:"signature,omitempty"` +} + +// NewTransactReceiptTransactionEndorsement instantiates a new TransactReceiptTransactionEndorsement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactReceiptTransactionEndorsement() *TransactReceiptTransactionEndorsement { + this := TransactReceiptTransactionEndorsement{} + return &this +} + +// NewTransactReceiptTransactionEndorsementWithDefaults instantiates a new TransactReceiptTransactionEndorsement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactReceiptTransactionEndorsementWithDefaults() *TransactReceiptTransactionEndorsement { + this := TransactReceiptTransactionEndorsement{} + return &this +} + +// GetMspid returns the Mspid field value if set, zero value otherwise. +func (o *TransactReceiptTransactionEndorsement) GetMspid() string { + if o == nil || IsNil(o.Mspid) { + var ret string + return ret + } + return *o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionEndorsement) GetMspidOk() (*string, bool) { + if o == nil || IsNil(o.Mspid) { + return nil, false + } + return o.Mspid, true +} + +// HasMspid returns a boolean if a field has been set. +func (o *TransactReceiptTransactionEndorsement) HasMspid() bool { + if o != nil && !IsNil(o.Mspid) { + return true + } + + return false +} + +// SetMspid gets a reference to the given string and assigns it to the Mspid field. +func (o *TransactReceiptTransactionEndorsement) SetMspid(v string) { + o.Mspid = &v +} + +// GetEndorserID returns the EndorserID field value if set, zero value otherwise. +func (o *TransactReceiptTransactionEndorsement) GetEndorserID() string { + if o == nil || IsNil(o.EndorserID) { + var ret string + return ret + } + return *o.EndorserID +} + +// GetEndorserIDOk returns a tuple with the EndorserID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionEndorsement) GetEndorserIDOk() (*string, bool) { + if o == nil || IsNil(o.EndorserID) { + return nil, false + } + return o.EndorserID, true +} + +// HasEndorserID returns a boolean if a field has been set. +func (o *TransactReceiptTransactionEndorsement) HasEndorserID() bool { + if o != nil && !IsNil(o.EndorserID) { + return true + } + + return false +} + +// SetEndorserID gets a reference to the given string and assigns it to the EndorserID field. +func (o *TransactReceiptTransactionEndorsement) SetEndorserID(v string) { + o.EndorserID = &v +} + +// GetSignature returns the Signature field value if set, zero value otherwise. +func (o *TransactReceiptTransactionEndorsement) GetSignature() string { + if o == nil || IsNil(o.Signature) { + var ret string + return ret + } + return *o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionEndorsement) GetSignatureOk() (*string, bool) { + if o == nil || IsNil(o.Signature) { + return nil, false + } + return o.Signature, true +} + +// HasSignature returns a boolean if a field has been set. +func (o *TransactReceiptTransactionEndorsement) HasSignature() bool { + if o != nil && !IsNil(o.Signature) { + return true + } + + return false +} + +// SetSignature gets a reference to the given string and assigns it to the Signature field. +func (o *TransactReceiptTransactionEndorsement) SetSignature(v string) { + o.Signature = &v +} + +func (o TransactReceiptTransactionEndorsement) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactReceiptTransactionEndorsement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mspid) { + toSerialize["mspid"] = o.Mspid + } + if !IsNil(o.EndorserID) { + toSerialize["endorserID"] = o.EndorserID + } + if !IsNil(o.Signature) { + toSerialize["signature"] = o.Signature + } + return toSerialize, nil +} + +type NullableTransactReceiptTransactionEndorsement struct { + value *TransactReceiptTransactionEndorsement + isSet bool +} + +func (v NullableTransactReceiptTransactionEndorsement) Get() *TransactReceiptTransactionEndorsement { + return v.value +} + +func (v *NullableTransactReceiptTransactionEndorsement) Set(val *TransactReceiptTransactionEndorsement) { + v.value = val + v.isSet = true +} + +func (v NullableTransactReceiptTransactionEndorsement) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactReceiptTransactionEndorsement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactReceiptTransactionEndorsement(val *TransactReceiptTransactionEndorsement) *NullableTransactReceiptTransactionEndorsement { + return &NullableTransactReceiptTransactionEndorsement{value: val, isSet: true} +} + +func (v NullableTransactReceiptTransactionEndorsement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactReceiptTransactionEndorsement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go new file mode 100644 index 0000000000..0ad1d2f160 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the VaultTransitKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VaultTransitKey{} + +// VaultTransitKey vault key details for signing fabric message with private key stored with transit engine. +type VaultTransitKey struct { + // label of private key + KeyName string `json:"keyName"` + // token for accessing private key + Token string `json:"token"` +} + +// NewVaultTransitKey instantiates a new VaultTransitKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVaultTransitKey(keyName string, token string) *VaultTransitKey { + this := VaultTransitKey{} + this.KeyName = keyName + this.Token = token + return &this +} + +// NewVaultTransitKeyWithDefaults instantiates a new VaultTransitKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVaultTransitKeyWithDefaults() *VaultTransitKey { + this := VaultTransitKey{} + return &this +} + +// GetKeyName returns the KeyName field value +func (o *VaultTransitKey) GetKeyName() string { + if o == nil { + var ret string + return ret + } + + return o.KeyName +} + +// GetKeyNameOk returns a tuple with the KeyName field value +// and a boolean to check if the value has been set. +func (o *VaultTransitKey) GetKeyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeyName, true +} + +// SetKeyName sets field value +func (o *VaultTransitKey) SetKeyName(v string) { + o.KeyName = v +} + +// GetToken returns the Token field value +func (o *VaultTransitKey) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *VaultTransitKey) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *VaultTransitKey) SetToken(v string) { + o.Token = v +} + +func (o VaultTransitKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VaultTransitKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keyName"] = o.KeyName + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableVaultTransitKey struct { + value *VaultTransitKey + isSet bool +} + +func (v NullableVaultTransitKey) Get() *VaultTransitKey { + return v.value +} + +func (v *NullableVaultTransitKey) Set(val *VaultTransitKey) { + v.value = val + v.isSet = true +} + +func (v NullableVaultTransitKey) IsSet() bool { + return v.isSet +} + +func (v *NullableVaultTransitKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVaultTransitKey(val *VaultTransitKey) *NullableVaultTransitKey { + return &NullableVaultTransitKey{value: val, isSet: true} +} + +func (v NullableVaultTransitKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVaultTransitKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go new file mode 100644 index 0000000000..e9d86d8d21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksCactusErrorResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksCactusErrorResponseV1{} + +// WatchBlocksCactusErrorResponseV1 Error response from WatchBlocks operation. +type WatchBlocksCactusErrorResponseV1 struct { + // Error code. + Code float32 `json:"code"` + // Description of the error. + ErrorMessage string `json:"errorMessage"` +} + +// NewWatchBlocksCactusErrorResponseV1 instantiates a new WatchBlocksCactusErrorResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksCactusErrorResponseV1(code float32, errorMessage string) *WatchBlocksCactusErrorResponseV1 { + this := WatchBlocksCactusErrorResponseV1{} + this.Code = code + this.ErrorMessage = errorMessage + return &this +} + +// NewWatchBlocksCactusErrorResponseV1WithDefaults instantiates a new WatchBlocksCactusErrorResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksCactusErrorResponseV1WithDefaults() *WatchBlocksCactusErrorResponseV1 { + this := WatchBlocksCactusErrorResponseV1{} + return &this +} + +// GetCode returns the Code field value +func (o *WatchBlocksCactusErrorResponseV1) GetCode() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusErrorResponseV1) GetCodeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *WatchBlocksCactusErrorResponseV1) SetCode(v float32) { + o.Code = v +} + +// GetErrorMessage returns the ErrorMessage field value +func (o *WatchBlocksCactusErrorResponseV1) GetErrorMessage() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusErrorResponseV1) GetErrorMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorMessage, true +} + +// SetErrorMessage sets field value +func (o *WatchBlocksCactusErrorResponseV1) SetErrorMessage(v string) { + o.ErrorMessage = v +} + +func (o WatchBlocksCactusErrorResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksCactusErrorResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["errorMessage"] = o.ErrorMessage + return toSerialize, nil +} + +type NullableWatchBlocksCactusErrorResponseV1 struct { + value *WatchBlocksCactusErrorResponseV1 + isSet bool +} + +func (v NullableWatchBlocksCactusErrorResponseV1) Get() *WatchBlocksCactusErrorResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksCactusErrorResponseV1) Set(val *WatchBlocksCactusErrorResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksCactusErrorResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksCactusErrorResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksCactusErrorResponseV1(val *WatchBlocksCactusErrorResponseV1) *NullableWatchBlocksCactusErrorResponseV1 { + return &NullableWatchBlocksCactusErrorResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksCactusErrorResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksCactusErrorResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go new file mode 100644 index 0000000000..7b5cf178bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go @@ -0,0 +1,202 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksCactusTransactionsEventV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksCactusTransactionsEventV1{} + +// WatchBlocksCactusTransactionsEventV1 Transaction summary from commited block. +type WatchBlocksCactusTransactionsEventV1 struct { + // ChainCode containing function that was executed. + ChaincodeId string `json:"chaincodeId"` + // Transaction identifier. + TransactionId string `json:"transactionId"` + // Function name that was executed. + FunctionName string `json:"functionName"` + // List of function arguments. + FunctionArgs []string `json:"functionArgs"` +} + +// NewWatchBlocksCactusTransactionsEventV1 instantiates a new WatchBlocksCactusTransactionsEventV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksCactusTransactionsEventV1(chaincodeId string, transactionId string, functionName string, functionArgs []string) *WatchBlocksCactusTransactionsEventV1 { + this := WatchBlocksCactusTransactionsEventV1{} + this.ChaincodeId = chaincodeId + this.TransactionId = transactionId + this.FunctionName = functionName + this.FunctionArgs = functionArgs + return &this +} + +// NewWatchBlocksCactusTransactionsEventV1WithDefaults instantiates a new WatchBlocksCactusTransactionsEventV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksCactusTransactionsEventV1WithDefaults() *WatchBlocksCactusTransactionsEventV1 { + this := WatchBlocksCactusTransactionsEventV1{} + return &this +} + +// GetChaincodeId returns the ChaincodeId field value +func (o *WatchBlocksCactusTransactionsEventV1) GetChaincodeId() string { + if o == nil { + var ret string + return ret + } + + return o.ChaincodeId +} + +// GetChaincodeIdOk returns a tuple with the ChaincodeId field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetChaincodeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChaincodeId, true +} + +// SetChaincodeId sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetChaincodeId(v string) { + o.ChaincodeId = v +} + +// GetTransactionId returns the TransactionId field value +func (o *WatchBlocksCactusTransactionsEventV1) GetTransactionId() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetTransactionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionId, true +} + +// SetTransactionId sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetTransactionId(v string) { + o.TransactionId = v +} + +// GetFunctionName returns the FunctionName field value +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionName() string { + if o == nil { + var ret string + return ret + } + + return o.FunctionName +} + +// GetFunctionNameOk returns a tuple with the FunctionName field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionName, true +} + +// SetFunctionName sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetFunctionName(v string) { + o.FunctionName = v +} + +// GetFunctionArgs returns the FunctionArgs field value +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionArgs() []string { + if o == nil { + var ret []string + return ret + } + + return o.FunctionArgs +} + +// GetFunctionArgsOk returns a tuple with the FunctionArgs field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionArgsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.FunctionArgs, true +} + +// SetFunctionArgs sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetFunctionArgs(v []string) { + o.FunctionArgs = v +} + +func (o WatchBlocksCactusTransactionsEventV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksCactusTransactionsEventV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["chaincodeId"] = o.ChaincodeId + toSerialize["transactionId"] = o.TransactionId + toSerialize["functionName"] = o.FunctionName + toSerialize["functionArgs"] = o.FunctionArgs + return toSerialize, nil +} + +type NullableWatchBlocksCactusTransactionsEventV1 struct { + value *WatchBlocksCactusTransactionsEventV1 + isSet bool +} + +func (v NullableWatchBlocksCactusTransactionsEventV1) Get() *WatchBlocksCactusTransactionsEventV1 { + return v.value +} + +func (v *NullableWatchBlocksCactusTransactionsEventV1) Set(val *WatchBlocksCactusTransactionsEventV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksCactusTransactionsEventV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksCactusTransactionsEventV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksCactusTransactionsEventV1(val *WatchBlocksCactusTransactionsEventV1) *NullableWatchBlocksCactusTransactionsEventV1 { + return &NullableWatchBlocksCactusTransactionsEventV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksCactusTransactionsEventV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksCactusTransactionsEventV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go new file mode 100644 index 0000000000..53f1b3b6f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksCactusTransactionsResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksCactusTransactionsResponseV1{} + +// WatchBlocksCactusTransactionsResponseV1 Custom response containing block transactions summary. Compatible with legacy fabric-socketio connector monitoring. +type WatchBlocksCactusTransactionsResponseV1 struct { + // List of transactions summary + CactusTransactionsEvents []WatchBlocksCactusTransactionsEventV1 `json:"cactusTransactionsEvents"` +} + +// NewWatchBlocksCactusTransactionsResponseV1 instantiates a new WatchBlocksCactusTransactionsResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksCactusTransactionsResponseV1(cactusTransactionsEvents []WatchBlocksCactusTransactionsEventV1) *WatchBlocksCactusTransactionsResponseV1 { + this := WatchBlocksCactusTransactionsResponseV1{} + this.CactusTransactionsEvents = cactusTransactionsEvents + return &this +} + +// NewWatchBlocksCactusTransactionsResponseV1WithDefaults instantiates a new WatchBlocksCactusTransactionsResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksCactusTransactionsResponseV1WithDefaults() *WatchBlocksCactusTransactionsResponseV1 { + this := WatchBlocksCactusTransactionsResponseV1{} + return &this +} + +// GetCactusTransactionsEvents returns the CactusTransactionsEvents field value +func (o *WatchBlocksCactusTransactionsResponseV1) GetCactusTransactionsEvents() []WatchBlocksCactusTransactionsEventV1 { + if o == nil { + var ret []WatchBlocksCactusTransactionsEventV1 + return ret + } + + return o.CactusTransactionsEvents +} + +// GetCactusTransactionsEventsOk returns a tuple with the CactusTransactionsEvents field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsResponseV1) GetCactusTransactionsEventsOk() ([]WatchBlocksCactusTransactionsEventV1, bool) { + if o == nil { + return nil, false + } + return o.CactusTransactionsEvents, true +} + +// SetCactusTransactionsEvents sets field value +func (o *WatchBlocksCactusTransactionsResponseV1) SetCactusTransactionsEvents(v []WatchBlocksCactusTransactionsEventV1) { + o.CactusTransactionsEvents = v +} + +func (o WatchBlocksCactusTransactionsResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksCactusTransactionsResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cactusTransactionsEvents"] = o.CactusTransactionsEvents + return toSerialize, nil +} + +type NullableWatchBlocksCactusTransactionsResponseV1 struct { + value *WatchBlocksCactusTransactionsResponseV1 + isSet bool +} + +func (v NullableWatchBlocksCactusTransactionsResponseV1) Get() *WatchBlocksCactusTransactionsResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksCactusTransactionsResponseV1) Set(val *WatchBlocksCactusTransactionsResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksCactusTransactionsResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksCactusTransactionsResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksCactusTransactionsResponseV1(val *WatchBlocksCactusTransactionsResponseV1) *NullableWatchBlocksCactusTransactionsResponseV1 { + return &NullableWatchBlocksCactusTransactionsResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksCactusTransactionsResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksCactusTransactionsResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_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 0000000000..92d2bc9d2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_filtered_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksFilteredResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksFilteredResponseV1{} + +// WatchBlocksFilteredResponseV1 Response that corresponds to Fabric SDK 'filtered' EventType. +type WatchBlocksFilteredResponseV1 struct { + // Filtered commited block. + FilteredBlock interface{} `json:"filteredBlock"` +} + +// NewWatchBlocksFilteredResponseV1 instantiates a new WatchBlocksFilteredResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksFilteredResponseV1(filteredBlock interface{}) *WatchBlocksFilteredResponseV1 { + this := WatchBlocksFilteredResponseV1{} + this.FilteredBlock = filteredBlock + return &this +} + +// NewWatchBlocksFilteredResponseV1WithDefaults instantiates a new WatchBlocksFilteredResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksFilteredResponseV1WithDefaults() *WatchBlocksFilteredResponseV1 { + this := WatchBlocksFilteredResponseV1{} + return &this +} + +// GetFilteredBlock returns the FilteredBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WatchBlocksFilteredResponseV1) GetFilteredBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.FilteredBlock +} + +// GetFilteredBlockOk returns a tuple with the FilteredBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksFilteredResponseV1) GetFilteredBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.FilteredBlock) { + return nil, false + } + return &o.FilteredBlock, true +} + +// SetFilteredBlock sets field value +func (o *WatchBlocksFilteredResponseV1) SetFilteredBlock(v interface{}) { + o.FilteredBlock = v +} + +func (o WatchBlocksFilteredResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksFilteredResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.FilteredBlock != nil { + toSerialize["filteredBlock"] = o.FilteredBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksFilteredResponseV1 struct { + value *WatchBlocksFilteredResponseV1 + isSet bool +} + +func (v NullableWatchBlocksFilteredResponseV1) Get() *WatchBlocksFilteredResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksFilteredResponseV1) Set(val *WatchBlocksFilteredResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksFilteredResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksFilteredResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksFilteredResponseV1(val *WatchBlocksFilteredResponseV1) *NullableWatchBlocksFilteredResponseV1 { + return &NullableWatchBlocksFilteredResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksFilteredResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksFilteredResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go new file mode 100644 index 0000000000..a03029fa7a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksFullResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksFullResponseV1{} + +// WatchBlocksFullResponseV1 Response that corresponds to Fabric SDK 'full' EventType. +type WatchBlocksFullResponseV1 struct { + // Full commited block. + FullBlock interface{} `json:"fullBlock"` +} + +// NewWatchBlocksFullResponseV1 instantiates a new WatchBlocksFullResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksFullResponseV1(fullBlock interface{}) *WatchBlocksFullResponseV1 { + this := WatchBlocksFullResponseV1{} + this.FullBlock = fullBlock + return &this +} + +// NewWatchBlocksFullResponseV1WithDefaults instantiates a new WatchBlocksFullResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksFullResponseV1WithDefaults() *WatchBlocksFullResponseV1 { + this := WatchBlocksFullResponseV1{} + return &this +} + +// GetFullBlock returns the FullBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WatchBlocksFullResponseV1) GetFullBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.FullBlock +} + +// GetFullBlockOk returns a tuple with the FullBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksFullResponseV1) GetFullBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.FullBlock) { + return nil, false + } + return &o.FullBlock, true +} + +// SetFullBlock sets field value +func (o *WatchBlocksFullResponseV1) SetFullBlock(v interface{}) { + o.FullBlock = v +} + +func (o WatchBlocksFullResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksFullResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.FullBlock != nil { + toSerialize["fullBlock"] = o.FullBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksFullResponseV1 struct { + value *WatchBlocksFullResponseV1 + isSet bool +} + +func (v NullableWatchBlocksFullResponseV1) Get() *WatchBlocksFullResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksFullResponseV1) Set(val *WatchBlocksFullResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksFullResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksFullResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksFullResponseV1(val *WatchBlocksFullResponseV1) *NullableWatchBlocksFullResponseV1 { + return &NullableWatchBlocksFullResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksFullResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksFullResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go new file mode 100644 index 0000000000..b37438ecf9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksListenerTypeV1 Response type from WatchBlocks. 'Cactus*' are custom views, others correspond to fabric SDK call. +type WatchBlocksListenerTypeV1 string + +// List of WatchBlocksListenerTypeV1 +const ( + Filtered WatchBlocksListenerTypeV1 = "filtered" + Full WatchBlocksListenerTypeV1 = "full" + Private WatchBlocksListenerTypeV1 = "private" + CactusTransactions WatchBlocksListenerTypeV1 = "cactus:transactions" +) + +// All allowed values of WatchBlocksListenerTypeV1 enum +var AllowedWatchBlocksListenerTypeV1EnumValues = []WatchBlocksListenerTypeV1{ + "filtered", + "full", + "private", + "cactus:transactions", +} + +func (v *WatchBlocksListenerTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksListenerTypeV1(value) + for _, existing := range AllowedWatchBlocksListenerTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksListenerTypeV1", value) +} + +// NewWatchBlocksListenerTypeV1FromValue returns a pointer to a valid WatchBlocksListenerTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksListenerTypeV1FromValue(v string) (*WatchBlocksListenerTypeV1, error) { + ev := WatchBlocksListenerTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksListenerTypeV1: valid values are %v", v, AllowedWatchBlocksListenerTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksListenerTypeV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksListenerTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksListenerTypeV1 value +func (v WatchBlocksListenerTypeV1) Ptr() *WatchBlocksListenerTypeV1 { + return &v +} + +type NullableWatchBlocksListenerTypeV1 struct { + value *WatchBlocksListenerTypeV1 + isSet bool +} + +func (v NullableWatchBlocksListenerTypeV1) Get() *WatchBlocksListenerTypeV1 { + return v.value +} + +func (v *NullableWatchBlocksListenerTypeV1) Set(val *WatchBlocksListenerTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksListenerTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksListenerTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksListenerTypeV1(val *WatchBlocksListenerTypeV1) *NullableWatchBlocksListenerTypeV1 { + return &NullableWatchBlocksListenerTypeV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksListenerTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksListenerTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go new file mode 100644 index 0000000000..f29dcf4eab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go @@ -0,0 +1,209 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksOptionsV1{} + +// WatchBlocksOptionsV1 Options passed when subscribing to block monitoring. +type WatchBlocksOptionsV1 struct { + // Hyperledger Fabric channel to connect to. + ChannelName string `json:"channelName"` + GatewayOptions GatewayOptions `json:"gatewayOptions"` + Type WatchBlocksListenerTypeV1 `json:"type"` + // From which block start monitoring. Defaults to latest. + StartBlock *string `json:"startBlock,omitempty"` +} + +// NewWatchBlocksOptionsV1 instantiates a new WatchBlocksOptionsV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksOptionsV1(channelName string, gatewayOptions GatewayOptions, type_ WatchBlocksListenerTypeV1) *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + this.ChannelName = channelName + this.GatewayOptions = gatewayOptions + this.Type = type_ + return &this +} + +// NewWatchBlocksOptionsV1WithDefaults instantiates a new WatchBlocksOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksOptionsV1WithDefaults() *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + return &this +} + +// GetChannelName returns the ChannelName field value +func (o *WatchBlocksOptionsV1) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *WatchBlocksOptionsV1) SetChannelName(v string) { + o.ChannelName = v +} + +// GetGatewayOptions returns the GatewayOptions field value +func (o *WatchBlocksOptionsV1) GetGatewayOptions() GatewayOptions { + if o == nil { + var ret GatewayOptions + return ret + } + + return o.GatewayOptions +} + +// GetGatewayOptionsOk returns a tuple with the GatewayOptions field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetGatewayOptionsOk() (*GatewayOptions, bool) { + if o == nil { + return nil, false + } + return &o.GatewayOptions, true +} + +// SetGatewayOptions sets field value +func (o *WatchBlocksOptionsV1) SetGatewayOptions(v GatewayOptions) { + o.GatewayOptions = v +} + +// GetType returns the Type field value +func (o *WatchBlocksOptionsV1) GetType() WatchBlocksListenerTypeV1 { + if o == nil { + var ret WatchBlocksListenerTypeV1 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetTypeOk() (*WatchBlocksListenerTypeV1, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WatchBlocksOptionsV1) SetType(v WatchBlocksListenerTypeV1) { + o.Type = v +} + +// GetStartBlock returns the StartBlock field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetStartBlock() string { + if o == nil || IsNil(o.StartBlock) { + var ret string + return ret + } + return *o.StartBlock +} + +// GetStartBlockOk returns a tuple with the StartBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetStartBlockOk() (*string, bool) { + if o == nil || IsNil(o.StartBlock) { + return nil, false + } + return o.StartBlock, true +} + +// HasStartBlock returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasStartBlock() bool { + if o != nil && !IsNil(o.StartBlock) { + return true + } + + return false +} + +// SetStartBlock gets a reference to the given string and assigns it to the StartBlock field. +func (o *WatchBlocksOptionsV1) SetStartBlock(v string) { + o.StartBlock = &v +} + +func (o WatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channelName"] = o.ChannelName + toSerialize["gatewayOptions"] = o.GatewayOptions + toSerialize["type"] = o.Type + if !IsNil(o.StartBlock) { + toSerialize["startBlock"] = o.StartBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksOptionsV1 struct { + value *WatchBlocksOptionsV1 + isSet bool +} + +func (v NullableWatchBlocksOptionsV1) Get() *WatchBlocksOptionsV1 { + return v.value +} + +func (v *NullableWatchBlocksOptionsV1) Set(val *WatchBlocksOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksOptionsV1(val *WatchBlocksOptionsV1) *NullableWatchBlocksOptionsV1 { + return &NullableWatchBlocksOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go new file mode 100644 index 0000000000..43edcc07a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksPrivateResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksPrivateResponseV1{} + +// WatchBlocksPrivateResponseV1 Response that corresponds to Fabric SDK 'private' EventType. +type WatchBlocksPrivateResponseV1 struct { + // Private commited block. + PrivateBlock interface{} `json:"privateBlock"` +} + +// NewWatchBlocksPrivateResponseV1 instantiates a new WatchBlocksPrivateResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksPrivateResponseV1(privateBlock interface{}) *WatchBlocksPrivateResponseV1 { + this := WatchBlocksPrivateResponseV1{} + this.PrivateBlock = privateBlock + return &this +} + +// NewWatchBlocksPrivateResponseV1WithDefaults instantiates a new WatchBlocksPrivateResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksPrivateResponseV1WithDefaults() *WatchBlocksPrivateResponseV1 { + this := WatchBlocksPrivateResponseV1{} + return &this +} + +// GetPrivateBlock returns the PrivateBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WatchBlocksPrivateResponseV1) GetPrivateBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.PrivateBlock +} + +// GetPrivateBlockOk returns a tuple with the PrivateBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksPrivateResponseV1) GetPrivateBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.PrivateBlock) { + return nil, false + } + return &o.PrivateBlock, true +} + +// SetPrivateBlock sets field value +func (o *WatchBlocksPrivateResponseV1) SetPrivateBlock(v interface{}) { + o.PrivateBlock = v +} + +func (o WatchBlocksPrivateResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksPrivateResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.PrivateBlock != nil { + toSerialize["privateBlock"] = o.PrivateBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksPrivateResponseV1 struct { + value *WatchBlocksPrivateResponseV1 + isSet bool +} + +func (v NullableWatchBlocksPrivateResponseV1) Get() *WatchBlocksPrivateResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksPrivateResponseV1) Set(val *WatchBlocksPrivateResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksPrivateResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksPrivateResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksPrivateResponseV1(val *WatchBlocksPrivateResponseV1) *NullableWatchBlocksPrivateResponseV1 { + return &NullableWatchBlocksPrivateResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksPrivateResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksPrivateResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go new file mode 100644 index 0000000000..8e54bc0bab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go @@ -0,0 +1,238 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksResponseV1 - Response block from WatchBlocks endpoint. Depends on 'type' passed in subscription options. +type WatchBlocksResponseV1 struct { + WatchBlocksCactusErrorResponseV1 *WatchBlocksCactusErrorResponseV1 + WatchBlocksCactusTransactionsResponseV1 *WatchBlocksCactusTransactionsResponseV1 + WatchBlocksFilteredResponseV1 *WatchBlocksFilteredResponseV1 + WatchBlocksFullResponseV1 *WatchBlocksFullResponseV1 + WatchBlocksPrivateResponseV1 *WatchBlocksPrivateResponseV1 +} + +// WatchBlocksCactusErrorResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksCactusErrorResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksCactusErrorResponseV1AsWatchBlocksResponseV1(v *WatchBlocksCactusErrorResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksCactusErrorResponseV1: v, + } +} + +// WatchBlocksCactusTransactionsResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksCactusTransactionsResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksCactusTransactionsResponseV1AsWatchBlocksResponseV1(v *WatchBlocksCactusTransactionsResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksCactusTransactionsResponseV1: v, + } +} + +// WatchBlocksFilteredResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksFilteredResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksFilteredResponseV1AsWatchBlocksResponseV1(v *WatchBlocksFilteredResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksFilteredResponseV1: v, + } +} + +// WatchBlocksFullResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksFullResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksFullResponseV1AsWatchBlocksResponseV1(v *WatchBlocksFullResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksFullResponseV1: v, + } +} + +// WatchBlocksPrivateResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksPrivateResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksPrivateResponseV1AsWatchBlocksResponseV1(v *WatchBlocksPrivateResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksPrivateResponseV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksResponseV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into WatchBlocksCactusErrorResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksCactusErrorResponseV1) + if err == nil { + jsonWatchBlocksCactusErrorResponseV1, _ := json.Marshal(dst.WatchBlocksCactusErrorResponseV1) + if string(jsonWatchBlocksCactusErrorResponseV1) == "{}" { // empty struct + dst.WatchBlocksCactusErrorResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksCactusErrorResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksCactusTransactionsResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksCactusTransactionsResponseV1) + if err == nil { + jsonWatchBlocksCactusTransactionsResponseV1, _ := json.Marshal(dst.WatchBlocksCactusTransactionsResponseV1) + if string(jsonWatchBlocksCactusTransactionsResponseV1) == "{}" { // empty struct + dst.WatchBlocksCactusTransactionsResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksCactusTransactionsResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksFilteredResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksFilteredResponseV1) + if err == nil { + jsonWatchBlocksFilteredResponseV1, _ := json.Marshal(dst.WatchBlocksFilteredResponseV1) + if string(jsonWatchBlocksFilteredResponseV1) == "{}" { // empty struct + dst.WatchBlocksFilteredResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksFilteredResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksFullResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksFullResponseV1) + if err == nil { + jsonWatchBlocksFullResponseV1, _ := json.Marshal(dst.WatchBlocksFullResponseV1) + if string(jsonWatchBlocksFullResponseV1) == "{}" { // empty struct + dst.WatchBlocksFullResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksFullResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksPrivateResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksPrivateResponseV1) + if err == nil { + jsonWatchBlocksPrivateResponseV1, _ := json.Marshal(dst.WatchBlocksPrivateResponseV1) + if string(jsonWatchBlocksPrivateResponseV1) == "{}" { // empty struct + dst.WatchBlocksPrivateResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksPrivateResponseV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.WatchBlocksCactusErrorResponseV1 = nil + dst.WatchBlocksCactusTransactionsResponseV1 = nil + dst.WatchBlocksFilteredResponseV1 = nil + dst.WatchBlocksFullResponseV1 = nil + dst.WatchBlocksPrivateResponseV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksResponseV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksResponseV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + if src.WatchBlocksCactusErrorResponseV1 != nil { + return json.Marshal(&src.WatchBlocksCactusErrorResponseV1) + } + + if src.WatchBlocksCactusTransactionsResponseV1 != nil { + return json.Marshal(&src.WatchBlocksCactusTransactionsResponseV1) + } + + if src.WatchBlocksFilteredResponseV1 != nil { + return json.Marshal(&src.WatchBlocksFilteredResponseV1) + } + + if src.WatchBlocksFullResponseV1 != nil { + return json.Marshal(&src.WatchBlocksFullResponseV1) + } + + if src.WatchBlocksPrivateResponseV1 != nil { + return json.Marshal(&src.WatchBlocksPrivateResponseV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksResponseV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.WatchBlocksCactusErrorResponseV1 != nil { + return obj.WatchBlocksCactusErrorResponseV1 + } + + if obj.WatchBlocksCactusTransactionsResponseV1 != nil { + return obj.WatchBlocksCactusTransactionsResponseV1 + } + + if obj.WatchBlocksFilteredResponseV1 != nil { + return obj.WatchBlocksFilteredResponseV1 + } + + if obj.WatchBlocksFullResponseV1 != nil { + return obj.WatchBlocksFullResponseV1 + } + + if obj.WatchBlocksPrivateResponseV1 != nil { + return obj.WatchBlocksPrivateResponseV1 + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksResponseV1 struct { + value *WatchBlocksResponseV1 + isSet bool +} + +func (v NullableWatchBlocksResponseV1) Get() *WatchBlocksResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksResponseV1) Set(val *WatchBlocksResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksResponseV1(val *WatchBlocksResponseV1) *NullableWatchBlocksResponseV1 { + return &NullableWatchBlocksResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 0000000000..679c47aa23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "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" + 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.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 0000000000..322359188d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_web_socket_key.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WebSocketKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebSocketKey{} + +// WebSocketKey web-socket key details for signing fabric message with private key stored with external client +type WebSocketKey struct { + // session Id to access client + SessionId string `json:"sessionId"` + // signature of the session ID + Signature string `json:"signature"` +} + +// NewWebSocketKey instantiates a new WebSocketKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebSocketKey(sessionId string, signature string) *WebSocketKey { + this := WebSocketKey{} + this.SessionId = sessionId + this.Signature = signature + return &this +} + +// NewWebSocketKeyWithDefaults instantiates a new WebSocketKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebSocketKeyWithDefaults() *WebSocketKey { + this := WebSocketKey{} + return &this +} + +// GetSessionId returns the SessionId field value +func (o *WebSocketKey) GetSessionId() string { + if o == nil { + var ret string + return ret + } + + return o.SessionId +} + +// GetSessionIdOk returns a tuple with the SessionId field value +// and a boolean to check if the value has been set. +func (o *WebSocketKey) GetSessionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionId, true +} + +// SetSessionId sets field value +func (o *WebSocketKey) SetSessionId(v string) { + o.SessionId = v +} + +// GetSignature returns the Signature field value +func (o *WebSocketKey) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *WebSocketKey) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *WebSocketKey) SetSignature(v string) { + o.Signature = v +} + +func (o WebSocketKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebSocketKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionId"] = o.SessionId + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableWebSocketKey struct { + value *WebSocketKey + isSet bool +} + +func (v NullableWebSocketKey) Get() *WebSocketKey { + return v.value +} + +func (v *NullableWebSocketKey) Set(val *WebSocketKey) { + v.value = val + v.isSet = true +} + +func (v NullableWebSocketKey) IsSet() bool { + return v.isSet +} + +func (v *NullableWebSocketKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebSocketKey(val *WebSocketKey) *NullableWebSocketKey { + return &NullableWebSocketKey{value: val, isSet: true} +} + +func (v NullableWebSocketKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebSocketKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..e6d9da5f6b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..200bf9dd1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,97 @@ +/* +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 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 0000000000..3fafbc69d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..03421c42d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Fabric + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..f3371019d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,81 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java +src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java +src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java +src/main/java/org/openapitools/client/model/ConnectionProfile.java +src/main/java/org/openapitools/client/model/ConnectionProfileClient.java +src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java +src/main/java/org/openapitools/client/model/DeployContractV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1Response.java +src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java +src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/FabricContractInvocationType.java +src/main/java/org/openapitools/client/model/FabricSigningCredential.java +src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java +src/main/java/org/openapitools/client/model/FileBase64.java +src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java +src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java +src/main/java/org/openapitools/client/model/GatewayOptions.java +src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java +src/main/java/org/openapitools/client/model/GetBlockRequestV1.java +src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java +src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java +src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java +src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java +src/main/java/org/openapitools/client/model/GetBlockResponseV1.java +src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java +src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java +src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java +src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java +src/main/java/org/openapitools/client/model/VaultTransitKey.java +src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java +src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java +src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java +src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WebSocketKey.java diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..6c31b51a60 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,189 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Fabric +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a fabric ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractGoSourceV1Request deployContractGoSourceV1Request = new DeployContractGoSourceV1Request(); // DeployContractGoSourceV1Request | + try { + DeployContractGoSourceV1Response result = apiInstance.deployContractGoSourceV1(deployContractGoSourceV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractGoSourceV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractGoSourceV1**](docs/DefaultApi.md#deployContractGoSourceV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source | Deploys a chaincode contract in the form of a go sources. +*DefaultApi* | [**deployContractV1**](docs/DefaultApi.md#deployContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract | Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. +*DefaultApi* | [**getBlockV1**](docs/DefaultApi.md#getBlockV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block | Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**getTransactionReceiptByTxIDV1**](docs/DefaultApi.md#getTransactionReceiptByTxIDV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid | get a transaction receipt by tx id on a Fabric ledger. +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction | Runs a transaction on a Fabric ledger. + + +## Documentation for Models + + - [ChainCodeLanguageRuntime](docs/ChainCodeLanguageRuntime.md) + - [ChainCodeLifeCycleCommandResponses](docs/ChainCodeLifeCycleCommandResponses.md) + - [ChainCodeProgrammingLanguage](docs/ChainCodeProgrammingLanguage.md) + - [ConnectionProfile](docs/ConnectionProfile.md) + - [ConnectionProfileClient](docs/ConnectionProfileClient.md) + - [DefaultEventHandlerStrategy](docs/DefaultEventHandlerStrategy.md) + - [DeployContractGoSourceV1501Response](docs/DeployContractGoSourceV1501Response.md) + - [DeployContractGoSourceV1Request](docs/DeployContractGoSourceV1Request.md) + - [DeployContractGoSourceV1RequestConstructorArgs](docs/DeployContractGoSourceV1RequestConstructorArgs.md) + - [DeployContractGoSourceV1Response](docs/DeployContractGoSourceV1Response.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeploymentTargetOrgFabric2x](docs/DeploymentTargetOrgFabric2x.md) + - [DeploymentTargetOrganization](docs/DeploymentTargetOrganization.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [FabricContractInvocationType](docs/FabricContractInvocationType.md) + - [FabricSigningCredential](docs/FabricSigningCredential.md) + - [FabricSigningCredentialType](docs/FabricSigningCredentialType.md) + - [FileBase64](docs/FileBase64.md) + - [GatewayDiscoveryOptions](docs/GatewayDiscoveryOptions.md) + - [GatewayEventHandlerOptions](docs/GatewayEventHandlerOptions.md) + - [GatewayOptions](docs/GatewayOptions.md) + - [GatewayOptionsWallet](docs/GatewayOptionsWallet.md) + - [GetBlockRequestV1](docs/GetBlockRequestV1.md) + - [GetBlockRequestV1Query](docs/GetBlockRequestV1Query.md) + - [GetBlockRequestV1QueryBlockHash](docs/GetBlockRequestV1QueryBlockHash.md) + - [GetBlockResponseDecodedV1](docs/GetBlockResponseDecodedV1.md) + - [GetBlockResponseEncodedV1](docs/GetBlockResponseEncodedV1.md) + - [GetBlockResponseV1](docs/GetBlockResponseV1.md) + - [GetTransactionReceiptResponse](docs/GetTransactionReceiptResponse.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SSHExecCommandResponse](docs/SSHExecCommandResponse.md) + - [TransactReceiptBlockMetaData](docs/TransactReceiptBlockMetaData.md) + - [TransactReceiptTransactionCreator](docs/TransactReceiptTransactionCreator.md) + - [TransactReceiptTransactionEndorsement](docs/TransactReceiptTransactionEndorsement.md) + - [VaultTransitKey](docs/VaultTransitKey.md) + - [WatchBlocksCactusErrorResponseV1](docs/WatchBlocksCactusErrorResponseV1.md) + - [WatchBlocksCactusTransactionsEventV1](docs/WatchBlocksCactusTransactionsEventV1.md) + - [WatchBlocksCactusTransactionsResponseV1](docs/WatchBlocksCactusTransactionsResponseV1.md) + - [WatchBlocksFilteredResponseV1](docs/WatchBlocksFilteredResponseV1.md) + - [WatchBlocksFullResponseV1](docs/WatchBlocksFullResponseV1.md) + - [WatchBlocksListenerTypeV1](docs/WatchBlocksListenerTypeV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksPrivateResponseV1](docs/WatchBlocksPrivateResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WebSocketKey](docs/WebSocketKey.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..82b1362aa9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1662 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a fabric ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Fabric + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction: + post: + description: "" + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "404": + description: "" + summary: Runs a transaction on a Fabric ledger. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/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-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source: + post: + operationId: deployContractGoSourceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractGoSourceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractGoSourceV1Response' + description: OK + "501": + content: + text/plain: + schema: + $ref: '#/components/schemas/deployContractGoSourceV1_501_response' + description: Not implemented + summary: Deploys a chaincode contract in the form of a go sources. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + "501": + content: + text/plain: + schema: + $ref: '#/components/schemas/deployContractGoSourceV1_501_response' + description: Not implemented + summary: "Deploys a chaincode contract from a set of source files. Note: This\ + \ endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers\ + \ to the Cactus API version, not the supported Fabric ledger version." + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block: + post: + operationId: getBlockV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get block from the channel using one of selectors from the input. Works + only on Fabric 2.x. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + TransactReceiptTransactionEndorsement: + example: + mspid: mspid + signature: signature + endorserID: endorserID + properties: + mspid: + type: string + endorserID: + type: string + signature: + type: string + type: object + TransactReceiptTransactionCreator: + example: + mspid: mspid + creatorID: creatorID + properties: + mspid: + type: string + creatorID: + type: string + type: object + TransactReceiptBlockMetaData: + example: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + properties: + mspid: + type: string + blockCreatorID: + type: string + signature: + type: string + type: object + VaultTransitKey: + description: vault key details for signing fabric message with private key stored + with transit engine. + example: + keyName: keyName + token: token + nullable: false + properties: + keyName: + description: label of private key + maxLength: 100 + minLength: 1 + nullable: false + type: string + token: + description: token for accessing private key + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - keyName + - token + type: object + WebSocketKey: + description: web-socket key details for signing fabric message with private + key stored with external client + example: + signature: signature + sessionId: sessionId + nullable: false + properties: + sessionId: + description: session Id to access client + maxLength: 100 + minLength: 1 + nullable: false + type: string + signature: + description: signature of the session ID + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - sessionId + - signature + type: object + FabricSigningCredentialType: + description: different type of identity provider for singing fabric messages + supported by this package + enum: + - X.509 + - Vault-X.509 + - WS-X.509 + nullable: false + type: string + FabricSigningCredential: + example: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/FabricSigningCredentialType' + vaultTransitKey: + $ref: '#/components/schemas/VaultTransitKey' + webSocketKey: + $ref: '#/components/schemas/WebSocketKey' + required: + - keychainId + - keychainRef + type: object + ChainCodeLifeCycleCommandResponses: + example: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + packaging: + $ref: '#/components/schemas/SSHExecCommandResponse' + installList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + queryInstalledList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + approveForMyOrgList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + commit: + $ref: '#/components/schemas/SSHExecCommandResponse' + queryCommitted: + $ref: '#/components/schemas/SSHExecCommandResponse' + init: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - approveForMyOrgList + - installList + - queryInstalledList + type: object + ChainCodeProgrammingLanguage: + description: Enumerates the supported source code programming languages of Hyperledger + Fabric + enum: + - golang + - javascript + - typescript + - java + type: string + ChainCodeLanguageRuntime: + description: Enumerates the supported programming language runtimes of Hyperledger + Fabric + enum: + - golang + - node + - java + type: string + ConnectionProfile: + additionalProperties: true + example: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + properties: + name: + example: basic-network + maxLength: 1024 + minLength: 1 + type: string + x-type: + example: hlfv1 + minLength: 1 + type: string + description: + example: The basic network + type: string + version: + example: "1.0" + type: string + client: + $ref: '#/components/schemas/ConnectionProfile_client' + channels: + additionalProperties: true + type: object + organizations: + additionalProperties: true + type: object + orderers: + additionalProperties: true + type: object + peers: + additionalProperties: true + type: object + certificateAuthorities: + additionalProperties: true + type: object + required: + - name + - organizations + - peers + - version + type: object + GatewayDiscoveryOptions: + additionalProperties: false + example: + asLocalhost: true + enabled: true + properties: + asLocalhost: + nullable: false + type: boolean + enabled: + nullable: false + type: boolean + type: object + GatewayOptions: + example: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + properties: + connectionProfile: + $ref: '#/components/schemas/ConnectionProfile' + discovery: + $ref: '#/components/schemas/GatewayDiscoveryOptions' + eventHandlerOptions: + $ref: '#/components/schemas/GatewayEventHandlerOptions' + identity: + type: string + wallet: + $ref: '#/components/schemas/GatewayOptions_wallet' + required: + - identity + - wallet + type: object + DefaultEventHandlerStrategy: + enum: + - MSPID_SCOPE_ALLFORTX + - MSPID_SCOPE_ANYFORTX + - NETWORK_SCOPE_ALLFORTX + - NETWORK_SCOPE_ANYFORTX + type: string + GatewayEventHandlerOptions: + additionalProperties: false + example: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + properties: + commitTimeout: + nullable: false + type: number + endorseTimeout: + nullable: false + type: number + strategy: + $ref: '#/components/schemas/DefaultEventHandlerStrategy' + required: + - strategy + type: object + FileBase64: + description: Represents a file-system file that has a name and a body which + holds the file contents as a Base64 encoded string + example: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + properties: + body: + description: The file's contents encoded as a Base64 string. + maxLength: 104857600 + minLength: 1 + nullable: false + type: string + filename: + description: The name as referred to on a file system + example: my-cool-file-full-of-wonders-and-fun-stuff.go + maxLength: 255 + minLength: 1 + nullable: false + type: string + filepath: + description: "The relative path of the file, if it should be placed in a\ + \ sub-directory" + example: ./my/sub-folder/structure/ + maxLength: 512 + minLength: 1 + nullable: false + type: string + required: + - body + - filename + type: object + FabricContractInvocationType: + enum: + - FabricContractInvocationType.SEND + - FabricContractInvocationType.CALL + - FabricContractInvocationType.SENDPRIVATE + type: string + SSHExecCommandResponse: + example: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + stdout: + nullable: false + type: string + stderr: + nullable: false + type: string + code: + nullable: true + type: integer + signal: + nullable: true + type: string + required: + - code + - signal + - stderr + - stdout + type: object + 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: responseType + transientData: "{}" + endorsingParties: + - endorsingParties + - endorsingParties + endorsingPeers: + - endorsingPeers + - endorsingPeers + 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 MSP IDs to set as the list of endorsing peers 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 + endorsingParties: + default: [] + items: + nullable: true + type: string + nullable: false + type: array + responseType: + type: string + required: + - channelName + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + RunTransactionResponse: + example: + success: true + functionOutput: functionOutput + transactionId: transactionId + properties: + functionOutput: + nullable: false + type: string + success: + nullable: false + type: boolean + transactionId: + nullable: false + type: string + required: + - functionOutput + - success + - transactionId + type: object + GetTransactionReceiptResponse: + example: + chainCodeVersion: chainCodeVersion + blockMetaData: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + transactionCreator: + mspid: mspid + creatorID: creatorID + blockNumber: blockNumber + chainCodeName: chainCodeName + transactionEndorsement: + - mspid: mspid + signature: signature + endorserID: endorserID + - mspid: mspid + signature: signature + endorserID: endorserID + responseStatus: responseStatus + channelID: channelID + rwsetWriteData: rwsetWriteData + rwsetKey: rwsetKey + properties: + blockNumber: + type: string + channelID: + type: string + transactionCreator: + $ref: '#/components/schemas/TransactReceiptTransactionCreator' + transactionEndorsement: + items: + $ref: '#/components/schemas/TransactReceiptTransactionEndorsement' + type: array + blockMetaData: + $ref: '#/components/schemas/TransactReceiptBlockMetaData' + chainCodeName: + type: string + chainCodeVersion: + type: string + responseStatus: + type: string + rwsetKey: + type: string + rwsetWriteData: + type: string + type: object + DeploymentTargetOrganization: + example: + CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + properties: + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeploymentTargetOrgFabric2x: + properties: + transient: + description: Transient map of arguments in JSON encoding + example: orderer.example.com:7050 + maxLength: 1073741824 + minLength: 1 + type: string + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeployContractGoSourceV1Request: + additionalProperties: false + example: + chainCodeVersion: 1.0.0 + pinnedDeps: + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + goSource: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + targetPeerAddresses: + - peer0.org1.example.com:7051 + goMod: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFiles: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + moduleName: hello-world-contract + policyDslSource: "AND('Org1MSP.member','Org2MSP.member')" + channelId: mychannel + modTidyOnly: true + properties: + policyDslSource: + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + tlsRootCertFiles: + description: The TLS root cert files that will be passed to the chaincode + instantiation command. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 65535 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + targetPeerAddresses: + description: An array of peer addresses where the contract will be instantiated. + Note that at present only the first item from this array will be used + which is the behavior taken from the official Fabric samples repository + and therefore it is assumed to be correct usage. + example: + - peer0.org1.example.com:7051 + items: + maxLength: 4096 + minLength: 1 + type: string + maxItems: 2048 + minItems: 1 + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + chainCodeVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + goSource: + $ref: '#/components/schemas/FileBase64' + goMod: + $ref: '#/components/schemas/FileBase64' + moduleName: + description: The go module name that will be used for the go compilation + process. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + pinnedDeps: + items: + example: github.com/hyperledger/fabric@v1.4.8 + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + modTidyOnly: + description: Indicates to the go chaincode compiler of Cactus if it should + do an actual go compilation with the contact source or if it should just + execute the go mod tidy command. + nullable: true + type: boolean + required: + - chainCodeVersion + - channelId + - goSource + - policyDslSource + - targetOrganizations + - targetPeerAddresses + - tlsRootCertFiles + type: object + DeployContractGoSourceV1Response: + example: + success: true + instantiationCommandResponse: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installationCommandResponses: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + success: + type: boolean + installationCommandResponses: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + type: array + instantiationCommandResponse: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - installationCommandResponses + - instantiationCommandResponse + - success + type: object + DeployContractV1Request: + additionalProperties: false + example: + ccVersion: 1.0.0 + ccLabel: hello-world-contract + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + ccLang: null + ccSequence: 1 + ccName: my-hello-world-contract + connTimeout: 0 + caFile: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + signaturePolicy: "AND('Org1MSP.member','Org2MSP.member')" + sourceFiles: + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + ordererTLSHostnameOverride: orderer.example.com:7050 + orderer: orderer.example.com:7050 + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + collectionsConfigFile: collectionsConfigFile + channelId: mychannel + properties: + ccLang: + $ref: '#/components/schemas/ChainCodeProgrammingLanguage' + caFile: + description: File-system path pointing at the CA file. + example: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + maxLength: 4096 + minLength: 1 + type: string + orderer: + description: Ordering service endpoint specified as : + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + ordererTLSHostnameOverride: + description: The hostname override to use when validating the TLS connection + to the orderer + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + connTimeout: + description: Timeout for client to connect (default 3s) + nullable: false + type: integer + signaturePolicy: + description: "Passed in to the peer via the --signature-policy argument\ + \ on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies" + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + collectionsConfigFile: + description: Name of the collections config file as present in the sourceFiles + array of the request. + maxLength: 255 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + ccSequence: + example: 1 + nullable: false + type: number + ccVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccName: + example: my-hello-world-contract + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccLabel: + description: Human readable label to uniquely identify the contract. Recommended + to include in this at least the contract name and the exact version in + order to make it easily distinguishable from other deployments of the + same contract. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + sourceFiles: + description: The your-smart-contract.go file where the functionality of + your contract is implemented. + items: + $ref: '#/components/schemas/FileBase64' + maxItems: 65535 + minItems: 1 + nullable: false + type: array + required: + - caFile + - ccLabel + - ccLang + - ccName + - ccSequence + - ccVersion + - channelId + - orderer + - ordererTLSHostnameOverride + - sourceFiles + - targetOrganizations + type: object + DeployContractV1Response: + example: + lifecycle: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + success: true + packageIds: + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + properties: + success: + type: boolean + packageIds: + items: + example: f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + lifecycle: + $ref: '#/components/schemas/ChainCodeLifeCycleCommandResponses' + required: + - lifecycle + - packageIds + - success + type: object + GetBlockRequestV1: + description: Request for GetBlock endpoint. + example: + gatewayOptions: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + query: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + skipDecode: false + channelName: channelName + connectionChannelName: connectionChannelName + properties: + channelName: + description: Fabric channel which we want to query. + maxLength: 100 + minLength: 1 + nullable: false + type: string + connectionChannelName: + description: "Fabric channel we want to connect to. If not provided, then\ + \ one from channelName parameter will be used" + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + query: + $ref: '#/components/schemas/GetBlockRequestV1_query' + skipDecode: + default: false + description: "If true, encoded buffer will be returned. Otherwise, entire\ + \ block object is returned." + nullable: false + type: boolean + required: + - channelName + - gatewayOptions + - query + type: object + FabricFullBlockDataV1: + description: Full hyperledger fabric block data. + GetBlockResponseDecodedV1: + description: When skipDecode is false (default) then decoded block object is + returned. + properties: + decodedBlock: + description: Full hyperledger fabric block data. + required: + - decodedBlock + type: object + GetBlockResponseEncodedV1: + description: When skipDecode is true then encoded block Buffer is returned. + properties: + encodedBlock: + type: string + required: + - encodedBlock + type: object + GetBlockResponseV1: + description: Response from GetBlock endpoint. + oneOf: + - $ref: '#/components/schemas/GetBlockResponseDecodedV1' + - $ref: '#/components/schemas/GetBlockResponseEncodedV1' + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.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 + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksListenerTypeV1: + description: "Response type from WatchBlocks. 'Cactus*' are custom views, others\ + \ correspond to fabric SDK call." + enum: + - filtered + - full + - private + - cactus:transactions + type: string + x-enum-varnames: + - Filtered + - Full + - Private + - CactusTransactions + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + channelName: + description: Hyperledger Fabric channel to connect to. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + type: + $ref: '#/components/schemas/WatchBlocksListenerTypeV1' + startBlock: + description: From which block start monitoring. Defaults to latest. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - channelName + - gatewayOptions + - type + type: object + WatchBlocksCactusTransactionsEventV1: + description: Transaction summary from commited block. + properties: + chaincodeId: + description: ChainCode containing function that was executed. + nullable: false + type: string + transactionId: + description: Transaction identifier. + nullable: false + type: string + functionName: + description: Function name that was executed. + nullable: false + type: string + functionArgs: + description: List of function arguments. + items: + minLength: 0 + nullable: false + type: string + type: array + required: + - chaincodeId + - functionArgs + - functionName + - transactionId + type: object + WatchBlocksCactusTransactionsResponseV1: + description: Custom response containing block transactions summary. Compatible + with legacy fabric-socketio connector monitoring. + properties: + cactusTransactionsEvents: + description: List of transactions summary + items: + $ref: '#/components/schemas/WatchBlocksCactusTransactionsEventV1' + type: array + required: + - cactusTransactionsEvents + type: object + WatchBlocksFullResponseV1: + description: Response that corresponds to Fabric SDK 'full' EventType. + properties: + fullBlock: + description: Full commited block. + nullable: false + required: + - fullBlock + type: object + WatchBlocksFilteredResponseV1: + description: Response that corresponds to Fabric SDK 'filtered' EventType. + properties: + filteredBlock: + description: Filtered commited block. + nullable: false + required: + - filteredBlock + type: object + WatchBlocksPrivateResponseV1: + description: Response that corresponds to Fabric SDK 'private' EventType. + properties: + privateBlock: + description: Private commited block. + nullable: false + required: + - privateBlock + type: object + WatchBlocksCactusErrorResponseV1: + description: Error response from WatchBlocks operation. + properties: + code: + description: Error code. + type: number + errorMessage: + description: Description of the error. + type: string + required: + - code + - errorMessage + type: object + WatchBlocksResponseV1: + description: Response block from WatchBlocks endpoint. Depends on 'type' passed + in subscription options. + oneOf: + - $ref: '#/components/schemas/WatchBlocksCactusTransactionsResponseV1' + - $ref: '#/components/schemas/WatchBlocksFullResponseV1' + - $ref: '#/components/schemas/WatchBlocksFilteredResponseV1' + - $ref: '#/components/schemas/WatchBlocksPrivateResponseV1' + - $ref: '#/components/schemas/WatchBlocksCactusErrorResponseV1' + deployContractGoSourceV1_501_response: + properties: + message: + maxLength: 2048 + minLength: 1 + nullable: false + type: string + type: object + ConnectionProfile_client: + example: + organization: Org1 + properties: + organization: + example: Org1 + type: string + type: object + GatewayOptions_wallet: + example: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + maxProperties: 1 + minProperties: 1 + properties: + keychain: + $ref: '#/components/schemas/FabricSigningCredential' + json: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + type: object + DeployContractGoSourceV1Request_constructorArgs: + example: "{} - An empty object literal can be sufficient if your contract does\ + \ not have parameters." + nullable: false + properties: + Args: + items: {} + maxLength: 2048 + minLength: 0 + type: array + type: object + GetBlockRequestV1_query_blockHash: + description: Select block by it's hash. + example: + buffer: buffer + encoding: encoding + nullable: false + properties: + encoding: + description: "NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...).\ + \ Passed directly to `Buffer.from()` call on hashBuffer. If not provided\ + \ then JSON buffer format is assumed." + nullable: false + type: string + buffer: + description: Buffer of blockHash. It's encoding should be described in `encoding` + parameter. + nullable: false + type: string + required: + - buffer + type: object + GetBlockRequestV1_query: + description: "Query selector, caller must provide at least one of them. First\ + \ found will be used, rest will be ignored, so it's recommended to pass single\ + \ selector." + example: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + properties: + blockNumber: + description: Select block by it's number. + nullable: false + type: string + blockHash: + $ref: '#/components/schemas/GetBlockRequestV1_query_blockHash' + transactionId: + description: Select block by id of transaction that it contains. + nullable: false + type: string + type: object + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..dc9abe99ff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3843f0cbf4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..945b2b14c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..c2fbdd46e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..423222206e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..3edbb76364 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,441 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ChainCodeLifeCycleCommandResponses.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConnectionProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConnectionProfileClient.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1501Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeploymentTargetOrgFabric2x.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeploymentTargetOrganization.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FabricSigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FileBase64.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayDiscoveryOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayEventHandlerOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayOptionsWallet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestV1Query.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestV1QueryBlockHash.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockResponseDecodedV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockResponseEncodedV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionReceiptResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SSHExecCommandResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactReceiptBlockMetaData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactReceiptTransactionCreator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactReceiptTransactionEndorsement.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VaultTransitKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksCactusErrorResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksCactusTransactionsResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksFilteredResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksFullResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksOptionsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksPrivateResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WebSocketKey.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..e58da26272 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..73d57e430a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..24cb0a5979 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..5f5437d546 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..930ba00483 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,821 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeployContractGoSourceV1501Response; +import org.openapitools.client.model.DeployContractGoSourceV1Request; +import org.openapitools.client.model.DeployContractGoSourceV1Response; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GetBlockRequestV1; +import org.openapitools.client.model.GetBlockResponseV1; +import org.openapitools.client.model.GetTransactionReceiptResponse; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deployContractGoSourceV1 + * @param deployContractGoSourceV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractGoSourceV1Call(DeployContractGoSourceV1Request deployContractGoSourceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractGoSourceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractGoSourceV1ValidateBeforeCall(DeployContractGoSourceV1Request deployContractGoSourceV1Request, final ApiCallback _callback) throws ApiException { + return deployContractGoSourceV1Call(deployContractGoSourceV1Request, _callback); + + } + + /** + * Deploys a chaincode contract in the form of a go sources. + * + * @param deployContractGoSourceV1Request (optional) + * @return DeployContractGoSourceV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public DeployContractGoSourceV1Response deployContractGoSourceV1(DeployContractGoSourceV1Request deployContractGoSourceV1Request) throws ApiException { + ApiResponse localVarResp = deployContractGoSourceV1WithHttpInfo(deployContractGoSourceV1Request); + return localVarResp.getData(); + } + + /** + * Deploys a chaincode contract in the form of a go sources. + * + * @param deployContractGoSourceV1Request (optional) + * @return ApiResponse<DeployContractGoSourceV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public ApiResponse deployContractGoSourceV1WithHttpInfo(DeployContractGoSourceV1Request deployContractGoSourceV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractGoSourceV1ValidateBeforeCall(deployContractGoSourceV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys a chaincode contract in the form of a go sources. (asynchronously) + * + * @param deployContractGoSourceV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractGoSourceV1Async(DeployContractGoSourceV1Request deployContractGoSourceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractGoSourceV1ValidateBeforeCall(deployContractGoSourceV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractV1 + * @param deployContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractV1Call(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json", + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractV1ValidateBeforeCall(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + return deployContractV1Call(deployContractV1Request, _callback); + + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + * + * @param deployContractV1Request (optional) + * @return DeployContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public DeployContractV1Response deployContractV1(DeployContractV1Request deployContractV1Request) throws ApiException { + ApiResponse localVarResp = deployContractV1WithHttpInfo(deployContractV1Request); + return localVarResp.getData(); + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + * + * @param deployContractV1Request (optional) + * @return ApiResponse<DeployContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public ApiResponse deployContractV1WithHttpInfo(DeployContractV1Request deployContractV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. (asynchronously) + * + * @param deployContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractV1Async(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlockV1 + * @param getBlockRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getBlockV1Call(GetBlockRequestV1 getBlockRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBlockRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBlockV1ValidateBeforeCall(GetBlockRequestV1 getBlockRequestV1, final ApiCallback _callback) throws ApiException { + return getBlockV1Call(getBlockRequestV1, _callback); + + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + * + * @param getBlockRequestV1 (optional) + * @return GetBlockResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public GetBlockResponseV1 getBlockV1(GetBlockRequestV1 getBlockRequestV1) throws ApiException { + ApiResponse localVarResp = getBlockV1WithHttpInfo(getBlockRequestV1); + return localVarResp.getData(); + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + * + * @param getBlockRequestV1 (optional) + * @return ApiResponse<GetBlockResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse getBlockV1WithHttpInfo(GetBlockRequestV1 getBlockRequestV1) throws ApiException { + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. (asynchronously) + * + * @param getBlockRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getBlockV1Async(GetBlockRequestV1 getBlockRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTransactionReceiptByTxIDV1 + * @param runTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public okhttp3.Call getTransactionReceiptByTxIDV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTransactionReceiptByTxIDV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'runTransactionRequest' is set + if (runTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'runTransactionRequest' when calling getTransactionReceiptByTxIDV1(Async)"); + } + + return getTransactionReceiptByTxIDV1Call(runTransactionRequest, _callback); + + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return GetTransactionReceiptResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public GetTransactionReceiptResponse getTransactionReceiptByTxIDV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = getTransactionReceiptByTxIDV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return ApiResponse<GetTransactionReceiptResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public ApiResponse getTransactionReceiptByTxIDV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = getTransactionReceiptByTxIDV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. (asynchronously) + * + * @param runTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public okhttp3.Call getTransactionReceiptByTxIDV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTransactionReceiptByTxIDV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'runTransactionRequest' is set + if (runTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'runTransactionRequest' when calling runTransactionV1(Async)"); + } + + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Runs a transaction on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Runs a transaction on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Runs a transaction on a Fabric ledger. (asynchronously) + * + * @param runTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..8116a55364 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..695cd18c5b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..d15f68c255 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..72aec74b8b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..189fe9e256 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java new file mode 100644 index 0000000000..48fe5ab3ac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the supported programming language runtimes of Hyperledger Fabric + */ +@JsonAdapter(ChainCodeLanguageRuntime.Adapter.class) +public enum ChainCodeLanguageRuntime { + + GOLANG("golang"), + + NODE("node"), + + JAVA("java"); + + private String value; + + ChainCodeLanguageRuntime(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChainCodeLanguageRuntime fromValue(String value) { + for (ChainCodeLanguageRuntime b : ChainCodeLanguageRuntime.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChainCodeLanguageRuntime enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChainCodeLanguageRuntime read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChainCodeLanguageRuntime.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java new file mode 100644 index 0000000000..afb1540939 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java @@ -0,0 +1,456 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.SSHExecCommandResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ChainCodeLifeCycleCommandResponses + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ChainCodeLifeCycleCommandResponses { + public static final String SERIALIZED_NAME_PACKAGING = "packaging"; + @SerializedName(SERIALIZED_NAME_PACKAGING) + private SSHExecCommandResponse packaging; + + public static final String SERIALIZED_NAME_INSTALL_LIST = "installList"; + @SerializedName(SERIALIZED_NAME_INSTALL_LIST) + private List installList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_QUERY_INSTALLED_LIST = "queryInstalledList"; + @SerializedName(SERIALIZED_NAME_QUERY_INSTALLED_LIST) + private List queryInstalledList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_APPROVE_FOR_MY_ORG_LIST = "approveForMyOrgList"; + @SerializedName(SERIALIZED_NAME_APPROVE_FOR_MY_ORG_LIST) + private List approveForMyOrgList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COMMIT = "commit"; + @SerializedName(SERIALIZED_NAME_COMMIT) + private SSHExecCommandResponse commit; + + public static final String SERIALIZED_NAME_QUERY_COMMITTED = "queryCommitted"; + @SerializedName(SERIALIZED_NAME_QUERY_COMMITTED) + private SSHExecCommandResponse queryCommitted; + + public static final String SERIALIZED_NAME_INIT = "init"; + @SerializedName(SERIALIZED_NAME_INIT) + private SSHExecCommandResponse init; + + public ChainCodeLifeCycleCommandResponses() { + } + + public ChainCodeLifeCycleCommandResponses packaging(SSHExecCommandResponse packaging) { + + this.packaging = packaging; + return this; + } + + /** + * Get packaging + * @return packaging + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getPackaging() { + return packaging; + } + + + public void setPackaging(SSHExecCommandResponse packaging) { + this.packaging = packaging; + } + + + public ChainCodeLifeCycleCommandResponses installList(List installList) { + + this.installList = installList; + return this; + } + + public ChainCodeLifeCycleCommandResponses addInstallListItem(SSHExecCommandResponse installListItem) { + if (this.installList == null) { + this.installList = new ArrayList<>(); + } + this.installList.add(installListItem); + return this; + } + + /** + * Get installList + * @return installList + **/ + @javax.annotation.Nonnull + public List getInstallList() { + return installList; + } + + + public void setInstallList(List installList) { + this.installList = installList; + } + + + public ChainCodeLifeCycleCommandResponses queryInstalledList(List queryInstalledList) { + + this.queryInstalledList = queryInstalledList; + return this; + } + + public ChainCodeLifeCycleCommandResponses addQueryInstalledListItem(SSHExecCommandResponse queryInstalledListItem) { + if (this.queryInstalledList == null) { + this.queryInstalledList = new ArrayList<>(); + } + this.queryInstalledList.add(queryInstalledListItem); + return this; + } + + /** + * Get queryInstalledList + * @return queryInstalledList + **/ + @javax.annotation.Nonnull + public List getQueryInstalledList() { + return queryInstalledList; + } + + + public void setQueryInstalledList(List queryInstalledList) { + this.queryInstalledList = queryInstalledList; + } + + + public ChainCodeLifeCycleCommandResponses approveForMyOrgList(List approveForMyOrgList) { + + this.approveForMyOrgList = approveForMyOrgList; + return this; + } + + public ChainCodeLifeCycleCommandResponses addApproveForMyOrgListItem(SSHExecCommandResponse approveForMyOrgListItem) { + if (this.approveForMyOrgList == null) { + this.approveForMyOrgList = new ArrayList<>(); + } + this.approveForMyOrgList.add(approveForMyOrgListItem); + return this; + } + + /** + * Get approveForMyOrgList + * @return approveForMyOrgList + **/ + @javax.annotation.Nonnull + public List getApproveForMyOrgList() { + return approveForMyOrgList; + } + + + public void setApproveForMyOrgList(List approveForMyOrgList) { + this.approveForMyOrgList = approveForMyOrgList; + } + + + public ChainCodeLifeCycleCommandResponses commit(SSHExecCommandResponse commit) { + + this.commit = commit; + return this; + } + + /** + * Get commit + * @return commit + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getCommit() { + return commit; + } + + + public void setCommit(SSHExecCommandResponse commit) { + this.commit = commit; + } + + + public ChainCodeLifeCycleCommandResponses queryCommitted(SSHExecCommandResponse queryCommitted) { + + this.queryCommitted = queryCommitted; + return this; + } + + /** + * Get queryCommitted + * @return queryCommitted + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getQueryCommitted() { + return queryCommitted; + } + + + public void setQueryCommitted(SSHExecCommandResponse queryCommitted) { + this.queryCommitted = queryCommitted; + } + + + public ChainCodeLifeCycleCommandResponses init(SSHExecCommandResponse init) { + + this.init = init; + return this; + } + + /** + * Get init + * @return init + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getInit() { + return init; + } + + + public void setInit(SSHExecCommandResponse init) { + this.init = init; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChainCodeLifeCycleCommandResponses chainCodeLifeCycleCommandResponses = (ChainCodeLifeCycleCommandResponses) o; + return Objects.equals(this.packaging, chainCodeLifeCycleCommandResponses.packaging) && + Objects.equals(this.installList, chainCodeLifeCycleCommandResponses.installList) && + Objects.equals(this.queryInstalledList, chainCodeLifeCycleCommandResponses.queryInstalledList) && + Objects.equals(this.approveForMyOrgList, chainCodeLifeCycleCommandResponses.approveForMyOrgList) && + Objects.equals(this.commit, chainCodeLifeCycleCommandResponses.commit) && + Objects.equals(this.queryCommitted, chainCodeLifeCycleCommandResponses.queryCommitted) && + Objects.equals(this.init, chainCodeLifeCycleCommandResponses.init); + } + + @Override + public int hashCode() { + return Objects.hash(packaging, installList, queryInstalledList, approveForMyOrgList, commit, queryCommitted, init); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChainCodeLifeCycleCommandResponses {\n"); + sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); + sb.append(" installList: ").append(toIndentedString(installList)).append("\n"); + sb.append(" queryInstalledList: ").append(toIndentedString(queryInstalledList)).append("\n"); + sb.append(" approveForMyOrgList: ").append(toIndentedString(approveForMyOrgList)).append("\n"); + sb.append(" commit: ").append(toIndentedString(commit)).append("\n"); + sb.append(" queryCommitted: ").append(toIndentedString(queryCommitted)).append("\n"); + sb.append(" init: ").append(toIndentedString(init)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("packaging"); + openapiFields.add("installList"); + openapiFields.add("queryInstalledList"); + openapiFields.add("approveForMyOrgList"); + openapiFields.add("commit"); + openapiFields.add("queryCommitted"); + openapiFields.add("init"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("installList"); + openapiRequiredFields.add("queryInstalledList"); + openapiRequiredFields.add("approveForMyOrgList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ChainCodeLifeCycleCommandResponses + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ChainCodeLifeCycleCommandResponses.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChainCodeLifeCycleCommandResponses is not found in the empty JSON string", ChainCodeLifeCycleCommandResponses.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ChainCodeLifeCycleCommandResponses.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChainCodeLifeCycleCommandResponses` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChainCodeLifeCycleCommandResponses.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `packaging` + if (jsonObj.get("packaging") != null && !jsonObj.get("packaging").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("packaging")); + } + // ensure the json data is an array + if (!jsonObj.get("installList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `installList` to be an array in the JSON string but got `%s`", jsonObj.get("installList").toString())); + } + + JsonArray jsonArrayinstallList = jsonObj.getAsJsonArray("installList"); + // validate the required field `installList` (array) + for (int i = 0; i < jsonArrayinstallList.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayinstallList.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("queryInstalledList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `queryInstalledList` to be an array in the JSON string but got `%s`", jsonObj.get("queryInstalledList").toString())); + } + + JsonArray jsonArrayqueryInstalledList = jsonObj.getAsJsonArray("queryInstalledList"); + // validate the required field `queryInstalledList` (array) + for (int i = 0; i < jsonArrayqueryInstalledList.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayqueryInstalledList.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("approveForMyOrgList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `approveForMyOrgList` to be an array in the JSON string but got `%s`", jsonObj.get("approveForMyOrgList").toString())); + } + + JsonArray jsonArrayapproveForMyOrgList = jsonObj.getAsJsonArray("approveForMyOrgList"); + // validate the required field `approveForMyOrgList` (array) + for (int i = 0; i < jsonArrayapproveForMyOrgList.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayapproveForMyOrgList.get(i).getAsJsonObject()); + }; + // validate the optional field `commit` + if (jsonObj.get("commit") != null && !jsonObj.get("commit").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("commit")); + } + // validate the optional field `queryCommitted` + if (jsonObj.get("queryCommitted") != null && !jsonObj.get("queryCommitted").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("queryCommitted")); + } + // validate the optional field `init` + if (jsonObj.get("init") != null && !jsonObj.get("init").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("init")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChainCodeLifeCycleCommandResponses.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChainCodeLifeCycleCommandResponses' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChainCodeLifeCycleCommandResponses.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChainCodeLifeCycleCommandResponses value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChainCodeLifeCycleCommandResponses read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChainCodeLifeCycleCommandResponses given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChainCodeLifeCycleCommandResponses + * @throws IOException if the JSON string is invalid with respect to ChainCodeLifeCycleCommandResponses + */ + public static ChainCodeLifeCycleCommandResponses fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChainCodeLifeCycleCommandResponses.class); + } + + /** + * Convert an instance of ChainCodeLifeCycleCommandResponses to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java new file mode 100644 index 0000000000..07da8013d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the supported source code programming languages of Hyperledger Fabric + */ +@JsonAdapter(ChainCodeProgrammingLanguage.Adapter.class) +public enum ChainCodeProgrammingLanguage { + + GOLANG("golang"), + + JAVASCRIPT("javascript"), + + TYPESCRIPT("typescript"), + + JAVA("java"); + + private String value; + + ChainCodeProgrammingLanguage(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChainCodeProgrammingLanguage fromValue(String value) { + for (ChainCodeProgrammingLanguage b : ChainCodeProgrammingLanguage.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChainCodeProgrammingLanguage enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChainCodeProgrammingLanguage read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChainCodeProgrammingLanguage.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java new file mode 100644 index 0000000000..ad70b1f4c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java @@ -0,0 +1,602 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.ConnectionProfileClient; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConnectionProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionProfile { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_X_TYPE = "x-type"; + @SerializedName(SERIALIZED_NAME_X_TYPE) + private String xType; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_CLIENT = "client"; + @SerializedName(SERIALIZED_NAME_CLIENT) + private ConnectionProfileClient client; + + public static final String SERIALIZED_NAME_CHANNELS = "channels"; + @SerializedName(SERIALIZED_NAME_CHANNELS) + private Map channels = new HashMap<>(); + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "organizations"; + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + private Map organizations = new HashMap<>(); + + public static final String SERIALIZED_NAME_ORDERERS = "orderers"; + @SerializedName(SERIALIZED_NAME_ORDERERS) + private Map orderers = new HashMap<>(); + + public static final String SERIALIZED_NAME_PEERS = "peers"; + @SerializedName(SERIALIZED_NAME_PEERS) + private Map peers = new HashMap<>(); + + public static final String SERIALIZED_NAME_CERTIFICATE_AUTHORITIES = "certificateAuthorities"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE_AUTHORITIES) + private Map certificateAuthorities = new HashMap<>(); + + public ConnectionProfile() { + } + + public ConnectionProfile name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ConnectionProfile xType(String xType) { + + this.xType = xType; + return this; + } + + /** + * Get xType + * @return xType + **/ + @javax.annotation.Nullable + public String getxType() { + return xType; + } + + + public void setxType(String xType) { + this.xType = xType; + } + + + public ConnectionProfile description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public ConnectionProfile version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public ConnectionProfile client(ConnectionProfileClient client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @javax.annotation.Nullable + public ConnectionProfileClient getClient() { + return client; + } + + + public void setClient(ConnectionProfileClient client) { + this.client = client; + } + + + public ConnectionProfile channels(Map channels) { + + this.channels = channels; + return this; + } + + public ConnectionProfile putChannelsItem(String key, Object channelsItem) { + if (this.channels == null) { + this.channels = new HashMap<>(); + } + this.channels.put(key, channelsItem); + return this; + } + + /** + * Get channels + * @return channels + **/ + @javax.annotation.Nullable + public Map getChannels() { + return channels; + } + + + public void setChannels(Map channels) { + this.channels = channels; + } + + + public ConnectionProfile organizations(Map organizations) { + + this.organizations = organizations; + return this; + } + + public ConnectionProfile putOrganizationsItem(String key, Object organizationsItem) { + if (this.organizations == null) { + this.organizations = new HashMap<>(); + } + this.organizations.put(key, organizationsItem); + return this; + } + + /** + * Get organizations + * @return organizations + **/ + @javax.annotation.Nonnull + public Map getOrganizations() { + return organizations; + } + + + public void setOrganizations(Map organizations) { + this.organizations = organizations; + } + + + public ConnectionProfile orderers(Map orderers) { + + this.orderers = orderers; + return this; + } + + public ConnectionProfile putOrderersItem(String key, Object orderersItem) { + if (this.orderers == null) { + this.orderers = new HashMap<>(); + } + this.orderers.put(key, orderersItem); + return this; + } + + /** + * Get orderers + * @return orderers + **/ + @javax.annotation.Nullable + public Map getOrderers() { + return orderers; + } + + + public void setOrderers(Map orderers) { + this.orderers = orderers; + } + + + public ConnectionProfile peers(Map peers) { + + this.peers = peers; + return this; + } + + public ConnectionProfile putPeersItem(String key, Object peersItem) { + if (this.peers == null) { + this.peers = new HashMap<>(); + } + this.peers.put(key, peersItem); + return this; + } + + /** + * Get peers + * @return peers + **/ + @javax.annotation.Nonnull + public Map getPeers() { + return peers; + } + + + public void setPeers(Map peers) { + this.peers = peers; + } + + + public ConnectionProfile certificateAuthorities(Map certificateAuthorities) { + + this.certificateAuthorities = certificateAuthorities; + return this; + } + + public ConnectionProfile putCertificateAuthoritiesItem(String key, Object certificateAuthoritiesItem) { + if (this.certificateAuthorities == null) { + this.certificateAuthorities = new HashMap<>(); + } + this.certificateAuthorities.put(key, certificateAuthoritiesItem); + return this; + } + + /** + * Get certificateAuthorities + * @return certificateAuthorities + **/ + @javax.annotation.Nullable + public Map getCertificateAuthorities() { + return certificateAuthorities; + } + + + public void setCertificateAuthorities(Map certificateAuthorities) { + this.certificateAuthorities = certificateAuthorities; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionProfile instance itself + */ + public ConnectionProfile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionProfile connectionProfile = (ConnectionProfile) o; + return Objects.equals(this.name, connectionProfile.name) && + Objects.equals(this.xType, connectionProfile.xType) && + Objects.equals(this.description, connectionProfile.description) && + Objects.equals(this.version, connectionProfile.version) && + Objects.equals(this.client, connectionProfile.client) && + Objects.equals(this.channels, connectionProfile.channels) && + Objects.equals(this.organizations, connectionProfile.organizations) && + Objects.equals(this.orderers, connectionProfile.orderers) && + Objects.equals(this.peers, connectionProfile.peers) && + Objects.equals(this.certificateAuthorities, connectionProfile.certificateAuthorities)&& + Objects.equals(this.additionalProperties, connectionProfile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, xType, description, version, client, channels, organizations, orderers, peers, certificateAuthorities, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionProfile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" xType: ").append(toIndentedString(xType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append(" channels: ").append(toIndentedString(channels)).append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" orderers: ").append(toIndentedString(orderers)).append("\n"); + sb.append(" peers: ").append(toIndentedString(peers)).append("\n"); + sb.append(" certificateAuthorities: ").append(toIndentedString(certificateAuthorities)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("x-type"); + openapiFields.add("description"); + openapiFields.add("version"); + openapiFields.add("client"); + openapiFields.add("channels"); + openapiFields.add("organizations"); + openapiFields.add("orderers"); + openapiFields.add("peers"); + openapiFields.add("certificateAuthorities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("organizations"); + openapiRequiredFields.add("peers"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConnectionProfile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConnectionProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionProfile is not found in the empty JSON string", ConnectionProfile.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectionProfile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("x-type") != null && !jsonObj.get("x-type").isJsonNull()) && !jsonObj.get("x-type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `x-type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("x-type").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + // validate the optional field `client` + if (jsonObj.get("client") != null && !jsonObj.get("client").isJsonNull()) { + ConnectionProfileClient.validateJsonObject(jsonObj.getAsJsonObject("client")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectionProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectionProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionProfile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ConnectionProfile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionProfile + * @throws IOException if the JSON string is invalid with respect to ConnectionProfile + */ + public static ConnectionProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionProfile.class); + } + + /** + * Convert an instance of ConnectionProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java new file mode 100644 index 0000000000..a4670c5489 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java @@ -0,0 +1,208 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConnectionProfileClient + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionProfileClient { + public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + private String organization; + + public ConnectionProfileClient() { + } + + public ConnectionProfileClient organization(String organization) { + + this.organization = organization; + return this; + } + + /** + * Get organization + * @return organization + **/ + @javax.annotation.Nullable + public String getOrganization() { + return organization; + } + + + public void setOrganization(String organization) { + this.organization = organization; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionProfileClient connectionProfileClient = (ConnectionProfileClient) o; + return Objects.equals(this.organization, connectionProfileClient.organization); + } + + @Override + public int hashCode() { + return Objects.hash(organization); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionProfileClient {\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("organization"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConnectionProfileClient + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConnectionProfileClient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionProfileClient is not found in the empty JSON string", ConnectionProfileClient.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConnectionProfileClient.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectionProfileClient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("organization") != null && !jsonObj.get("organization").isJsonNull()) && !jsonObj.get("organization").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organization` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectionProfileClient.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionProfileClient' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionProfileClient.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectionProfileClient value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectionProfileClient read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionProfileClient given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionProfileClient + * @throws IOException if the JSON string is invalid with respect to ConnectionProfileClient + */ + public static ConnectionProfileClient fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionProfileClient.class); + } + + /** + * Convert an instance of ConnectionProfileClient to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java new file mode 100644 index 0000000000..7c4401e52b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets DefaultEventHandlerStrategy + */ +@JsonAdapter(DefaultEventHandlerStrategy.Adapter.class) +public enum DefaultEventHandlerStrategy { + + MSPID_SCOPE_ALLFORTX("MSPID_SCOPE_ALLFORTX"), + + MSPID_SCOPE_ANYFORTX("MSPID_SCOPE_ANYFORTX"), + + NETWORK_SCOPE_ALLFORTX("NETWORK_SCOPE_ALLFORTX"), + + NETWORK_SCOPE_ANYFORTX("NETWORK_SCOPE_ANYFORTX"); + + private String value; + + DefaultEventHandlerStrategy(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefaultEventHandlerStrategy fromValue(String value) { + for (DefaultEventHandlerStrategy b : DefaultEventHandlerStrategy.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DefaultEventHandlerStrategy enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DefaultEventHandlerStrategy read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DefaultEventHandlerStrategy.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java new file mode 100644 index 0000000000..4930f3d6d0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java @@ -0,0 +1,208 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1501Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1501Response { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public DeployContractGoSourceV1501Response() { + } + + public DeployContractGoSourceV1501Response message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1501Response deployContractGoSourceV1501Response = (DeployContractGoSourceV1501Response) o; + return Objects.equals(this.message, deployContractGoSourceV1501Response.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1501Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1501Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1501Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1501Response is not found in the empty JSON string", DeployContractGoSourceV1501Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1501Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1501Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1501Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1501Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1501Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1501Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1501Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1501Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1501Response + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1501Response + */ + public static DeployContractGoSourceV1501Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1501Response.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1501Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java new file mode 100644 index 0000000000..adc54ace52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java @@ -0,0 +1,613 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1Request { + public static final String SERIALIZED_NAME_POLICY_DSL_SOURCE = "policyDslSource"; + @SerializedName(SERIALIZED_NAME_POLICY_DSL_SOURCE) + private String policyDslSource; + + public static final String SERIALIZED_NAME_TLS_ROOT_CERT_FILES = "tlsRootCertFiles"; + @SerializedName(SERIALIZED_NAME_TLS_ROOT_CERT_FILES) + private String tlsRootCertFiles; + + public static final String SERIALIZED_NAME_CHANNEL_ID = "channelId"; + @SerializedName(SERIALIZED_NAME_CHANNEL_ID) + private String channelId; + + public static final String SERIALIZED_NAME_TARGET_ORGANIZATIONS = "targetOrganizations"; + @SerializedName(SERIALIZED_NAME_TARGET_ORGANIZATIONS) + private List targetOrganizations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TARGET_PEER_ADDRESSES = "targetPeerAddresses"; + @SerializedName(SERIALIZED_NAME_TARGET_PEER_ADDRESSES) + private List targetPeerAddresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private DeployContractGoSourceV1RequestConstructorArgs constructorArgs; + + public static final String SERIALIZED_NAME_CHAIN_CODE_VERSION = "chainCodeVersion"; + @SerializedName(SERIALIZED_NAME_CHAIN_CODE_VERSION) + private String chainCodeVersion; + + public static final String SERIALIZED_NAME_GO_SOURCE = "goSource"; + @SerializedName(SERIALIZED_NAME_GO_SOURCE) + private FileBase64 goSource; + + public static final String SERIALIZED_NAME_GO_MOD = "goMod"; + @SerializedName(SERIALIZED_NAME_GO_MOD) + private FileBase64 goMod; + + public static final String SERIALIZED_NAME_MODULE_NAME = "moduleName"; + @SerializedName(SERIALIZED_NAME_MODULE_NAME) + private String moduleName; + + public static final String SERIALIZED_NAME_PINNED_DEPS = "pinnedDeps"; + @SerializedName(SERIALIZED_NAME_PINNED_DEPS) + private List pinnedDeps; + + public static final String SERIALIZED_NAME_MOD_TIDY_ONLY = "modTidyOnly"; + @SerializedName(SERIALIZED_NAME_MOD_TIDY_ONLY) + private Boolean modTidyOnly; + + public DeployContractGoSourceV1Request() { + } + + public DeployContractGoSourceV1Request policyDslSource(String policyDslSource) { + + this.policyDslSource = policyDslSource; + return this; + } + + /** + * Get policyDslSource + * @return policyDslSource + **/ + @javax.annotation.Nonnull + public String getPolicyDslSource() { + return policyDslSource; + } + + + public void setPolicyDslSource(String policyDslSource) { + this.policyDslSource = policyDslSource; + } + + + public DeployContractGoSourceV1Request tlsRootCertFiles(String tlsRootCertFiles) { + + this.tlsRootCertFiles = tlsRootCertFiles; + return this; + } + + /** + * The TLS root cert files that will be passed to the chaincode instantiation command. + * @return tlsRootCertFiles + **/ + @javax.annotation.Nonnull + public String getTlsRootCertFiles() { + return tlsRootCertFiles; + } + + + public void setTlsRootCertFiles(String tlsRootCertFiles) { + this.tlsRootCertFiles = tlsRootCertFiles; + } + + + public DeployContractGoSourceV1Request channelId(String channelId) { + + this.channelId = channelId; + return this; + } + + /** + * The name of the Fabric channel where the contract will get instantiated. + * @return channelId + **/ + @javax.annotation.Nonnull + public String getChannelId() { + return channelId; + } + + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + + public DeployContractGoSourceV1Request targetOrganizations(List targetOrganizations) { + + this.targetOrganizations = targetOrganizations; + return this; + } + + public DeployContractGoSourceV1Request addTargetOrganizationsItem(DeploymentTargetOrganization targetOrganizationsItem) { + if (this.targetOrganizations == null) { + this.targetOrganizations = new ArrayList<>(); + } + this.targetOrganizations.add(targetOrganizationsItem); + return this; + } + + /** + * Get targetOrganizations + * @return targetOrganizations + **/ + @javax.annotation.Nonnull + public List getTargetOrganizations() { + return targetOrganizations; + } + + + public void setTargetOrganizations(List targetOrganizations) { + this.targetOrganizations = targetOrganizations; + } + + + public DeployContractGoSourceV1Request targetPeerAddresses(List targetPeerAddresses) { + + this.targetPeerAddresses = targetPeerAddresses; + return this; + } + + public DeployContractGoSourceV1Request addTargetPeerAddressesItem(String targetPeerAddressesItem) { + if (this.targetPeerAddresses == null) { + this.targetPeerAddresses = new ArrayList<>(); + } + this.targetPeerAddresses.add(targetPeerAddressesItem); + return this; + } + + /** + * An array of peer addresses where the contract will be instantiated. Note that at present only the first item from this array will be used which is the behavior taken from the official Fabric samples repository and therefore it is assumed to be correct usage. + * @return targetPeerAddresses + **/ + @javax.annotation.Nonnull + public List getTargetPeerAddresses() { + return targetPeerAddresses; + } + + + public void setTargetPeerAddresses(List targetPeerAddresses) { + this.targetPeerAddresses = targetPeerAddresses; + } + + + public DeployContractGoSourceV1Request constructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public DeployContractGoSourceV1RequestConstructorArgs getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractGoSourceV1Request chainCodeVersion(String chainCodeVersion) { + + this.chainCodeVersion = chainCodeVersion; + return this; + } + + /** + * Get chainCodeVersion + * @return chainCodeVersion + **/ + @javax.annotation.Nonnull + public String getChainCodeVersion() { + return chainCodeVersion; + } + + + public void setChainCodeVersion(String chainCodeVersion) { + this.chainCodeVersion = chainCodeVersion; + } + + + public DeployContractGoSourceV1Request goSource(FileBase64 goSource) { + + this.goSource = goSource; + return this; + } + + /** + * Get goSource + * @return goSource + **/ + @javax.annotation.Nonnull + public FileBase64 getGoSource() { + return goSource; + } + + + public void setGoSource(FileBase64 goSource) { + this.goSource = goSource; + } + + + public DeployContractGoSourceV1Request goMod(FileBase64 goMod) { + + this.goMod = goMod; + return this; + } + + /** + * Get goMod + * @return goMod + **/ + @javax.annotation.Nullable + public FileBase64 getGoMod() { + return goMod; + } + + + public void setGoMod(FileBase64 goMod) { + this.goMod = goMod; + } + + + public DeployContractGoSourceV1Request moduleName(String moduleName) { + + this.moduleName = moduleName; + return this; + } + + /** + * The go module name that will be used for the go compilation process. + * @return moduleName + **/ + @javax.annotation.Nullable + public String getModuleName() { + return moduleName; + } + + + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } + + + public DeployContractGoSourceV1Request pinnedDeps(List pinnedDeps) { + + this.pinnedDeps = pinnedDeps; + return this; + } + + public DeployContractGoSourceV1Request addPinnedDepsItem(String pinnedDepsItem) { + if (this.pinnedDeps == null) { + this.pinnedDeps = new ArrayList<>(); + } + this.pinnedDeps.add(pinnedDepsItem); + return this; + } + + /** + * Get pinnedDeps + * @return pinnedDeps + **/ + @javax.annotation.Nullable + public List getPinnedDeps() { + return pinnedDeps; + } + + + public void setPinnedDeps(List pinnedDeps) { + this.pinnedDeps = pinnedDeps; + } + + + public DeployContractGoSourceV1Request modTidyOnly(Boolean modTidyOnly) { + + this.modTidyOnly = modTidyOnly; + return this; + } + + /** + * Indicates to the go chaincode compiler of Cactus if it should do an actual go compilation with the contact source or if it should just execute the go mod tidy command. + * @return modTidyOnly + **/ + @javax.annotation.Nullable + public Boolean getModTidyOnly() { + return modTidyOnly; + } + + + public void setModTidyOnly(Boolean modTidyOnly) { + this.modTidyOnly = modTidyOnly; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1Request deployContractGoSourceV1Request = (DeployContractGoSourceV1Request) o; + return Objects.equals(this.policyDslSource, deployContractGoSourceV1Request.policyDslSource) && + Objects.equals(this.tlsRootCertFiles, deployContractGoSourceV1Request.tlsRootCertFiles) && + Objects.equals(this.channelId, deployContractGoSourceV1Request.channelId) && + Objects.equals(this.targetOrganizations, deployContractGoSourceV1Request.targetOrganizations) && + Objects.equals(this.targetPeerAddresses, deployContractGoSourceV1Request.targetPeerAddresses) && + Objects.equals(this.constructorArgs, deployContractGoSourceV1Request.constructorArgs) && + Objects.equals(this.chainCodeVersion, deployContractGoSourceV1Request.chainCodeVersion) && + Objects.equals(this.goSource, deployContractGoSourceV1Request.goSource) && + Objects.equals(this.goMod, deployContractGoSourceV1Request.goMod) && + Objects.equals(this.moduleName, deployContractGoSourceV1Request.moduleName) && + Objects.equals(this.pinnedDeps, deployContractGoSourceV1Request.pinnedDeps) && + Objects.equals(this.modTidyOnly, deployContractGoSourceV1Request.modTidyOnly); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(policyDslSource, tlsRootCertFiles, channelId, targetOrganizations, targetPeerAddresses, constructorArgs, chainCodeVersion, goSource, goMod, moduleName, pinnedDeps, modTidyOnly); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1Request {\n"); + sb.append(" policyDslSource: ").append(toIndentedString(policyDslSource)).append("\n"); + sb.append(" tlsRootCertFiles: ").append(toIndentedString(tlsRootCertFiles)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" targetOrganizations: ").append(toIndentedString(targetOrganizations)).append("\n"); + sb.append(" targetPeerAddresses: ").append(toIndentedString(targetPeerAddresses)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" chainCodeVersion: ").append(toIndentedString(chainCodeVersion)).append("\n"); + sb.append(" goSource: ").append(toIndentedString(goSource)).append("\n"); + sb.append(" goMod: ").append(toIndentedString(goMod)).append("\n"); + sb.append(" moduleName: ").append(toIndentedString(moduleName)).append("\n"); + sb.append(" pinnedDeps: ").append(toIndentedString(pinnedDeps)).append("\n"); + sb.append(" modTidyOnly: ").append(toIndentedString(modTidyOnly)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("policyDslSource"); + openapiFields.add("tlsRootCertFiles"); + openapiFields.add("channelId"); + openapiFields.add("targetOrganizations"); + openapiFields.add("targetPeerAddresses"); + openapiFields.add("constructorArgs"); + openapiFields.add("chainCodeVersion"); + openapiFields.add("goSource"); + openapiFields.add("goMod"); + openapiFields.add("moduleName"); + openapiFields.add("pinnedDeps"); + openapiFields.add("modTidyOnly"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("policyDslSource"); + openapiRequiredFields.add("tlsRootCertFiles"); + openapiRequiredFields.add("channelId"); + openapiRequiredFields.add("targetOrganizations"); + openapiRequiredFields.add("targetPeerAddresses"); + openapiRequiredFields.add("chainCodeVersion"); + openapiRequiredFields.add("goSource"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1Request is not found in the empty JSON string", DeployContractGoSourceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractGoSourceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("policyDslSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `policyDslSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("policyDslSource").toString())); + } + if (!jsonObj.get("tlsRootCertFiles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tlsRootCertFiles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tlsRootCertFiles").toString())); + } + if (!jsonObj.get("channelId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("targetOrganizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetOrganizations` to be an array in the JSON string but got `%s`", jsonObj.get("targetOrganizations").toString())); + } + + JsonArray jsonArraytargetOrganizations = jsonObj.getAsJsonArray("targetOrganizations"); + // validate the required field `targetOrganizations` (array) + for (int i = 0; i < jsonArraytargetOrganizations.size(); i++) { + DeploymentTargetOrganization.validateJsonObject(jsonArraytargetOrganizations.get(i).getAsJsonObject()); + }; + // ensure the required json array is present + if (jsonObj.get("targetPeerAddresses") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("targetPeerAddresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetPeerAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("targetPeerAddresses").toString())); + } + // validate the optional field `constructorArgs` + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonNull()) { + DeployContractGoSourceV1RequestConstructorArgs.validateJsonObject(jsonObj.getAsJsonObject("constructorArgs")); + } + if (!jsonObj.get("chainCodeVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainCodeVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainCodeVersion").toString())); + } + // validate the required field `goSource` + FileBase64.validateJsonObject(jsonObj.getAsJsonObject("goSource")); + // validate the optional field `goMod` + if (jsonObj.get("goMod") != null && !jsonObj.get("goMod").isJsonNull()) { + FileBase64.validateJsonObject(jsonObj.getAsJsonObject("goMod")); + } + if ((jsonObj.get("moduleName") != null && !jsonObj.get("moduleName").isJsonNull()) && !jsonObj.get("moduleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `moduleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("moduleName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("pinnedDeps") != null && !jsonObj.get("pinnedDeps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pinnedDeps` to be an array in the JSON string but got `%s`", jsonObj.get("pinnedDeps").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1Request + */ + public static DeployContractGoSourceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1Request.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java new file mode 100644 index 0000000000..9a51cefe5d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java @@ -0,0 +1,219 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1RequestConstructorArgs + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1RequestConstructorArgs { + public static final String SERIALIZED_NAME_ARGS = "Args"; + @SerializedName(SERIALIZED_NAME_ARGS) + private List args; + + public DeployContractGoSourceV1RequestConstructorArgs() { + } + + public DeployContractGoSourceV1RequestConstructorArgs args(List args) { + + this.args = args; + return this; + } + + public DeployContractGoSourceV1RequestConstructorArgs addArgsItem(Object argsItem) { + if (this.args == null) { + this.args = new ArrayList<>(); + } + this.args.add(argsItem); + return this; + } + + /** + * Get args + * @return args + **/ + @javax.annotation.Nullable + public List getArgs() { + return args; + } + + + public void setArgs(List args) { + this.args = args; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1RequestConstructorArgs deployContractGoSourceV1RequestConstructorArgs = (DeployContractGoSourceV1RequestConstructorArgs) o; + return Objects.equals(this.args, deployContractGoSourceV1RequestConstructorArgs.args); + } + + @Override + public int hashCode() { + return Objects.hash(args); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1RequestConstructorArgs {\n"); + sb.append(" args: ").append(toIndentedString(args)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Args"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1RequestConstructorArgs + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1RequestConstructorArgs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1RequestConstructorArgs is not found in the empty JSON string", DeployContractGoSourceV1RequestConstructorArgs.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1RequestConstructorArgs.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1RequestConstructorArgs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("Args") != null && !jsonObj.get("Args").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Args` to be an array in the JSON string but got `%s`", jsonObj.get("Args").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1RequestConstructorArgs.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1RequestConstructorArgs' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1RequestConstructorArgs.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1RequestConstructorArgs value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1RequestConstructorArgs read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1RequestConstructorArgs given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1RequestConstructorArgs + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1RequestConstructorArgs + */ + public static DeployContractGoSourceV1RequestConstructorArgs fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1RequestConstructorArgs.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1RequestConstructorArgs to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java new file mode 100644 index 0000000000..52dc95a729 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java @@ -0,0 +1,294 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.SSHExecCommandResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_INSTALLATION_COMMAND_RESPONSES = "installationCommandResponses"; + @SerializedName(SERIALIZED_NAME_INSTALLATION_COMMAND_RESPONSES) + private List installationCommandResponses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSTANTIATION_COMMAND_RESPONSE = "instantiationCommandResponse"; + @SerializedName(SERIALIZED_NAME_INSTANTIATION_COMMAND_RESPONSE) + private SSHExecCommandResponse instantiationCommandResponse; + + public DeployContractGoSourceV1Response() { + } + + public DeployContractGoSourceV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public DeployContractGoSourceV1Response installationCommandResponses(List installationCommandResponses) { + + this.installationCommandResponses = installationCommandResponses; + return this; + } + + public DeployContractGoSourceV1Response addInstallationCommandResponsesItem(SSHExecCommandResponse installationCommandResponsesItem) { + if (this.installationCommandResponses == null) { + this.installationCommandResponses = new ArrayList<>(); + } + this.installationCommandResponses.add(installationCommandResponsesItem); + return this; + } + + /** + * Get installationCommandResponses + * @return installationCommandResponses + **/ + @javax.annotation.Nonnull + public List getInstallationCommandResponses() { + return installationCommandResponses; + } + + + public void setInstallationCommandResponses(List installationCommandResponses) { + this.installationCommandResponses = installationCommandResponses; + } + + + public DeployContractGoSourceV1Response instantiationCommandResponse(SSHExecCommandResponse instantiationCommandResponse) { + + this.instantiationCommandResponse = instantiationCommandResponse; + return this; + } + + /** + * Get instantiationCommandResponse + * @return instantiationCommandResponse + **/ + @javax.annotation.Nonnull + public SSHExecCommandResponse getInstantiationCommandResponse() { + return instantiationCommandResponse; + } + + + public void setInstantiationCommandResponse(SSHExecCommandResponse instantiationCommandResponse) { + this.instantiationCommandResponse = instantiationCommandResponse; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1Response deployContractGoSourceV1Response = (DeployContractGoSourceV1Response) o; + return Objects.equals(this.success, deployContractGoSourceV1Response.success) && + Objects.equals(this.installationCommandResponses, deployContractGoSourceV1Response.installationCommandResponses) && + Objects.equals(this.instantiationCommandResponse, deployContractGoSourceV1Response.instantiationCommandResponse); + } + + @Override + public int hashCode() { + return Objects.hash(success, installationCommandResponses, instantiationCommandResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" installationCommandResponses: ").append(toIndentedString(installationCommandResponses)).append("\n"); + sb.append(" instantiationCommandResponse: ").append(toIndentedString(instantiationCommandResponse)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("installationCommandResponses"); + openapiFields.add("instantiationCommandResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("installationCommandResponses"); + openapiRequiredFields.add("instantiationCommandResponse"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1Response is not found in the empty JSON string", DeployContractGoSourceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractGoSourceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("installationCommandResponses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `installationCommandResponses` to be an array in the JSON string but got `%s`", jsonObj.get("installationCommandResponses").toString())); + } + + JsonArray jsonArrayinstallationCommandResponses = jsonObj.getAsJsonArray("installationCommandResponses"); + // validate the required field `installationCommandResponses` (array) + for (int i = 0; i < jsonArrayinstallationCommandResponses.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayinstallationCommandResponses.get(i).getAsJsonObject()); + }; + // validate the required field `instantiationCommandResponse` + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("instantiationCommandResponse")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1Response + */ + public static DeployContractGoSourceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1Response.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java new file mode 100644 index 0000000000..0db35dced8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java @@ -0,0 +1,689 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ChainCodeProgrammingLanguage; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Request { + public static final String SERIALIZED_NAME_CC_LANG = "ccLang"; + @SerializedName(SERIALIZED_NAME_CC_LANG) + private ChainCodeProgrammingLanguage ccLang; + + public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + @SerializedName(SERIALIZED_NAME_CA_FILE) + private String caFile; + + public static final String SERIALIZED_NAME_ORDERER = "orderer"; + @SerializedName(SERIALIZED_NAME_ORDERER) + private String orderer; + + public static final String SERIALIZED_NAME_ORDERER_T_L_S_HOSTNAME_OVERRIDE = "ordererTLSHostnameOverride"; + @SerializedName(SERIALIZED_NAME_ORDERER_T_L_S_HOSTNAME_OVERRIDE) + private String ordererTLSHostnameOverride; + + public static final String SERIALIZED_NAME_CONN_TIMEOUT = "connTimeout"; + @SerializedName(SERIALIZED_NAME_CONN_TIMEOUT) + private Integer connTimeout; + + public static final String SERIALIZED_NAME_SIGNATURE_POLICY = "signaturePolicy"; + @SerializedName(SERIALIZED_NAME_SIGNATURE_POLICY) + private String signaturePolicy; + + public static final String SERIALIZED_NAME_COLLECTIONS_CONFIG_FILE = "collectionsConfigFile"; + @SerializedName(SERIALIZED_NAME_COLLECTIONS_CONFIG_FILE) + private String collectionsConfigFile; + + public static final String SERIALIZED_NAME_CHANNEL_ID = "channelId"; + @SerializedName(SERIALIZED_NAME_CHANNEL_ID) + private String channelId; + + public static final String SERIALIZED_NAME_TARGET_ORGANIZATIONS = "targetOrganizations"; + @SerializedName(SERIALIZED_NAME_TARGET_ORGANIZATIONS) + private List targetOrganizations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private DeployContractGoSourceV1RequestConstructorArgs constructorArgs; + + public static final String SERIALIZED_NAME_CC_SEQUENCE = "ccSequence"; + @SerializedName(SERIALIZED_NAME_CC_SEQUENCE) + private BigDecimal ccSequence; + + public static final String SERIALIZED_NAME_CC_VERSION = "ccVersion"; + @SerializedName(SERIALIZED_NAME_CC_VERSION) + private String ccVersion; + + public static final String SERIALIZED_NAME_CC_NAME = "ccName"; + @SerializedName(SERIALIZED_NAME_CC_NAME) + private String ccName; + + public static final String SERIALIZED_NAME_CC_LABEL = "ccLabel"; + @SerializedName(SERIALIZED_NAME_CC_LABEL) + private String ccLabel; + + public static final String SERIALIZED_NAME_SOURCE_FILES = "sourceFiles"; + @SerializedName(SERIALIZED_NAME_SOURCE_FILES) + private List sourceFiles = new ArrayList<>(); + + public DeployContractV1Request() { + } + + public DeployContractV1Request ccLang(ChainCodeProgrammingLanguage ccLang) { + + this.ccLang = ccLang; + return this; + } + + /** + * Get ccLang + * @return ccLang + **/ + @javax.annotation.Nonnull + public ChainCodeProgrammingLanguage getCcLang() { + return ccLang; + } + + + public void setCcLang(ChainCodeProgrammingLanguage ccLang) { + this.ccLang = ccLang; + } + + + public DeployContractV1Request caFile(String caFile) { + + this.caFile = caFile; + return this; + } + + /** + * File-system path pointing at the CA file. + * @return caFile + **/ + @javax.annotation.Nonnull + public String getCaFile() { + return caFile; + } + + + public void setCaFile(String caFile) { + this.caFile = caFile; + } + + + public DeployContractV1Request orderer(String orderer) { + + this.orderer = orderer; + return this; + } + + /** + * Ordering service endpoint specified as <hostname or IP address>:<port> + * @return orderer + **/ + @javax.annotation.Nonnull + public String getOrderer() { + return orderer; + } + + + public void setOrderer(String orderer) { + this.orderer = orderer; + } + + + public DeployContractV1Request ordererTLSHostnameOverride(String ordererTLSHostnameOverride) { + + this.ordererTLSHostnameOverride = ordererTLSHostnameOverride; + return this; + } + + /** + * The hostname override to use when validating the TLS connection to the orderer + * @return ordererTLSHostnameOverride + **/ + @javax.annotation.Nonnull + public String getOrdererTLSHostnameOverride() { + return ordererTLSHostnameOverride; + } + + + public void setOrdererTLSHostnameOverride(String ordererTLSHostnameOverride) { + this.ordererTLSHostnameOverride = ordererTLSHostnameOverride; + } + + + public DeployContractV1Request connTimeout(Integer connTimeout) { + + this.connTimeout = connTimeout; + return this; + } + + /** + * Timeout for client to connect (default 3s) + * @return connTimeout + **/ + @javax.annotation.Nullable + public Integer getConnTimeout() { + return connTimeout; + } + + + public void setConnTimeout(Integer connTimeout) { + this.connTimeout = connTimeout; + } + + + public DeployContractV1Request signaturePolicy(String signaturePolicy) { + + this.signaturePolicy = signaturePolicy; + return this; + } + + /** + * Passed in to the peer via the --signature-policy argument on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies + * @return signaturePolicy + **/ + @javax.annotation.Nullable + public String getSignaturePolicy() { + return signaturePolicy; + } + + + public void setSignaturePolicy(String signaturePolicy) { + this.signaturePolicy = signaturePolicy; + } + + + public DeployContractV1Request collectionsConfigFile(String collectionsConfigFile) { + + this.collectionsConfigFile = collectionsConfigFile; + return this; + } + + /** + * Name of the collections config file as present in the sourceFiles array of the request. + * @return collectionsConfigFile + **/ + @javax.annotation.Nullable + public String getCollectionsConfigFile() { + return collectionsConfigFile; + } + + + public void setCollectionsConfigFile(String collectionsConfigFile) { + this.collectionsConfigFile = collectionsConfigFile; + } + + + public DeployContractV1Request channelId(String channelId) { + + this.channelId = channelId; + return this; + } + + /** + * The name of the Fabric channel where the contract will get instantiated. + * @return channelId + **/ + @javax.annotation.Nonnull + public String getChannelId() { + return channelId; + } + + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + + public DeployContractV1Request targetOrganizations(List targetOrganizations) { + + this.targetOrganizations = targetOrganizations; + return this; + } + + public DeployContractV1Request addTargetOrganizationsItem(DeploymentTargetOrganization targetOrganizationsItem) { + if (this.targetOrganizations == null) { + this.targetOrganizations = new ArrayList<>(); + } + this.targetOrganizations.add(targetOrganizationsItem); + return this; + } + + /** + * Get targetOrganizations + * @return targetOrganizations + **/ + @javax.annotation.Nonnull + public List getTargetOrganizations() { + return targetOrganizations; + } + + + public void setTargetOrganizations(List targetOrganizations) { + this.targetOrganizations = targetOrganizations; + } + + + public DeployContractV1Request constructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public DeployContractGoSourceV1RequestConstructorArgs getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractV1Request ccSequence(BigDecimal ccSequence) { + + this.ccSequence = ccSequence; + return this; + } + + /** + * Get ccSequence + * @return ccSequence + **/ + @javax.annotation.Nonnull + public BigDecimal getCcSequence() { + return ccSequence; + } + + + public void setCcSequence(BigDecimal ccSequence) { + this.ccSequence = ccSequence; + } + + + public DeployContractV1Request ccVersion(String ccVersion) { + + this.ccVersion = ccVersion; + return this; + } + + /** + * Get ccVersion + * @return ccVersion + **/ + @javax.annotation.Nonnull + public String getCcVersion() { + return ccVersion; + } + + + public void setCcVersion(String ccVersion) { + this.ccVersion = ccVersion; + } + + + public DeployContractV1Request ccName(String ccName) { + + this.ccName = ccName; + return this; + } + + /** + * Get ccName + * @return ccName + **/ + @javax.annotation.Nonnull + public String getCcName() { + return ccName; + } + + + public void setCcName(String ccName) { + this.ccName = ccName; + } + + + public DeployContractV1Request ccLabel(String ccLabel) { + + this.ccLabel = ccLabel; + return this; + } + + /** + * Human readable label to uniquely identify the contract. Recommended to include in this at least the contract name and the exact version in order to make it easily distinguishable from other deployments of the same contract. + * @return ccLabel + **/ + @javax.annotation.Nonnull + public String getCcLabel() { + return ccLabel; + } + + + public void setCcLabel(String ccLabel) { + this.ccLabel = ccLabel; + } + + + public DeployContractV1Request sourceFiles(List sourceFiles) { + + this.sourceFiles = sourceFiles; + return this; + } + + public DeployContractV1Request addSourceFilesItem(FileBase64 sourceFilesItem) { + if (this.sourceFiles == null) { + this.sourceFiles = new ArrayList<>(); + } + this.sourceFiles.add(sourceFilesItem); + return this; + } + + /** + * The your-smart-contract.go file where the functionality of your contract is implemented. + * @return sourceFiles + **/ + @javax.annotation.Nonnull + public List getSourceFiles() { + return sourceFiles; + } + + + public void setSourceFiles(List sourceFiles) { + this.sourceFiles = sourceFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Request deployContractV1Request = (DeployContractV1Request) o; + return Objects.equals(this.ccLang, deployContractV1Request.ccLang) && + Objects.equals(this.caFile, deployContractV1Request.caFile) && + Objects.equals(this.orderer, deployContractV1Request.orderer) && + Objects.equals(this.ordererTLSHostnameOverride, deployContractV1Request.ordererTLSHostnameOverride) && + Objects.equals(this.connTimeout, deployContractV1Request.connTimeout) && + Objects.equals(this.signaturePolicy, deployContractV1Request.signaturePolicy) && + Objects.equals(this.collectionsConfigFile, deployContractV1Request.collectionsConfigFile) && + Objects.equals(this.channelId, deployContractV1Request.channelId) && + Objects.equals(this.targetOrganizations, deployContractV1Request.targetOrganizations) && + Objects.equals(this.constructorArgs, deployContractV1Request.constructorArgs) && + Objects.equals(this.ccSequence, deployContractV1Request.ccSequence) && + Objects.equals(this.ccVersion, deployContractV1Request.ccVersion) && + Objects.equals(this.ccName, deployContractV1Request.ccName) && + Objects.equals(this.ccLabel, deployContractV1Request.ccLabel) && + Objects.equals(this.sourceFiles, deployContractV1Request.sourceFiles); + } + + @Override + public int hashCode() { + return Objects.hash(ccLang, caFile, orderer, ordererTLSHostnameOverride, connTimeout, signaturePolicy, collectionsConfigFile, channelId, targetOrganizations, constructorArgs, ccSequence, ccVersion, ccName, ccLabel, sourceFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Request {\n"); + sb.append(" ccLang: ").append(toIndentedString(ccLang)).append("\n"); + sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); + sb.append(" orderer: ").append(toIndentedString(orderer)).append("\n"); + sb.append(" ordererTLSHostnameOverride: ").append(toIndentedString(ordererTLSHostnameOverride)).append("\n"); + sb.append(" connTimeout: ").append(toIndentedString(connTimeout)).append("\n"); + sb.append(" signaturePolicy: ").append(toIndentedString(signaturePolicy)).append("\n"); + sb.append(" collectionsConfigFile: ").append(toIndentedString(collectionsConfigFile)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" targetOrganizations: ").append(toIndentedString(targetOrganizations)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" ccSequence: ").append(toIndentedString(ccSequence)).append("\n"); + sb.append(" ccVersion: ").append(toIndentedString(ccVersion)).append("\n"); + sb.append(" ccName: ").append(toIndentedString(ccName)).append("\n"); + sb.append(" ccLabel: ").append(toIndentedString(ccLabel)).append("\n"); + sb.append(" sourceFiles: ").append(toIndentedString(sourceFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ccLang"); + openapiFields.add("caFile"); + openapiFields.add("orderer"); + openapiFields.add("ordererTLSHostnameOverride"); + openapiFields.add("connTimeout"); + openapiFields.add("signaturePolicy"); + openapiFields.add("collectionsConfigFile"); + openapiFields.add("channelId"); + openapiFields.add("targetOrganizations"); + openapiFields.add("constructorArgs"); + openapiFields.add("ccSequence"); + openapiFields.add("ccVersion"); + openapiFields.add("ccName"); + openapiFields.add("ccLabel"); + openapiFields.add("sourceFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ccLang"); + openapiRequiredFields.add("caFile"); + openapiRequiredFields.add("orderer"); + openapiRequiredFields.add("ordererTLSHostnameOverride"); + openapiRequiredFields.add("channelId"); + openapiRequiredFields.add("targetOrganizations"); + openapiRequiredFields.add("ccSequence"); + openapiRequiredFields.add("ccVersion"); + openapiRequiredFields.add("ccName"); + openapiRequiredFields.add("ccLabel"); + openapiRequiredFields.add("sourceFiles"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Request is not found in the empty JSON string", DeployContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("caFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); + } + if (!jsonObj.get("orderer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `orderer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderer").toString())); + } + if (!jsonObj.get("ordererTLSHostnameOverride").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ordererTLSHostnameOverride` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ordererTLSHostnameOverride").toString())); + } + if ((jsonObj.get("signaturePolicy") != null && !jsonObj.get("signaturePolicy").isJsonNull()) && !jsonObj.get("signaturePolicy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signaturePolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signaturePolicy").toString())); + } + if ((jsonObj.get("collectionsConfigFile") != null && !jsonObj.get("collectionsConfigFile").isJsonNull()) && !jsonObj.get("collectionsConfigFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `collectionsConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collectionsConfigFile").toString())); + } + if (!jsonObj.get("channelId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("targetOrganizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetOrganizations` to be an array in the JSON string but got `%s`", jsonObj.get("targetOrganizations").toString())); + } + + JsonArray jsonArraytargetOrganizations = jsonObj.getAsJsonArray("targetOrganizations"); + // validate the required field `targetOrganizations` (array) + for (int i = 0; i < jsonArraytargetOrganizations.size(); i++) { + DeploymentTargetOrganization.validateJsonObject(jsonArraytargetOrganizations.get(i).getAsJsonObject()); + }; + // validate the optional field `constructorArgs` + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonNull()) { + DeployContractGoSourceV1RequestConstructorArgs.validateJsonObject(jsonObj.getAsJsonObject("constructorArgs")); + } + if (!jsonObj.get("ccVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ccVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ccVersion").toString())); + } + if (!jsonObj.get("ccName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ccName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ccName").toString())); + } + if (!jsonObj.get("ccLabel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ccLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ccLabel").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("sourceFiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceFiles` to be an array in the JSON string but got `%s`", jsonObj.get("sourceFiles").toString())); + } + + JsonArray jsonArraysourceFiles = jsonObj.getAsJsonArray("sourceFiles"); + // validate the required field `sourceFiles` (array) + for (int i = 0; i < jsonArraysourceFiles.size(); i++) { + FileBase64.validateJsonObject(jsonArraysourceFiles.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Request + */ + public static DeployContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Request.class); + } + + /** + * Convert an instance of DeployContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java new file mode 100644 index 0000000000..0328449cdf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java @@ -0,0 +1,290 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ChainCodeLifeCycleCommandResponses; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_PACKAGE_IDS = "packageIds"; + @SerializedName(SERIALIZED_NAME_PACKAGE_IDS) + private List packageIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LIFECYCLE = "lifecycle"; + @SerializedName(SERIALIZED_NAME_LIFECYCLE) + private ChainCodeLifeCycleCommandResponses lifecycle; + + public DeployContractV1Response() { + } + + public DeployContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public DeployContractV1Response packageIds(List packageIds) { + + this.packageIds = packageIds; + return this; + } + + public DeployContractV1Response addPackageIdsItem(String packageIdsItem) { + if (this.packageIds == null) { + this.packageIds = new ArrayList<>(); + } + this.packageIds.add(packageIdsItem); + return this; + } + + /** + * Get packageIds + * @return packageIds + **/ + @javax.annotation.Nonnull + public List getPackageIds() { + return packageIds; + } + + + public void setPackageIds(List packageIds) { + this.packageIds = packageIds; + } + + + public DeployContractV1Response lifecycle(ChainCodeLifeCycleCommandResponses lifecycle) { + + this.lifecycle = lifecycle; + return this; + } + + /** + * Get lifecycle + * @return lifecycle + **/ + @javax.annotation.Nonnull + public ChainCodeLifeCycleCommandResponses getLifecycle() { + return lifecycle; + } + + + public void setLifecycle(ChainCodeLifeCycleCommandResponses lifecycle) { + this.lifecycle = lifecycle; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Response deployContractV1Response = (DeployContractV1Response) o; + return Objects.equals(this.success, deployContractV1Response.success) && + Objects.equals(this.packageIds, deployContractV1Response.packageIds) && + Objects.equals(this.lifecycle, deployContractV1Response.lifecycle); + } + + @Override + public int hashCode() { + return Objects.hash(success, packageIds, lifecycle); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" packageIds: ").append(toIndentedString(packageIds)).append("\n"); + sb.append(" lifecycle: ").append(toIndentedString(lifecycle)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("packageIds"); + openapiFields.add("lifecycle"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("packageIds"); + openapiRequiredFields.add("lifecycle"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Response is not found in the empty JSON string", DeployContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("packageIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("packageIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `packageIds` to be an array in the JSON string but got `%s`", jsonObj.get("packageIds").toString())); + } + // validate the required field `lifecycle` + ChainCodeLifeCycleCommandResponses.validateJsonObject(jsonObj.getAsJsonObject("lifecycle")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Response + */ + public static DeployContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Response.class); + } + + /** + * Convert an instance of DeployContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java new file mode 100644 index 0000000000..f7a5636c6f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java @@ -0,0 +1,375 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeploymentTargetOrgFabric2x + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeploymentTargetOrgFabric2x { + public static final String SERIALIZED_NAME_TRANSIENT = "transient"; + @SerializedName(SERIALIZED_NAME_TRANSIENT) + private String _transient; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D = "CORE_PEER_LOCALMSPID"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D) + private String CORE_PEER_LOCALMSPID; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S = "CORE_PEER_ADDRESS"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S) + private String CORE_PEER_ADDRESS; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H = "CORE_PEER_MSPCONFIGPATH"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H) + private String CORE_PEER_MSPCONFIGPATH; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "CORE_PEER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String CORE_PEER_TLS_ROOTCERT_FILE; + + public static final String SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "ORDERER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String ORDERER_TLS_ROOTCERT_FILE; + + public DeploymentTargetOrgFabric2x() { + } + + public DeploymentTargetOrgFabric2x _transient(String _transient) { + + this._transient = _transient; + return this; + } + + /** + * Transient map of arguments in JSON encoding + * @return _transient + **/ + @javax.annotation.Nullable + public String getTransient() { + return _transient; + } + + + public void setTransient(String _transient) { + this._transient = _transient; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_LOCALMSPID(String CORE_PEER_LOCALMSPID) { + + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_LOCALMSPID + **/ + @javax.annotation.Nonnull + public String getCOREPEERLOCALMSPID() { + return CORE_PEER_LOCALMSPID; + } + + + public void setCOREPEERLOCALMSPID(String CORE_PEER_LOCALMSPID) { + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_ADDRESS(String CORE_PEER_ADDRESS) { + + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_ADDRESS + **/ + @javax.annotation.Nonnull + public String getCOREPEERADDRESS() { + return CORE_PEER_ADDRESS; + } + + + public void setCOREPEERADDRESS(String CORE_PEER_ADDRESS) { + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_MSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_MSPCONFIGPATH + **/ + @javax.annotation.Nonnull + public String getCOREPEERMSPCONFIGPATH() { + return CORE_PEER_MSPCONFIGPATH; + } + + + public void setCOREPEERMSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_TLS_ROOTCERT_FILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getCOREPEERTLSROOTCERTFILE() { + return CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public void setCOREPEERTLSROOTCERTFILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public DeploymentTargetOrgFabric2x ORDERER_TLS_ROOTCERT_FILE(String ORDERER_TLS_ROOTCERT_FILE) { + + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return ORDERER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getORDERERTLSROOTCERTFILE() { + return ORDERER_TLS_ROOTCERT_FILE; + } + + + public void setORDERERTLSROOTCERTFILE(String ORDERER_TLS_ROOTCERT_FILE) { + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentTargetOrgFabric2x deploymentTargetOrgFabric2x = (DeploymentTargetOrgFabric2x) o; + return Objects.equals(this._transient, deploymentTargetOrgFabric2x._transient) && + Objects.equals(this.CORE_PEER_LOCALMSPID, deploymentTargetOrgFabric2x.CORE_PEER_LOCALMSPID) && + Objects.equals(this.CORE_PEER_ADDRESS, deploymentTargetOrgFabric2x.CORE_PEER_ADDRESS) && + Objects.equals(this.CORE_PEER_MSPCONFIGPATH, deploymentTargetOrgFabric2x.CORE_PEER_MSPCONFIGPATH) && + Objects.equals(this.CORE_PEER_TLS_ROOTCERT_FILE, deploymentTargetOrgFabric2x.CORE_PEER_TLS_ROOTCERT_FILE) && + Objects.equals(this.ORDERER_TLS_ROOTCERT_FILE, deploymentTargetOrgFabric2x.ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public int hashCode() { + return Objects.hash(_transient, CORE_PEER_LOCALMSPID, CORE_PEER_ADDRESS, CORE_PEER_MSPCONFIGPATH, CORE_PEER_TLS_ROOTCERT_FILE, ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentTargetOrgFabric2x {\n"); + sb.append(" _transient: ").append(toIndentedString(_transient)).append("\n"); + sb.append(" CORE_PEER_LOCALMSPID: ").append(toIndentedString(CORE_PEER_LOCALMSPID)).append("\n"); + sb.append(" CORE_PEER_ADDRESS: ").append(toIndentedString(CORE_PEER_ADDRESS)).append("\n"); + sb.append(" CORE_PEER_MSPCONFIGPATH: ").append(toIndentedString(CORE_PEER_MSPCONFIGPATH)).append("\n"); + sb.append(" CORE_PEER_TLS_ROOTCERT_FILE: ").append(toIndentedString(CORE_PEER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append(" ORDERER_TLS_ROOTCERT_FILE: ").append(toIndentedString(ORDERER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transient"); + openapiFields.add("CORE_PEER_LOCALMSPID"); + openapiFields.add("CORE_PEER_ADDRESS"); + openapiFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiFields.add("ORDERER_TLS_ROOTCERT_FILE"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("CORE_PEER_LOCALMSPID"); + openapiRequiredFields.add("CORE_PEER_ADDRESS"); + openapiRequiredFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiRequiredFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiRequiredFields.add("ORDERER_TLS_ROOTCERT_FILE"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentTargetOrgFabric2x + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeploymentTargetOrgFabric2x.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentTargetOrgFabric2x is not found in the empty JSON string", DeploymentTargetOrgFabric2x.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentTargetOrgFabric2x.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentTargetOrgFabric2x` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeploymentTargetOrgFabric2x.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("transient") != null && !jsonObj.get("transient").isJsonNull()) && !jsonObj.get("transient").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transient").toString())); + } + if (!jsonObj.get("CORE_PEER_LOCALMSPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_LOCALMSPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_LOCALMSPID").toString())); + } + if (!jsonObj.get("CORE_PEER_ADDRESS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_ADDRESS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_ADDRESS").toString())); + } + if (!jsonObj.get("CORE_PEER_MSPCONFIGPATH").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_MSPCONFIGPATH` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_MSPCONFIGPATH").toString())); + } + if (!jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").toString())); + } + if (!jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ORDERER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentTargetOrgFabric2x.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentTargetOrgFabric2x' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentTargetOrgFabric2x.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentTargetOrgFabric2x value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentTargetOrgFabric2x read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentTargetOrgFabric2x given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentTargetOrgFabric2x + * @throws IOException if the JSON string is invalid with respect to DeploymentTargetOrgFabric2x + */ + public static DeploymentTargetOrgFabric2x fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentTargetOrgFabric2x.class); + } + + /** + * Convert an instance of DeploymentTargetOrgFabric2x to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java new file mode 100644 index 0000000000..e9d07a29e9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java @@ -0,0 +1,344 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeploymentTargetOrganization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeploymentTargetOrganization { + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D = "CORE_PEER_LOCALMSPID"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D) + private String CORE_PEER_LOCALMSPID; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S = "CORE_PEER_ADDRESS"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S) + private String CORE_PEER_ADDRESS; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H = "CORE_PEER_MSPCONFIGPATH"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H) + private String CORE_PEER_MSPCONFIGPATH; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "CORE_PEER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String CORE_PEER_TLS_ROOTCERT_FILE; + + public static final String SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "ORDERER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String ORDERER_TLS_ROOTCERT_FILE; + + public DeploymentTargetOrganization() { + } + + public DeploymentTargetOrganization CORE_PEER_LOCALMSPID(String CORE_PEER_LOCALMSPID) { + + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_LOCALMSPID + **/ + @javax.annotation.Nonnull + public String getCOREPEERLOCALMSPID() { + return CORE_PEER_LOCALMSPID; + } + + + public void setCOREPEERLOCALMSPID(String CORE_PEER_LOCALMSPID) { + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + } + + + public DeploymentTargetOrganization CORE_PEER_ADDRESS(String CORE_PEER_ADDRESS) { + + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_ADDRESS + **/ + @javax.annotation.Nonnull + public String getCOREPEERADDRESS() { + return CORE_PEER_ADDRESS; + } + + + public void setCOREPEERADDRESS(String CORE_PEER_ADDRESS) { + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + } + + + public DeploymentTargetOrganization CORE_PEER_MSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_MSPCONFIGPATH + **/ + @javax.annotation.Nonnull + public String getCOREPEERMSPCONFIGPATH() { + return CORE_PEER_MSPCONFIGPATH; + } + + + public void setCOREPEERMSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + } + + + public DeploymentTargetOrganization CORE_PEER_TLS_ROOTCERT_FILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getCOREPEERTLSROOTCERTFILE() { + return CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public void setCOREPEERTLSROOTCERTFILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public DeploymentTargetOrganization ORDERER_TLS_ROOTCERT_FILE(String ORDERER_TLS_ROOTCERT_FILE) { + + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return ORDERER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getORDERERTLSROOTCERTFILE() { + return ORDERER_TLS_ROOTCERT_FILE; + } + + + public void setORDERERTLSROOTCERTFILE(String ORDERER_TLS_ROOTCERT_FILE) { + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentTargetOrganization deploymentTargetOrganization = (DeploymentTargetOrganization) o; + return Objects.equals(this.CORE_PEER_LOCALMSPID, deploymentTargetOrganization.CORE_PEER_LOCALMSPID) && + Objects.equals(this.CORE_PEER_ADDRESS, deploymentTargetOrganization.CORE_PEER_ADDRESS) && + Objects.equals(this.CORE_PEER_MSPCONFIGPATH, deploymentTargetOrganization.CORE_PEER_MSPCONFIGPATH) && + Objects.equals(this.CORE_PEER_TLS_ROOTCERT_FILE, deploymentTargetOrganization.CORE_PEER_TLS_ROOTCERT_FILE) && + Objects.equals(this.ORDERER_TLS_ROOTCERT_FILE, deploymentTargetOrganization.ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public int hashCode() { + return Objects.hash(CORE_PEER_LOCALMSPID, CORE_PEER_ADDRESS, CORE_PEER_MSPCONFIGPATH, CORE_PEER_TLS_ROOTCERT_FILE, ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentTargetOrganization {\n"); + sb.append(" CORE_PEER_LOCALMSPID: ").append(toIndentedString(CORE_PEER_LOCALMSPID)).append("\n"); + sb.append(" CORE_PEER_ADDRESS: ").append(toIndentedString(CORE_PEER_ADDRESS)).append("\n"); + sb.append(" CORE_PEER_MSPCONFIGPATH: ").append(toIndentedString(CORE_PEER_MSPCONFIGPATH)).append("\n"); + sb.append(" CORE_PEER_TLS_ROOTCERT_FILE: ").append(toIndentedString(CORE_PEER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append(" ORDERER_TLS_ROOTCERT_FILE: ").append(toIndentedString(ORDERER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CORE_PEER_LOCALMSPID"); + openapiFields.add("CORE_PEER_ADDRESS"); + openapiFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiFields.add("ORDERER_TLS_ROOTCERT_FILE"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("CORE_PEER_LOCALMSPID"); + openapiRequiredFields.add("CORE_PEER_ADDRESS"); + openapiRequiredFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiRequiredFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiRequiredFields.add("ORDERER_TLS_ROOTCERT_FILE"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentTargetOrganization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeploymentTargetOrganization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentTargetOrganization is not found in the empty JSON string", DeploymentTargetOrganization.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentTargetOrganization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentTargetOrganization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeploymentTargetOrganization.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("CORE_PEER_LOCALMSPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_LOCALMSPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_LOCALMSPID").toString())); + } + if (!jsonObj.get("CORE_PEER_ADDRESS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_ADDRESS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_ADDRESS").toString())); + } + if (!jsonObj.get("CORE_PEER_MSPCONFIGPATH").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_MSPCONFIGPATH` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_MSPCONFIGPATH").toString())); + } + if (!jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").toString())); + } + if (!jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ORDERER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentTargetOrganization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentTargetOrganization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentTargetOrganization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentTargetOrganization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentTargetOrganization read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentTargetOrganization given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentTargetOrganization + * @throws IOException if the JSON string is invalid with respect to DeploymentTargetOrganization + */ + public static DeploymentTargetOrganization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentTargetOrganization.class); + } + + /** + * Convert an instance of DeploymentTargetOrganization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 0000000000..031c7033ad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java new file mode 100644 index 0000000000..3c5a25337e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets FabricContractInvocationType + */ +@JsonAdapter(FabricContractInvocationType.Adapter.class) +public enum FabricContractInvocationType { + + SEND("FabricContractInvocationType.SEND"), + + CALL("FabricContractInvocationType.CALL"), + + SENDPRIVATE("FabricContractInvocationType.SENDPRIVATE"); + + private String value; + + FabricContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FabricContractInvocationType fromValue(String value) { + for (FabricContractInvocationType b : FabricContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FabricContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FabricContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FabricContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java new file mode 100644 index 0000000000..cdff9df6f4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.FabricSigningCredentialType; +import org.openapitools.client.model.VaultTransitKey; +import org.openapitools.client.model.WebSocketKey; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * FabricSigningCredential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FabricSigningCredential { + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_KEYCHAIN_REF = "keychainRef"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_REF) + private String keychainRef; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private FabricSigningCredentialType type; + + public static final String SERIALIZED_NAME_VAULT_TRANSIT_KEY = "vaultTransitKey"; + @SerializedName(SERIALIZED_NAME_VAULT_TRANSIT_KEY) + private VaultTransitKey vaultTransitKey; + + public static final String SERIALIZED_NAME_WEB_SOCKET_KEY = "webSocketKey"; + @SerializedName(SERIALIZED_NAME_WEB_SOCKET_KEY) + private WebSocketKey webSocketKey; + + public FabricSigningCredential() { + } + + public FabricSigningCredential keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public FabricSigningCredential keychainRef(String keychainRef) { + + this.keychainRef = keychainRef; + return this; + } + + /** + * Get keychainRef + * @return keychainRef + **/ + @javax.annotation.Nonnull + public String getKeychainRef() { + return keychainRef; + } + + + public void setKeychainRef(String keychainRef) { + this.keychainRef = keychainRef; + } + + + public FabricSigningCredential type(FabricSigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + public FabricSigningCredentialType getType() { + return type; + } + + + public void setType(FabricSigningCredentialType type) { + this.type = type; + } + + + public FabricSigningCredential vaultTransitKey(VaultTransitKey vaultTransitKey) { + + this.vaultTransitKey = vaultTransitKey; + return this; + } + + /** + * Get vaultTransitKey + * @return vaultTransitKey + **/ + @javax.annotation.Nullable + public VaultTransitKey getVaultTransitKey() { + return vaultTransitKey; + } + + + public void setVaultTransitKey(VaultTransitKey vaultTransitKey) { + this.vaultTransitKey = vaultTransitKey; + } + + + public FabricSigningCredential webSocketKey(WebSocketKey webSocketKey) { + + this.webSocketKey = webSocketKey; + return this; + } + + /** + * Get webSocketKey + * @return webSocketKey + **/ + @javax.annotation.Nullable + public WebSocketKey getWebSocketKey() { + return webSocketKey; + } + + + public void setWebSocketKey(WebSocketKey webSocketKey) { + this.webSocketKey = webSocketKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FabricSigningCredential fabricSigningCredential = (FabricSigningCredential) o; + return Objects.equals(this.keychainId, fabricSigningCredential.keychainId) && + Objects.equals(this.keychainRef, fabricSigningCredential.keychainRef) && + Objects.equals(this.type, fabricSigningCredential.type) && + Objects.equals(this.vaultTransitKey, fabricSigningCredential.vaultTransitKey) && + Objects.equals(this.webSocketKey, fabricSigningCredential.webSocketKey); + } + + @Override + public int hashCode() { + return Objects.hash(keychainId, keychainRef, type, vaultTransitKey, webSocketKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FabricSigningCredential {\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" keychainRef: ").append(toIndentedString(keychainRef)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vaultTransitKey: ").append(toIndentedString(vaultTransitKey)).append("\n"); + sb.append(" webSocketKey: ").append(toIndentedString(webSocketKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychainId"); + openapiFields.add("keychainRef"); + openapiFields.add("type"); + openapiFields.add("vaultTransitKey"); + openapiFields.add("webSocketKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("keychainRef"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FabricSigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FabricSigningCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FabricSigningCredential is not found in the empty JSON string", FabricSigningCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FabricSigningCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FabricSigningCredential` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FabricSigningCredential.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("keychainRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainRef").toString())); + } + // validate the optional field `vaultTransitKey` + if (jsonObj.get("vaultTransitKey") != null && !jsonObj.get("vaultTransitKey").isJsonNull()) { + VaultTransitKey.validateJsonObject(jsonObj.getAsJsonObject("vaultTransitKey")); + } + // validate the optional field `webSocketKey` + if (jsonObj.get("webSocketKey") != null && !jsonObj.get("webSocketKey").isJsonNull()) { + WebSocketKey.validateJsonObject(jsonObj.getAsJsonObject("webSocketKey")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FabricSigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FabricSigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FabricSigningCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FabricSigningCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FabricSigningCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FabricSigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of FabricSigningCredential + * @throws IOException if the JSON string is invalid with respect to FabricSigningCredential + */ + public static FabricSigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FabricSigningCredential.class); + } + + /** + * Convert an instance of FabricSigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java new file mode 100644 index 0000000000..c8ebdd2fbc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * different type of identity provider for singing fabric messages supported by this package + */ +@JsonAdapter(FabricSigningCredentialType.Adapter.class) +public enum FabricSigningCredentialType { + + X_509("X.509"), + + VAULT_X_509("Vault-X.509"), + + WS_X_509("WS-X.509"); + + private String value; + + FabricSigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FabricSigningCredentialType fromValue(String value) { + for (FabricSigningCredentialType b : FabricSigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FabricSigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FabricSigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FabricSigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java new file mode 100644 index 0000000000..c46fd2d93b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java @@ -0,0 +1,279 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Represents a file-system file that has a name and a body which holds the file contents as a Base64 encoded string + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FileBase64 { + public static final String SERIALIZED_NAME_BODY = "body"; + @SerializedName(SERIALIZED_NAME_BODY) + private String body; + + public static final String SERIALIZED_NAME_FILENAME = "filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + private String filename; + + public static final String SERIALIZED_NAME_FILEPATH = "filepath"; + @SerializedName(SERIALIZED_NAME_FILEPATH) + private String filepath; + + public FileBase64() { + } + + public FileBase64 body(String body) { + + this.body = body; + return this; + } + + /** + * The file's contents encoded as a Base64 string. + * @return body + **/ + @javax.annotation.Nonnull + public String getBody() { + return body; + } + + + public void setBody(String body) { + this.body = body; + } + + + public FileBase64 filename(String filename) { + + this.filename = filename; + return this; + } + + /** + * The name as referred to on a file system + * @return filename + **/ + @javax.annotation.Nonnull + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public FileBase64 filepath(String filepath) { + + this.filepath = filepath; + return this; + } + + /** + * The relative path of the file, if it should be placed in a sub-directory + * @return filepath + **/ + @javax.annotation.Nullable + public String getFilepath() { + return filepath; + } + + + public void setFilepath(String filepath) { + this.filepath = filepath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileBase64 fileBase64 = (FileBase64) o; + return Objects.equals(this.body, fileBase64.body) && + Objects.equals(this.filename, fileBase64.filename) && + Objects.equals(this.filepath, fileBase64.filepath); + } + + @Override + public int hashCode() { + return Objects.hash(body, filename, filepath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileBase64 {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" filepath: ").append(toIndentedString(filepath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("body"); + openapiFields.add("filename"); + openapiFields.add("filepath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("body"); + openapiRequiredFields.add("filename"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FileBase64 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FileBase64.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FileBase64 is not found in the empty JSON string", FileBase64.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FileBase64.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileBase64` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FileBase64.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("body").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString())); + } + if (!jsonObj.get("filename").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); + } + if ((jsonObj.get("filepath") != null && !jsonObj.get("filepath").isJsonNull()) && !jsonObj.get("filepath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filepath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filepath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileBase64.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileBase64' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileBase64.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileBase64 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileBase64 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileBase64 given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileBase64 + * @throws IOException if the JSON string is invalid with respect to FileBase64 + */ + public static FileBase64 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileBase64.class); + } + + /** + * Convert an instance of FileBase64 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java new file mode 100644 index 0000000000..5d31258cb8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java @@ -0,0 +1,233 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayDiscoveryOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayDiscoveryOptions { + public static final String SERIALIZED_NAME_AS_LOCALHOST = "asLocalhost"; + @SerializedName(SERIALIZED_NAME_AS_LOCALHOST) + private Boolean asLocalhost; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public GatewayDiscoveryOptions() { + } + + public GatewayDiscoveryOptions asLocalhost(Boolean asLocalhost) { + + this.asLocalhost = asLocalhost; + return this; + } + + /** + * Get asLocalhost + * @return asLocalhost + **/ + @javax.annotation.Nullable + public Boolean getAsLocalhost() { + return asLocalhost; + } + + + public void setAsLocalhost(Boolean asLocalhost) { + this.asLocalhost = asLocalhost; + } + + + public GatewayDiscoveryOptions enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + **/ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayDiscoveryOptions gatewayDiscoveryOptions = (GatewayDiscoveryOptions) o; + return Objects.equals(this.asLocalhost, gatewayDiscoveryOptions.asLocalhost) && + Objects.equals(this.enabled, gatewayDiscoveryOptions.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(asLocalhost, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayDiscoveryOptions {\n"); + sb.append(" asLocalhost: ").append(toIndentedString(asLocalhost)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asLocalhost"); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayDiscoveryOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayDiscoveryOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayDiscoveryOptions is not found in the empty JSON string", GatewayDiscoveryOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayDiscoveryOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayDiscoveryOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayDiscoveryOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayDiscoveryOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayDiscoveryOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayDiscoveryOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayDiscoveryOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayDiscoveryOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayDiscoveryOptions + * @throws IOException if the JSON string is invalid with respect to GatewayDiscoveryOptions + */ + public static GatewayDiscoveryOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayDiscoveryOptions.class); + } + + /** + * Convert an instance of GatewayDiscoveryOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java new file mode 100644 index 0000000000..ecd47083cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java @@ -0,0 +1,271 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.DefaultEventHandlerStrategy; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayEventHandlerOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayEventHandlerOptions { + public static final String SERIALIZED_NAME_COMMIT_TIMEOUT = "commitTimeout"; + @SerializedName(SERIALIZED_NAME_COMMIT_TIMEOUT) + private BigDecimal commitTimeout; + + public static final String SERIALIZED_NAME_ENDORSE_TIMEOUT = "endorseTimeout"; + @SerializedName(SERIALIZED_NAME_ENDORSE_TIMEOUT) + private BigDecimal endorseTimeout; + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + private DefaultEventHandlerStrategy strategy; + + public GatewayEventHandlerOptions() { + } + + public GatewayEventHandlerOptions commitTimeout(BigDecimal commitTimeout) { + + this.commitTimeout = commitTimeout; + return this; + } + + /** + * Get commitTimeout + * @return commitTimeout + **/ + @javax.annotation.Nullable + public BigDecimal getCommitTimeout() { + return commitTimeout; + } + + + public void setCommitTimeout(BigDecimal commitTimeout) { + this.commitTimeout = commitTimeout; + } + + + public GatewayEventHandlerOptions endorseTimeout(BigDecimal endorseTimeout) { + + this.endorseTimeout = endorseTimeout; + return this; + } + + /** + * Get endorseTimeout + * @return endorseTimeout + **/ + @javax.annotation.Nullable + public BigDecimal getEndorseTimeout() { + return endorseTimeout; + } + + + public void setEndorseTimeout(BigDecimal endorseTimeout) { + this.endorseTimeout = endorseTimeout; + } + + + public GatewayEventHandlerOptions strategy(DefaultEventHandlerStrategy strategy) { + + this.strategy = strategy; + return this; + } + + /** + * Get strategy + * @return strategy + **/ + @javax.annotation.Nonnull + public DefaultEventHandlerStrategy getStrategy() { + return strategy; + } + + + public void setStrategy(DefaultEventHandlerStrategy strategy) { + this.strategy = strategy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayEventHandlerOptions gatewayEventHandlerOptions = (GatewayEventHandlerOptions) o; + return Objects.equals(this.commitTimeout, gatewayEventHandlerOptions.commitTimeout) && + Objects.equals(this.endorseTimeout, gatewayEventHandlerOptions.endorseTimeout) && + Objects.equals(this.strategy, gatewayEventHandlerOptions.strategy); + } + + @Override + public int hashCode() { + return Objects.hash(commitTimeout, endorseTimeout, strategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayEventHandlerOptions {\n"); + sb.append(" commitTimeout: ").append(toIndentedString(commitTimeout)).append("\n"); + sb.append(" endorseTimeout: ").append(toIndentedString(endorseTimeout)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commitTimeout"); + openapiFields.add("endorseTimeout"); + openapiFields.add("strategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("strategy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayEventHandlerOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayEventHandlerOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayEventHandlerOptions is not found in the empty JSON string", GatewayEventHandlerOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayEventHandlerOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayEventHandlerOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GatewayEventHandlerOptions.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayEventHandlerOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayEventHandlerOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayEventHandlerOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayEventHandlerOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayEventHandlerOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayEventHandlerOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayEventHandlerOptions + * @throws IOException if the JSON string is invalid with respect to GatewayEventHandlerOptions + */ + public static GatewayEventHandlerOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayEventHandlerOptions.class); + } + + /** + * Convert an instance of GatewayEventHandlerOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java new file mode 100644 index 0000000000..e3025ba3c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ConnectionProfile; +import org.openapitools.client.model.GatewayDiscoveryOptions; +import org.openapitools.client.model.GatewayEventHandlerOptions; +import org.openapitools.client.model.GatewayOptionsWallet; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayOptions { + public static final String SERIALIZED_NAME_CONNECTION_PROFILE = "connectionProfile"; + @SerializedName(SERIALIZED_NAME_CONNECTION_PROFILE) + private ConnectionProfile connectionProfile; + + public static final String SERIALIZED_NAME_DISCOVERY = "discovery"; + @SerializedName(SERIALIZED_NAME_DISCOVERY) + private GatewayDiscoveryOptions discovery; + + public static final String SERIALIZED_NAME_EVENT_HANDLER_OPTIONS = "eventHandlerOptions"; + @SerializedName(SERIALIZED_NAME_EVENT_HANDLER_OPTIONS) + private GatewayEventHandlerOptions eventHandlerOptions; + + public static final String SERIALIZED_NAME_IDENTITY = "identity"; + @SerializedName(SERIALIZED_NAME_IDENTITY) + private String identity; + + public static final String SERIALIZED_NAME_WALLET = "wallet"; + @SerializedName(SERIALIZED_NAME_WALLET) + private GatewayOptionsWallet wallet; + + public GatewayOptions() { + } + + public GatewayOptions connectionProfile(ConnectionProfile connectionProfile) { + + this.connectionProfile = connectionProfile; + return this; + } + + /** + * Get connectionProfile + * @return connectionProfile + **/ + @javax.annotation.Nullable + public ConnectionProfile getConnectionProfile() { + return connectionProfile; + } + + + public void setConnectionProfile(ConnectionProfile connectionProfile) { + this.connectionProfile = connectionProfile; + } + + + public GatewayOptions discovery(GatewayDiscoveryOptions discovery) { + + this.discovery = discovery; + return this; + } + + /** + * Get discovery + * @return discovery + **/ + @javax.annotation.Nullable + public GatewayDiscoveryOptions getDiscovery() { + return discovery; + } + + + public void setDiscovery(GatewayDiscoveryOptions discovery) { + this.discovery = discovery; + } + + + public GatewayOptions eventHandlerOptions(GatewayEventHandlerOptions eventHandlerOptions) { + + this.eventHandlerOptions = eventHandlerOptions; + return this; + } + + /** + * Get eventHandlerOptions + * @return eventHandlerOptions + **/ + @javax.annotation.Nullable + public GatewayEventHandlerOptions getEventHandlerOptions() { + return eventHandlerOptions; + } + + + public void setEventHandlerOptions(GatewayEventHandlerOptions eventHandlerOptions) { + this.eventHandlerOptions = eventHandlerOptions; + } + + + public GatewayOptions identity(String identity) { + + this.identity = identity; + return this; + } + + /** + * Get identity + * @return identity + **/ + @javax.annotation.Nonnull + public String getIdentity() { + return identity; + } + + + public void setIdentity(String identity) { + this.identity = identity; + } + + + public GatewayOptions wallet(GatewayOptionsWallet wallet) { + + this.wallet = wallet; + return this; + } + + /** + * Get wallet + * @return wallet + **/ + @javax.annotation.Nonnull + public GatewayOptionsWallet getWallet() { + return wallet; + } + + + public void setWallet(GatewayOptionsWallet wallet) { + this.wallet = wallet; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayOptions gatewayOptions = (GatewayOptions) o; + return Objects.equals(this.connectionProfile, gatewayOptions.connectionProfile) && + Objects.equals(this.discovery, gatewayOptions.discovery) && + Objects.equals(this.eventHandlerOptions, gatewayOptions.eventHandlerOptions) && + Objects.equals(this.identity, gatewayOptions.identity) && + Objects.equals(this.wallet, gatewayOptions.wallet); + } + + @Override + public int hashCode() { + return Objects.hash(connectionProfile, discovery, eventHandlerOptions, identity, wallet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayOptions {\n"); + sb.append(" connectionProfile: ").append(toIndentedString(connectionProfile)).append("\n"); + sb.append(" discovery: ").append(toIndentedString(discovery)).append("\n"); + sb.append(" eventHandlerOptions: ").append(toIndentedString(eventHandlerOptions)).append("\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" wallet: ").append(toIndentedString(wallet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectionProfile"); + openapiFields.add("discovery"); + openapiFields.add("eventHandlerOptions"); + openapiFields.add("identity"); + openapiFields.add("wallet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identity"); + openapiRequiredFields.add("wallet"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayOptions is not found in the empty JSON string", GatewayOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GatewayOptions.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `discovery` + if (jsonObj.get("discovery") != null && !jsonObj.get("discovery").isJsonNull()) { + GatewayDiscoveryOptions.validateJsonObject(jsonObj.getAsJsonObject("discovery")); + } + // validate the optional field `eventHandlerOptions` + if (jsonObj.get("eventHandlerOptions") != null && !jsonObj.get("eventHandlerOptions").isJsonNull()) { + GatewayEventHandlerOptions.validateJsonObject(jsonObj.getAsJsonObject("eventHandlerOptions")); + } + if (!jsonObj.get("identity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identity").toString())); + } + // validate the required field `wallet` + GatewayOptionsWallet.validateJsonObject(jsonObj.getAsJsonObject("wallet")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayOptions + * @throws IOException if the JSON string is invalid with respect to GatewayOptions + */ + public static GatewayOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayOptions.class); + } + + /** + * Convert an instance of GatewayOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java new file mode 100644 index 0000000000..549a06547c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java @@ -0,0 +1,241 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.FabricSigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayOptionsWallet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayOptionsWallet { + public static final String SERIALIZED_NAME_KEYCHAIN = "keychain"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN) + private FabricSigningCredential keychain; + + public static final String SERIALIZED_NAME_JSON = "json"; + @SerializedName(SERIALIZED_NAME_JSON) + private String json; + + public GatewayOptionsWallet() { + } + + public GatewayOptionsWallet keychain(FabricSigningCredential keychain) { + + this.keychain = keychain; + return this; + } + + /** + * Get keychain + * @return keychain + **/ + @javax.annotation.Nullable + public FabricSigningCredential getKeychain() { + return keychain; + } + + + public void setKeychain(FabricSigningCredential keychain) { + this.keychain = keychain; + } + + + public GatewayOptionsWallet json(String json) { + + this.json = json; + return this; + } + + /** + * Get json + * @return json + **/ + @javax.annotation.Nullable + public String getJson() { + return json; + } + + + public void setJson(String json) { + this.json = json; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayOptionsWallet gatewayOptionsWallet = (GatewayOptionsWallet) o; + return Objects.equals(this.keychain, gatewayOptionsWallet.keychain) && + Objects.equals(this.json, gatewayOptionsWallet.json); + } + + @Override + public int hashCode() { + return Objects.hash(keychain, json); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayOptionsWallet {\n"); + sb.append(" keychain: ").append(toIndentedString(keychain)).append("\n"); + sb.append(" json: ").append(toIndentedString(json)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychain"); + openapiFields.add("json"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayOptionsWallet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayOptionsWallet.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayOptionsWallet is not found in the empty JSON string", GatewayOptionsWallet.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayOptionsWallet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayOptionsWallet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `keychain` + if (jsonObj.get("keychain") != null && !jsonObj.get("keychain").isJsonNull()) { + FabricSigningCredential.validateJsonObject(jsonObj.getAsJsonObject("keychain")); + } + if ((jsonObj.get("json") != null && !jsonObj.get("json").isJsonNull()) && !jsonObj.get("json").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `json` to be a primitive type in the JSON string but got `%s`", jsonObj.get("json").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayOptionsWallet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayOptionsWallet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayOptionsWallet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayOptionsWallet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayOptionsWallet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayOptionsWallet given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayOptionsWallet + * @throws IOException if the JSON string is invalid with respect to GatewayOptionsWallet + */ + public static GatewayOptionsWallet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayOptionsWallet.class); + } + + /** + * Convert an instance of GatewayOptionsWallet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java new file mode 100644 index 0000000000..8162ba9980 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java @@ -0,0 +1,339 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.GetBlockRequestV1Query; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request for GetBlock endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestV1 { + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_CONNECTION_CHANNEL_NAME = "connectionChannelName"; + @SerializedName(SERIALIZED_NAME_CONNECTION_CHANNEL_NAME) + private String connectionChannelName; + + public static final String SERIALIZED_NAME_GATEWAY_OPTIONS = "gatewayOptions"; + @SerializedName(SERIALIZED_NAME_GATEWAY_OPTIONS) + private GatewayOptions gatewayOptions; + + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private GetBlockRequestV1Query query; + + public static final String SERIALIZED_NAME_SKIP_DECODE = "skipDecode"; + @SerializedName(SERIALIZED_NAME_SKIP_DECODE) + private Boolean skipDecode = false; + + public GetBlockRequestV1() { + } + + public GetBlockRequestV1 channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Fabric channel which we want to query. + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public GetBlockRequestV1 connectionChannelName(String connectionChannelName) { + + this.connectionChannelName = connectionChannelName; + return this; + } + + /** + * Fabric channel we want to connect to. If not provided, then one from channelName parameter will be used + * @return connectionChannelName + **/ + @javax.annotation.Nullable + public String getConnectionChannelName() { + return connectionChannelName; + } + + + public void setConnectionChannelName(String connectionChannelName) { + this.connectionChannelName = connectionChannelName; + } + + + public GetBlockRequestV1 gatewayOptions(GatewayOptions gatewayOptions) { + + this.gatewayOptions = gatewayOptions; + return this; + } + + /** + * Get gatewayOptions + * @return gatewayOptions + **/ + @javax.annotation.Nonnull + public GatewayOptions getGatewayOptions() { + return gatewayOptions; + } + + + public void setGatewayOptions(GatewayOptions gatewayOptions) { + this.gatewayOptions = gatewayOptions; + } + + + public GetBlockRequestV1 query(GetBlockRequestV1Query query) { + + this.query = query; + return this; + } + + /** + * Get query + * @return query + **/ + @javax.annotation.Nonnull + public GetBlockRequestV1Query getQuery() { + return query; + } + + + public void setQuery(GetBlockRequestV1Query query) { + this.query = query; + } + + + public GetBlockRequestV1 skipDecode(Boolean skipDecode) { + + this.skipDecode = skipDecode; + return this; + } + + /** + * If true, encoded buffer will be returned. Otherwise, entire block object is returned. + * @return skipDecode + **/ + @javax.annotation.Nullable + public Boolean getSkipDecode() { + return skipDecode; + } + + + public void setSkipDecode(Boolean skipDecode) { + this.skipDecode = skipDecode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestV1 getBlockRequestV1 = (GetBlockRequestV1) o; + return Objects.equals(this.channelName, getBlockRequestV1.channelName) && + Objects.equals(this.connectionChannelName, getBlockRequestV1.connectionChannelName) && + Objects.equals(this.gatewayOptions, getBlockRequestV1.gatewayOptions) && + Objects.equals(this.query, getBlockRequestV1.query) && + Objects.equals(this.skipDecode, getBlockRequestV1.skipDecode); + } + + @Override + public int hashCode() { + return Objects.hash(channelName, connectionChannelName, gatewayOptions, query, skipDecode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestV1 {\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" connectionChannelName: ").append(toIndentedString(connectionChannelName)).append("\n"); + sb.append(" gatewayOptions: ").append(toIndentedString(gatewayOptions)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" skipDecode: ").append(toIndentedString(skipDecode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("channelName"); + openapiFields.add("connectionChannelName"); + openapiFields.add("gatewayOptions"); + openapiFields.add("query"); + openapiFields.add("skipDecode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("gatewayOptions"); + openapiRequiredFields.add("query"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestV1 is not found in the empty JSON string", GetBlockRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + if ((jsonObj.get("connectionChannelName") != null && !jsonObj.get("connectionChannelName").isJsonNull()) && !jsonObj.get("connectionChannelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectionChannelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectionChannelName").toString())); + } + // validate the required field `gatewayOptions` + GatewayOptions.validateJsonObject(jsonObj.getAsJsonObject("gatewayOptions")); + // validate the required field `query` + GetBlockRequestV1Query.validateJsonObject(jsonObj.getAsJsonObject("query")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestV1 + */ + public static GetBlockRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestV1.class); + } + + /** + * Convert an instance of GetBlockRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java new file mode 100644 index 0000000000..448175bbba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java @@ -0,0 +1,272 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GetBlockRequestV1QueryBlockHash; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Query selector, caller must provide at least one of them. First found will be used, rest will be ignored, so it's recommended to pass single selector. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestV1Query { + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private GetBlockRequestV1QueryBlockHash blockHash; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public GetBlockRequestV1Query() { + } + + public GetBlockRequestV1Query blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Select block by it's number. + * @return blockNumber + **/ + @javax.annotation.Nullable + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public GetBlockRequestV1Query blockHash(GetBlockRequestV1QueryBlockHash blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nullable + public GetBlockRequestV1QueryBlockHash getBlockHash() { + return blockHash; + } + + + public void setBlockHash(GetBlockRequestV1QueryBlockHash blockHash) { + this.blockHash = blockHash; + } + + + public GetBlockRequestV1Query transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * Select block by id of transaction that it contains. + * @return transactionId + **/ + @javax.annotation.Nullable + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestV1Query getBlockRequestV1Query = (GetBlockRequestV1Query) o; + return Objects.equals(this.blockNumber, getBlockRequestV1Query.blockNumber) && + Objects.equals(this.blockHash, getBlockRequestV1Query.blockHash) && + Objects.equals(this.transactionId, getBlockRequestV1Query.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(blockNumber, blockHash, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestV1Query {\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockNumber"); + openapiFields.add("blockHash"); + openapiFields.add("transactionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestV1Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestV1Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestV1Query is not found in the empty JSON string", GetBlockRequestV1Query.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestV1Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestV1Query` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("blockNumber") != null && !jsonObj.get("blockNumber").isJsonNull()) && !jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + // validate the optional field `blockHash` + if (jsonObj.get("blockHash") != null && !jsonObj.get("blockHash").isJsonNull()) { + GetBlockRequestV1QueryBlockHash.validateJsonObject(jsonObj.getAsJsonObject("blockHash")); + } + if ((jsonObj.get("transactionId") != null && !jsonObj.get("transactionId").isJsonNull()) && !jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestV1Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestV1Query' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestV1Query.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestV1Query value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestV1Query read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestV1Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestV1Query + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestV1Query + */ + public static GetBlockRequestV1Query fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestV1Query.class); + } + + /** + * Convert an instance of GetBlockRequestV1Query to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java new file mode 100644 index 0000000000..2650025816 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java @@ -0,0 +1,247 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Select block by it's hash. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestV1QueryBlockHash { + public static final String SERIALIZED_NAME_ENCODING = "encoding"; + @SerializedName(SERIALIZED_NAME_ENCODING) + private String encoding; + + public static final String SERIALIZED_NAME_BUFFER = "buffer"; + @SerializedName(SERIALIZED_NAME_BUFFER) + private String buffer; + + public GetBlockRequestV1QueryBlockHash() { + } + + public GetBlockRequestV1QueryBlockHash encoding(String encoding) { + + this.encoding = encoding; + return this; + } + + /** + * NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...). Passed directly to `Buffer.from()` call on hashBuffer. If not provided then JSON buffer format is assumed. + * @return encoding + **/ + @javax.annotation.Nullable + public String getEncoding() { + return encoding; + } + + + public void setEncoding(String encoding) { + this.encoding = encoding; + } + + + public GetBlockRequestV1QueryBlockHash buffer(String buffer) { + + this.buffer = buffer; + return this; + } + + /** + * Buffer of blockHash. It's encoding should be described in `encoding` parameter. + * @return buffer + **/ + @javax.annotation.Nonnull + public String getBuffer() { + return buffer; + } + + + public void setBuffer(String buffer) { + this.buffer = buffer; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestV1QueryBlockHash getBlockRequestV1QueryBlockHash = (GetBlockRequestV1QueryBlockHash) o; + return Objects.equals(this.encoding, getBlockRequestV1QueryBlockHash.encoding) && + Objects.equals(this.buffer, getBlockRequestV1QueryBlockHash.buffer); + } + + @Override + public int hashCode() { + return Objects.hash(encoding, buffer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestV1QueryBlockHash {\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" buffer: ").append(toIndentedString(buffer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("encoding"); + openapiFields.add("buffer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("buffer"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestV1QueryBlockHash + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestV1QueryBlockHash.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestV1QueryBlockHash is not found in the empty JSON string", GetBlockRequestV1QueryBlockHash.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestV1QueryBlockHash.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestV1QueryBlockHash` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockRequestV1QueryBlockHash.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("encoding") != null && !jsonObj.get("encoding").isJsonNull()) && !jsonObj.get("encoding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encoding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encoding").toString())); + } + if (!jsonObj.get("buffer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `buffer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buffer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestV1QueryBlockHash.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestV1QueryBlockHash' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestV1QueryBlockHash.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestV1QueryBlockHash value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestV1QueryBlockHash read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestV1QueryBlockHash given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestV1QueryBlockHash + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestV1QueryBlockHash + */ + public static GetBlockRequestV1QueryBlockHash fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestV1QueryBlockHash.class); + } + + /** + * Convert an instance of GetBlockRequestV1QueryBlockHash to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java new file mode 100644 index 0000000000..390704b8e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * When skipDecode is false (default) then decoded block object is returned. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockResponseDecodedV1 { + public static final String SERIALIZED_NAME_DECODED_BLOCK = "decodedBlock"; + @SerializedName(SERIALIZED_NAME_DECODED_BLOCK) + private Object decodedBlock = null; + + public GetBlockResponseDecodedV1() { + } + + public GetBlockResponseDecodedV1 decodedBlock(Object decodedBlock) { + + this.decodedBlock = decodedBlock; + return this; + } + + /** + * Full hyperledger fabric block data. + * @return decodedBlock + **/ + @javax.annotation.Nullable + public Object getDecodedBlock() { + return decodedBlock; + } + + + public void setDecodedBlock(Object decodedBlock) { + this.decodedBlock = decodedBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockResponseDecodedV1 getBlockResponseDecodedV1 = (GetBlockResponseDecodedV1) o; + return Objects.equals(this.decodedBlock, getBlockResponseDecodedV1.decodedBlock); + } + + @Override + public int hashCode() { + return Objects.hash(decodedBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockResponseDecodedV1 {\n"); + sb.append(" decodedBlock: ").append(toIndentedString(decodedBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("decodedBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("decodedBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockResponseDecodedV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockResponseDecodedV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockResponseDecodedV1 is not found in the empty JSON string", GetBlockResponseDecodedV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockResponseDecodedV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockResponseDecodedV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockResponseDecodedV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockResponseDecodedV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockResponseDecodedV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseDecodedV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockResponseDecodedV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockResponseDecodedV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockResponseDecodedV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockResponseDecodedV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockResponseDecodedV1 + */ + public static GetBlockResponseDecodedV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockResponseDecodedV1.class); + } + + /** + * Convert an instance of GetBlockResponseDecodedV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java new file mode 100644 index 0000000000..ddaa3df9a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * When skipDecode is true then encoded block Buffer is returned. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockResponseEncodedV1 { + public static final String SERIALIZED_NAME_ENCODED_BLOCK = "encodedBlock"; + @SerializedName(SERIALIZED_NAME_ENCODED_BLOCK) + private String encodedBlock; + + public GetBlockResponseEncodedV1() { + } + + public GetBlockResponseEncodedV1 encodedBlock(String encodedBlock) { + + this.encodedBlock = encodedBlock; + return this; + } + + /** + * Get encodedBlock + * @return encodedBlock + **/ + @javax.annotation.Nonnull + public String getEncodedBlock() { + return encodedBlock; + } + + + public void setEncodedBlock(String encodedBlock) { + this.encodedBlock = encodedBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockResponseEncodedV1 getBlockResponseEncodedV1 = (GetBlockResponseEncodedV1) o; + return Objects.equals(this.encodedBlock, getBlockResponseEncodedV1.encodedBlock); + } + + @Override + public int hashCode() { + return Objects.hash(encodedBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockResponseEncodedV1 {\n"); + sb.append(" encodedBlock: ").append(toIndentedString(encodedBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("encodedBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("encodedBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockResponseEncodedV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockResponseEncodedV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockResponseEncodedV1 is not found in the empty JSON string", GetBlockResponseEncodedV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockResponseEncodedV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockResponseEncodedV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockResponseEncodedV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("encodedBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encodedBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encodedBlock").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockResponseEncodedV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockResponseEncodedV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseEncodedV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockResponseEncodedV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockResponseEncodedV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockResponseEncodedV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockResponseEncodedV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockResponseEncodedV1 + */ + public static GetBlockResponseEncodedV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockResponseEncodedV1.class); + } + + /** + * Convert an instance of GetBlockResponseEncodedV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java new file mode 100644 index 0000000000..511210e587 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GetBlockResponseDecodedV1; +import org.openapitools.client.model.GetBlockResponseEncodedV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockResponseV1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GetBlockResponseV1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterGetBlockResponseDecodedV1 = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseDecodedV1.class)); + final TypeAdapter adapterGetBlockResponseEncodedV1 = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseEncodedV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockResponseV1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `GetBlockResponseDecodedV1` + if (value.getActualInstance() instanceof GetBlockResponseDecodedV1) { + JsonObject obj = adapterGetBlockResponseDecodedV1.toJsonTree((GetBlockResponseDecodedV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetBlockResponseEncodedV1` + if (value.getActualInstance() instanceof GetBlockResponseEncodedV1) { + JsonObject obj = adapterGetBlockResponseEncodedV1.toJsonTree((GetBlockResponseEncodedV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: GetBlockResponseDecodedV1, GetBlockResponseEncodedV1"); + } + + @Override + public GetBlockResponseV1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize GetBlockResponseDecodedV1 + try { + // validate the JSON object to see if any exception is thrown + GetBlockResponseDecodedV1.validateJsonObject(jsonObject); + actualAdapter = adapterGetBlockResponseDecodedV1; + match++; + log.log(Level.FINER, "Input data matches schema 'GetBlockResponseDecodedV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetBlockResponseDecodedV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetBlockResponseDecodedV1'", e); + } + + // deserialize GetBlockResponseEncodedV1 + try { + // validate the JSON object to see if any exception is thrown + GetBlockResponseEncodedV1.validateJsonObject(jsonObject); + actualAdapter = adapterGetBlockResponseEncodedV1; + match++; + log.log(Level.FINER, "Input data matches schema 'GetBlockResponseEncodedV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetBlockResponseEncodedV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetBlockResponseEncodedV1'", e); + } + + if (match == 1) { + GetBlockResponseV1 ret = new GetBlockResponseV1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GetBlockResponseV1: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GetBlockResponseV1() { + super("oneOf", Boolean.FALSE); + } + + public GetBlockResponseV1(GetBlockResponseDecodedV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GetBlockResponseV1(GetBlockResponseEncodedV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("GetBlockResponseDecodedV1", new GenericType() { + }); + schemas.put("GetBlockResponseEncodedV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GetBlockResponseV1.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * GetBlockResponseDecodedV1, GetBlockResponseEncodedV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof GetBlockResponseDecodedV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetBlockResponseEncodedV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be GetBlockResponseDecodedV1, GetBlockResponseEncodedV1"); + } + + /** + * Get the actual instance, which can be the following: + * GetBlockResponseDecodedV1, GetBlockResponseEncodedV1 + * + * @return The actual instance (GetBlockResponseDecodedV1, GetBlockResponseEncodedV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GetBlockResponseDecodedV1`. If the actual instance is not `GetBlockResponseDecodedV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetBlockResponseDecodedV1` + * @throws ClassCastException if the instance is not `GetBlockResponseDecodedV1` + */ + public GetBlockResponseDecodedV1 getGetBlockResponseDecodedV1() throws ClassCastException { + return (GetBlockResponseDecodedV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetBlockResponseEncodedV1`. If the actual instance is not `GetBlockResponseEncodedV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetBlockResponseEncodedV1` + * @throws ClassCastException if the instance is not `GetBlockResponseEncodedV1` + */ + public GetBlockResponseEncodedV1 getGetBlockResponseEncodedV1() throws ClassCastException { + return (GetBlockResponseEncodedV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with GetBlockResponseDecodedV1 + try { + GetBlockResponseDecodedV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetBlockResponseDecodedV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetBlockResponseEncodedV1 + try { + GetBlockResponseEncodedV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetBlockResponseEncodedV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GetBlockResponseV1 with oneOf schemas: GetBlockResponseDecodedV1, GetBlockResponseEncodedV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of GetBlockResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockResponseV1 + */ + public static GetBlockResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockResponseV1.class); + } + + /** + * Convert an instance of GetBlockResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java new file mode 100644 index 0000000000..07dbc7065a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java @@ -0,0 +1,513 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.TransactReceiptBlockMetaData; +import org.openapitools.client.model.TransactReceiptTransactionCreator; +import org.openapitools.client.model.TransactReceiptTransactionEndorsement; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetTransactionReceiptResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionReceiptResponse { + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_CHANNEL_I_D = "channelID"; + @SerializedName(SERIALIZED_NAME_CHANNEL_I_D) + private String channelID; + + public static final String SERIALIZED_NAME_TRANSACTION_CREATOR = "transactionCreator"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CREATOR) + private TransactReceiptTransactionCreator transactionCreator; + + public static final String SERIALIZED_NAME_TRANSACTION_ENDORSEMENT = "transactionEndorsement"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ENDORSEMENT) + private List transactionEndorsement; + + public static final String SERIALIZED_NAME_BLOCK_META_DATA = "blockMetaData"; + @SerializedName(SERIALIZED_NAME_BLOCK_META_DATA) + private TransactReceiptBlockMetaData blockMetaData; + + public static final String SERIALIZED_NAME_CHAIN_CODE_NAME = "chainCodeName"; + @SerializedName(SERIALIZED_NAME_CHAIN_CODE_NAME) + private String chainCodeName; + + public static final String SERIALIZED_NAME_CHAIN_CODE_VERSION = "chainCodeVersion"; + @SerializedName(SERIALIZED_NAME_CHAIN_CODE_VERSION) + private String chainCodeVersion; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS) + private String responseStatus; + + public static final String SERIALIZED_NAME_RWSET_KEY = "rwsetKey"; + @SerializedName(SERIALIZED_NAME_RWSET_KEY) + private String rwsetKey; + + public static final String SERIALIZED_NAME_RWSET_WRITE_DATA = "rwsetWriteData"; + @SerializedName(SERIALIZED_NAME_RWSET_WRITE_DATA) + private String rwsetWriteData; + + public GetTransactionReceiptResponse() { + } + + public GetTransactionReceiptResponse blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nullable + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public GetTransactionReceiptResponse channelID(String channelID) { + + this.channelID = channelID; + return this; + } + + /** + * Get channelID + * @return channelID + **/ + @javax.annotation.Nullable + public String getChannelID() { + return channelID; + } + + + public void setChannelID(String channelID) { + this.channelID = channelID; + } + + + public GetTransactionReceiptResponse transactionCreator(TransactReceiptTransactionCreator transactionCreator) { + + this.transactionCreator = transactionCreator; + return this; + } + + /** + * Get transactionCreator + * @return transactionCreator + **/ + @javax.annotation.Nullable + public TransactReceiptTransactionCreator getTransactionCreator() { + return transactionCreator; + } + + + public void setTransactionCreator(TransactReceiptTransactionCreator transactionCreator) { + this.transactionCreator = transactionCreator; + } + + + public GetTransactionReceiptResponse transactionEndorsement(List transactionEndorsement) { + + this.transactionEndorsement = transactionEndorsement; + return this; + } + + public GetTransactionReceiptResponse addTransactionEndorsementItem(TransactReceiptTransactionEndorsement transactionEndorsementItem) { + if (this.transactionEndorsement == null) { + this.transactionEndorsement = new ArrayList<>(); + } + this.transactionEndorsement.add(transactionEndorsementItem); + return this; + } + + /** + * Get transactionEndorsement + * @return transactionEndorsement + **/ + @javax.annotation.Nullable + public List getTransactionEndorsement() { + return transactionEndorsement; + } + + + public void setTransactionEndorsement(List transactionEndorsement) { + this.transactionEndorsement = transactionEndorsement; + } + + + public GetTransactionReceiptResponse blockMetaData(TransactReceiptBlockMetaData blockMetaData) { + + this.blockMetaData = blockMetaData; + return this; + } + + /** + * Get blockMetaData + * @return blockMetaData + **/ + @javax.annotation.Nullable + public TransactReceiptBlockMetaData getBlockMetaData() { + return blockMetaData; + } + + + public void setBlockMetaData(TransactReceiptBlockMetaData blockMetaData) { + this.blockMetaData = blockMetaData; + } + + + public GetTransactionReceiptResponse chainCodeName(String chainCodeName) { + + this.chainCodeName = chainCodeName; + return this; + } + + /** + * Get chainCodeName + * @return chainCodeName + **/ + @javax.annotation.Nullable + public String getChainCodeName() { + return chainCodeName; + } + + + public void setChainCodeName(String chainCodeName) { + this.chainCodeName = chainCodeName; + } + + + public GetTransactionReceiptResponse chainCodeVersion(String chainCodeVersion) { + + this.chainCodeVersion = chainCodeVersion; + return this; + } + + /** + * Get chainCodeVersion + * @return chainCodeVersion + **/ + @javax.annotation.Nullable + public String getChainCodeVersion() { + return chainCodeVersion; + } + + + public void setChainCodeVersion(String chainCodeVersion) { + this.chainCodeVersion = chainCodeVersion; + } + + + public GetTransactionReceiptResponse responseStatus(String responseStatus) { + + this.responseStatus = responseStatus; + return this; + } + + /** + * Get responseStatus + * @return responseStatus + **/ + @javax.annotation.Nullable + public String getResponseStatus() { + return responseStatus; + } + + + public void setResponseStatus(String responseStatus) { + this.responseStatus = responseStatus; + } + + + public GetTransactionReceiptResponse rwsetKey(String rwsetKey) { + + this.rwsetKey = rwsetKey; + return this; + } + + /** + * Get rwsetKey + * @return rwsetKey + **/ + @javax.annotation.Nullable + public String getRwsetKey() { + return rwsetKey; + } + + + public void setRwsetKey(String rwsetKey) { + this.rwsetKey = rwsetKey; + } + + + public GetTransactionReceiptResponse rwsetWriteData(String rwsetWriteData) { + + this.rwsetWriteData = rwsetWriteData; + return this; + } + + /** + * Get rwsetWriteData + * @return rwsetWriteData + **/ + @javax.annotation.Nullable + public String getRwsetWriteData() { + return rwsetWriteData; + } + + + public void setRwsetWriteData(String rwsetWriteData) { + this.rwsetWriteData = rwsetWriteData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionReceiptResponse getTransactionReceiptResponse = (GetTransactionReceiptResponse) o; + return Objects.equals(this.blockNumber, getTransactionReceiptResponse.blockNumber) && + Objects.equals(this.channelID, getTransactionReceiptResponse.channelID) && + Objects.equals(this.transactionCreator, getTransactionReceiptResponse.transactionCreator) && + Objects.equals(this.transactionEndorsement, getTransactionReceiptResponse.transactionEndorsement) && + Objects.equals(this.blockMetaData, getTransactionReceiptResponse.blockMetaData) && + Objects.equals(this.chainCodeName, getTransactionReceiptResponse.chainCodeName) && + Objects.equals(this.chainCodeVersion, getTransactionReceiptResponse.chainCodeVersion) && + Objects.equals(this.responseStatus, getTransactionReceiptResponse.responseStatus) && + Objects.equals(this.rwsetKey, getTransactionReceiptResponse.rwsetKey) && + Objects.equals(this.rwsetWriteData, getTransactionReceiptResponse.rwsetWriteData); + } + + @Override + public int hashCode() { + return Objects.hash(blockNumber, channelID, transactionCreator, transactionEndorsement, blockMetaData, chainCodeName, chainCodeVersion, responseStatus, rwsetKey, rwsetWriteData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionReceiptResponse {\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" channelID: ").append(toIndentedString(channelID)).append("\n"); + sb.append(" transactionCreator: ").append(toIndentedString(transactionCreator)).append("\n"); + sb.append(" transactionEndorsement: ").append(toIndentedString(transactionEndorsement)).append("\n"); + sb.append(" blockMetaData: ").append(toIndentedString(blockMetaData)).append("\n"); + sb.append(" chainCodeName: ").append(toIndentedString(chainCodeName)).append("\n"); + sb.append(" chainCodeVersion: ").append(toIndentedString(chainCodeVersion)).append("\n"); + sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n"); + sb.append(" rwsetKey: ").append(toIndentedString(rwsetKey)).append("\n"); + sb.append(" rwsetWriteData: ").append(toIndentedString(rwsetWriteData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockNumber"); + openapiFields.add("channelID"); + openapiFields.add("transactionCreator"); + openapiFields.add("transactionEndorsement"); + openapiFields.add("blockMetaData"); + openapiFields.add("chainCodeName"); + openapiFields.add("chainCodeVersion"); + openapiFields.add("responseStatus"); + openapiFields.add("rwsetKey"); + openapiFields.add("rwsetWriteData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionReceiptResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionReceiptResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionReceiptResponse is not found in the empty JSON string", GetTransactionReceiptResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionReceiptResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionReceiptResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("blockNumber") != null && !jsonObj.get("blockNumber").isJsonNull()) && !jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + if ((jsonObj.get("channelID") != null && !jsonObj.get("channelID").isJsonNull()) && !jsonObj.get("channelID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelID").toString())); + } + // validate the optional field `transactionCreator` + if (jsonObj.get("transactionCreator") != null && !jsonObj.get("transactionCreator").isJsonNull()) { + TransactReceiptTransactionCreator.validateJsonObject(jsonObj.getAsJsonObject("transactionCreator")); + } + if (jsonObj.get("transactionEndorsement") != null && !jsonObj.get("transactionEndorsement").isJsonNull()) { + JsonArray jsonArraytransactionEndorsement = jsonObj.getAsJsonArray("transactionEndorsement"); + if (jsonArraytransactionEndorsement != null) { + // ensure the json data is an array + if (!jsonObj.get("transactionEndorsement").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionEndorsement` to be an array in the JSON string but got `%s`", jsonObj.get("transactionEndorsement").toString())); + } + + // validate the optional field `transactionEndorsement` (array) + for (int i = 0; i < jsonArraytransactionEndorsement.size(); i++) { + TransactReceiptTransactionEndorsement.validateJsonObject(jsonArraytransactionEndorsement.get(i).getAsJsonObject()); + }; + } + } + // validate the optional field `blockMetaData` + if (jsonObj.get("blockMetaData") != null && !jsonObj.get("blockMetaData").isJsonNull()) { + TransactReceiptBlockMetaData.validateJsonObject(jsonObj.getAsJsonObject("blockMetaData")); + } + if ((jsonObj.get("chainCodeName") != null && !jsonObj.get("chainCodeName").isJsonNull()) && !jsonObj.get("chainCodeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainCodeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainCodeName").toString())); + } + if ((jsonObj.get("chainCodeVersion") != null && !jsonObj.get("chainCodeVersion").isJsonNull()) && !jsonObj.get("chainCodeVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainCodeVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainCodeVersion").toString())); + } + if ((jsonObj.get("responseStatus") != null && !jsonObj.get("responseStatus").isJsonNull()) && !jsonObj.get("responseStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseStatus").toString())); + } + if ((jsonObj.get("rwsetKey") != null && !jsonObj.get("rwsetKey").isJsonNull()) && !jsonObj.get("rwsetKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rwsetKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rwsetKey").toString())); + } + if ((jsonObj.get("rwsetWriteData") != null && !jsonObj.get("rwsetWriteData").isJsonNull()) && !jsonObj.get("rwsetWriteData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rwsetWriteData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rwsetWriteData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionReceiptResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionReceiptResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionReceiptResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionReceiptResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionReceiptResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionReceiptResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionReceiptResponse + * @throws IOException if the JSON string is invalid with respect to GetTransactionReceiptResponse + */ + public static GetTransactionReceiptResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionReceiptResponse.class); + } + + /** + * Convert an instance of GetTransactionReceiptResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 0000000000..98ff8b8755 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,571 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.FabricContractInvocationType; +import org.openapitools.client.model.FabricSigningCredential; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_ENDORSING_PEERS = "endorsingPeers"; + @SerializedName(SERIALIZED_NAME_ENDORSING_PEERS) + private List endorsingPeers; + + public static final String SERIALIZED_NAME_TRANSIENT_DATA = "transientData"; + @SerializedName(SERIALIZED_NAME_TRANSIENT_DATA) + private Object transientData; + + public static final String SERIALIZED_NAME_GATEWAY_OPTIONS = "gatewayOptions"; + @SerializedName(SERIALIZED_NAME_GATEWAY_OPTIONS) + private GatewayOptions gatewayOptions; + + public static final String SERIALIZED_NAME_SIGNING_CREDENTIAL = "signingCredential"; + @SerializedName(SERIALIZED_NAME_SIGNING_CREDENTIAL) + private FabricSigningCredential signingCredential; + + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private FabricContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_ENDORSING_PARTIES = "endorsingParties"; + @SerializedName(SERIALIZED_NAME_ENDORSING_PARTIES) + private List endorsingParties = null; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "responseType"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + private String responseType; + + public RunTransactionRequest() { + } + + public RunTransactionRequest endorsingPeers(List endorsingPeers) { + + this.endorsingPeers = endorsingPeers; + return this; + } + + public RunTransactionRequest addEndorsingPeersItem(String endorsingPeersItem) { + if (this.endorsingPeers == null) { + this.endorsingPeers = new ArrayList<>(); + } + this.endorsingPeers.add(endorsingPeersItem); + return this; + } + + /** + * An array of MSP IDs to set as the list of endorsing peers for the transaction. + * @return endorsingPeers + **/ + @javax.annotation.Nullable + public List getEndorsingPeers() { + return endorsingPeers; + } + + + public void setEndorsingPeers(List endorsingPeers) { + this.endorsingPeers = endorsingPeers; + } + + + public RunTransactionRequest transientData(Object transientData) { + + this.transientData = transientData; + return this; + } + + /** + * Get transientData + * @return transientData + **/ + @javax.annotation.Nullable + public Object getTransientData() { + return transientData; + } + + + public void setTransientData(Object transientData) { + this.transientData = transientData; + } + + + public RunTransactionRequest gatewayOptions(GatewayOptions gatewayOptions) { + + this.gatewayOptions = gatewayOptions; + return this; + } + + /** + * Get gatewayOptions + * @return gatewayOptions + **/ + @javax.annotation.Nullable + public GatewayOptions getGatewayOptions() { + return gatewayOptions; + } + + + public void setGatewayOptions(GatewayOptions gatewayOptions) { + this.gatewayOptions = gatewayOptions; + } + + + public RunTransactionRequest signingCredential(FabricSigningCredential signingCredential) { + + this.signingCredential = signingCredential; + return this; + } + + /** + * Get signingCredential + * @return signingCredential + **/ + @javax.annotation.Nonnull + public FabricSigningCredential getSigningCredential() { + return signingCredential; + } + + + public void setSigningCredential(FabricSigningCredential signingCredential) { + this.signingCredential = signingCredential; + } + + + public RunTransactionRequest channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Get channelName + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public RunTransactionRequest contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public RunTransactionRequest invocationType(FabricContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public FabricContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(FabricContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public RunTransactionRequest methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * Get methodName + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public RunTransactionRequest params(List params) { + + this.params = params; + return this; + } + + public RunTransactionRequest addParamsItem(String paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public RunTransactionRequest endorsingParties(List endorsingParties) { + + this.endorsingParties = endorsingParties; + return this; + } + + public RunTransactionRequest addEndorsingPartiesItem(String endorsingPartiesItem) { + if (this.endorsingParties == null) { + this.endorsingParties = null; + } + this.endorsingParties.add(endorsingPartiesItem); + return this; + } + + /** + * Get endorsingParties + * @return endorsingParties + **/ + @javax.annotation.Nullable + public List getEndorsingParties() { + return endorsingParties; + } + + + public void setEndorsingParties(List endorsingParties) { + this.endorsingParties = endorsingParties; + } + + + public RunTransactionRequest responseType(String responseType) { + + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + **/ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + + public void setResponseType(String responseType) { + this.responseType = responseType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.endorsingPeers, runTransactionRequest.endorsingPeers) && + Objects.equals(this.transientData, runTransactionRequest.transientData) && + Objects.equals(this.gatewayOptions, runTransactionRequest.gatewayOptions) && + Objects.equals(this.signingCredential, runTransactionRequest.signingCredential) && + Objects.equals(this.channelName, runTransactionRequest.channelName) && + Objects.equals(this.contractName, runTransactionRequest.contractName) && + Objects.equals(this.invocationType, runTransactionRequest.invocationType) && + Objects.equals(this.methodName, runTransactionRequest.methodName) && + Objects.equals(this.params, runTransactionRequest.params) && + Objects.equals(this.endorsingParties, runTransactionRequest.endorsingParties) && + Objects.equals(this.responseType, runTransactionRequest.responseType); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(endorsingPeers, transientData, gatewayOptions, signingCredential, channelName, contractName, invocationType, methodName, params, endorsingParties, responseType); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" endorsingPeers: ").append(toIndentedString(endorsingPeers)).append("\n"); + sb.append(" transientData: ").append(toIndentedString(transientData)).append("\n"); + sb.append(" gatewayOptions: ").append(toIndentedString(gatewayOptions)).append("\n"); + sb.append(" signingCredential: ").append(toIndentedString(signingCredential)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" endorsingParties: ").append(toIndentedString(endorsingParties)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("endorsingPeers"); + openapiFields.add("transientData"); + openapiFields.add("gatewayOptions"); + openapiFields.add("signingCredential"); + openapiFields.add("channelName"); + openapiFields.add("contractName"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("endorsingParties"); + openapiFields.add("responseType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signingCredential"); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("endorsingPeers") != null && !jsonObj.get("endorsingPeers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `endorsingPeers` to be an array in the JSON string but got `%s`", jsonObj.get("endorsingPeers").toString())); + } + // validate the optional field `gatewayOptions` + if (jsonObj.get("gatewayOptions") != null && !jsonObj.get("gatewayOptions").isJsonNull()) { + GatewayOptions.validateJsonObject(jsonObj.getAsJsonObject("gatewayOptions")); + } + // validate the required field `signingCredential` + FabricSigningCredential.validateJsonObject(jsonObj.getAsJsonObject("signingCredential")); + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("endorsingParties") != null && !jsonObj.get("endorsingParties").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `endorsingParties` to be an array in the JSON string but got `%s`", jsonObj.get("endorsingParties").toString())); + } + if ((jsonObj.get("responseType") != null && !jsonObj.get("responseType").isJsonNull()) && !jsonObj.get("responseType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..847d0707cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_FUNCTION_OUTPUT = "functionOutput"; + @SerializedName(SERIALIZED_NAME_FUNCTION_OUTPUT) + private String functionOutput; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public RunTransactionResponse() { + } + + public RunTransactionResponse functionOutput(String functionOutput) { + + this.functionOutput = functionOutput; + return this; + } + + /** + * Get functionOutput + * @return functionOutput + **/ + @javax.annotation.Nonnull + public String getFunctionOutput() { + return functionOutput; + } + + + public void setFunctionOutput(String functionOutput) { + this.functionOutput = functionOutput; + } + + + public RunTransactionResponse success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RunTransactionResponse transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * Get transactionId + * @return transactionId + **/ + @javax.annotation.Nonnull + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.functionOutput, runTransactionResponse.functionOutput) && + Objects.equals(this.success, runTransactionResponse.success) && + Objects.equals(this.transactionId, runTransactionResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(functionOutput, success, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" functionOutput: ").append(toIndentedString(functionOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("functionOutput"); + openapiFields.add("success"); + openapiFields.add("transactionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("functionOutput"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("transactionId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("functionOutput").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `functionOutput` to be a primitive type in the JSON string but got `%s`", jsonObj.get("functionOutput").toString())); + } + if (!jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java new file mode 100644 index 0000000000..889849439a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SSHExecCommandResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SSHExecCommandResponse { + public static final String SERIALIZED_NAME_STDOUT = "stdout"; + @SerializedName(SERIALIZED_NAME_STDOUT) + private String stdout; + + public static final String SERIALIZED_NAME_STDERR = "stderr"; + @SerializedName(SERIALIZED_NAME_STDERR) + private String stderr; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private Integer code; + + public static final String SERIALIZED_NAME_SIGNAL = "signal"; + @SerializedName(SERIALIZED_NAME_SIGNAL) + private String signal; + + public SSHExecCommandResponse() { + } + + public SSHExecCommandResponse stdout(String stdout) { + + this.stdout = stdout; + return this; + } + + /** + * Get stdout + * @return stdout + **/ + @javax.annotation.Nonnull + public String getStdout() { + return stdout; + } + + + public void setStdout(String stdout) { + this.stdout = stdout; + } + + + public SSHExecCommandResponse stderr(String stderr) { + + this.stderr = stderr; + return this; + } + + /** + * Get stderr + * @return stderr + **/ + @javax.annotation.Nonnull + public String getStderr() { + return stderr; + } + + + public void setStderr(String stderr) { + this.stderr = stderr; + } + + + public SSHExecCommandResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + public Integer getCode() { + return code; + } + + + public void setCode(Integer code) { + this.code = code; + } + + + public SSHExecCommandResponse signal(String signal) { + + this.signal = signal; + return this; + } + + /** + * Get signal + * @return signal + **/ + @javax.annotation.Nullable + public String getSignal() { + return signal; + } + + + public void setSignal(String signal) { + this.signal = signal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSHExecCommandResponse ssHExecCommandResponse = (SSHExecCommandResponse) o; + return Objects.equals(this.stdout, ssHExecCommandResponse.stdout) && + Objects.equals(this.stderr, ssHExecCommandResponse.stderr) && + Objects.equals(this.code, ssHExecCommandResponse.code) && + Objects.equals(this.signal, ssHExecCommandResponse.signal); + } + + @Override + public int hashCode() { + return Objects.hash(stdout, stderr, code, signal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSHExecCommandResponse {\n"); + sb.append(" stdout: ").append(toIndentedString(stdout)).append("\n"); + sb.append(" stderr: ").append(toIndentedString(stderr)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" signal: ").append(toIndentedString(signal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stdout"); + openapiFields.add("stderr"); + openapiFields.add("code"); + openapiFields.add("signal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stdout"); + openapiRequiredFields.add("stderr"); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("signal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SSHExecCommandResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SSHExecCommandResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SSHExecCommandResponse is not found in the empty JSON string", SSHExecCommandResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SSHExecCommandResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SSHExecCommandResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SSHExecCommandResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("stdout").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stdout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stdout").toString())); + } + if (!jsonObj.get("stderr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stderr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stderr").toString())); + } + if (!jsonObj.get("signal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SSHExecCommandResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SSHExecCommandResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SSHExecCommandResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SSHExecCommandResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SSHExecCommandResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SSHExecCommandResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSHExecCommandResponse + * @throws IOException if the JSON string is invalid with respect to SSHExecCommandResponse + */ + public static SSHExecCommandResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SSHExecCommandResponse.class); + } + + /** + * Convert an instance of SSHExecCommandResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java new file mode 100644 index 0000000000..2288e51417 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransactReceiptBlockMetaData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactReceiptBlockMetaData { + public static final String SERIALIZED_NAME_MSPID = "mspid"; + @SerializedName(SERIALIZED_NAME_MSPID) + private String mspid; + + public static final String SERIALIZED_NAME_BLOCK_CREATOR_I_D = "blockCreatorID"; + @SerializedName(SERIALIZED_NAME_BLOCK_CREATOR_I_D) + private String blockCreatorID; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public TransactReceiptBlockMetaData() { + } + + public TransactReceiptBlockMetaData mspid(String mspid) { + + this.mspid = mspid; + return this; + } + + /** + * Get mspid + * @return mspid + **/ + @javax.annotation.Nullable + public String getMspid() { + return mspid; + } + + + public void setMspid(String mspid) { + this.mspid = mspid; + } + + + public TransactReceiptBlockMetaData blockCreatorID(String blockCreatorID) { + + this.blockCreatorID = blockCreatorID; + return this; + } + + /** + * Get blockCreatorID + * @return blockCreatorID + **/ + @javax.annotation.Nullable + public String getBlockCreatorID() { + return blockCreatorID; + } + + + public void setBlockCreatorID(String blockCreatorID) { + this.blockCreatorID = blockCreatorID; + } + + + public TransactReceiptBlockMetaData signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactReceiptBlockMetaData transactReceiptBlockMetaData = (TransactReceiptBlockMetaData) o; + return Objects.equals(this.mspid, transactReceiptBlockMetaData.mspid) && + Objects.equals(this.blockCreatorID, transactReceiptBlockMetaData.blockCreatorID) && + Objects.equals(this.signature, transactReceiptBlockMetaData.signature); + } + + @Override + public int hashCode() { + return Objects.hash(mspid, blockCreatorID, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactReceiptBlockMetaData {\n"); + sb.append(" mspid: ").append(toIndentedString(mspid)).append("\n"); + sb.append(" blockCreatorID: ").append(toIndentedString(blockCreatorID)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mspid"); + openapiFields.add("blockCreatorID"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactReceiptBlockMetaData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactReceiptBlockMetaData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactReceiptBlockMetaData is not found in the empty JSON string", TransactReceiptBlockMetaData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactReceiptBlockMetaData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactReceiptBlockMetaData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("mspid") != null && !jsonObj.get("mspid").isJsonNull()) && !jsonObj.get("mspid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mspid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mspid").toString())); + } + if ((jsonObj.get("blockCreatorID") != null && !jsonObj.get("blockCreatorID").isJsonNull()) && !jsonObj.get("blockCreatorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockCreatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockCreatorID").toString())); + } + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactReceiptBlockMetaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactReceiptBlockMetaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactReceiptBlockMetaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactReceiptBlockMetaData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactReceiptBlockMetaData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactReceiptBlockMetaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactReceiptBlockMetaData + * @throws IOException if the JSON string is invalid with respect to TransactReceiptBlockMetaData + */ + public static TransactReceiptBlockMetaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactReceiptBlockMetaData.class); + } + + /** + * Convert an instance of TransactReceiptBlockMetaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java new file mode 100644 index 0000000000..c77bcce334 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java @@ -0,0 +1,239 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransactReceiptTransactionCreator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactReceiptTransactionCreator { + public static final String SERIALIZED_NAME_MSPID = "mspid"; + @SerializedName(SERIALIZED_NAME_MSPID) + private String mspid; + + public static final String SERIALIZED_NAME_CREATOR_I_D = "creatorID"; + @SerializedName(SERIALIZED_NAME_CREATOR_I_D) + private String creatorID; + + public TransactReceiptTransactionCreator() { + } + + public TransactReceiptTransactionCreator mspid(String mspid) { + + this.mspid = mspid; + return this; + } + + /** + * Get mspid + * @return mspid + **/ + @javax.annotation.Nullable + public String getMspid() { + return mspid; + } + + + public void setMspid(String mspid) { + this.mspid = mspid; + } + + + public TransactReceiptTransactionCreator creatorID(String creatorID) { + + this.creatorID = creatorID; + return this; + } + + /** + * Get creatorID + * @return creatorID + **/ + @javax.annotation.Nullable + public String getCreatorID() { + return creatorID; + } + + + public void setCreatorID(String creatorID) { + this.creatorID = creatorID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactReceiptTransactionCreator transactReceiptTransactionCreator = (TransactReceiptTransactionCreator) o; + return Objects.equals(this.mspid, transactReceiptTransactionCreator.mspid) && + Objects.equals(this.creatorID, transactReceiptTransactionCreator.creatorID); + } + + @Override + public int hashCode() { + return Objects.hash(mspid, creatorID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactReceiptTransactionCreator {\n"); + sb.append(" mspid: ").append(toIndentedString(mspid)).append("\n"); + sb.append(" creatorID: ").append(toIndentedString(creatorID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mspid"); + openapiFields.add("creatorID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactReceiptTransactionCreator + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactReceiptTransactionCreator.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactReceiptTransactionCreator is not found in the empty JSON string", TransactReceiptTransactionCreator.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactReceiptTransactionCreator.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactReceiptTransactionCreator` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("mspid") != null && !jsonObj.get("mspid").isJsonNull()) && !jsonObj.get("mspid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mspid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mspid").toString())); + } + if ((jsonObj.get("creatorID") != null && !jsonObj.get("creatorID").isJsonNull()) && !jsonObj.get("creatorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactReceiptTransactionCreator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactReceiptTransactionCreator' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactReceiptTransactionCreator.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactReceiptTransactionCreator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactReceiptTransactionCreator read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactReceiptTransactionCreator given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactReceiptTransactionCreator + * @throws IOException if the JSON string is invalid with respect to TransactReceiptTransactionCreator + */ + public static TransactReceiptTransactionCreator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactReceiptTransactionCreator.class); + } + + /** + * Convert an instance of TransactReceiptTransactionCreator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java new file mode 100644 index 0000000000..2020956290 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransactReceiptTransactionEndorsement + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactReceiptTransactionEndorsement { + public static final String SERIALIZED_NAME_MSPID = "mspid"; + @SerializedName(SERIALIZED_NAME_MSPID) + private String mspid; + + public static final String SERIALIZED_NAME_ENDORSER_I_D = "endorserID"; + @SerializedName(SERIALIZED_NAME_ENDORSER_I_D) + private String endorserID; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public TransactReceiptTransactionEndorsement() { + } + + public TransactReceiptTransactionEndorsement mspid(String mspid) { + + this.mspid = mspid; + return this; + } + + /** + * Get mspid + * @return mspid + **/ + @javax.annotation.Nullable + public String getMspid() { + return mspid; + } + + + public void setMspid(String mspid) { + this.mspid = mspid; + } + + + public TransactReceiptTransactionEndorsement endorserID(String endorserID) { + + this.endorserID = endorserID; + return this; + } + + /** + * Get endorserID + * @return endorserID + **/ + @javax.annotation.Nullable + public String getEndorserID() { + return endorserID; + } + + + public void setEndorserID(String endorserID) { + this.endorserID = endorserID; + } + + + public TransactReceiptTransactionEndorsement signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactReceiptTransactionEndorsement transactReceiptTransactionEndorsement = (TransactReceiptTransactionEndorsement) o; + return Objects.equals(this.mspid, transactReceiptTransactionEndorsement.mspid) && + Objects.equals(this.endorserID, transactReceiptTransactionEndorsement.endorserID) && + Objects.equals(this.signature, transactReceiptTransactionEndorsement.signature); + } + + @Override + public int hashCode() { + return Objects.hash(mspid, endorserID, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactReceiptTransactionEndorsement {\n"); + sb.append(" mspid: ").append(toIndentedString(mspid)).append("\n"); + sb.append(" endorserID: ").append(toIndentedString(endorserID)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mspid"); + openapiFields.add("endorserID"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactReceiptTransactionEndorsement + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactReceiptTransactionEndorsement.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactReceiptTransactionEndorsement is not found in the empty JSON string", TransactReceiptTransactionEndorsement.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactReceiptTransactionEndorsement.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactReceiptTransactionEndorsement` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("mspid") != null && !jsonObj.get("mspid").isJsonNull()) && !jsonObj.get("mspid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mspid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mspid").toString())); + } + if ((jsonObj.get("endorserID") != null && !jsonObj.get("endorserID").isJsonNull()) && !jsonObj.get("endorserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `endorserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endorserID").toString())); + } + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactReceiptTransactionEndorsement.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactReceiptTransactionEndorsement' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactReceiptTransactionEndorsement.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactReceiptTransactionEndorsement value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactReceiptTransactionEndorsement read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactReceiptTransactionEndorsement given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactReceiptTransactionEndorsement + * @throws IOException if the JSON string is invalid with respect to TransactReceiptTransactionEndorsement + */ + public static TransactReceiptTransactionEndorsement fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactReceiptTransactionEndorsement.class); + } + + /** + * Convert an instance of TransactReceiptTransactionEndorsement to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java new file mode 100644 index 0000000000..aedda10fa8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * vault key details for signing fabric message with private key stored with transit engine. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VaultTransitKey { + public static final String SERIALIZED_NAME_KEY_NAME = "keyName"; + @SerializedName(SERIALIZED_NAME_KEY_NAME) + private String keyName; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public VaultTransitKey() { + } + + public VaultTransitKey keyName(String keyName) { + + this.keyName = keyName; + return this; + } + + /** + * label of private key + * @return keyName + **/ + @javax.annotation.Nonnull + public String getKeyName() { + return keyName; + } + + + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + + public VaultTransitKey token(String token) { + + this.token = token; + return this; + } + + /** + * token for accessing private key + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + + public void setToken(String token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VaultTransitKey vaultTransitKey = (VaultTransitKey) o; + return Objects.equals(this.keyName, vaultTransitKey.keyName) && + Objects.equals(this.token, vaultTransitKey.token); + } + + @Override + public int hashCode() { + return Objects.hash(keyName, token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VaultTransitKey {\n"); + sb.append(" keyName: ").append(toIndentedString(keyName)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keyName"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keyName"); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to VaultTransitKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!VaultTransitKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VaultTransitKey is not found in the empty JSON string", VaultTransitKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!VaultTransitKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VaultTransitKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VaultTransitKey.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keyName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyName").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VaultTransitKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VaultTransitKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VaultTransitKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VaultTransitKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VaultTransitKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VaultTransitKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of VaultTransitKey + * @throws IOException if the JSON string is invalid with respect to VaultTransitKey + */ + public static VaultTransitKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VaultTransitKey.class); + } + + /** + * Convert an instance of VaultTransitKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java new file mode 100644 index 0000000000..189f2d092e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Error response from WatchBlocks operation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksCactusErrorResponseV1 { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private BigDecimal code; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public WatchBlocksCactusErrorResponseV1() { + } + + public WatchBlocksCactusErrorResponseV1 code(BigDecimal code) { + + this.code = code; + return this; + } + + /** + * Error code. + * @return code + **/ + @javax.annotation.Nonnull + public BigDecimal getCode() { + return code; + } + + + public void setCode(BigDecimal code) { + this.code = code; + } + + + public WatchBlocksCactusErrorResponseV1 errorMessage(String errorMessage) { + + this.errorMessage = errorMessage; + return this; + } + + /** + * Description of the error. + * @return errorMessage + **/ + @javax.annotation.Nonnull + public String getErrorMessage() { + return errorMessage; + } + + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksCactusErrorResponseV1 watchBlocksCactusErrorResponseV1 = (WatchBlocksCactusErrorResponseV1) o; + return Objects.equals(this.code, watchBlocksCactusErrorResponseV1.code) && + Objects.equals(this.errorMessage, watchBlocksCactusErrorResponseV1.errorMessage); + } + + @Override + public int hashCode() { + return Objects.hash(code, errorMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksCactusErrorResponseV1 {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("errorMessage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("errorMessage"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksCactusErrorResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksCactusErrorResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksCactusErrorResponseV1 is not found in the empty JSON string", WatchBlocksCactusErrorResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksCactusErrorResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksCactusErrorResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksCactusErrorResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorMessage").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksCactusErrorResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksCactusErrorResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusErrorResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksCactusErrorResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksCactusErrorResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksCactusErrorResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksCactusErrorResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksCactusErrorResponseV1 + */ + public static WatchBlocksCactusErrorResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksCactusErrorResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksCactusErrorResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java new file mode 100644 index 0000000000..e7c53400c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Transaction summary from commited block. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksCactusTransactionsEventV1 { + public static final String SERIALIZED_NAME_CHAINCODE_ID = "chaincodeId"; + @SerializedName(SERIALIZED_NAME_CHAINCODE_ID) + private String chaincodeId; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public static final String SERIALIZED_NAME_FUNCTION_NAME = "functionName"; + @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) + private String functionName; + + public static final String SERIALIZED_NAME_FUNCTION_ARGS = "functionArgs"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ARGS) + private List functionArgs = new ArrayList<>(); + + public WatchBlocksCactusTransactionsEventV1() { + } + + public WatchBlocksCactusTransactionsEventV1 chaincodeId(String chaincodeId) { + + this.chaincodeId = chaincodeId; + return this; + } + + /** + * ChainCode containing function that was executed. + * @return chaincodeId + **/ + @javax.annotation.Nonnull + public String getChaincodeId() { + return chaincodeId; + } + + + public void setChaincodeId(String chaincodeId) { + this.chaincodeId = chaincodeId; + } + + + public WatchBlocksCactusTransactionsEventV1 transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * Transaction identifier. + * @return transactionId + **/ + @javax.annotation.Nonnull + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + public WatchBlocksCactusTransactionsEventV1 functionName(String functionName) { + + this.functionName = functionName; + return this; + } + + /** + * Function name that was executed. + * @return functionName + **/ + @javax.annotation.Nonnull + public String getFunctionName() { + return functionName; + } + + + public void setFunctionName(String functionName) { + this.functionName = functionName; + } + + + public WatchBlocksCactusTransactionsEventV1 functionArgs(List functionArgs) { + + this.functionArgs = functionArgs; + return this; + } + + public WatchBlocksCactusTransactionsEventV1 addFunctionArgsItem(String functionArgsItem) { + if (this.functionArgs == null) { + this.functionArgs = new ArrayList<>(); + } + this.functionArgs.add(functionArgsItem); + return this; + } + + /** + * List of function arguments. + * @return functionArgs + **/ + @javax.annotation.Nonnull + public List getFunctionArgs() { + return functionArgs; + } + + + public void setFunctionArgs(List functionArgs) { + this.functionArgs = functionArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksCactusTransactionsEventV1 watchBlocksCactusTransactionsEventV1 = (WatchBlocksCactusTransactionsEventV1) o; + return Objects.equals(this.chaincodeId, watchBlocksCactusTransactionsEventV1.chaincodeId) && + Objects.equals(this.transactionId, watchBlocksCactusTransactionsEventV1.transactionId) && + Objects.equals(this.functionName, watchBlocksCactusTransactionsEventV1.functionName) && + Objects.equals(this.functionArgs, watchBlocksCactusTransactionsEventV1.functionArgs); + } + + @Override + public int hashCode() { + return Objects.hash(chaincodeId, transactionId, functionName, functionArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksCactusTransactionsEventV1 {\n"); + sb.append(" chaincodeId: ").append(toIndentedString(chaincodeId)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionArgs: ").append(toIndentedString(functionArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("chaincodeId"); + openapiFields.add("transactionId"); + openapiFields.add("functionName"); + openapiFields.add("functionArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("chaincodeId"); + openapiRequiredFields.add("transactionId"); + openapiRequiredFields.add("functionName"); + openapiRequiredFields.add("functionArgs"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksCactusTransactionsEventV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksCactusTransactionsEventV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksCactusTransactionsEventV1 is not found in the empty JSON string", WatchBlocksCactusTransactionsEventV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksCactusTransactionsEventV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksCactusTransactionsEventV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksCactusTransactionsEventV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("chaincodeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chaincodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chaincodeId").toString())); + } + if (!jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + if (!jsonObj.get("functionName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `functionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("functionName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("functionArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("functionArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `functionArgs` to be an array in the JSON string but got `%s`", jsonObj.get("functionArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksCactusTransactionsEventV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksCactusTransactionsEventV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusTransactionsEventV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksCactusTransactionsEventV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksCactusTransactionsEventV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksCactusTransactionsEventV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksCactusTransactionsEventV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksCactusTransactionsEventV1 + */ + public static WatchBlocksCactusTransactionsEventV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksCactusTransactionsEventV1.class); + } + + /** + * Convert an instance of WatchBlocksCactusTransactionsEventV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java new file mode 100644 index 0000000000..1f5f56a102 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java @@ -0,0 +1,234 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Custom response containing block transactions summary. Compatible with legacy fabric-socketio connector monitoring. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksCactusTransactionsResponseV1 { + public static final String SERIALIZED_NAME_CACTUS_TRANSACTIONS_EVENTS = "cactusTransactionsEvents"; + @SerializedName(SERIALIZED_NAME_CACTUS_TRANSACTIONS_EVENTS) + private List cactusTransactionsEvents = new ArrayList<>(); + + public WatchBlocksCactusTransactionsResponseV1() { + } + + public WatchBlocksCactusTransactionsResponseV1 cactusTransactionsEvents(List cactusTransactionsEvents) { + + this.cactusTransactionsEvents = cactusTransactionsEvents; + return this; + } + + public WatchBlocksCactusTransactionsResponseV1 addCactusTransactionsEventsItem(WatchBlocksCactusTransactionsEventV1 cactusTransactionsEventsItem) { + if (this.cactusTransactionsEvents == null) { + this.cactusTransactionsEvents = new ArrayList<>(); + } + this.cactusTransactionsEvents.add(cactusTransactionsEventsItem); + return this; + } + + /** + * List of transactions summary + * @return cactusTransactionsEvents + **/ + @javax.annotation.Nonnull + public List getCactusTransactionsEvents() { + return cactusTransactionsEvents; + } + + + public void setCactusTransactionsEvents(List cactusTransactionsEvents) { + this.cactusTransactionsEvents = cactusTransactionsEvents; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksCactusTransactionsResponseV1 watchBlocksCactusTransactionsResponseV1 = (WatchBlocksCactusTransactionsResponseV1) o; + return Objects.equals(this.cactusTransactionsEvents, watchBlocksCactusTransactionsResponseV1.cactusTransactionsEvents); + } + + @Override + public int hashCode() { + return Objects.hash(cactusTransactionsEvents); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksCactusTransactionsResponseV1 {\n"); + sb.append(" cactusTransactionsEvents: ").append(toIndentedString(cactusTransactionsEvents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cactusTransactionsEvents"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cactusTransactionsEvents"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksCactusTransactionsResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksCactusTransactionsResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksCactusTransactionsResponseV1 is not found in the empty JSON string", WatchBlocksCactusTransactionsResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksCactusTransactionsResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksCactusTransactionsResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksCactusTransactionsResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cactusTransactionsEvents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cactusTransactionsEvents` to be an array in the JSON string but got `%s`", jsonObj.get("cactusTransactionsEvents").toString())); + } + + JsonArray jsonArraycactusTransactionsEvents = jsonObj.getAsJsonArray("cactusTransactionsEvents"); + // validate the required field `cactusTransactionsEvents` (array) + for (int i = 0; i < jsonArraycactusTransactionsEvents.size(); i++) { + WatchBlocksCactusTransactionsEventV1.validateJsonObject(jsonArraycactusTransactionsEvents.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksCactusTransactionsResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksCactusTransactionsResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusTransactionsResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksCactusTransactionsResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksCactusTransactionsResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksCactusTransactionsResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksCactusTransactionsResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksCactusTransactionsResponseV1 + */ + public static WatchBlocksCactusTransactionsResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksCactusTransactionsResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksCactusTransactionsResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java new file mode 100644 index 0000000000..d01ecc4215 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that corresponds to Fabric SDK 'filtered' EventType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksFilteredResponseV1 { + public static final String SERIALIZED_NAME_FILTERED_BLOCK = "filteredBlock"; + @SerializedName(SERIALIZED_NAME_FILTERED_BLOCK) + private Object filteredBlock = null; + + public WatchBlocksFilteredResponseV1() { + } + + public WatchBlocksFilteredResponseV1 filteredBlock(Object filteredBlock) { + + this.filteredBlock = filteredBlock; + return this; + } + + /** + * Filtered commited block. + * @return filteredBlock + **/ + @javax.annotation.Nullable + public Object getFilteredBlock() { + return filteredBlock; + } + + + public void setFilteredBlock(Object filteredBlock) { + this.filteredBlock = filteredBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksFilteredResponseV1 watchBlocksFilteredResponseV1 = (WatchBlocksFilteredResponseV1) o; + return Objects.equals(this.filteredBlock, watchBlocksFilteredResponseV1.filteredBlock); + } + + @Override + public int hashCode() { + return Objects.hash(filteredBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksFilteredResponseV1 {\n"); + sb.append(" filteredBlock: ").append(toIndentedString(filteredBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filteredBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filteredBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksFilteredResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksFilteredResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksFilteredResponseV1 is not found in the empty JSON string", WatchBlocksFilteredResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksFilteredResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksFilteredResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksFilteredResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksFilteredResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksFilteredResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFilteredResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksFilteredResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksFilteredResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksFilteredResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksFilteredResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksFilteredResponseV1 + */ + public static WatchBlocksFilteredResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksFilteredResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksFilteredResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java new file mode 100644 index 0000000000..c590a038e9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that corresponds to Fabric SDK 'full' EventType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksFullResponseV1 { + public static final String SERIALIZED_NAME_FULL_BLOCK = "fullBlock"; + @SerializedName(SERIALIZED_NAME_FULL_BLOCK) + private Object fullBlock = null; + + public WatchBlocksFullResponseV1() { + } + + public WatchBlocksFullResponseV1 fullBlock(Object fullBlock) { + + this.fullBlock = fullBlock; + return this; + } + + /** + * Full commited block. + * @return fullBlock + **/ + @javax.annotation.Nullable + public Object getFullBlock() { + return fullBlock; + } + + + public void setFullBlock(Object fullBlock) { + this.fullBlock = fullBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksFullResponseV1 watchBlocksFullResponseV1 = (WatchBlocksFullResponseV1) o; + return Objects.equals(this.fullBlock, watchBlocksFullResponseV1.fullBlock); + } + + @Override + public int hashCode() { + return Objects.hash(fullBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksFullResponseV1 {\n"); + sb.append(" fullBlock: ").append(toIndentedString(fullBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fullBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fullBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksFullResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksFullResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksFullResponseV1 is not found in the empty JSON string", WatchBlocksFullResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksFullResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksFullResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksFullResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksFullResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksFullResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFullResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksFullResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksFullResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksFullResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksFullResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksFullResponseV1 + */ + public static WatchBlocksFullResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksFullResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksFullResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java new file mode 100644 index 0000000000..5f6167cfb0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Response type from WatchBlocks. 'Cactus*' are custom views, others correspond to fabric SDK call. + */ +@JsonAdapter(WatchBlocksListenerTypeV1.Adapter.class) +public enum WatchBlocksListenerTypeV1 { + + Filtered("filtered"), + + Full("full"), + + Private("private"), + + CactusTransactions("cactus:transactions"); + + private String value; + + WatchBlocksListenerTypeV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksListenerTypeV1 fromValue(String value) { + for (WatchBlocksListenerTypeV1 b : WatchBlocksListenerTypeV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksListenerTypeV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksListenerTypeV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksListenerTypeV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java new file mode 100644 index 0000000000..26f87f4f2e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.WatchBlocksListenerTypeV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Options passed when subscribing to block monitoring. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksOptionsV1 { + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_GATEWAY_OPTIONS = "gatewayOptions"; + @SerializedName(SERIALIZED_NAME_GATEWAY_OPTIONS) + private GatewayOptions gatewayOptions; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private WatchBlocksListenerTypeV1 type; + + public static final String SERIALIZED_NAME_START_BLOCK = "startBlock"; + @SerializedName(SERIALIZED_NAME_START_BLOCK) + private String startBlock; + + public WatchBlocksOptionsV1() { + } + + public WatchBlocksOptionsV1 channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Hyperledger Fabric channel to connect to. + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public WatchBlocksOptionsV1 gatewayOptions(GatewayOptions gatewayOptions) { + + this.gatewayOptions = gatewayOptions; + return this; + } + + /** + * Get gatewayOptions + * @return gatewayOptions + **/ + @javax.annotation.Nonnull + public GatewayOptions getGatewayOptions() { + return gatewayOptions; + } + + + public void setGatewayOptions(GatewayOptions gatewayOptions) { + this.gatewayOptions = gatewayOptions; + } + + + public WatchBlocksOptionsV1 type(WatchBlocksListenerTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public WatchBlocksListenerTypeV1 getType() { + return type; + } + + + public void setType(WatchBlocksListenerTypeV1 type) { + this.type = type; + } + + + public WatchBlocksOptionsV1 startBlock(String startBlock) { + + this.startBlock = startBlock; + return this; + } + + /** + * From which block start monitoring. Defaults to latest. + * @return startBlock + **/ + @javax.annotation.Nullable + public String getStartBlock() { + return startBlock; + } + + + public void setStartBlock(String startBlock) { + this.startBlock = startBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksOptionsV1 watchBlocksOptionsV1 = (WatchBlocksOptionsV1) o; + return Objects.equals(this.channelName, watchBlocksOptionsV1.channelName) && + Objects.equals(this.gatewayOptions, watchBlocksOptionsV1.gatewayOptions) && + Objects.equals(this.type, watchBlocksOptionsV1.type) && + Objects.equals(this.startBlock, watchBlocksOptionsV1.startBlock); + } + + @Override + public int hashCode() { + return Objects.hash(channelName, gatewayOptions, type, startBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksOptionsV1 {\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" gatewayOptions: ").append(toIndentedString(gatewayOptions)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" startBlock: ").append(toIndentedString(startBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("channelName"); + openapiFields.add("gatewayOptions"); + openapiFields.add("type"); + openapiFields.add("startBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("gatewayOptions"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksOptionsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksOptionsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksOptionsV1 is not found in the empty JSON string", WatchBlocksOptionsV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksOptionsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksOptionsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksOptionsV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + // validate the required field `gatewayOptions` + GatewayOptions.validateJsonObject(jsonObj.getAsJsonObject("gatewayOptions")); + if ((jsonObj.get("startBlock") != null && !jsonObj.get("startBlock").isJsonNull()) && !jsonObj.get("startBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startBlock").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksOptionsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksOptionsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksOptionsV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksOptionsV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksOptionsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksOptionsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksOptionsV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksOptionsV1 + */ + public static WatchBlocksOptionsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksOptionsV1.class); + } + + /** + * Convert an instance of WatchBlocksOptionsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java new file mode 100644 index 0000000000..700fad2664 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that corresponds to Fabric SDK 'private' EventType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksPrivateResponseV1 { + public static final String SERIALIZED_NAME_PRIVATE_BLOCK = "privateBlock"; + @SerializedName(SERIALIZED_NAME_PRIVATE_BLOCK) + private Object privateBlock = null; + + public WatchBlocksPrivateResponseV1() { + } + + public WatchBlocksPrivateResponseV1 privateBlock(Object privateBlock) { + + this.privateBlock = privateBlock; + return this; + } + + /** + * Private commited block. + * @return privateBlock + **/ + @javax.annotation.Nullable + public Object getPrivateBlock() { + return privateBlock; + } + + + public void setPrivateBlock(Object privateBlock) { + this.privateBlock = privateBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksPrivateResponseV1 watchBlocksPrivateResponseV1 = (WatchBlocksPrivateResponseV1) o; + return Objects.equals(this.privateBlock, watchBlocksPrivateResponseV1.privateBlock); + } + + @Override + public int hashCode() { + return Objects.hash(privateBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksPrivateResponseV1 {\n"); + sb.append(" privateBlock: ").append(toIndentedString(privateBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksPrivateResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksPrivateResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksPrivateResponseV1 is not found in the empty JSON string", WatchBlocksPrivateResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksPrivateResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksPrivateResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksPrivateResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksPrivateResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksPrivateResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksPrivateResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksPrivateResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksPrivateResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksPrivateResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksPrivateResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksPrivateResponseV1 + */ + public static WatchBlocksPrivateResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksPrivateResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksPrivateResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java new file mode 100644 index 0000000000..481015921f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java @@ -0,0 +1,447 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksCactusErrorResponseV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsResponseV1; +import org.openapitools.client.model.WatchBlocksFilteredResponseV1; +import org.openapitools.client.model.WatchBlocksFullResponseV1; +import org.openapitools.client.model.WatchBlocksPrivateResponseV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksResponseV1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksResponseV1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWatchBlocksCactusErrorResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusErrorResponseV1.class)); + final TypeAdapter adapterWatchBlocksCactusTransactionsResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusTransactionsResponseV1.class)); + final TypeAdapter adapterWatchBlocksFilteredResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFilteredResponseV1.class)); + final TypeAdapter adapterWatchBlocksFullResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFullResponseV1.class)); + final TypeAdapter adapterWatchBlocksPrivateResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksPrivateResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksResponseV1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `WatchBlocksCactusErrorResponseV1` + if (value.getActualInstance() instanceof WatchBlocksCactusErrorResponseV1) { + JsonObject obj = adapterWatchBlocksCactusErrorResponseV1.toJsonTree((WatchBlocksCactusErrorResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksCactusTransactionsResponseV1` + if (value.getActualInstance() instanceof WatchBlocksCactusTransactionsResponseV1) { + JsonObject obj = adapterWatchBlocksCactusTransactionsResponseV1.toJsonTree((WatchBlocksCactusTransactionsResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksFilteredResponseV1` + if (value.getActualInstance() instanceof WatchBlocksFilteredResponseV1) { + JsonObject obj = adapterWatchBlocksFilteredResponseV1.toJsonTree((WatchBlocksFilteredResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksFullResponseV1` + if (value.getActualInstance() instanceof WatchBlocksFullResponseV1) { + JsonObject obj = adapterWatchBlocksFullResponseV1.toJsonTree((WatchBlocksFullResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksPrivateResponseV1` + if (value.getActualInstance() instanceof WatchBlocksPrivateResponseV1) { + JsonObject obj = adapterWatchBlocksPrivateResponseV1.toJsonTree((WatchBlocksPrivateResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1"); + } + + @Override + public WatchBlocksResponseV1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize WatchBlocksCactusErrorResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksCactusErrorResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksCactusErrorResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksCactusErrorResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksCactusErrorResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksCactusErrorResponseV1'", e); + } + + // deserialize WatchBlocksCactusTransactionsResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksCactusTransactionsResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksCactusTransactionsResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksCactusTransactionsResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksCactusTransactionsResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksCactusTransactionsResponseV1'", e); + } + + // deserialize WatchBlocksFilteredResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksFilteredResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksFilteredResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksFilteredResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksFilteredResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksFilteredResponseV1'", e); + } + + // deserialize WatchBlocksFullResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksFullResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksFullResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksFullResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksFullResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksFullResponseV1'", e); + } + + // deserialize WatchBlocksPrivateResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksPrivateResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksPrivateResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksPrivateResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksPrivateResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksPrivateResponseV1'", e); + } + + if (match == 1) { + WatchBlocksResponseV1 ret = new WatchBlocksResponseV1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksResponseV1: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksResponseV1() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksResponseV1(WatchBlocksCactusErrorResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksCactusTransactionsResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksFilteredResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksFullResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksPrivateResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("WatchBlocksCactusErrorResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksCactusTransactionsResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksFilteredResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksFullResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksPrivateResponseV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksResponseV1.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof WatchBlocksCactusErrorResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksCactusTransactionsResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksFilteredResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksFullResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksPrivateResponseV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1"); + } + + /** + * Get the actual instance, which can be the following: + * WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1 + * + * @return The actual instance (WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksCactusErrorResponseV1`. If the actual instance is not `WatchBlocksCactusErrorResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksCactusErrorResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksCactusErrorResponseV1` + */ + public WatchBlocksCactusErrorResponseV1 getWatchBlocksCactusErrorResponseV1() throws ClassCastException { + return (WatchBlocksCactusErrorResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksCactusTransactionsResponseV1`. If the actual instance is not `WatchBlocksCactusTransactionsResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksCactusTransactionsResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksCactusTransactionsResponseV1` + */ + public WatchBlocksCactusTransactionsResponseV1 getWatchBlocksCactusTransactionsResponseV1() throws ClassCastException { + return (WatchBlocksCactusTransactionsResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksFilteredResponseV1`. If the actual instance is not `WatchBlocksFilteredResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksFilteredResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksFilteredResponseV1` + */ + public WatchBlocksFilteredResponseV1 getWatchBlocksFilteredResponseV1() throws ClassCastException { + return (WatchBlocksFilteredResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksFullResponseV1`. If the actual instance is not `WatchBlocksFullResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksFullResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksFullResponseV1` + */ + public WatchBlocksFullResponseV1 getWatchBlocksFullResponseV1() throws ClassCastException { + return (WatchBlocksFullResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksPrivateResponseV1`. If the actual instance is not `WatchBlocksPrivateResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksPrivateResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksPrivateResponseV1` + */ + public WatchBlocksPrivateResponseV1 getWatchBlocksPrivateResponseV1() throws ClassCastException { + return (WatchBlocksPrivateResponseV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with WatchBlocksCactusErrorResponseV1 + try { + WatchBlocksCactusErrorResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksCactusErrorResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksCactusTransactionsResponseV1 + try { + WatchBlocksCactusTransactionsResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksCactusTransactionsResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksFilteredResponseV1 + try { + WatchBlocksFilteredResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksFilteredResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksFullResponseV1 + try { + WatchBlocksFullResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksFullResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksPrivateResponseV1 + try { + WatchBlocksPrivateResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksPrivateResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksResponseV1 with oneOf schemas: WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksResponseV1 + */ + public static WatchBlocksResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 0000000000..6c04f238eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Websocket requests for monitoring new blocks. + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java new file mode 100644 index 0000000000..771c94ef13 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * web-socket key details for signing fabric message with private key stored with external client + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WebSocketKey { + public static final String SERIALIZED_NAME_SESSION_ID = "sessionId"; + @SerializedName(SERIALIZED_NAME_SESSION_ID) + private String sessionId; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public WebSocketKey() { + } + + public WebSocketKey sessionId(String sessionId) { + + this.sessionId = sessionId; + return this; + } + + /** + * session Id to access client + * @return sessionId + **/ + @javax.annotation.Nonnull + public String getSessionId() { + return sessionId; + } + + + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + + public WebSocketKey signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * signature of the session ID + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebSocketKey webSocketKey = (WebSocketKey) o; + return Objects.equals(this.sessionId, webSocketKey.sessionId) && + Objects.equals(this.signature, webSocketKey.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionId, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebSocketKey {\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionId"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionId"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WebSocketKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WebSocketKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebSocketKey is not found in the empty JSON string", WebSocketKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WebSocketKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebSocketKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebSocketKey.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebSocketKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebSocketKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebSocketKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebSocketKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebSocketKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebSocketKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebSocketKey + * @throws IOException if the JSON string is invalid with respect to WebSocketKey + */ + public static WebSocketKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebSocketKey.class); + } + + /** + * Convert an instance of WebSocketKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..96036af165 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,119 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeployContractGoSourceV1501Response; +import org.openapitools.client.model.DeployContractGoSourceV1Request; +import org.openapitools.client.model.DeployContractGoSourceV1Response; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GetBlockRequestV1; +import org.openapitools.client.model.GetBlockResponseV1; +import org.openapitools.client.model.GetTransactionReceiptResponse; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys a chaincode contract in the form of a go sources. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractGoSourceV1Test() throws ApiException { + DeployContractGoSourceV1Request deployContractGoSourceV1Request = null; + DeployContractGoSourceV1Response response = api.deployContractGoSourceV1(deployContractGoSourceV1Request); + // TODO: test validations + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractV1Test() throws ApiException { + DeployContractV1Request deployContractV1Request = null; + DeployContractV1Response response = api.deployContractV1(deployContractV1Request); + // TODO: test validations + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockV1Test() throws ApiException { + GetBlockRequestV1 getBlockRequestV1 = null; + GetBlockResponseV1 response = api.getBlockV1(getBlockRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTransactionReceiptByTxIDV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + GetTransactionReceiptResponse response = api.getTransactionReceiptByTxIDV1(runTransactionRequest); + // TODO: test validations + } + + /** + * Runs a transaction on a Fabric ledger. + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java new file mode 100644 index 0000000000..9cf63eb4eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ChainCodeLanguageRuntime + */ +public class ChainCodeLanguageRuntimeTest { + /** + * Model tests for ChainCodeLanguageRuntime + */ + @Test + public void testChainCodeLanguageRuntime() { + // TODO: test ChainCodeLanguageRuntime + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java new file mode 100644 index 0000000000..325a87a228 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java @@ -0,0 +1,99 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.SSHExecCommandResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ChainCodeLifeCycleCommandResponses + */ +public class ChainCodeLifeCycleCommandResponsesTest { + private final ChainCodeLifeCycleCommandResponses model = new ChainCodeLifeCycleCommandResponses(); + + /** + * Model tests for ChainCodeLifeCycleCommandResponses + */ + @Test + public void testChainCodeLifeCycleCommandResponses() { + // TODO: test ChainCodeLifeCycleCommandResponses + } + + /** + * Test the property 'packaging' + */ + @Test + public void packagingTest() { + // TODO: test packaging + } + + /** + * Test the property 'installList' + */ + @Test + public void installListTest() { + // TODO: test installList + } + + /** + * Test the property 'queryInstalledList' + */ + @Test + public void queryInstalledListTest() { + // TODO: test queryInstalledList + } + + /** + * Test the property 'approveForMyOrgList' + */ + @Test + public void approveForMyOrgListTest() { + // TODO: test approveForMyOrgList + } + + /** + * Test the property 'commit' + */ + @Test + public void commitTest() { + // TODO: test commit + } + + /** + * Test the property 'queryCommitted' + */ + @Test + public void queryCommittedTest() { + // TODO: test queryCommitted + } + + /** + * Test the property 'init' + */ + @Test + public void initTest() { + // TODO: test init + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java new file mode 100644 index 0000000000..2c0e1a8315 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ChainCodeProgrammingLanguage + */ +public class ChainCodeProgrammingLanguageTest { + /** + * Model tests for ChainCodeProgrammingLanguage + */ + @Test + public void testChainCodeProgrammingLanguage() { + // TODO: test ChainCodeProgrammingLanguage + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java new file mode 100644 index 0000000000..a5838e90be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConnectionProfileClient + */ +public class ConnectionProfileClientTest { + private final ConnectionProfileClient model = new ConnectionProfileClient(); + + /** + * Model tests for ConnectionProfileClient + */ + @Test + public void testConnectionProfileClient() { + // TODO: test ConnectionProfileClient + } + + /** + * Test the property 'organization' + */ + @Test + public void organizationTest() { + // TODO: test organization + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java new file mode 100644 index 0000000000..85d8d650ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java @@ -0,0 +1,123 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.ConnectionProfileClient; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConnectionProfile + */ +public class ConnectionProfileTest { + private final ConnectionProfile model = new ConnectionProfile(); + + /** + * Model tests for ConnectionProfile + */ + @Test + public void testConnectionProfile() { + // TODO: test ConnectionProfile + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'xType' + */ + @Test + public void xTypeTest() { + // TODO: test xType + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + + /** + * Test the property 'channels' + */ + @Test + public void channelsTest() { + // TODO: test channels + } + + /** + * Test the property 'organizations' + */ + @Test + public void organizationsTest() { + // TODO: test organizations + } + + /** + * Test the property 'orderers' + */ + @Test + public void orderersTest() { + // TODO: test orderers + } + + /** + * Test the property 'peers' + */ + @Test + public void peersTest() { + // TODO: test peers + } + + /** + * Test the property 'certificateAuthorities' + */ + @Test + public void certificateAuthoritiesTest() { + // TODO: test certificateAuthorities + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java new file mode 100644 index 0000000000..76fb69940d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DefaultEventHandlerStrategy + */ +public class DefaultEventHandlerStrategyTest { + /** + * Model tests for DefaultEventHandlerStrategy + */ + @Test + public void testDefaultEventHandlerStrategy() { + // TODO: test DefaultEventHandlerStrategy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java new file mode 100644 index 0000000000..fe01deae45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1501Response + */ +public class DeployContractGoSourceV1501ResponseTest { + private final DeployContractGoSourceV1501Response model = new DeployContractGoSourceV1501Response(); + + /** + * Model tests for DeployContractGoSourceV1501Response + */ + @Test + public void testDeployContractGoSourceV1501Response() { + // TODO: test DeployContractGoSourceV1501Response + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java new file mode 100644 index 0000000000..742f15be99 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1RequestConstructorArgs + */ +public class DeployContractGoSourceV1RequestConstructorArgsTest { + private final DeployContractGoSourceV1RequestConstructorArgs model = new DeployContractGoSourceV1RequestConstructorArgs(); + + /** + * Model tests for DeployContractGoSourceV1RequestConstructorArgs + */ + @Test + public void testDeployContractGoSourceV1RequestConstructorArgs() { + // TODO: test DeployContractGoSourceV1RequestConstructorArgs + } + + /** + * Test the property 'args' + */ + @Test + public void argsTest() { + // TODO: test args + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java new file mode 100644 index 0000000000..e44a68dafe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java @@ -0,0 +1,142 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1Request + */ +public class DeployContractGoSourceV1RequestTest { + private final DeployContractGoSourceV1Request model = new DeployContractGoSourceV1Request(); + + /** + * Model tests for DeployContractGoSourceV1Request + */ + @Test + public void testDeployContractGoSourceV1Request() { + // TODO: test DeployContractGoSourceV1Request + } + + /** + * Test the property 'policyDslSource' + */ + @Test + public void policyDslSourceTest() { + // TODO: test policyDslSource + } + + /** + * Test the property 'tlsRootCertFiles' + */ + @Test + public void tlsRootCertFilesTest() { + // TODO: test tlsRootCertFiles + } + + /** + * Test the property 'channelId' + */ + @Test + public void channelIdTest() { + // TODO: test channelId + } + + /** + * Test the property 'targetOrganizations' + */ + @Test + public void targetOrganizationsTest() { + // TODO: test targetOrganizations + } + + /** + * Test the property 'targetPeerAddresses' + */ + @Test + public void targetPeerAddressesTest() { + // TODO: test targetPeerAddresses + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'chainCodeVersion' + */ + @Test + public void chainCodeVersionTest() { + // TODO: test chainCodeVersion + } + + /** + * Test the property 'goSource' + */ + @Test + public void goSourceTest() { + // TODO: test goSource + } + + /** + * Test the property 'goMod' + */ + @Test + public void goModTest() { + // TODO: test goMod + } + + /** + * Test the property 'moduleName' + */ + @Test + public void moduleNameTest() { + // TODO: test moduleName + } + + /** + * Test the property 'pinnedDeps' + */ + @Test + public void pinnedDepsTest() { + // TODO: test pinnedDeps + } + + /** + * Test the property 'modTidyOnly' + */ + @Test + public void modTidyOnlyTest() { + // TODO: test modTidyOnly + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java new file mode 100644 index 0000000000..c0305baee4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.SSHExecCommandResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1Response + */ +public class DeployContractGoSourceV1ResponseTest { + private final DeployContractGoSourceV1Response model = new DeployContractGoSourceV1Response(); + + /** + * Model tests for DeployContractGoSourceV1Response + */ + @Test + public void testDeployContractGoSourceV1Response() { + // TODO: test DeployContractGoSourceV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'installationCommandResponses' + */ + @Test + public void installationCommandResponsesTest() { + // TODO: test installationCommandResponses + } + + /** + * Test the property 'instantiationCommandResponse' + */ + @Test + public void instantiationCommandResponseTest() { + // TODO: test instantiationCommandResponse + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java new file mode 100644 index 0000000000..5ee2016f61 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java @@ -0,0 +1,167 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ChainCodeProgrammingLanguage; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Request + */ +public class DeployContractV1RequestTest { + private final DeployContractV1Request model = new DeployContractV1Request(); + + /** + * Model tests for DeployContractV1Request + */ + @Test + public void testDeployContractV1Request() { + // TODO: test DeployContractV1Request + } + + /** + * Test the property 'ccLang' + */ + @Test + public void ccLangTest() { + // TODO: test ccLang + } + + /** + * Test the property 'caFile' + */ + @Test + public void caFileTest() { + // TODO: test caFile + } + + /** + * Test the property 'orderer' + */ + @Test + public void ordererTest() { + // TODO: test orderer + } + + /** + * Test the property 'ordererTLSHostnameOverride' + */ + @Test + public void ordererTLSHostnameOverrideTest() { + // TODO: test ordererTLSHostnameOverride + } + + /** + * Test the property 'connTimeout' + */ + @Test + public void connTimeoutTest() { + // TODO: test connTimeout + } + + /** + * Test the property 'signaturePolicy' + */ + @Test + public void signaturePolicyTest() { + // TODO: test signaturePolicy + } + + /** + * Test the property 'collectionsConfigFile' + */ + @Test + public void collectionsConfigFileTest() { + // TODO: test collectionsConfigFile + } + + /** + * Test the property 'channelId' + */ + @Test + public void channelIdTest() { + // TODO: test channelId + } + + /** + * Test the property 'targetOrganizations' + */ + @Test + public void targetOrganizationsTest() { + // TODO: test targetOrganizations + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'ccSequence' + */ + @Test + public void ccSequenceTest() { + // TODO: test ccSequence + } + + /** + * Test the property 'ccVersion' + */ + @Test + public void ccVersionTest() { + // TODO: test ccVersion + } + + /** + * Test the property 'ccName' + */ + @Test + public void ccNameTest() { + // TODO: test ccName + } + + /** + * Test the property 'ccLabel' + */ + @Test + public void ccLabelTest() { + // TODO: test ccLabel + } + + /** + * Test the property 'sourceFiles' + */ + @Test + public void sourceFilesTest() { + // TODO: test sourceFiles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java new file mode 100644 index 0000000000..5c8151abeb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ChainCodeLifeCycleCommandResponses; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Response + */ +public class DeployContractV1ResponseTest { + private final DeployContractV1Response model = new DeployContractV1Response(); + + /** + * Model tests for DeployContractV1Response + */ + @Test + public void testDeployContractV1Response() { + // TODO: test DeployContractV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'packageIds' + */ + @Test + public void packageIdsTest() { + // TODO: test packageIds + } + + /** + * Test the property 'lifecycle' + */ + @Test + public void lifecycleTest() { + // TODO: test lifecycle + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java new file mode 100644 index 0000000000..00a79fb8ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java @@ -0,0 +1,88 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeploymentTargetOrgFabric2x + */ +public class DeploymentTargetOrgFabric2xTest { + private final DeploymentTargetOrgFabric2x model = new DeploymentTargetOrgFabric2x(); + + /** + * Model tests for DeploymentTargetOrgFabric2x + */ + @Test + public void testDeploymentTargetOrgFabric2x() { + // TODO: test DeploymentTargetOrgFabric2x + } + + /** + * Test the property '_transient' + */ + @Test + public void _transientTest() { + // TODO: test _transient + } + + /** + * Test the property 'CORE_PEER_LOCALMSPID' + */ + @Test + public void CORE_PEER_LOCALMSPIDTest() { + // TODO: test CORE_PEER_LOCALMSPID + } + + /** + * Test the property 'CORE_PEER_ADDRESS' + */ + @Test + public void CORE_PEER_ADDRESSTest() { + // TODO: test CORE_PEER_ADDRESS + } + + /** + * Test the property 'CORE_PEER_MSPCONFIGPATH' + */ + @Test + public void CORE_PEER_MSPCONFIGPATHTest() { + // TODO: test CORE_PEER_MSPCONFIGPATH + } + + /** + * Test the property 'CORE_PEER_TLS_ROOTCERT_FILE' + */ + @Test + public void CORE_PEER_TLS_ROOTCERT_FILETest() { + // TODO: test CORE_PEER_TLS_ROOTCERT_FILE + } + + /** + * Test the property 'ORDERER_TLS_ROOTCERT_FILE' + */ + @Test + public void ORDERER_TLS_ROOTCERT_FILETest() { + // TODO: test ORDERER_TLS_ROOTCERT_FILE + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java new file mode 100644 index 0000000000..f40c49c81c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeploymentTargetOrganization + */ +public class DeploymentTargetOrganizationTest { + private final DeploymentTargetOrganization model = new DeploymentTargetOrganization(); + + /** + * Model tests for DeploymentTargetOrganization + */ + @Test + public void testDeploymentTargetOrganization() { + // TODO: test DeploymentTargetOrganization + } + + /** + * Test the property 'CORE_PEER_LOCALMSPID' + */ + @Test + public void CORE_PEER_LOCALMSPIDTest() { + // TODO: test CORE_PEER_LOCALMSPID + } + + /** + * Test the property 'CORE_PEER_ADDRESS' + */ + @Test + public void CORE_PEER_ADDRESSTest() { + // TODO: test CORE_PEER_ADDRESS + } + + /** + * Test the property 'CORE_PEER_MSPCONFIGPATH' + */ + @Test + public void CORE_PEER_MSPCONFIGPATHTest() { + // TODO: test CORE_PEER_MSPCONFIGPATH + } + + /** + * Test the property 'CORE_PEER_TLS_ROOTCERT_FILE' + */ + @Test + public void CORE_PEER_TLS_ROOTCERT_FILETest() { + // TODO: test CORE_PEER_TLS_ROOTCERT_FILE + } + + /** + * Test the property 'ORDERER_TLS_ROOTCERT_FILE' + */ + @Test + public void ORDERER_TLS_ROOTCERT_FILETest() { + // TODO: test ORDERER_TLS_ROOTCERT_FILE + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 0000000000..314c1aafcb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java new file mode 100644 index 0000000000..eb7f384a13 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FabricContractInvocationType + */ +public class FabricContractInvocationTypeTest { + /** + * Model tests for FabricContractInvocationType + */ + @Test + public void testFabricContractInvocationType() { + // TODO: test FabricContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java new file mode 100644 index 0000000000..5bb8e03bc6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.FabricSigningCredentialType; +import org.openapitools.client.model.VaultTransitKey; +import org.openapitools.client.model.WebSocketKey; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FabricSigningCredential + */ +public class FabricSigningCredentialTest { + private final FabricSigningCredential model = new FabricSigningCredential(); + + /** + * Model tests for FabricSigningCredential + */ + @Test + public void testFabricSigningCredential() { + // TODO: test FabricSigningCredential + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'vaultTransitKey' + */ + @Test + public void vaultTransitKeyTest() { + // TODO: test vaultTransitKey + } + + /** + * Test the property 'webSocketKey' + */ + @Test + public void webSocketKeyTest() { + // TODO: test webSocketKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java new file mode 100644 index 0000000000..ba749e554c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FabricSigningCredentialType + */ +public class FabricSigningCredentialTypeTest { + /** + * Model tests for FabricSigningCredentialType + */ + @Test + public void testFabricSigningCredentialType() { + // TODO: test FabricSigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java new file mode 100644 index 0000000000..eaa95091a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FileBase64 + */ +public class FileBase64Test { + private final FileBase64 model = new FileBase64(); + + /** + * Model tests for FileBase64 + */ + @Test + public void testFileBase64() { + // TODO: test FileBase64 + } + + /** + * Test the property 'body' + */ + @Test + public void bodyTest() { + // TODO: test body + } + + /** + * Test the property 'filename' + */ + @Test + public void filenameTest() { + // TODO: test filename + } + + /** + * Test the property 'filepath' + */ + @Test + public void filepathTest() { + // TODO: test filepath + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java new file mode 100644 index 0000000000..0bee9a1472 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayDiscoveryOptions + */ +public class GatewayDiscoveryOptionsTest { + private final GatewayDiscoveryOptions model = new GatewayDiscoveryOptions(); + + /** + * Model tests for GatewayDiscoveryOptions + */ + @Test + public void testGatewayDiscoveryOptions() { + // TODO: test GatewayDiscoveryOptions + } + + /** + * Test the property 'asLocalhost' + */ + @Test + public void asLocalhostTest() { + // TODO: test asLocalhost + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java new file mode 100644 index 0000000000..ea2fb3ff59 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.DefaultEventHandlerStrategy; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayEventHandlerOptions + */ +public class GatewayEventHandlerOptionsTest { + private final GatewayEventHandlerOptions model = new GatewayEventHandlerOptions(); + + /** + * Model tests for GatewayEventHandlerOptions + */ + @Test + public void testGatewayEventHandlerOptions() { + // TODO: test GatewayEventHandlerOptions + } + + /** + * Test the property 'commitTimeout' + */ + @Test + public void commitTimeoutTest() { + // TODO: test commitTimeout + } + + /** + * Test the property 'endorseTimeout' + */ + @Test + public void endorseTimeoutTest() { + // TODO: test endorseTimeout + } + + /** + * Test the property 'strategy' + */ + @Test + public void strategyTest() { + // TODO: test strategy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java new file mode 100644 index 0000000000..bae8c91bfa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ConnectionProfile; +import org.openapitools.client.model.GatewayDiscoveryOptions; +import org.openapitools.client.model.GatewayEventHandlerOptions; +import org.openapitools.client.model.GatewayOptionsWallet; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayOptions + */ +public class GatewayOptionsTest { + private final GatewayOptions model = new GatewayOptions(); + + /** + * Model tests for GatewayOptions + */ + @Test + public void testGatewayOptions() { + // TODO: test GatewayOptions + } + + /** + * Test the property 'connectionProfile' + */ + @Test + public void connectionProfileTest() { + // TODO: test connectionProfile + } + + /** + * Test the property 'discovery' + */ + @Test + public void discoveryTest() { + // TODO: test discovery + } + + /** + * Test the property 'eventHandlerOptions' + */ + @Test + public void eventHandlerOptionsTest() { + // TODO: test eventHandlerOptions + } + + /** + * Test the property 'identity' + */ + @Test + public void identityTest() { + // TODO: test identity + } + + /** + * Test the property 'wallet' + */ + @Test + public void walletTest() { + // TODO: test wallet + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java new file mode 100644 index 0000000000..33f14554c0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.FabricSigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayOptionsWallet + */ +public class GatewayOptionsWalletTest { + private final GatewayOptionsWallet model = new GatewayOptionsWallet(); + + /** + * Model tests for GatewayOptionsWallet + */ + @Test + public void testGatewayOptionsWallet() { + // TODO: test GatewayOptionsWallet + } + + /** + * Test the property 'keychain' + */ + @Test + public void keychainTest() { + // TODO: test keychain + } + + /** + * Test the property 'json' + */ + @Test + public void jsonTest() { + // TODO: test json + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java new file mode 100644 index 0000000000..2be46d5e1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestV1QueryBlockHash + */ +public class GetBlockRequestV1QueryBlockHashTest { + private final GetBlockRequestV1QueryBlockHash model = new GetBlockRequestV1QueryBlockHash(); + + /** + * Model tests for GetBlockRequestV1QueryBlockHash + */ + @Test + public void testGetBlockRequestV1QueryBlockHash() { + // TODO: test GetBlockRequestV1QueryBlockHash + } + + /** + * Test the property 'encoding' + */ + @Test + public void encodingTest() { + // TODO: test encoding + } + + /** + * Test the property 'buffer' + */ + @Test + public void bufferTest() { + // TODO: test buffer + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java new file mode 100644 index 0000000000..c6b6582ee5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GetBlockRequestV1QueryBlockHash; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestV1Query + */ +public class GetBlockRequestV1QueryTest { + private final GetBlockRequestV1Query model = new GetBlockRequestV1Query(); + + /** + * Model tests for GetBlockRequestV1Query + */ + @Test + public void testGetBlockRequestV1Query() { + // TODO: test GetBlockRequestV1Query + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java new file mode 100644 index 0000000000..e22eb6b41c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.GetBlockRequestV1Query; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestV1 + */ +public class GetBlockRequestV1Test { + private final GetBlockRequestV1 model = new GetBlockRequestV1(); + + /** + * Model tests for GetBlockRequestV1 + */ + @Test + public void testGetBlockRequestV1() { + // TODO: test GetBlockRequestV1 + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'connectionChannelName' + */ + @Test + public void connectionChannelNameTest() { + // TODO: test connectionChannelName + } + + /** + * Test the property 'gatewayOptions' + */ + @Test + public void gatewayOptionsTest() { + // TODO: test gatewayOptions + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'skipDecode' + */ + @Test + public void skipDecodeTest() { + // TODO: test skipDecode + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java new file mode 100644 index 0000000000..e09b60f124 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockResponseDecodedV1 + */ +public class GetBlockResponseDecodedV1Test { + private final GetBlockResponseDecodedV1 model = new GetBlockResponseDecodedV1(); + + /** + * Model tests for GetBlockResponseDecodedV1 + */ + @Test + public void testGetBlockResponseDecodedV1() { + // TODO: test GetBlockResponseDecodedV1 + } + + /** + * Test the property 'decodedBlock' + */ + @Test + public void decodedBlockTest() { + // TODO: test decodedBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java new file mode 100644 index 0000000000..660d9696b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockResponseEncodedV1 + */ +public class GetBlockResponseEncodedV1Test { + private final GetBlockResponseEncodedV1 model = new GetBlockResponseEncodedV1(); + + /** + * Model tests for GetBlockResponseEncodedV1 + */ + @Test + public void testGetBlockResponseEncodedV1() { + // TODO: test GetBlockResponseEncodedV1 + } + + /** + * Test the property 'encodedBlock' + */ + @Test + public void encodedBlockTest() { + // TODO: test encodedBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java new file mode 100644 index 0000000000..0a01cee27e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GetBlockResponseDecodedV1; +import org.openapitools.client.model.GetBlockResponseEncodedV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockResponseV1 + */ +public class GetBlockResponseV1Test { + private final GetBlockResponseV1 model = new GetBlockResponseV1(); + + /** + * Model tests for GetBlockResponseV1 + */ + @Test + public void testGetBlockResponseV1() { + // TODO: test GetBlockResponseV1 + } + + /** + * Test the property 'decodedBlock' + */ + @Test + public void decodedBlockTest() { + // TODO: test decodedBlock + } + + /** + * Test the property 'encodedBlock' + */ + @Test + public void encodedBlockTest() { + // TODO: test encodedBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java new file mode 100644 index 0000000000..829d50dfd7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java @@ -0,0 +1,125 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.TransactReceiptBlockMetaData; +import org.openapitools.client.model.TransactReceiptTransactionCreator; +import org.openapitools.client.model.TransactReceiptTransactionEndorsement; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionReceiptResponse + */ +public class GetTransactionReceiptResponseTest { + private final GetTransactionReceiptResponse model = new GetTransactionReceiptResponse(); + + /** + * Model tests for GetTransactionReceiptResponse + */ + @Test + public void testGetTransactionReceiptResponse() { + // TODO: test GetTransactionReceiptResponse + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'channelID' + */ + @Test + public void channelIDTest() { + // TODO: test channelID + } + + /** + * Test the property 'transactionCreator' + */ + @Test + public void transactionCreatorTest() { + // TODO: test transactionCreator + } + + /** + * Test the property 'transactionEndorsement' + */ + @Test + public void transactionEndorsementTest() { + // TODO: test transactionEndorsement + } + + /** + * Test the property 'blockMetaData' + */ + @Test + public void blockMetaDataTest() { + // TODO: test blockMetaData + } + + /** + * Test the property 'chainCodeName' + */ + @Test + public void chainCodeNameTest() { + // TODO: test chainCodeName + } + + /** + * Test the property 'chainCodeVersion' + */ + @Test + public void chainCodeVersionTest() { + // TODO: test chainCodeVersion + } + + /** + * Test the property 'responseStatus' + */ + @Test + public void responseStatusTest() { + // TODO: test responseStatus + } + + /** + * Test the property 'rwsetKey' + */ + @Test + public void rwsetKeyTest() { + // TODO: test rwsetKey + } + + /** + * Test the property 'rwsetWriteData' + */ + @Test + public void rwsetWriteDataTest() { + // TODO: test rwsetWriteData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 0000000000..cee9e82ad0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.FabricContractInvocationType; +import org.openapitools.client.model.FabricSigningCredential; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'endorsingPeers' + */ + @Test + public void endorsingPeersTest() { + // TODO: test endorsingPeers + } + + /** + * Test the property 'transientData' + */ + @Test + public void transientDataTest() { + // TODO: test transientData + } + + /** + * Test the property 'gatewayOptions' + */ + @Test + public void gatewayOptionsTest() { + // TODO: test gatewayOptions + } + + /** + * Test the property 'signingCredential' + */ + @Test + public void signingCredentialTest() { + // TODO: test signingCredential + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'endorsingParties' + */ + @Test + public void endorsingPartiesTest() { + // TODO: test endorsingParties + } + + /** + * Test the property 'responseType' + */ + @Test + public void responseTypeTest() { + // TODO: test responseType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..3eb60c0fd6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'functionOutput' + */ + @Test + public void functionOutputTest() { + // TODO: test functionOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java new file mode 100644 index 0000000000..9c6d101736 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SSHExecCommandResponse + */ +public class SSHExecCommandResponseTest { + private final SSHExecCommandResponse model = new SSHExecCommandResponse(); + + /** + * Model tests for SSHExecCommandResponse + */ + @Test + public void testSSHExecCommandResponse() { + // TODO: test SSHExecCommandResponse + } + + /** + * Test the property 'stdout' + */ + @Test + public void stdoutTest() { + // TODO: test stdout + } + + /** + * Test the property 'stderr' + */ + @Test + public void stderrTest() { + // TODO: test stderr + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'signal' + */ + @Test + public void signalTest() { + // TODO: test signal + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java new file mode 100644 index 0000000000..1925bb83ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactReceiptBlockMetaData + */ +public class TransactReceiptBlockMetaDataTest { + private final TransactReceiptBlockMetaData model = new TransactReceiptBlockMetaData(); + + /** + * Model tests for TransactReceiptBlockMetaData + */ + @Test + public void testTransactReceiptBlockMetaData() { + // TODO: test TransactReceiptBlockMetaData + } + + /** + * Test the property 'mspid' + */ + @Test + public void mspidTest() { + // TODO: test mspid + } + + /** + * Test the property 'blockCreatorID' + */ + @Test + public void blockCreatorIDTest() { + // TODO: test blockCreatorID + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java new file mode 100644 index 0000000000..24aea3186e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactReceiptTransactionCreator + */ +public class TransactReceiptTransactionCreatorTest { + private final TransactReceiptTransactionCreator model = new TransactReceiptTransactionCreator(); + + /** + * Model tests for TransactReceiptTransactionCreator + */ + @Test + public void testTransactReceiptTransactionCreator() { + // TODO: test TransactReceiptTransactionCreator + } + + /** + * Test the property 'mspid' + */ + @Test + public void mspidTest() { + // TODO: test mspid + } + + /** + * Test the property 'creatorID' + */ + @Test + public void creatorIDTest() { + // TODO: test creatorID + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java new file mode 100644 index 0000000000..1d04835b78 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactReceiptTransactionEndorsement + */ +public class TransactReceiptTransactionEndorsementTest { + private final TransactReceiptTransactionEndorsement model = new TransactReceiptTransactionEndorsement(); + + /** + * Model tests for TransactReceiptTransactionEndorsement + */ + @Test + public void testTransactReceiptTransactionEndorsement() { + // TODO: test TransactReceiptTransactionEndorsement + } + + /** + * Test the property 'mspid' + */ + @Test + public void mspidTest() { + // TODO: test mspid + } + + /** + * Test the property 'endorserID' + */ + @Test + public void endorserIDTest() { + // TODO: test endorserID + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java new file mode 100644 index 0000000000..0f85c1af30 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for VaultTransitKey + */ +public class VaultTransitKeyTest { + private final VaultTransitKey model = new VaultTransitKey(); + + /** + * Model tests for VaultTransitKey + */ + @Test + public void testVaultTransitKey() { + // TODO: test VaultTransitKey + } + + /** + * Test the property 'keyName' + */ + @Test + public void keyNameTest() { + // TODO: test keyName + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + // TODO: test token + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java new file mode 100644 index 0000000000..051a542536 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksCactusErrorResponseV1 + */ +public class WatchBlocksCactusErrorResponseV1Test { + private final WatchBlocksCactusErrorResponseV1 model = new WatchBlocksCactusErrorResponseV1(); + + /** + * Model tests for WatchBlocksCactusErrorResponseV1 + */ + @Test + public void testWatchBlocksCactusErrorResponseV1() { + // TODO: test WatchBlocksCactusErrorResponseV1 + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'errorMessage' + */ + @Test + public void errorMessageTest() { + // TODO: test errorMessage + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java new file mode 100644 index 0000000000..88ec9f078c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksCactusTransactionsEventV1 + */ +public class WatchBlocksCactusTransactionsEventV1Test { + private final WatchBlocksCactusTransactionsEventV1 model = new WatchBlocksCactusTransactionsEventV1(); + + /** + * Model tests for WatchBlocksCactusTransactionsEventV1 + */ + @Test + public void testWatchBlocksCactusTransactionsEventV1() { + // TODO: test WatchBlocksCactusTransactionsEventV1 + } + + /** + * Test the property 'chaincodeId' + */ + @Test + public void chaincodeIdTest() { + // TODO: test chaincodeId + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + + /** + * Test the property 'functionName' + */ + @Test + public void functionNameTest() { + // TODO: test functionName + } + + /** + * Test the property 'functionArgs' + */ + @Test + public void functionArgsTest() { + // TODO: test functionArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java new file mode 100644 index 0000000000..f807ee8ca5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java @@ -0,0 +1,51 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksCactusTransactionsResponseV1 + */ +public class WatchBlocksCactusTransactionsResponseV1Test { + private final WatchBlocksCactusTransactionsResponseV1 model = new WatchBlocksCactusTransactionsResponseV1(); + + /** + * Model tests for WatchBlocksCactusTransactionsResponseV1 + */ + @Test + public void testWatchBlocksCactusTransactionsResponseV1() { + // TODO: test WatchBlocksCactusTransactionsResponseV1 + } + + /** + * Test the property 'cactusTransactionsEvents' + */ + @Test + public void cactusTransactionsEventsTest() { + // TODO: test cactusTransactionsEvents + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java new file mode 100644 index 0000000000..b6c6304308 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksFilteredResponseV1 + */ +public class WatchBlocksFilteredResponseV1Test { + private final WatchBlocksFilteredResponseV1 model = new WatchBlocksFilteredResponseV1(); + + /** + * Model tests for WatchBlocksFilteredResponseV1 + */ + @Test + public void testWatchBlocksFilteredResponseV1() { + // TODO: test WatchBlocksFilteredResponseV1 + } + + /** + * Test the property 'filteredBlock' + */ + @Test + public void filteredBlockTest() { + // TODO: test filteredBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java new file mode 100644 index 0000000000..6f5ea3d43a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksFullResponseV1 + */ +public class WatchBlocksFullResponseV1Test { + private final WatchBlocksFullResponseV1 model = new WatchBlocksFullResponseV1(); + + /** + * Model tests for WatchBlocksFullResponseV1 + */ + @Test + public void testWatchBlocksFullResponseV1() { + // TODO: test WatchBlocksFullResponseV1 + } + + /** + * Test the property 'fullBlock' + */ + @Test + public void fullBlockTest() { + // TODO: test fullBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java new file mode 100644 index 0000000000..e67885ba1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksListenerTypeV1 + */ +public class WatchBlocksListenerTypeV1Test { + /** + * Model tests for WatchBlocksListenerTypeV1 + */ + @Test + public void testWatchBlocksListenerTypeV1() { + // TODO: test WatchBlocksListenerTypeV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java new file mode 100644 index 0000000000..1c4eb86379 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.WatchBlocksListenerTypeV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksOptionsV1 + */ +public class WatchBlocksOptionsV1Test { + private final WatchBlocksOptionsV1 model = new WatchBlocksOptionsV1(); + + /** + * Model tests for WatchBlocksOptionsV1 + */ + @Test + public void testWatchBlocksOptionsV1() { + // TODO: test WatchBlocksOptionsV1 + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'gatewayOptions' + */ + @Test + public void gatewayOptionsTest() { + // TODO: test gatewayOptions + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'startBlock' + */ + @Test + public void startBlockTest() { + // TODO: test startBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java new file mode 100644 index 0000000000..dd7457694b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksPrivateResponseV1 + */ +public class WatchBlocksPrivateResponseV1Test { + private final WatchBlocksPrivateResponseV1 model = new WatchBlocksPrivateResponseV1(); + + /** + * Model tests for WatchBlocksPrivateResponseV1 + */ + @Test + public void testWatchBlocksPrivateResponseV1() { + // TODO: test WatchBlocksPrivateResponseV1 + } + + /** + * Test the property 'privateBlock' + */ + @Test + public void privateBlockTest() { + // TODO: test privateBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java new file mode 100644 index 0000000000..0f634f85f3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java @@ -0,0 +1,97 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksCactusErrorResponseV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsResponseV1; +import org.openapitools.client.model.WatchBlocksFilteredResponseV1; +import org.openapitools.client.model.WatchBlocksFullResponseV1; +import org.openapitools.client.model.WatchBlocksPrivateResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksResponseV1 + */ +public class WatchBlocksResponseV1Test { + private final WatchBlocksResponseV1 model = new WatchBlocksResponseV1(); + + /** + * Model tests for WatchBlocksResponseV1 + */ + @Test + public void testWatchBlocksResponseV1() { + // TODO: test WatchBlocksResponseV1 + } + + /** + * Test the property 'cactusTransactionsEvents' + */ + @Test + public void cactusTransactionsEventsTest() { + // TODO: test cactusTransactionsEvents + } + + /** + * Test the property 'fullBlock' + */ + @Test + public void fullBlockTest() { + // TODO: test fullBlock + } + + /** + * Test the property 'filteredBlock' + */ + @Test + public void filteredBlockTest() { + // TODO: test filteredBlock + } + + /** + * Test the property 'privateBlock' + */ + @Test + public void privateBlockTest() { + // TODO: test privateBlock + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'errorMessage' + */ + @Test + public void errorMessageTest() { + // TODO: test errorMessage + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 0000000000..32d212cc57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java new file mode 100644 index 0000000000..1c1ab9dbb8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WebSocketKey + */ +public class WebSocketKeyTest { + private final WebSocketKey model = new WebSocketKey(); + + /** + * Model tests for WebSocketKey + */ + @Test + public void testWebSocketKey() { + // TODO: test WebSocketKey + } + + /** + * Test the property 'sessionId' + */ + @Test + public void sessionIdTest() { + // TODO: test sessionId + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/package.json b/packages/cactus-plugin-ledger-connector-iroha/package.json index 565451d3e2..2764b3d49d 100644 --- a/packages/cactus-plugin-ledger-connector-iroha/package.json +++ b/packages/cactus-plugin-ledger-connector-iroha/package.json @@ -47,7 +47,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 0000000000..f92c7cdd32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_add_asset_quantity_request_parameters.go +model_add_peer_request_parameters.go +model_add_signatory_request_parameters.go +model_append_role_request_parameters.go +model_call_engine_request_parameters.go +model_compare_and_set_account_detail_request_parameters.go +model_create_account_request_parameters.go +model_create_asset_request_parameters.go +model_create_domain_request_parameters.go +model_create_role_request_parameters.go +model_detach_role_request_parameters.go +model_error_exception_json_response_v1.go +model_error_exception_response_v1.go +model_generate_transaction_request_v1.go +model_get_account_asset_transactions_request_parameters.go +model_get_account_assets_request_parameters.go +model_get_account_detail_request_parameters.go +model_get_account_request_parameters.go +model_get_account_transactions_request_parameters.go +model_get_asset_info_request_parameters.go +model_get_block_request_parameters.go +model_get_engine_receipts_request_parameters.go +model_get_pending_transactions_request_parameters.go +model_get_role_permissions_request_parameters.go +model_get_signatories_request_parameters.go +model_get_transactions_request_parameters.go +model_grant_permission_request_parameters.go +model_iroha_base_config.go +model_iroha_block_progress.go +model_iroha_block_response.go +model_iroha_block_response_payload.go +model_iroha_command.go +model_iroha_query.go +model_iroha_socket_io_transact_v1.go +model_key_pair.go +model_remove_peer_request_parameters.go +model_remove_signatory_request_parameters.go +model_revoke_permission_request_parameters.go +model_run_transaction_request_v1.go +model_run_transaction_request_v1_body.go +model_run_transaction_request_v1_params.go +model_run_transaction_response.go +model_run_transaction_signed_request_v1.go +model_set_account_detail_request_parameters.go +model_set_account_quorum_request_parameters.go +model_subtract_asset_quantity_request_parameters.go +model_transfer_asset_request_parameters.go +model_watch_blocks_v1.go +response.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 0000000000..bc904229cd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,161 @@ +# Go API client for cactus-plugin-ledger-connector-iroha + +Can perform basic tasks on a Iroha ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-iroha "github.com/hyperledger/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GenerateTransactionV1**](docs/DefaultApi.md#generatetransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction | Executes a transaction on a Iroha ledger + + +## Documentation For Models + + - [AddAssetQuantityRequestParameters](docs/AddAssetQuantityRequestParameters.md) + - [AddPeerRequestParameters](docs/AddPeerRequestParameters.md) + - [AddSignatoryRequestParameters](docs/AddSignatoryRequestParameters.md) + - [AppendRoleRequestParameters](docs/AppendRoleRequestParameters.md) + - [CallEngineRequestParameters](docs/CallEngineRequestParameters.md) + - [CompareAndSetAccountDetailRequestParameters](docs/CompareAndSetAccountDetailRequestParameters.md) + - [CreateAccountRequestParameters](docs/CreateAccountRequestParameters.md) + - [CreateAssetRequestParameters](docs/CreateAssetRequestParameters.md) + - [CreateDomainRequestParameters](docs/CreateDomainRequestParameters.md) + - [CreateRoleRequestParameters](docs/CreateRoleRequestParameters.md) + - [DetachRoleRequestParameters](docs/DetachRoleRequestParameters.md) + - [ErrorExceptionJsonResponseV1](docs/ErrorExceptionJsonResponseV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GetAccountAssetTransactionsRequestParameters](docs/GetAccountAssetTransactionsRequestParameters.md) + - [GetAccountAssetsRequestParameters](docs/GetAccountAssetsRequestParameters.md) + - [GetAccountDetailRequestParameters](docs/GetAccountDetailRequestParameters.md) + - [GetAccountRequestParameters](docs/GetAccountRequestParameters.md) + - [GetAccountTransactionsRequestParameters](docs/GetAccountTransactionsRequestParameters.md) + - [GetAssetInfoRequestParameters](docs/GetAssetInfoRequestParameters.md) + - [GetBlockRequestParameters](docs/GetBlockRequestParameters.md) + - [GetEngineReceiptsRequestParameters](docs/GetEngineReceiptsRequestParameters.md) + - [GetPendingTransactionsRequestParameters](docs/GetPendingTransactionsRequestParameters.md) + - [GetRolePermissionsRequestParameters](docs/GetRolePermissionsRequestParameters.md) + - [GetSignatoriesRequestParameters](docs/GetSignatoriesRequestParameters.md) + - [GetTransactionsRequestParameters](docs/GetTransactionsRequestParameters.md) + - [GrantPermissionRequestParameters](docs/GrantPermissionRequestParameters.md) + - [IrohaBaseConfig](docs/IrohaBaseConfig.md) + - [IrohaBlockProgress](docs/IrohaBlockProgress.md) + - [IrohaBlockResponse](docs/IrohaBlockResponse.md) + - [IrohaBlockResponsePayload](docs/IrohaBlockResponsePayload.md) + - [IrohaCommand](docs/IrohaCommand.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaSocketIOTransactV1](docs/IrohaSocketIOTransactV1.md) + - [KeyPair](docs/KeyPair.md) + - [RemovePeerRequestParameters](docs/RemovePeerRequestParameters.md) + - [RemoveSignatoryRequestParameters](docs/RemoveSignatoryRequestParameters.md) + - [RevokePermissionRequestParameters](docs/RevokePermissionRequestParameters.md) + - [RunTransactionRequestV1](docs/RunTransactionRequestV1.md) + - [RunTransactionRequestV1Body](docs/RunTransactionRequestV1Body.md) + - [RunTransactionRequestV1Params](docs/RunTransactionRequestV1Params.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [RunTransactionSignedRequestV1](docs/RunTransactionSignedRequestV1.md) + - [SetAccountDetailRequestParameters](docs/SetAccountDetailRequestParameters.md) + - [SetAccountQuorumRequestParameters](docs/SetAccountQuorumRequestParameters.md) + - [SubtractAssetQuantityRequestParameters](docs/SubtractAssetQuantityRequestParameters.md) + - [TransferAssetRequestParameters](docs/TransferAssetRequestParameters.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..53aaa351e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,897 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequestV1Body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Bad Request error. + "405": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Method Not Allowed error. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + application/octet-stream: + schema: + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Bad Request Error + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics +components: + schemas: + IrohaCommand: + enum: + - createAccount + - setAccountDetail + - setAccountQuorum + - compareAndSetAccountDetail + - createAsset + - addAssetQuantity + - subtractAssetQuantity + - transferAsset + - createDomain + - createRole + - detachRole + - appendRole + - addSignatory + - removeSignatory + - grantPermission + - revokePermission + - addPeer + - removePeer + - setSettingValue + - callEngine + type: string + x-enum-descriptions: + - "Make entity in the system, capable of sending transactions or queries, storing\ + \ signatories, personal data and identifiers." + - Set key-value information for a given account. + - "Set the number of signatories required to confirm the identity of a user,\ + \ who creates the transaction." + - Set key-value information for a given account if the old value matches the + value passed. + - "Create a new type of asset, unique in a domain. An asset is a countable representation\ + \ of a commodity." + - Increase the quantity of an asset on account of transaction creator. + - Decrease the number of assets on account of transaction creator. + - "Share assets within the account in peer network: in the way that source account\ + \ transfers assets to the target account." + - "Make new domain in Iroha network, which is a group of accounts." + - Create a new role in the system from the set of permissions. + - Detach a role from the set of roles of an account. + - "Promote an account to some created role in the system, where a role is a\ + \ set of permissions account has to perform an action (command or query)." + - Add an identifier to the account. Such identifier is a public key of another + device or a public key of another user. + - "Remove a public key, associated with an identity, from an account" + - Give another account rights to perform actions on the account of transaction + sender (give someone right to do something with my account). + - Revoke or dismiss given granted permission from another account in the network. + - Write into ledger the fact of peer addition into the peer network. + - Write into ledger the fact of peer removal from the network. + - "This command is not available for use, it was added for backward compatibility\ + \ with Iroha." + - This command is not availalbe for use because it is related to smart contract. + x-enum-varnames: + - CreateAccount + - SetAccountDetail + - SetAccountQuorum + - CompareAndSetAccountDetail + - CreateAsset + - AddAssetQuantity + - SubtractAssetQuantity + - TransferAsset + - CreateDomain + - CreateRole + - DetachRole + - AppendRole + - AddSignatory + - RemoveSignatory + - GrantPermission + - RevokePermission + - AddPeer + - RemovePeer + - SetSettingValue + - CallEngine + IrohaQuery: + enum: + - getAccount + - getAccountDetail + - getAssetInfo + - getAccountAssets + - getTransactions + - getPendingTransactions + - getAccountTransactions + - getAccountAssetTransactions + - getRoles + - getSignatories + - getRolePermissions + - getBlock + - getEngineReceipts + - fetchCommits + - getPeers + type: string + x-enum-descriptions: + - To get the state of an account + - To get details of the account. + - To get information on the given asset (as for now - its precision). + - To get the state of all assets in an account (a balance). + - "To retrieve information about transactions, based on their hashes." + - To retrieve a list of pending (not fully signed) multisignature transactions + or batches of transactions issued by account of query creator. + - To retrieve a list of transactions per account. + - To retrieve all transactions associated with given account and asset. + - To get existing roles in the system. + - "To get signatories, which act as an identity of the account." + - To get available permissions per role in the system. + - "To get a specific block, using its height as an identifier." + - To retrieve a receipt of a CallEngine command. Allows to access the event + log created during computations inside the EVM. + - "To get new blocks as soon as they are committed, a user can invoke FetchCommits\ + \ RPC call to Iroha network." + - A query that returns a list of peers in Iroha network. + x-enum-varnames: + - GetAccount + - GetAccountDetail + - GetAssetInfo + - GetAccountAssets + - GetTransactions + - GetPendingTransactions + - GetAccountTransactions + - GetAccountAssetTransactions + - GetRoles + - GetSignatories + - GetRolePermissions + - GetBlock + - GetEngineReceipts + - FetchCommits + - GetPeers + KeyPair: + properties: + publicKey: + description: SHA-3 ed25519 public keys of length 64 are recommended. + example: 313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910 + nullable: false + type: string + privateKey: + description: SHA-3 ed25519 private keys of length 64 are recommended. + example: f101537e319568c765b2cc89698325604991dca57b9716b58016b253506cab70 + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + RunTransactionRequestV1Params: + oneOf: + - items: {} + type: array + - $ref: '#/components/schemas/AddAssetQuantityRequestParameters' + - $ref: '#/components/schemas/AddPeerRequestParameters' + - $ref: '#/components/schemas/AddSignatoryRequestParameters' + - $ref: '#/components/schemas/AppendRoleRequestParameters' + - $ref: '#/components/schemas/CallEngineRequestParameters' + - $ref: '#/components/schemas/CreateAccountRequestParameters' + - $ref: '#/components/schemas/CreateAssetRequestParameters' + - $ref: '#/components/schemas/CreateDomainRequestParameters' + - $ref: '#/components/schemas/CreateRoleRequestParameters' + - $ref: '#/components/schemas/DetachRoleRequestParameters' + - $ref: '#/components/schemas/GrantPermissionRequestParameters' + - $ref: '#/components/schemas/RemovePeerRequestParameters' + - $ref: '#/components/schemas/RemoveSignatoryRequestParameters' + - $ref: '#/components/schemas/RevokePermissionRequestParameters' + - $ref: '#/components/schemas/SetAccountDetailRequestParameters' + - $ref: '#/components/schemas/SetAccountQuorumRequestParameters' + - $ref: '#/components/schemas/SubtractAssetQuantityRequestParameters' + - $ref: '#/components/schemas/TransferAssetRequestParameters' + - $ref: '#/components/schemas/CompareAndSetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAccountRequestParameters' + - $ref: '#/components/schemas/GetBlockRequestParameters' + - $ref: '#/components/schemas/GetSignatoriesRequestParameters' + - $ref: '#/components/schemas/GetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetPendingTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetsRequestParameters' + - $ref: '#/components/schemas/GetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAssetInfoRequestParameters' + - $ref: '#/components/schemas/GetRolePermissionsRequestParameters' + - $ref: '#/components/schemas/GetEngineReceiptsRequestParameters' + RunTransactionRequestV1Body: + oneOf: + - $ref: '#/components/schemas/RunTransactionRequestV1' + - $ref: '#/components/schemas/RunTransactionSignedRequestV1' + RunTransactionRequestV1: + additionalProperties: false + properties: + commandName: + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + params: + $ref: '#/components/schemas/RunTransactionRequestV1Params' + required: + - baseConfig + - commandName + - params + type: object + AddAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + AddPeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Peer. + properties: + address: + type: string + peerKey: + type: string + tlsCertificate: + type: string + syncingPeer: + type: boolean + required: + - address + - peerKey + type: object + AddSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + AppendRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Append Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + CallEngineRequestParameters: + description: The list of arguments to pass in to the transaction request to + Call Engine. + properties: + caller: + type: string + callee: + type: string + input: + type: string + required: + - callee + - caller + - input + type: object + CreateAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Account. + properties: + accountName: + type: string + domainId: + type: string + publicKey: + type: string + required: + - accountName + - domainId + - publicKey + type: object + CreateAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Asset. + properties: + assetName: + type: string + domainId: + type: string + precision: + type: integer + required: + - assetName + - domainId + - precision + type: object + CreateDomainRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Domain. + properties: + domainId: + type: string + defaultRole: + type: string + required: + - defaultRole + - domainId + type: object + CreateRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Role. + properties: + roleName: + type: string + permissionsList: + items: + type: number + type: array + required: + - permissionsList + - roleName + type: object + DetachRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Detach Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + GrantPermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Grant Permission. + properties: + accountId: + type: string + permission: + type: string + required: + - accountId + - permission + type: object + RemovePeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Peer. + properties: + publicKey: + type: string + required: + - publicKey + type: object + RemoveSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + RevokePermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Revoke Permission. + properties: + accountId: + type: string + permission: + type: number + required: + - accountId + - permission + type: object + SetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + required: + - accountId + - key + - value + type: object + SetAccountQuorumRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Quorum. + properties: + accountId: + type: string + quorum: + type: integer + required: + - accountId + - quorum + type: object + SubtractAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Subtract Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + TransferAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Transfer Asset. + properties: + srcAccountId: + type: string + destAccountId: + type: string + assetId: + type: string + description: + type: string + amount: + type: number + required: + - amount + - assetId + - description + - destAccountId + - srcAccountId + type: object + CompareAndSetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Compare And Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + oldValue: + type: string + check_empty: + type: boolean + required: + - accountId + - check_empty + - key + - value + type: object + GetAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account. + properties: + accountId: + type: string + required: + - accountId + type: object + GetBlockRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Block. + properties: + height: + type: integer + required: + - height + type: object + GetSignatoriesRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Signatories. + properties: + accountId: + type: string + required: + - accountId + type: object + GetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Transactions. + properties: + txHashesList: + items: + type: string + type: array + required: + - txHashesList + type: object + GetPendingTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Pending Transactions. + properties: + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + required: + - pageSize + type: object + GetAccountTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Transactions. + properties: + accountId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + firstTxHeight: + type: integer + lastTxHeight: + type: integer + required: + - accountId + - firstTxHash + - pageSize + type: object + GetAccountAssetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Asset Transactions. + properties: + accountId: + type: string + assetId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + required: + - accountId + - assetId + - firstTxHash + - pageSize + type: object + GetAccountAssetsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Assets. + properties: + accountId: + type: string + pageSize: + type: number + firstAssetId: + type: string + required: + - accountId + - pageSize + type: object + GetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Detail. + properties: + accountId: + type: string + key: + type: string + writer: + type: string + pageSize: + type: integer + paginationKey: + type: string + paginationWriter: + type: string + required: + - pageSize + - paginationKey + - paginationWriter + type: object + GetAssetInfoRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Asset Info. + properties: + assetId: + type: string + required: + - assetId + type: object + GetRolePermissionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Role Permissions. + properties: + roleId: + type: string + required: + - roleId + type: object + GetEngineReceiptsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Engine Receipts. + properties: + txHash: + type: string + required: + - txHash + type: object + RunTransactionSignedRequestV1: + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + required: + - signedTransaction + type: object + GenerateTransactionRequestV1: + additionalProperties: false + example: + creatorAccountId: creatorAccountId + commandName: "" + commandParams: "{}" + quorum: 0.8008281904610115 + properties: + commandName: + description: Iroha command name. + nullable: false + type: IrohaCommand + commandParams: + description: Parameters for iroha command specified in commandName + type: object + creatorAccountId: + description: Sender account id + nullable: false + type: string + quorum: + default: 1 + description: Requested transaction quorum + nullable: false + type: number + required: + - commandName + - commandParams + - creatorAccountId + type: object + IrohaBaseConfig: + additionalProperties: true + properties: + irohaHost: + nullable: false + type: string + irohaPort: + nullable: false + type: number + creatorAccountId: + nullable: false + type: string + privKey: + default: [] + items: {} + nullable: false + type: array + quorum: + nullable: false + type: number + timeoutLimit: + nullable: false + type: number + tls: + description: Can only be set to false for an insecure grpc connection. + nullable: false + type: boolean + monitorMode: + description: Flag used for monitoring. It changes default beahviour of transaction + wrapper so it return error to caller instead of throwing RuntimeError + straight away. + nullable: true + type: boolean + type: object + RunTransactionResponse: + example: + transactionReceipt: "" + properties: + transactionReceipt: {} + required: + - transactionReceipt + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + ErrorExceptionJsonResponseV1: + properties: + message: + nullable: false + type: string + name: + nullable: false + type: string + error: + nullable: false + type: string + stack: + nullable: false + type: string + cause: + nullable: false + type: string + required: + - message + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + - SendAsyncRequest + - SendSyncRequest + IrohaSocketIOTransactV1: + enum: + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest + type: string + x-enum-varnames: + - SendAsyncRequest + - SendSyncRequest + IrohaBlockResponse: + properties: + payload: + $ref: '#/components/schemas/IrohaBlockResponse_payload' + signaturesList: + items: {} + type: array + required: + - payload + - signaturesList + type: object + IrohaBlockProgress: + properties: + transactionReceipt: + $ref: '#/components/schemas/IrohaBlockResponse' + required: + - transactionReceipt + type: object + IrohaBlockResponse_payload: + properties: + transactionsList: + items: {} + type: array + txNumber: + type: number + height: + type: number + prevBlockHash: + type: string + createdTime: + type: number + rejectedTransactionsHashesList: + items: {} + type: array + required: + - createdTime + - height + - prevBlockHash + - rejectedTransactionsHashesList + - transactionsList + - txNumber + type: object diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..743044ea89 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,383 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGenerateTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + generateTransactionRequestV1 *GenerateTransactionRequestV1 +} + +func (r ApiGenerateTransactionV1Request) GenerateTransactionRequestV1(generateTransactionRequestV1 GenerateTransactionRequestV1) ApiGenerateTransactionV1Request { + r.generateTransactionRequestV1 = &generateTransactionRequestV1 + return r +} + +func (r ApiGenerateTransactionV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GenerateTransactionV1Execute(r) +} + +/* +GenerateTransactionV1 Generate transaction that can be signed locally. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateTransactionV1Request +*/ +func (a *DefaultApiService) GenerateTransactionV1(ctx context.Context) ApiGenerateTransactionV1Request { + return ApiGenerateTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GenerateTransactionV1Execute(r ApiGenerateTransactionV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GenerateTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.generateTransactionRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequestV1Body *RunTransactionRequestV1Body +} + +func (r ApiRunTransactionV1Request) RunTransactionRequestV1Body(runTransactionRequestV1Body RunTransactionRequestV1Body) ApiRunTransactionV1Request { + r.runTransactionRequestV1Body = &runTransactionRequestV1Body + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a Iroha ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequestV1Body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorExceptionJsonResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorExceptionJsonResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionJsonResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..6ded5d1477 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Iroha API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..b57ec163ee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..2016088582 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 0000000000..42d289bb66 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 0000000000..c966c8ddfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go new file mode 100644 index 0000000000..b46372487c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AddAssetQuantityRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddAssetQuantityRequestParameters{} + +// AddAssetQuantityRequestParameters The list of arguments to pass in to the transaction request to Add Asset Quantity. +type AddAssetQuantityRequestParameters struct { + AssetId string `json:"assetId"` + Amount float32 `json:"amount"` +} + +// NewAddAssetQuantityRequestParameters instantiates a new AddAssetQuantityRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddAssetQuantityRequestParameters(assetId string, amount float32) *AddAssetQuantityRequestParameters { + this := AddAssetQuantityRequestParameters{} + this.AssetId = assetId + this.Amount = amount + return &this +} + +// NewAddAssetQuantityRequestParametersWithDefaults instantiates a new AddAssetQuantityRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddAssetQuantityRequestParametersWithDefaults() *AddAssetQuantityRequestParameters { + this := AddAssetQuantityRequestParameters{} + return &this +} + +// GetAssetId returns the AssetId field value +func (o *AddAssetQuantityRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *AddAssetQuantityRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *AddAssetQuantityRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetAmount returns the Amount field value +func (o *AddAssetQuantityRequestParameters) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *AddAssetQuantityRequestParameters) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *AddAssetQuantityRequestParameters) SetAmount(v float32) { + o.Amount = v +} + +func (o AddAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddAssetQuantityRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetId"] = o.AssetId + toSerialize["amount"] = o.Amount + return toSerialize, nil +} + +type NullableAddAssetQuantityRequestParameters struct { + value *AddAssetQuantityRequestParameters + isSet bool +} + +func (v NullableAddAssetQuantityRequestParameters) Get() *AddAssetQuantityRequestParameters { + return v.value +} + +func (v *NullableAddAssetQuantityRequestParameters) Set(val *AddAssetQuantityRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAddAssetQuantityRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAddAssetQuantityRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddAssetQuantityRequestParameters(val *AddAssetQuantityRequestParameters) *NullableAddAssetQuantityRequestParameters { + return &NullableAddAssetQuantityRequestParameters{value: val, isSet: true} +} + +func (v NullableAddAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddAssetQuantityRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go new file mode 100644 index 0000000000..0c3d2629e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go @@ -0,0 +1,216 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AddPeerRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddPeerRequestParameters{} + +// AddPeerRequestParameters The list of arguments to pass in to the transaction request to Add Peer. +type AddPeerRequestParameters struct { + Address string `json:"address"` + PeerKey string `json:"peerKey"` + TlsCertificate *string `json:"tlsCertificate,omitempty"` + SyncingPeer *bool `json:"syncingPeer,omitempty"` +} + +// NewAddPeerRequestParameters instantiates a new AddPeerRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddPeerRequestParameters(address string, peerKey string) *AddPeerRequestParameters { + this := AddPeerRequestParameters{} + this.Address = address + this.PeerKey = peerKey + return &this +} + +// NewAddPeerRequestParametersWithDefaults instantiates a new AddPeerRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddPeerRequestParametersWithDefaults() *AddPeerRequestParameters { + this := AddPeerRequestParameters{} + return &this +} + +// GetAddress returns the Address field value +func (o *AddPeerRequestParameters) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *AddPeerRequestParameters) SetAddress(v string) { + o.Address = v +} + +// GetPeerKey returns the PeerKey field value +func (o *AddPeerRequestParameters) GetPeerKey() string { + if o == nil { + var ret string + return ret + } + + return o.PeerKey +} + +// GetPeerKeyOk returns a tuple with the PeerKey field value +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetPeerKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PeerKey, true +} + +// SetPeerKey sets field value +func (o *AddPeerRequestParameters) SetPeerKey(v string) { + o.PeerKey = v +} + +// GetTlsCertificate returns the TlsCertificate field value if set, zero value otherwise. +func (o *AddPeerRequestParameters) GetTlsCertificate() string { + if o == nil || IsNil(o.TlsCertificate) { + var ret string + return ret + } + return *o.TlsCertificate +} + +// GetTlsCertificateOk returns a tuple with the TlsCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetTlsCertificateOk() (*string, bool) { + if o == nil || IsNil(o.TlsCertificate) { + return nil, false + } + return o.TlsCertificate, true +} + +// HasTlsCertificate returns a boolean if a field has been set. +func (o *AddPeerRequestParameters) HasTlsCertificate() bool { + if o != nil && !IsNil(o.TlsCertificate) { + return true + } + + return false +} + +// SetTlsCertificate gets a reference to the given string and assigns it to the TlsCertificate field. +func (o *AddPeerRequestParameters) SetTlsCertificate(v string) { + o.TlsCertificate = &v +} + +// GetSyncingPeer returns the SyncingPeer field value if set, zero value otherwise. +func (o *AddPeerRequestParameters) GetSyncingPeer() bool { + if o == nil || IsNil(o.SyncingPeer) { + var ret bool + return ret + } + return *o.SyncingPeer +} + +// GetSyncingPeerOk returns a tuple with the SyncingPeer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetSyncingPeerOk() (*bool, bool) { + if o == nil || IsNil(o.SyncingPeer) { + return nil, false + } + return o.SyncingPeer, true +} + +// HasSyncingPeer returns a boolean if a field has been set. +func (o *AddPeerRequestParameters) HasSyncingPeer() bool { + if o != nil && !IsNil(o.SyncingPeer) { + return true + } + + return false +} + +// SetSyncingPeer gets a reference to the given bool and assigns it to the SyncingPeer field. +func (o *AddPeerRequestParameters) SetSyncingPeer(v bool) { + o.SyncingPeer = &v +} + +func (o AddPeerRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddPeerRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["peerKey"] = o.PeerKey + if !IsNil(o.TlsCertificate) { + toSerialize["tlsCertificate"] = o.TlsCertificate + } + if !IsNil(o.SyncingPeer) { + toSerialize["syncingPeer"] = o.SyncingPeer + } + return toSerialize, nil +} + +type NullableAddPeerRequestParameters struct { + value *AddPeerRequestParameters + isSet bool +} + +func (v NullableAddPeerRequestParameters) Get() *AddPeerRequestParameters { + return v.value +} + +func (v *NullableAddPeerRequestParameters) Set(val *AddPeerRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAddPeerRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAddPeerRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddPeerRequestParameters(val *AddPeerRequestParameters) *NullableAddPeerRequestParameters { + return &NullableAddPeerRequestParameters{value: val, isSet: true} +} + +func (v NullableAddPeerRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddPeerRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go new file mode 100644 index 0000000000..48079c0c38 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AddSignatoryRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddSignatoryRequestParameters{} + +// AddSignatoryRequestParameters The list of arguments to pass in to the transaction request to Add Signatory. +type AddSignatoryRequestParameters struct { + AccountId string `json:"accountId"` + PublicKey string `json:"publicKey"` +} + +// NewAddSignatoryRequestParameters instantiates a new AddSignatoryRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddSignatoryRequestParameters(accountId string, publicKey string) *AddSignatoryRequestParameters { + this := AddSignatoryRequestParameters{} + this.AccountId = accountId + this.PublicKey = publicKey + return &this +} + +// NewAddSignatoryRequestParametersWithDefaults instantiates a new AddSignatoryRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddSignatoryRequestParametersWithDefaults() *AddSignatoryRequestParameters { + this := AddSignatoryRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *AddSignatoryRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *AddSignatoryRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *AddSignatoryRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPublicKey returns the PublicKey field value +func (o *AddSignatoryRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *AddSignatoryRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *AddSignatoryRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o AddSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddSignatoryRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableAddSignatoryRequestParameters struct { + value *AddSignatoryRequestParameters + isSet bool +} + +func (v NullableAddSignatoryRequestParameters) Get() *AddSignatoryRequestParameters { + return v.value +} + +func (v *NullableAddSignatoryRequestParameters) Set(val *AddSignatoryRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAddSignatoryRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAddSignatoryRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddSignatoryRequestParameters(val *AddSignatoryRequestParameters) *NullableAddSignatoryRequestParameters { + return &NullableAddSignatoryRequestParameters{value: val, isSet: true} +} + +func (v NullableAddSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddSignatoryRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go new file mode 100644 index 0000000000..d9a7cd8324 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AppendRoleRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppendRoleRequestParameters{} + +// AppendRoleRequestParameters The list of arguments to pass in to the transaction request to Append Role. +type AppendRoleRequestParameters struct { + AccountId string `json:"accountId"` + RoleName string `json:"roleName"` +} + +// NewAppendRoleRequestParameters instantiates a new AppendRoleRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAppendRoleRequestParameters(accountId string, roleName string) *AppendRoleRequestParameters { + this := AppendRoleRequestParameters{} + this.AccountId = accountId + this.RoleName = roleName + return &this +} + +// NewAppendRoleRequestParametersWithDefaults instantiates a new AppendRoleRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAppendRoleRequestParametersWithDefaults() *AppendRoleRequestParameters { + this := AppendRoleRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *AppendRoleRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *AppendRoleRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *AppendRoleRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetRoleName returns the RoleName field value +func (o *AppendRoleRequestParameters) GetRoleName() string { + if o == nil { + var ret string + return ret + } + + return o.RoleName +} + +// GetRoleNameOk returns a tuple with the RoleName field value +// and a boolean to check if the value has been set. +func (o *AppendRoleRequestParameters) GetRoleNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleName, true +} + +// SetRoleName sets field value +func (o *AppendRoleRequestParameters) SetRoleName(v string) { + o.RoleName = v +} + +func (o AppendRoleRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppendRoleRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["roleName"] = o.RoleName + return toSerialize, nil +} + +type NullableAppendRoleRequestParameters struct { + value *AppendRoleRequestParameters + isSet bool +} + +func (v NullableAppendRoleRequestParameters) Get() *AppendRoleRequestParameters { + return v.value +} + +func (v *NullableAppendRoleRequestParameters) Set(val *AppendRoleRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAppendRoleRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAppendRoleRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAppendRoleRequestParameters(val *AppendRoleRequestParameters) *NullableAppendRoleRequestParameters { + return &NullableAppendRoleRequestParameters{value: val, isSet: true} +} + +func (v NullableAppendRoleRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAppendRoleRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go new file mode 100644 index 0000000000..9059a1038b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CallEngineRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CallEngineRequestParameters{} + +// CallEngineRequestParameters The list of arguments to pass in to the transaction request to Call Engine. +type CallEngineRequestParameters struct { + Caller string `json:"caller"` + Callee string `json:"callee"` + Input string `json:"input"` +} + +// NewCallEngineRequestParameters instantiates a new CallEngineRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCallEngineRequestParameters(caller string, callee string, input string) *CallEngineRequestParameters { + this := CallEngineRequestParameters{} + this.Caller = caller + this.Callee = callee + this.Input = input + return &this +} + +// NewCallEngineRequestParametersWithDefaults instantiates a new CallEngineRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCallEngineRequestParametersWithDefaults() *CallEngineRequestParameters { + this := CallEngineRequestParameters{} + return &this +} + +// GetCaller returns the Caller field value +func (o *CallEngineRequestParameters) GetCaller() string { + if o == nil { + var ret string + return ret + } + + return o.Caller +} + +// GetCallerOk returns a tuple with the Caller field value +// and a boolean to check if the value has been set. +func (o *CallEngineRequestParameters) GetCallerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Caller, true +} + +// SetCaller sets field value +func (o *CallEngineRequestParameters) SetCaller(v string) { + o.Caller = v +} + +// GetCallee returns the Callee field value +func (o *CallEngineRequestParameters) GetCallee() string { + if o == nil { + var ret string + return ret + } + + return o.Callee +} + +// GetCalleeOk returns a tuple with the Callee field value +// and a boolean to check if the value has been set. +func (o *CallEngineRequestParameters) GetCalleeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Callee, true +} + +// SetCallee sets field value +func (o *CallEngineRequestParameters) SetCallee(v string) { + o.Callee = v +} + +// GetInput returns the Input field value +func (o *CallEngineRequestParameters) GetInput() string { + if o == nil { + var ret string + return ret + } + + return o.Input +} + +// GetInputOk returns a tuple with the Input field value +// and a boolean to check if the value has been set. +func (o *CallEngineRequestParameters) GetInputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *CallEngineRequestParameters) SetInput(v string) { + o.Input = v +} + +func (o CallEngineRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CallEngineRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["caller"] = o.Caller + toSerialize["callee"] = o.Callee + toSerialize["input"] = o.Input + return toSerialize, nil +} + +type NullableCallEngineRequestParameters struct { + value *CallEngineRequestParameters + isSet bool +} + +func (v NullableCallEngineRequestParameters) Get() *CallEngineRequestParameters { + return v.value +} + +func (v *NullableCallEngineRequestParameters) Set(val *CallEngineRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCallEngineRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCallEngineRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCallEngineRequestParameters(val *CallEngineRequestParameters) *NullableCallEngineRequestParameters { + return &NullableCallEngineRequestParameters{value: val, isSet: true} +} + +func (v NullableCallEngineRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCallEngineRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go new file mode 100644 index 0000000000..e870b84340 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go @@ -0,0 +1,234 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CompareAndSetAccountDetailRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CompareAndSetAccountDetailRequestParameters{} + +// CompareAndSetAccountDetailRequestParameters The list of arguments to pass in to the transaction request to Compare And Set Account Detail. +type CompareAndSetAccountDetailRequestParameters struct { + AccountId string `json:"accountId"` + Key string `json:"key"` + Value string `json:"value"` + OldValue *string `json:"oldValue,omitempty"` + CheckEmpty bool `json:"check_empty"` +} + +// NewCompareAndSetAccountDetailRequestParameters instantiates a new CompareAndSetAccountDetailRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCompareAndSetAccountDetailRequestParameters(accountId string, key string, value string, checkEmpty bool) *CompareAndSetAccountDetailRequestParameters { + this := CompareAndSetAccountDetailRequestParameters{} + this.AccountId = accountId + this.Key = key + this.Value = value + this.CheckEmpty = checkEmpty + return &this +} + +// NewCompareAndSetAccountDetailRequestParametersWithDefaults instantiates a new CompareAndSetAccountDetailRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCompareAndSetAccountDetailRequestParametersWithDefaults() *CompareAndSetAccountDetailRequestParameters { + this := CompareAndSetAccountDetailRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *CompareAndSetAccountDetailRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetKey returns the Key field value +func (o *CompareAndSetAccountDetailRequestParameters) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *CompareAndSetAccountDetailRequestParameters) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetValue(v string) { + o.Value = v +} + +// GetOldValue returns the OldValue field value if set, zero value otherwise. +func (o *CompareAndSetAccountDetailRequestParameters) GetOldValue() string { + if o == nil || IsNil(o.OldValue) { + var ret string + return ret + } + return *o.OldValue +} + +// GetOldValueOk returns a tuple with the OldValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetOldValueOk() (*string, bool) { + if o == nil || IsNil(o.OldValue) { + return nil, false + } + return o.OldValue, true +} + +// HasOldValue returns a boolean if a field has been set. +func (o *CompareAndSetAccountDetailRequestParameters) HasOldValue() bool { + if o != nil && !IsNil(o.OldValue) { + return true + } + + return false +} + +// SetOldValue gets a reference to the given string and assigns it to the OldValue field. +func (o *CompareAndSetAccountDetailRequestParameters) SetOldValue(v string) { + o.OldValue = &v +} + +// GetCheckEmpty returns the CheckEmpty field value +func (o *CompareAndSetAccountDetailRequestParameters) GetCheckEmpty() bool { + if o == nil { + var ret bool + return ret + } + + return o.CheckEmpty +} + +// GetCheckEmptyOk returns a tuple with the CheckEmpty field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetCheckEmptyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CheckEmpty, true +} + +// SetCheckEmpty sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetCheckEmpty(v bool) { + o.CheckEmpty = v +} + +func (o CompareAndSetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CompareAndSetAccountDetailRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + if !IsNil(o.OldValue) { + toSerialize["oldValue"] = o.OldValue + } + toSerialize["check_empty"] = o.CheckEmpty + return toSerialize, nil +} + +type NullableCompareAndSetAccountDetailRequestParameters struct { + value *CompareAndSetAccountDetailRequestParameters + isSet bool +} + +func (v NullableCompareAndSetAccountDetailRequestParameters) Get() *CompareAndSetAccountDetailRequestParameters { + return v.value +} + +func (v *NullableCompareAndSetAccountDetailRequestParameters) Set(val *CompareAndSetAccountDetailRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCompareAndSetAccountDetailRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCompareAndSetAccountDetailRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCompareAndSetAccountDetailRequestParameters(val *CompareAndSetAccountDetailRequestParameters) *NullableCompareAndSetAccountDetailRequestParameters { + return &NullableCompareAndSetAccountDetailRequestParameters{value: val, isSet: true} +} + +func (v NullableCompareAndSetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCompareAndSetAccountDetailRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go new file mode 100644 index 0000000000..ab7f545591 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateAccountRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAccountRequestParameters{} + +// CreateAccountRequestParameters The list of arguments to pass in to the transaction request to Create Account. +type CreateAccountRequestParameters struct { + AccountName string `json:"accountName"` + DomainId string `json:"domainId"` + PublicKey string `json:"publicKey"` +} + +// NewCreateAccountRequestParameters instantiates a new CreateAccountRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAccountRequestParameters(accountName string, domainId string, publicKey string) *CreateAccountRequestParameters { + this := CreateAccountRequestParameters{} + this.AccountName = accountName + this.DomainId = domainId + this.PublicKey = publicKey + return &this +} + +// NewCreateAccountRequestParametersWithDefaults instantiates a new CreateAccountRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAccountRequestParametersWithDefaults() *CreateAccountRequestParameters { + this := CreateAccountRequestParameters{} + return &this +} + +// GetAccountName returns the AccountName field value +func (o *CreateAccountRequestParameters) GetAccountName() string { + if o == nil { + var ret string + return ret + } + + return o.AccountName +} + +// GetAccountNameOk returns a tuple with the AccountName field value +// and a boolean to check if the value has been set. +func (o *CreateAccountRequestParameters) GetAccountNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountName, true +} + +// SetAccountName sets field value +func (o *CreateAccountRequestParameters) SetAccountName(v string) { + o.AccountName = v +} + +// GetDomainId returns the DomainId field value +func (o *CreateAccountRequestParameters) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *CreateAccountRequestParameters) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *CreateAccountRequestParameters) SetDomainId(v string) { + o.DomainId = v +} + +// GetPublicKey returns the PublicKey field value +func (o *CreateAccountRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CreateAccountRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CreateAccountRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o CreateAccountRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAccountRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountName"] = o.AccountName + toSerialize["domainId"] = o.DomainId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableCreateAccountRequestParameters struct { + value *CreateAccountRequestParameters + isSet bool +} + +func (v NullableCreateAccountRequestParameters) Get() *CreateAccountRequestParameters { + return v.value +} + +func (v *NullableCreateAccountRequestParameters) Set(val *CreateAccountRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAccountRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAccountRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAccountRequestParameters(val *CreateAccountRequestParameters) *NullableCreateAccountRequestParameters { + return &NullableCreateAccountRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateAccountRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAccountRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go new file mode 100644 index 0000000000..9ea93b702e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateAssetRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAssetRequestParameters{} + +// CreateAssetRequestParameters The list of arguments to pass in to the transaction request to Create Asset. +type CreateAssetRequestParameters struct { + AssetName string `json:"assetName"` + DomainId string `json:"domainId"` + Precision int32 `json:"precision"` +} + +// NewCreateAssetRequestParameters instantiates a new CreateAssetRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAssetRequestParameters(assetName string, domainId string, precision int32) *CreateAssetRequestParameters { + this := CreateAssetRequestParameters{} + this.AssetName = assetName + this.DomainId = domainId + this.Precision = precision + return &this +} + +// NewCreateAssetRequestParametersWithDefaults instantiates a new CreateAssetRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAssetRequestParametersWithDefaults() *CreateAssetRequestParameters { + this := CreateAssetRequestParameters{} + return &this +} + +// GetAssetName returns the AssetName field value +func (o *CreateAssetRequestParameters) GetAssetName() string { + if o == nil { + var ret string + return ret + } + + return o.AssetName +} + +// GetAssetNameOk returns a tuple with the AssetName field value +// and a boolean to check if the value has been set. +func (o *CreateAssetRequestParameters) GetAssetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetName, true +} + +// SetAssetName sets field value +func (o *CreateAssetRequestParameters) SetAssetName(v string) { + o.AssetName = v +} + +// GetDomainId returns the DomainId field value +func (o *CreateAssetRequestParameters) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *CreateAssetRequestParameters) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *CreateAssetRequestParameters) SetDomainId(v string) { + o.DomainId = v +} + +// GetPrecision returns the Precision field value +func (o *CreateAssetRequestParameters) GetPrecision() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Precision +} + +// GetPrecisionOk returns a tuple with the Precision field value +// and a boolean to check if the value has been set. +func (o *CreateAssetRequestParameters) GetPrecisionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Precision, true +} + +// SetPrecision sets field value +func (o *CreateAssetRequestParameters) SetPrecision(v int32) { + o.Precision = v +} + +func (o CreateAssetRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAssetRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetName"] = o.AssetName + toSerialize["domainId"] = o.DomainId + toSerialize["precision"] = o.Precision + return toSerialize, nil +} + +type NullableCreateAssetRequestParameters struct { + value *CreateAssetRequestParameters + isSet bool +} + +func (v NullableCreateAssetRequestParameters) Get() *CreateAssetRequestParameters { + return v.value +} + +func (v *NullableCreateAssetRequestParameters) Set(val *CreateAssetRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAssetRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAssetRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAssetRequestParameters(val *CreateAssetRequestParameters) *NullableCreateAssetRequestParameters { + return &NullableCreateAssetRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateAssetRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAssetRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go new file mode 100644 index 0000000000..37023403c1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateDomainRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDomainRequestParameters{} + +// CreateDomainRequestParameters The list of arguments to pass in to the transaction request to Create Domain. +type CreateDomainRequestParameters struct { + DomainId string `json:"domainId"` + DefaultRole string `json:"defaultRole"` +} + +// NewCreateDomainRequestParameters instantiates a new CreateDomainRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDomainRequestParameters(domainId string, defaultRole string) *CreateDomainRequestParameters { + this := CreateDomainRequestParameters{} + this.DomainId = domainId + this.DefaultRole = defaultRole + return &this +} + +// NewCreateDomainRequestParametersWithDefaults instantiates a new CreateDomainRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDomainRequestParametersWithDefaults() *CreateDomainRequestParameters { + this := CreateDomainRequestParameters{} + return &this +} + +// GetDomainId returns the DomainId field value +func (o *CreateDomainRequestParameters) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *CreateDomainRequestParameters) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *CreateDomainRequestParameters) SetDomainId(v string) { + o.DomainId = v +} + +// GetDefaultRole returns the DefaultRole field value +func (o *CreateDomainRequestParameters) GetDefaultRole() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultRole +} + +// GetDefaultRoleOk returns a tuple with the DefaultRole field value +// and a boolean to check if the value has been set. +func (o *CreateDomainRequestParameters) GetDefaultRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultRole, true +} + +// SetDefaultRole sets field value +func (o *CreateDomainRequestParameters) SetDefaultRole(v string) { + o.DefaultRole = v +} + +func (o CreateDomainRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDomainRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["domainId"] = o.DomainId + toSerialize["defaultRole"] = o.DefaultRole + return toSerialize, nil +} + +type NullableCreateDomainRequestParameters struct { + value *CreateDomainRequestParameters + isSet bool +} + +func (v NullableCreateDomainRequestParameters) Get() *CreateDomainRequestParameters { + return v.value +} + +func (v *NullableCreateDomainRequestParameters) Set(val *CreateDomainRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDomainRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDomainRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDomainRequestParameters(val *CreateDomainRequestParameters) *NullableCreateDomainRequestParameters { + return &NullableCreateDomainRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateDomainRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDomainRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go new file mode 100644 index 0000000000..c5da347b71 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateRoleRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRoleRequestParameters{} + +// CreateRoleRequestParameters The list of arguments to pass in to the transaction request to Create Role. +type CreateRoleRequestParameters struct { + RoleName string `json:"roleName"` + PermissionsList []float32 `json:"permissionsList"` +} + +// NewCreateRoleRequestParameters instantiates a new CreateRoleRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRoleRequestParameters(roleName string, permissionsList []float32) *CreateRoleRequestParameters { + this := CreateRoleRequestParameters{} + this.RoleName = roleName + this.PermissionsList = permissionsList + return &this +} + +// NewCreateRoleRequestParametersWithDefaults instantiates a new CreateRoleRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRoleRequestParametersWithDefaults() *CreateRoleRequestParameters { + this := CreateRoleRequestParameters{} + return &this +} + +// GetRoleName returns the RoleName field value +func (o *CreateRoleRequestParameters) GetRoleName() string { + if o == nil { + var ret string + return ret + } + + return o.RoleName +} + +// GetRoleNameOk returns a tuple with the RoleName field value +// and a boolean to check if the value has been set. +func (o *CreateRoleRequestParameters) GetRoleNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleName, true +} + +// SetRoleName sets field value +func (o *CreateRoleRequestParameters) SetRoleName(v string) { + o.RoleName = v +} + +// GetPermissionsList returns the PermissionsList field value +func (o *CreateRoleRequestParameters) GetPermissionsList() []float32 { + if o == nil { + var ret []float32 + return ret + } + + return o.PermissionsList +} + +// GetPermissionsListOk returns a tuple with the PermissionsList field value +// and a boolean to check if the value has been set. +func (o *CreateRoleRequestParameters) GetPermissionsListOk() ([]float32, bool) { + if o == nil { + return nil, false + } + return o.PermissionsList, true +} + +// SetPermissionsList sets field value +func (o *CreateRoleRequestParameters) SetPermissionsList(v []float32) { + o.PermissionsList = v +} + +func (o CreateRoleRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRoleRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roleName"] = o.RoleName + toSerialize["permissionsList"] = o.PermissionsList + return toSerialize, nil +} + +type NullableCreateRoleRequestParameters struct { + value *CreateRoleRequestParameters + isSet bool +} + +func (v NullableCreateRoleRequestParameters) Get() *CreateRoleRequestParameters { + return v.value +} + +func (v *NullableCreateRoleRequestParameters) Set(val *CreateRoleRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRoleRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRoleRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRoleRequestParameters(val *CreateRoleRequestParameters) *NullableCreateRoleRequestParameters { + return &NullableCreateRoleRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateRoleRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRoleRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go new file mode 100644 index 0000000000..b29234c3df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the DetachRoleRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DetachRoleRequestParameters{} + +// DetachRoleRequestParameters The list of arguments to pass in to the transaction request to Detach Role. +type DetachRoleRequestParameters struct { + AccountId string `json:"accountId"` + RoleName string `json:"roleName"` +} + +// NewDetachRoleRequestParameters instantiates a new DetachRoleRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDetachRoleRequestParameters(accountId string, roleName string) *DetachRoleRequestParameters { + this := DetachRoleRequestParameters{} + this.AccountId = accountId + this.RoleName = roleName + return &this +} + +// NewDetachRoleRequestParametersWithDefaults instantiates a new DetachRoleRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDetachRoleRequestParametersWithDefaults() *DetachRoleRequestParameters { + this := DetachRoleRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *DetachRoleRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *DetachRoleRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *DetachRoleRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetRoleName returns the RoleName field value +func (o *DetachRoleRequestParameters) GetRoleName() string { + if o == nil { + var ret string + return ret + } + + return o.RoleName +} + +// GetRoleNameOk returns a tuple with the RoleName field value +// and a boolean to check if the value has been set. +func (o *DetachRoleRequestParameters) GetRoleNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleName, true +} + +// SetRoleName sets field value +func (o *DetachRoleRequestParameters) SetRoleName(v string) { + o.RoleName = v +} + +func (o DetachRoleRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DetachRoleRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["roleName"] = o.RoleName + return toSerialize, nil +} + +type NullableDetachRoleRequestParameters struct { + value *DetachRoleRequestParameters + isSet bool +} + +func (v NullableDetachRoleRequestParameters) Get() *DetachRoleRequestParameters { + return v.value +} + +func (v *NullableDetachRoleRequestParameters) Set(val *DetachRoleRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableDetachRoleRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableDetachRoleRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDetachRoleRequestParameters(val *DetachRoleRequestParameters) *NullableDetachRoleRequestParameters { + return &NullableDetachRoleRequestParameters{value: val, isSet: true} +} + +func (v NullableDetachRoleRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDetachRoleRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go new file mode 100644 index 0000000000..8a7c9fc42e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go @@ -0,0 +1,261 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionJsonResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionJsonResponseV1{} + +// ErrorExceptionJsonResponseV1 struct for ErrorExceptionJsonResponseV1 +type ErrorExceptionJsonResponseV1 struct { + Message string `json:"message"` + Name *string `json:"name,omitempty"` + Error *string `json:"error,omitempty"` + Stack *string `json:"stack,omitempty"` + Cause *string `json:"cause,omitempty"` +} + +// NewErrorExceptionJsonResponseV1 instantiates a new ErrorExceptionJsonResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionJsonResponseV1(message string) *ErrorExceptionJsonResponseV1 { + this := ErrorExceptionJsonResponseV1{} + this.Message = message + return &this +} + +// NewErrorExceptionJsonResponseV1WithDefaults instantiates a new ErrorExceptionJsonResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionJsonResponseV1WithDefaults() *ErrorExceptionJsonResponseV1 { + this := ErrorExceptionJsonResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionJsonResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionJsonResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ErrorExceptionJsonResponseV1) SetName(v string) { + o.Name = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *ErrorExceptionJsonResponseV1) SetError(v string) { + o.Error = &v +} + +// GetStack returns the Stack field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetStack() string { + if o == nil || IsNil(o.Stack) { + var ret string + return ret + } + return *o.Stack +} + +// GetStackOk returns a tuple with the Stack field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetStackOk() (*string, bool) { + if o == nil || IsNil(o.Stack) { + return nil, false + } + return o.Stack, true +} + +// HasStack returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasStack() bool { + if o != nil && !IsNil(o.Stack) { + return true + } + + return false +} + +// SetStack gets a reference to the given string and assigns it to the Stack field. +func (o *ErrorExceptionJsonResponseV1) SetStack(v string) { + o.Stack = &v +} + +// GetCause returns the Cause field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetCause() string { + if o == nil || IsNil(o.Cause) { + var ret string + return ret + } + return *o.Cause +} + +// GetCauseOk returns a tuple with the Cause field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetCauseOk() (*string, bool) { + if o == nil || IsNil(o.Cause) { + return nil, false + } + return o.Cause, true +} + +// HasCause returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasCause() bool { + if o != nil && !IsNil(o.Cause) { + return true + } + + return false +} + +// SetCause gets a reference to the given string and assigns it to the Cause field. +func (o *ErrorExceptionJsonResponseV1) SetCause(v string) { + o.Cause = &v +} + +func (o ErrorExceptionJsonResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionJsonResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Stack) { + toSerialize["stack"] = o.Stack + } + if !IsNil(o.Cause) { + toSerialize["cause"] = o.Cause + } + return toSerialize, nil +} + +type NullableErrorExceptionJsonResponseV1 struct { + value *ErrorExceptionJsonResponseV1 + isSet bool +} + +func (v NullableErrorExceptionJsonResponseV1) Get() *ErrorExceptionJsonResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionJsonResponseV1) Set(val *ErrorExceptionJsonResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionJsonResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionJsonResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionJsonResponseV1(val *ErrorExceptionJsonResponseV1) *NullableErrorExceptionJsonResponseV1 { + return &NullableErrorExceptionJsonResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionJsonResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionJsonResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 0000000000..b1991f27e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go new file mode 100644 index 0000000000..991e0825fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GenerateTransactionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenerateTransactionRequestV1{} + +// GenerateTransactionRequestV1 struct for GenerateTransactionRequestV1 +type GenerateTransactionRequestV1 struct { + // Iroha command name. + CommandName IrohaCommand `json:"commandName"` + // Parameters for iroha command specified in commandName + CommandParams map[string]interface{} `json:"commandParams"` + // Sender account id + CreatorAccountId string `json:"creatorAccountId"` + // Requested transaction quorum + Quorum *float32 `json:"quorum,omitempty"` +} + +// NewGenerateTransactionRequestV1 instantiates a new GenerateTransactionRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenerateTransactionRequestV1(commandName IrohaCommand, commandParams map[string]interface{}, creatorAccountId string) *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + this.CommandName = commandName + this.CommandParams = commandParams + this.CreatorAccountId = creatorAccountId + var quorum float32 = 1 + this.Quorum = &quorum + return &this +} + +// NewGenerateTransactionRequestV1WithDefaults instantiates a new GenerateTransactionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenerateTransactionRequestV1WithDefaults() *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + var quorum float32 = 1 + this.Quorum = &quorum + return &this +} + +// GetCommandName returns the CommandName field value +func (o *GenerateTransactionRequestV1) GetCommandName() IrohaCommand { + if o == nil { + var ret IrohaCommand + return ret + } + + return o.CommandName +} + +// GetCommandNameOk returns a tuple with the CommandName field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetCommandNameOk() (*IrohaCommand, bool) { + if o == nil { + return nil, false + } + return &o.CommandName, true +} + +// SetCommandName sets field value +func (o *GenerateTransactionRequestV1) SetCommandName(v IrohaCommand) { + o.CommandName = v +} + +// GetCommandParams returns the CommandParams field value +func (o *GenerateTransactionRequestV1) GetCommandParams() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.CommandParams +} + +// GetCommandParamsOk returns a tuple with the CommandParams field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetCommandParamsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.CommandParams, true +} + +// SetCommandParams sets field value +func (o *GenerateTransactionRequestV1) SetCommandParams(v map[string]interface{}) { + o.CommandParams = v +} + +// GetCreatorAccountId returns the CreatorAccountId field value +func (o *GenerateTransactionRequestV1) GetCreatorAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.CreatorAccountId +} + +// GetCreatorAccountIdOk returns a tuple with the CreatorAccountId field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetCreatorAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatorAccountId, true +} + +// SetCreatorAccountId sets field value +func (o *GenerateTransactionRequestV1) SetCreatorAccountId(v string) { + o.CreatorAccountId = v +} + +// GetQuorum returns the Quorum field value if set, zero value otherwise. +func (o *GenerateTransactionRequestV1) GetQuorum() float32 { + if o == nil || IsNil(o.Quorum) { + var ret float32 + return ret + } + return *o.Quorum +} + +// GetQuorumOk returns a tuple with the Quorum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetQuorumOk() (*float32, bool) { + if o == nil || IsNil(o.Quorum) { + return nil, false + } + return o.Quorum, true +} + +// HasQuorum returns a boolean if a field has been set. +func (o *GenerateTransactionRequestV1) HasQuorum() bool { + if o != nil && !IsNil(o.Quorum) { + return true + } + + return false +} + +// SetQuorum gets a reference to the given float32 and assigns it to the Quorum field. +func (o *GenerateTransactionRequestV1) SetQuorum(v float32) { + o.Quorum = &v +} + +func (o GenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenerateTransactionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["commandName"] = o.CommandName + toSerialize["commandParams"] = o.CommandParams + toSerialize["creatorAccountId"] = o.CreatorAccountId + if !IsNil(o.Quorum) { + toSerialize["quorum"] = o.Quorum + } + return toSerialize, nil +} + +type NullableGenerateTransactionRequestV1 struct { + value *GenerateTransactionRequestV1 + isSet bool +} + +func (v NullableGenerateTransactionRequestV1) Get() *GenerateTransactionRequestV1 { + return v.value +} + +func (v *NullableGenerateTransactionRequestV1) Set(val *GenerateTransactionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateTransactionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateTransactionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateTransactionRequestV1(val *GenerateTransactionRequestV1) *NullableGenerateTransactionRequestV1 { + return &NullableGenerateTransactionRequestV1{value: val, isSet: true} +} + +func (v NullableGenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateTransactionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go new file mode 100644 index 0000000000..7a068ae4a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountAssetTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountAssetTransactionsRequestParameters{} + +// GetAccountAssetTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Account Asset Transactions. +type GetAccountAssetTransactionsRequestParameters struct { + AccountId string `json:"accountId"` + AssetId string `json:"assetId"` + PageSize int32 `json:"pageSize"` + FirstTxHash string `json:"firstTxHash"` +} + +// NewGetAccountAssetTransactionsRequestParameters instantiates a new GetAccountAssetTransactionsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAccountAssetTransactionsRequestParameters(accountId string, assetId string, pageSize int32, firstTxHash string) *GetAccountAssetTransactionsRequestParameters { + this := GetAccountAssetTransactionsRequestParameters{} + this.AccountId = accountId + this.AssetId = assetId + this.PageSize = pageSize + this.FirstTxHash = firstTxHash + return &this +} + +// NewGetAccountAssetTransactionsRequestParametersWithDefaults instantiates a new GetAccountAssetTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountAssetTransactionsRequestParametersWithDefaults() *GetAccountAssetTransactionsRequestParameters { + this := GetAccountAssetTransactionsRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountAssetTransactionsRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetAssetId returns the AssetId field value +func (o *GetAccountAssetTransactionsRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountAssetTransactionsRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetFirstTxHash returns the FirstTxHash field value +func (o *GetAccountAssetTransactionsRequestParameters) GetFirstTxHash() string { + if o == nil { + var ret string + return ret + } + + return o.FirstTxHash +} + +// GetFirstTxHashOk returns a tuple with the FirstTxHash field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetFirstTxHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FirstTxHash, true +} + +// SetFirstTxHash sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetFirstTxHash(v string) { + o.FirstTxHash = v +} + +func (o GetAccountAssetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountAssetTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["assetId"] = o.AssetId + toSerialize["pageSize"] = o.PageSize + toSerialize["firstTxHash"] = o.FirstTxHash + return toSerialize, nil +} + +type NullableGetAccountAssetTransactionsRequestParameters struct { + value *GetAccountAssetTransactionsRequestParameters + isSet bool +} + +func (v NullableGetAccountAssetTransactionsRequestParameters) Get() *GetAccountAssetTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetAccountAssetTransactionsRequestParameters) Set(val *GetAccountAssetTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountAssetTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountAssetTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountAssetTransactionsRequestParameters(val *GetAccountAssetTransactionsRequestParameters) *NullableGetAccountAssetTransactionsRequestParameters { + return &NullableGetAccountAssetTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountAssetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountAssetTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go new file mode 100644 index 0000000000..45c9bf330a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go @@ -0,0 +1,180 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountAssetsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountAssetsRequestParameters{} + +// GetAccountAssetsRequestParameters The list of arguments to pass in to the transaction request to Get Account Assets. +type GetAccountAssetsRequestParameters struct { + AccountId string `json:"accountId"` + PageSize float32 `json:"pageSize"` + FirstAssetId *string `json:"firstAssetId,omitempty"` +} + +// NewGetAccountAssetsRequestParameters instantiates a new GetAccountAssetsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAccountAssetsRequestParameters(accountId string, pageSize float32) *GetAccountAssetsRequestParameters { + this := GetAccountAssetsRequestParameters{} + this.AccountId = accountId + this.PageSize = pageSize + return &this +} + +// NewGetAccountAssetsRequestParametersWithDefaults instantiates a new GetAccountAssetsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountAssetsRequestParametersWithDefaults() *GetAccountAssetsRequestParameters { + this := GetAccountAssetsRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountAssetsRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetsRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountAssetsRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountAssetsRequestParameters) GetPageSize() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetsRequestParameters) GetPageSizeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountAssetsRequestParameters) SetPageSize(v float32) { + o.PageSize = v +} + +// GetFirstAssetId returns the FirstAssetId field value if set, zero value otherwise. +func (o *GetAccountAssetsRequestParameters) GetFirstAssetId() string { + if o == nil || IsNil(o.FirstAssetId) { + var ret string + return ret + } + return *o.FirstAssetId +} + +// GetFirstAssetIdOk returns a tuple with the FirstAssetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountAssetsRequestParameters) GetFirstAssetIdOk() (*string, bool) { + if o == nil || IsNil(o.FirstAssetId) { + return nil, false + } + return o.FirstAssetId, true +} + +// HasFirstAssetId returns a boolean if a field has been set. +func (o *GetAccountAssetsRequestParameters) HasFirstAssetId() bool { + if o != nil && !IsNil(o.FirstAssetId) { + return true + } + + return false +} + +// SetFirstAssetId gets a reference to the given string and assigns it to the FirstAssetId field. +func (o *GetAccountAssetsRequestParameters) SetFirstAssetId(v string) { + o.FirstAssetId = &v +} + +func (o GetAccountAssetsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountAssetsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["pageSize"] = o.PageSize + if !IsNil(o.FirstAssetId) { + toSerialize["firstAssetId"] = o.FirstAssetId + } + return toSerialize, nil +} + +type NullableGetAccountAssetsRequestParameters struct { + value *GetAccountAssetsRequestParameters + isSet bool +} + +func (v NullableGetAccountAssetsRequestParameters) Get() *GetAccountAssetsRequestParameters { + return v.value +} + +func (v *NullableGetAccountAssetsRequestParameters) Set(val *GetAccountAssetsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountAssetsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountAssetsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountAssetsRequestParameters(val *GetAccountAssetsRequestParameters) *NullableGetAccountAssetsRequestParameters { + return &NullableGetAccountAssetsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountAssetsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountAssetsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go new file mode 100644 index 0000000000..3c29160511 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountDetailRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountDetailRequestParameters{} + +// GetAccountDetailRequestParameters The list of arguments to pass in to the transaction request to Get Account Detail. +type GetAccountDetailRequestParameters struct { + AccountId *string `json:"accountId,omitempty"` + Key *string `json:"key,omitempty"` + Writer *string `json:"writer,omitempty"` + PageSize int32 `json:"pageSize"` + PaginationKey string `json:"paginationKey"` + PaginationWriter string `json:"paginationWriter"` +} + +// NewGetAccountDetailRequestParameters instantiates a new GetAccountDetailRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAccountDetailRequestParameters(pageSize int32, paginationKey string, paginationWriter string) *GetAccountDetailRequestParameters { + this := GetAccountDetailRequestParameters{} + this.PageSize = pageSize + this.PaginationKey = paginationKey + this.PaginationWriter = paginationWriter + return &this +} + +// NewGetAccountDetailRequestParametersWithDefaults instantiates a new GetAccountDetailRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountDetailRequestParametersWithDefaults() *GetAccountDetailRequestParameters { + this := GetAccountDetailRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value if set, zero value otherwise. +func (o *GetAccountDetailRequestParameters) GetAccountId() string { + if o == nil || IsNil(o.AccountId) { + var ret string + return ret + } + return *o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil || IsNil(o.AccountId) { + return nil, false + } + return o.AccountId, true +} + +// HasAccountId returns a boolean if a field has been set. +func (o *GetAccountDetailRequestParameters) HasAccountId() bool { + if o != nil && !IsNil(o.AccountId) { + return true + } + + return false +} + +// SetAccountId gets a reference to the given string and assigns it to the AccountId field. +func (o *GetAccountDetailRequestParameters) SetAccountId(v string) { + o.AccountId = &v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *GetAccountDetailRequestParameters) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *GetAccountDetailRequestParameters) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *GetAccountDetailRequestParameters) SetKey(v string) { + o.Key = &v +} + +// GetWriter returns the Writer field value if set, zero value otherwise. +func (o *GetAccountDetailRequestParameters) GetWriter() string { + if o == nil || IsNil(o.Writer) { + var ret string + return ret + } + return *o.Writer +} + +// GetWriterOk returns a tuple with the Writer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetWriterOk() (*string, bool) { + if o == nil || IsNil(o.Writer) { + return nil, false + } + return o.Writer, true +} + +// HasWriter returns a boolean if a field has been set. +func (o *GetAccountDetailRequestParameters) HasWriter() bool { + if o != nil && !IsNil(o.Writer) { + return true + } + + return false +} + +// SetWriter gets a reference to the given string and assigns it to the Writer field. +func (o *GetAccountDetailRequestParameters) SetWriter(v string) { + o.Writer = &v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountDetailRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountDetailRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetPaginationKey returns the PaginationKey field value +func (o *GetAccountDetailRequestParameters) GetPaginationKey() string { + if o == nil { + var ret string + return ret + } + + return o.PaginationKey +} + +// GetPaginationKeyOk returns a tuple with the PaginationKey field value +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetPaginationKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaginationKey, true +} + +// SetPaginationKey sets field value +func (o *GetAccountDetailRequestParameters) SetPaginationKey(v string) { + o.PaginationKey = v +} + +// GetPaginationWriter returns the PaginationWriter field value +func (o *GetAccountDetailRequestParameters) GetPaginationWriter() string { + if o == nil { + var ret string + return ret + } + + return o.PaginationWriter +} + +// GetPaginationWriterOk returns a tuple with the PaginationWriter field value +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetPaginationWriterOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaginationWriter, true +} + +// SetPaginationWriter sets field value +func (o *GetAccountDetailRequestParameters) SetPaginationWriter(v string) { + o.PaginationWriter = v +} + +func (o GetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountDetailRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccountId) { + toSerialize["accountId"] = o.AccountId + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Writer) { + toSerialize["writer"] = o.Writer + } + toSerialize["pageSize"] = o.PageSize + toSerialize["paginationKey"] = o.PaginationKey + toSerialize["paginationWriter"] = o.PaginationWriter + return toSerialize, nil +} + +type NullableGetAccountDetailRequestParameters struct { + value *GetAccountDetailRequestParameters + isSet bool +} + +func (v NullableGetAccountDetailRequestParameters) Get() *GetAccountDetailRequestParameters { + return v.value +} + +func (v *NullableGetAccountDetailRequestParameters) Set(val *GetAccountDetailRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountDetailRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountDetailRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountDetailRequestParameters(val *GetAccountDetailRequestParameters) *NullableGetAccountDetailRequestParameters { + return &NullableGetAccountDetailRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountDetailRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go new file mode 100644 index 0000000000..48afa17d1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountRequestParameters{} + +// GetAccountRequestParameters The list of arguments to pass in to the transaction request to Get Account. +type GetAccountRequestParameters struct { + AccountId string `json:"accountId"` +} + +// NewGetAccountRequestParameters instantiates a new GetAccountRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAccountRequestParameters(accountId string) *GetAccountRequestParameters { + this := GetAccountRequestParameters{} + this.AccountId = accountId + return &this +} + +// NewGetAccountRequestParametersWithDefaults instantiates a new GetAccountRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountRequestParametersWithDefaults() *GetAccountRequestParameters { + this := GetAccountRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +func (o GetAccountRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + return toSerialize, nil +} + +type NullableGetAccountRequestParameters struct { + value *GetAccountRequestParameters + isSet bool +} + +func (v NullableGetAccountRequestParameters) Get() *GetAccountRequestParameters { + return v.value +} + +func (v *NullableGetAccountRequestParameters) Set(val *GetAccountRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountRequestParameters(val *GetAccountRequestParameters) *NullableGetAccountRequestParameters { + return &NullableGetAccountRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go new file mode 100644 index 0000000000..df6c2c5c88 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountTransactionsRequestParameters{} + +// GetAccountTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Account Transactions. +type GetAccountTransactionsRequestParameters struct { + AccountId string `json:"accountId"` + PageSize int32 `json:"pageSize"` + FirstTxHash string `json:"firstTxHash"` + FirstTxTime map[string]interface{} `json:"firstTxTime,omitempty"` + LastTxTime map[string]interface{} `json:"lastTxTime,omitempty"` + FirstTxHeight *int32 `json:"firstTxHeight,omitempty"` + LastTxHeight *int32 `json:"lastTxHeight,omitempty"` +} + +// NewGetAccountTransactionsRequestParameters instantiates a new GetAccountTransactionsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAccountTransactionsRequestParameters(accountId string, pageSize int32, firstTxHash string) *GetAccountTransactionsRequestParameters { + this := GetAccountTransactionsRequestParameters{} + this.AccountId = accountId + this.PageSize = pageSize + this.FirstTxHash = firstTxHash + return &this +} + +// NewGetAccountTransactionsRequestParametersWithDefaults instantiates a new GetAccountTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountTransactionsRequestParametersWithDefaults() *GetAccountTransactionsRequestParameters { + this := GetAccountTransactionsRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountTransactionsRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountTransactionsRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountTransactionsRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountTransactionsRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetFirstTxHash returns the FirstTxHash field value +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHash() string { + if o == nil { + var ret string + return ret + } + + return o.FirstTxHash +} + +// GetFirstTxHashOk returns a tuple with the FirstTxHash field value +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FirstTxHash, true +} + +// SetFirstTxHash sets field value +func (o *GetAccountTransactionsRequestParameters) SetFirstTxHash(v string) { + o.FirstTxHash = v +} + +// GetFirstTxTime returns the FirstTxTime field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxTime() map[string]interface{} { + if o == nil || IsNil(o.FirstTxTime) { + var ret map[string]interface{} + return ret + } + return o.FirstTxTime +} + +// GetFirstTxTimeOk returns a tuple with the FirstTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FirstTxTime) { + return map[string]interface{}{}, false + } + return o.FirstTxTime, true +} + +// HasFirstTxTime returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasFirstTxTime() bool { + if o != nil && !IsNil(o.FirstTxTime) { + return true + } + + return false +} + +// SetFirstTxTime gets a reference to the given map[string]interface{} and assigns it to the FirstTxTime field. +func (o *GetAccountTransactionsRequestParameters) SetFirstTxTime(v map[string]interface{}) { + o.FirstTxTime = v +} + +// GetLastTxTime returns the LastTxTime field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetLastTxTime() map[string]interface{} { + if o == nil || IsNil(o.LastTxTime) { + var ret map[string]interface{} + return ret + } + return o.LastTxTime +} + +// GetLastTxTimeOk returns a tuple with the LastTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetLastTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.LastTxTime) { + return map[string]interface{}{}, false + } + return o.LastTxTime, true +} + +// HasLastTxTime returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasLastTxTime() bool { + if o != nil && !IsNil(o.LastTxTime) { + return true + } + + return false +} + +// SetLastTxTime gets a reference to the given map[string]interface{} and assigns it to the LastTxTime field. +func (o *GetAccountTransactionsRequestParameters) SetLastTxTime(v map[string]interface{}) { + o.LastTxTime = v +} + +// GetFirstTxHeight returns the FirstTxHeight field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHeight() int32 { + if o == nil || IsNil(o.FirstTxHeight) { + var ret int32 + return ret + } + return *o.FirstTxHeight +} + +// GetFirstTxHeightOk returns a tuple with the FirstTxHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHeightOk() (*int32, bool) { + if o == nil || IsNil(o.FirstTxHeight) { + return nil, false + } + return o.FirstTxHeight, true +} + +// HasFirstTxHeight returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasFirstTxHeight() bool { + if o != nil && !IsNil(o.FirstTxHeight) { + return true + } + + return false +} + +// SetFirstTxHeight gets a reference to the given int32 and assigns it to the FirstTxHeight field. +func (o *GetAccountTransactionsRequestParameters) SetFirstTxHeight(v int32) { + o.FirstTxHeight = &v +} + +// GetLastTxHeight returns the LastTxHeight field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetLastTxHeight() int32 { + if o == nil || IsNil(o.LastTxHeight) { + var ret int32 + return ret + } + return *o.LastTxHeight +} + +// GetLastTxHeightOk returns a tuple with the LastTxHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetLastTxHeightOk() (*int32, bool) { + if o == nil || IsNil(o.LastTxHeight) { + return nil, false + } + return o.LastTxHeight, true +} + +// HasLastTxHeight returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasLastTxHeight() bool { + if o != nil && !IsNil(o.LastTxHeight) { + return true + } + + return false +} + +// SetLastTxHeight gets a reference to the given int32 and assigns it to the LastTxHeight field. +func (o *GetAccountTransactionsRequestParameters) SetLastTxHeight(v int32) { + o.LastTxHeight = &v +} + +func (o GetAccountTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["pageSize"] = o.PageSize + toSerialize["firstTxHash"] = o.FirstTxHash + if !IsNil(o.FirstTxTime) { + toSerialize["firstTxTime"] = o.FirstTxTime + } + if !IsNil(o.LastTxTime) { + toSerialize["lastTxTime"] = o.LastTxTime + } + if !IsNil(o.FirstTxHeight) { + toSerialize["firstTxHeight"] = o.FirstTxHeight + } + if !IsNil(o.LastTxHeight) { + toSerialize["lastTxHeight"] = o.LastTxHeight + } + return toSerialize, nil +} + +type NullableGetAccountTransactionsRequestParameters struct { + value *GetAccountTransactionsRequestParameters + isSet bool +} + +func (v NullableGetAccountTransactionsRequestParameters) Get() *GetAccountTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetAccountTransactionsRequestParameters) Set(val *GetAccountTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountTransactionsRequestParameters(val *GetAccountTransactionsRequestParameters) *NullableGetAccountTransactionsRequestParameters { + return &NullableGetAccountTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go new file mode 100644 index 0000000000..ac3db713b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAssetInfoRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAssetInfoRequestParameters{} + +// GetAssetInfoRequestParameters The list of arguments to pass in to the transaction request to Get Asset Info. +type GetAssetInfoRequestParameters struct { + AssetId string `json:"assetId"` +} + +// NewGetAssetInfoRequestParameters instantiates a new GetAssetInfoRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAssetInfoRequestParameters(assetId string) *GetAssetInfoRequestParameters { + this := GetAssetInfoRequestParameters{} + this.AssetId = assetId + return &this +} + +// NewGetAssetInfoRequestParametersWithDefaults instantiates a new GetAssetInfoRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAssetInfoRequestParametersWithDefaults() *GetAssetInfoRequestParameters { + this := GetAssetInfoRequestParameters{} + return &this +} + +// GetAssetId returns the AssetId field value +func (o *GetAssetInfoRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *GetAssetInfoRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *GetAssetInfoRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +func (o GetAssetInfoRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAssetInfoRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetId"] = o.AssetId + return toSerialize, nil +} + +type NullableGetAssetInfoRequestParameters struct { + value *GetAssetInfoRequestParameters + isSet bool +} + +func (v NullableGetAssetInfoRequestParameters) Get() *GetAssetInfoRequestParameters { + return v.value +} + +func (v *NullableGetAssetInfoRequestParameters) Set(val *GetAssetInfoRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAssetInfoRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAssetInfoRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAssetInfoRequestParameters(val *GetAssetInfoRequestParameters) *NullableGetAssetInfoRequestParameters { + return &NullableGetAssetInfoRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAssetInfoRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAssetInfoRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go new file mode 100644 index 0000000000..be4141faee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestParameters{} + +// GetBlockRequestParameters The list of arguments to pass in to the transaction request to Get Block. +type GetBlockRequestParameters struct { + Height int32 `json:"height"` +} + +// NewGetBlockRequestParameters instantiates a new GetBlockRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBlockRequestParameters(height int32) *GetBlockRequestParameters { + this := GetBlockRequestParameters{} + this.Height = height + return &this +} + +// NewGetBlockRequestParametersWithDefaults instantiates a new GetBlockRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestParametersWithDefaults() *GetBlockRequestParameters { + this := GetBlockRequestParameters{} + return &this +} + +// GetHeight returns the Height field value +func (o *GetBlockRequestParameters) GetHeight() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Height +} + +// GetHeightOk returns a tuple with the Height field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestParameters) GetHeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Height, true +} + +// SetHeight sets field value +func (o *GetBlockRequestParameters) SetHeight(v int32) { + o.Height = v +} + +func (o GetBlockRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["height"] = o.Height + return toSerialize, nil +} + +type NullableGetBlockRequestParameters struct { + value *GetBlockRequestParameters + isSet bool +} + +func (v NullableGetBlockRequestParameters) Get() *GetBlockRequestParameters { + return v.value +} + +func (v *NullableGetBlockRequestParameters) Set(val *GetBlockRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestParameters(val *GetBlockRequestParameters) *NullableGetBlockRequestParameters { + return &NullableGetBlockRequestParameters{value: val, isSet: true} +} + +func (v NullableGetBlockRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go new file mode 100644 index 0000000000..96d1d008d1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetEngineReceiptsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetEngineReceiptsRequestParameters{} + +// GetEngineReceiptsRequestParameters The list of arguments to pass in to the transaction request to Get Engine Receipts. +type GetEngineReceiptsRequestParameters struct { + TxHash string `json:"txHash"` +} + +// NewGetEngineReceiptsRequestParameters instantiates a new GetEngineReceiptsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetEngineReceiptsRequestParameters(txHash string) *GetEngineReceiptsRequestParameters { + this := GetEngineReceiptsRequestParameters{} + this.TxHash = txHash + return &this +} + +// NewGetEngineReceiptsRequestParametersWithDefaults instantiates a new GetEngineReceiptsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetEngineReceiptsRequestParametersWithDefaults() *GetEngineReceiptsRequestParameters { + this := GetEngineReceiptsRequestParameters{} + return &this +} + +// GetTxHash returns the TxHash field value +func (o *GetEngineReceiptsRequestParameters) GetTxHash() string { + if o == nil { + var ret string + return ret + } + + return o.TxHash +} + +// GetTxHashOk returns a tuple with the TxHash field value +// and a boolean to check if the value has been set. +func (o *GetEngineReceiptsRequestParameters) GetTxHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TxHash, true +} + +// SetTxHash sets field value +func (o *GetEngineReceiptsRequestParameters) SetTxHash(v string) { + o.TxHash = v +} + +func (o GetEngineReceiptsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetEngineReceiptsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["txHash"] = o.TxHash + return toSerialize, nil +} + +type NullableGetEngineReceiptsRequestParameters struct { + value *GetEngineReceiptsRequestParameters + isSet bool +} + +func (v NullableGetEngineReceiptsRequestParameters) Get() *GetEngineReceiptsRequestParameters { + return v.value +} + +func (v *NullableGetEngineReceiptsRequestParameters) Set(val *GetEngineReceiptsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetEngineReceiptsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetEngineReceiptsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetEngineReceiptsRequestParameters(val *GetEngineReceiptsRequestParameters) *NullableGetEngineReceiptsRequestParameters { + return &NullableGetEngineReceiptsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetEngineReceiptsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetEngineReceiptsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go new file mode 100644 index 0000000000..79bda3fc20 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetPendingTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetPendingTransactionsRequestParameters{} + +// GetPendingTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Pending Transactions. +type GetPendingTransactionsRequestParameters struct { + PageSize int32 `json:"pageSize"` + FirstTxHash *string `json:"firstTxHash,omitempty"` + FirstTxTime map[string]interface{} `json:"firstTxTime,omitempty"` + LastTxTime map[string]interface{} `json:"lastTxTime,omitempty"` +} + +// NewGetPendingTransactionsRequestParameters instantiates a new GetPendingTransactionsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetPendingTransactionsRequestParameters(pageSize int32) *GetPendingTransactionsRequestParameters { + this := GetPendingTransactionsRequestParameters{} + this.PageSize = pageSize + return &this +} + +// NewGetPendingTransactionsRequestParametersWithDefaults instantiates a new GetPendingTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPendingTransactionsRequestParametersWithDefaults() *GetPendingTransactionsRequestParameters { + this := GetPendingTransactionsRequestParameters{} + return &this +} + +// GetPageSize returns the PageSize field value +func (o *GetPendingTransactionsRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetPendingTransactionsRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetFirstTxHash returns the FirstTxHash field value if set, zero value otherwise. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxHash() string { + if o == nil || IsNil(o.FirstTxHash) { + var ret string + return ret + } + return *o.FirstTxHash +} + +// GetFirstTxHashOk returns a tuple with the FirstTxHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxHashOk() (*string, bool) { + if o == nil || IsNil(o.FirstTxHash) { + return nil, false + } + return o.FirstTxHash, true +} + +// HasFirstTxHash returns a boolean if a field has been set. +func (o *GetPendingTransactionsRequestParameters) HasFirstTxHash() bool { + if o != nil && !IsNil(o.FirstTxHash) { + return true + } + + return false +} + +// SetFirstTxHash gets a reference to the given string and assigns it to the FirstTxHash field. +func (o *GetPendingTransactionsRequestParameters) SetFirstTxHash(v string) { + o.FirstTxHash = &v +} + +// GetFirstTxTime returns the FirstTxTime field value if set, zero value otherwise. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxTime() map[string]interface{} { + if o == nil || IsNil(o.FirstTxTime) { + var ret map[string]interface{} + return ret + } + return o.FirstTxTime +} + +// GetFirstTxTimeOk returns a tuple with the FirstTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FirstTxTime) { + return map[string]interface{}{}, false + } + return o.FirstTxTime, true +} + +// HasFirstTxTime returns a boolean if a field has been set. +func (o *GetPendingTransactionsRequestParameters) HasFirstTxTime() bool { + if o != nil && !IsNil(o.FirstTxTime) { + return true + } + + return false +} + +// SetFirstTxTime gets a reference to the given map[string]interface{} and assigns it to the FirstTxTime field. +func (o *GetPendingTransactionsRequestParameters) SetFirstTxTime(v map[string]interface{}) { + o.FirstTxTime = v +} + +// GetLastTxTime returns the LastTxTime field value if set, zero value otherwise. +func (o *GetPendingTransactionsRequestParameters) GetLastTxTime() map[string]interface{} { + if o == nil || IsNil(o.LastTxTime) { + var ret map[string]interface{} + return ret + } + return o.LastTxTime +} + +// GetLastTxTimeOk returns a tuple with the LastTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetLastTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.LastTxTime) { + return map[string]interface{}{}, false + } + return o.LastTxTime, true +} + +// HasLastTxTime returns a boolean if a field has been set. +func (o *GetPendingTransactionsRequestParameters) HasLastTxTime() bool { + if o != nil && !IsNil(o.LastTxTime) { + return true + } + + return false +} + +// SetLastTxTime gets a reference to the given map[string]interface{} and assigns it to the LastTxTime field. +func (o *GetPendingTransactionsRequestParameters) SetLastTxTime(v map[string]interface{}) { + o.LastTxTime = v +} + +func (o GetPendingTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPendingTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pageSize"] = o.PageSize + if !IsNil(o.FirstTxHash) { + toSerialize["firstTxHash"] = o.FirstTxHash + } + if !IsNil(o.FirstTxTime) { + toSerialize["firstTxTime"] = o.FirstTxTime + } + if !IsNil(o.LastTxTime) { + toSerialize["lastTxTime"] = o.LastTxTime + } + return toSerialize, nil +} + +type NullableGetPendingTransactionsRequestParameters struct { + value *GetPendingTransactionsRequestParameters + isSet bool +} + +func (v NullableGetPendingTransactionsRequestParameters) Get() *GetPendingTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetPendingTransactionsRequestParameters) Set(val *GetPendingTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetPendingTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPendingTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPendingTransactionsRequestParameters(val *GetPendingTransactionsRequestParameters) *NullableGetPendingTransactionsRequestParameters { + return &NullableGetPendingTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetPendingTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPendingTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go new file mode 100644 index 0000000000..00e9c3cd0e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetRolePermissionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRolePermissionsRequestParameters{} + +// GetRolePermissionsRequestParameters The list of arguments to pass in to the transaction request to Get Role Permissions. +type GetRolePermissionsRequestParameters struct { + RoleId string `json:"roleId"` +} + +// NewGetRolePermissionsRequestParameters instantiates a new GetRolePermissionsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRolePermissionsRequestParameters(roleId string) *GetRolePermissionsRequestParameters { + this := GetRolePermissionsRequestParameters{} + this.RoleId = roleId + return &this +} + +// NewGetRolePermissionsRequestParametersWithDefaults instantiates a new GetRolePermissionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRolePermissionsRequestParametersWithDefaults() *GetRolePermissionsRequestParameters { + this := GetRolePermissionsRequestParameters{} + return &this +} + +// GetRoleId returns the RoleId field value +func (o *GetRolePermissionsRequestParameters) GetRoleId() string { + if o == nil { + var ret string + return ret + } + + return o.RoleId +} + +// GetRoleIdOk returns a tuple with the RoleId field value +// and a boolean to check if the value has been set. +func (o *GetRolePermissionsRequestParameters) GetRoleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleId, true +} + +// SetRoleId sets field value +func (o *GetRolePermissionsRequestParameters) SetRoleId(v string) { + o.RoleId = v +} + +func (o GetRolePermissionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRolePermissionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roleId"] = o.RoleId + return toSerialize, nil +} + +type NullableGetRolePermissionsRequestParameters struct { + value *GetRolePermissionsRequestParameters + isSet bool +} + +func (v NullableGetRolePermissionsRequestParameters) Get() *GetRolePermissionsRequestParameters { + return v.value +} + +func (v *NullableGetRolePermissionsRequestParameters) Set(val *GetRolePermissionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetRolePermissionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRolePermissionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRolePermissionsRequestParameters(val *GetRolePermissionsRequestParameters) *NullableGetRolePermissionsRequestParameters { + return &NullableGetRolePermissionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetRolePermissionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRolePermissionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go new file mode 100644 index 0000000000..ab5e2f282c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetSignatoriesRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSignatoriesRequestParameters{} + +// GetSignatoriesRequestParameters The list of arguments to pass in to the transaction request to Get Signatories. +type GetSignatoriesRequestParameters struct { + AccountId string `json:"accountId"` +} + +// NewGetSignatoriesRequestParameters instantiates a new GetSignatoriesRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetSignatoriesRequestParameters(accountId string) *GetSignatoriesRequestParameters { + this := GetSignatoriesRequestParameters{} + this.AccountId = accountId + return &this +} + +// NewGetSignatoriesRequestParametersWithDefaults instantiates a new GetSignatoriesRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetSignatoriesRequestParametersWithDefaults() *GetSignatoriesRequestParameters { + this := GetSignatoriesRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetSignatoriesRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetSignatoriesRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetSignatoriesRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +func (o GetSignatoriesRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSignatoriesRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + return toSerialize, nil +} + +type NullableGetSignatoriesRequestParameters struct { + value *GetSignatoriesRequestParameters + isSet bool +} + +func (v NullableGetSignatoriesRequestParameters) Get() *GetSignatoriesRequestParameters { + return v.value +} + +func (v *NullableGetSignatoriesRequestParameters) Set(val *GetSignatoriesRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetSignatoriesRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSignatoriesRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSignatoriesRequestParameters(val *GetSignatoriesRequestParameters) *NullableGetSignatoriesRequestParameters { + return &NullableGetSignatoriesRequestParameters{value: val, isSet: true} +} + +func (v NullableGetSignatoriesRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSignatoriesRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go new file mode 100644 index 0000000000..42e985ed52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionsRequestParameters{} + +// GetTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Transactions. +type GetTransactionsRequestParameters struct { + TxHashesList []string `json:"txHashesList"` +} + +// NewGetTransactionsRequestParameters instantiates a new GetTransactionsRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTransactionsRequestParameters(txHashesList []string) *GetTransactionsRequestParameters { + this := GetTransactionsRequestParameters{} + this.TxHashesList = txHashesList + return &this +} + +// NewGetTransactionsRequestParametersWithDefaults instantiates a new GetTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionsRequestParametersWithDefaults() *GetTransactionsRequestParameters { + this := GetTransactionsRequestParameters{} + return &this +} + +// GetTxHashesList returns the TxHashesList field value +func (o *GetTransactionsRequestParameters) GetTxHashesList() []string { + if o == nil { + var ret []string + return ret + } + + return o.TxHashesList +} + +// GetTxHashesListOk returns a tuple with the TxHashesList field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsRequestParameters) GetTxHashesListOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TxHashesList, true +} + +// SetTxHashesList sets field value +func (o *GetTransactionsRequestParameters) SetTxHashesList(v []string) { + o.TxHashesList = v +} + +func (o GetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["txHashesList"] = o.TxHashesList + return toSerialize, nil +} + +type NullableGetTransactionsRequestParameters struct { + value *GetTransactionsRequestParameters + isSet bool +} + +func (v NullableGetTransactionsRequestParameters) Get() *GetTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetTransactionsRequestParameters) Set(val *GetTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionsRequestParameters(val *GetTransactionsRequestParameters) *NullableGetTransactionsRequestParameters { + return &NullableGetTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go new file mode 100644 index 0000000000..d932ffbdfa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GrantPermissionRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GrantPermissionRequestParameters{} + +// GrantPermissionRequestParameters The list of arguments to pass in to the transaction request to Grant Permission. +type GrantPermissionRequestParameters struct { + AccountId string `json:"accountId"` + Permission string `json:"permission"` +} + +// NewGrantPermissionRequestParameters instantiates a new GrantPermissionRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGrantPermissionRequestParameters(accountId string, permission string) *GrantPermissionRequestParameters { + this := GrantPermissionRequestParameters{} + this.AccountId = accountId + this.Permission = permission + return &this +} + +// NewGrantPermissionRequestParametersWithDefaults instantiates a new GrantPermissionRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGrantPermissionRequestParametersWithDefaults() *GrantPermissionRequestParameters { + this := GrantPermissionRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GrantPermissionRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GrantPermissionRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GrantPermissionRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPermission returns the Permission field value +func (o *GrantPermissionRequestParameters) GetPermission() string { + if o == nil { + var ret string + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *GrantPermissionRequestParameters) GetPermissionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *GrantPermissionRequestParameters) SetPermission(v string) { + o.Permission = v +} + +func (o GrantPermissionRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GrantPermissionRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["permission"] = o.Permission + return toSerialize, nil +} + +type NullableGrantPermissionRequestParameters struct { + value *GrantPermissionRequestParameters + isSet bool +} + +func (v NullableGrantPermissionRequestParameters) Get() *GrantPermissionRequestParameters { + return v.value +} + +func (v *NullableGrantPermissionRequestParameters) Set(val *GrantPermissionRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGrantPermissionRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGrantPermissionRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGrantPermissionRequestParameters(val *GrantPermissionRequestParameters) *NullableGrantPermissionRequestParameters { + return &NullableGrantPermissionRequestParameters{value: val, isSet: true} +} + +func (v NullableGrantPermissionRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGrantPermissionRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go new file mode 100644 index 0000000000..1b6d1d1c35 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go @@ -0,0 +1,422 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBaseConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBaseConfig{} + +// IrohaBaseConfig struct for IrohaBaseConfig +type IrohaBaseConfig struct { + IrohaHost *string `json:"irohaHost,omitempty"` + IrohaPort *float32 `json:"irohaPort,omitempty"` + CreatorAccountId *string `json:"creatorAccountId,omitempty"` + PrivKey []interface{} `json:"privKey,omitempty"` + Quorum *float32 `json:"quorum,omitempty"` + TimeoutLimit *float32 `json:"timeoutLimit,omitempty"` + // Can only be set to false for an insecure grpc connection. + Tls *bool `json:"tls,omitempty"` + // Flag used for monitoring. It changes default beahviour of transaction wrapper so it return error to caller instead of throwing RuntimeError straight away. + MonitorMode NullableBool `json:"monitorMode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IrohaBaseConfig IrohaBaseConfig + +// NewIrohaBaseConfig instantiates a new IrohaBaseConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaBaseConfig() *IrohaBaseConfig { + this := IrohaBaseConfig{} + return &this +} + +// NewIrohaBaseConfigWithDefaults instantiates a new IrohaBaseConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBaseConfigWithDefaults() *IrohaBaseConfig { + this := IrohaBaseConfig{} + return &this +} + +// GetIrohaHost returns the IrohaHost field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetIrohaHost() string { + if o == nil || IsNil(o.IrohaHost) { + var ret string + return ret + } + return *o.IrohaHost +} + +// GetIrohaHostOk returns a tuple with the IrohaHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetIrohaHostOk() (*string, bool) { + if o == nil || IsNil(o.IrohaHost) { + return nil, false + } + return o.IrohaHost, true +} + +// HasIrohaHost returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasIrohaHost() bool { + if o != nil && !IsNil(o.IrohaHost) { + return true + } + + return false +} + +// SetIrohaHost gets a reference to the given string and assigns it to the IrohaHost field. +func (o *IrohaBaseConfig) SetIrohaHost(v string) { + o.IrohaHost = &v +} + +// GetIrohaPort returns the IrohaPort field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetIrohaPort() float32 { + if o == nil || IsNil(o.IrohaPort) { + var ret float32 + return ret + } + return *o.IrohaPort +} + +// GetIrohaPortOk returns a tuple with the IrohaPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetIrohaPortOk() (*float32, bool) { + if o == nil || IsNil(o.IrohaPort) { + return nil, false + } + return o.IrohaPort, true +} + +// HasIrohaPort returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasIrohaPort() bool { + if o != nil && !IsNil(o.IrohaPort) { + return true + } + + return false +} + +// SetIrohaPort gets a reference to the given float32 and assigns it to the IrohaPort field. +func (o *IrohaBaseConfig) SetIrohaPort(v float32) { + o.IrohaPort = &v +} + +// GetCreatorAccountId returns the CreatorAccountId field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetCreatorAccountId() string { + if o == nil || IsNil(o.CreatorAccountId) { + var ret string + return ret + } + return *o.CreatorAccountId +} + +// GetCreatorAccountIdOk returns a tuple with the CreatorAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetCreatorAccountIdOk() (*string, bool) { + if o == nil || IsNil(o.CreatorAccountId) { + return nil, false + } + return o.CreatorAccountId, true +} + +// HasCreatorAccountId returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasCreatorAccountId() bool { + if o != nil && !IsNil(o.CreatorAccountId) { + return true + } + + return false +} + +// SetCreatorAccountId gets a reference to the given string and assigns it to the CreatorAccountId field. +func (o *IrohaBaseConfig) SetCreatorAccountId(v string) { + o.CreatorAccountId = &v +} + +// GetPrivKey returns the PrivKey field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetPrivKey() []interface{} { + if o == nil || IsNil(o.PrivKey) { + var ret []interface{} + return ret + } + return o.PrivKey +} + +// GetPrivKeyOk returns a tuple with the PrivKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetPrivKeyOk() ([]interface{}, bool) { + if o == nil || IsNil(o.PrivKey) { + return nil, false + } + return o.PrivKey, true +} + +// HasPrivKey returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasPrivKey() bool { + if o != nil && !IsNil(o.PrivKey) { + return true + } + + return false +} + +// SetPrivKey gets a reference to the given []interface{} and assigns it to the PrivKey field. +func (o *IrohaBaseConfig) SetPrivKey(v []interface{}) { + o.PrivKey = v +} + +// GetQuorum returns the Quorum field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetQuorum() float32 { + if o == nil || IsNil(o.Quorum) { + var ret float32 + return ret + } + return *o.Quorum +} + +// GetQuorumOk returns a tuple with the Quorum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetQuorumOk() (*float32, bool) { + if o == nil || IsNil(o.Quorum) { + return nil, false + } + return o.Quorum, true +} + +// HasQuorum returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasQuorum() bool { + if o != nil && !IsNil(o.Quorum) { + return true + } + + return false +} + +// SetQuorum gets a reference to the given float32 and assigns it to the Quorum field. +func (o *IrohaBaseConfig) SetQuorum(v float32) { + o.Quorum = &v +} + +// GetTimeoutLimit returns the TimeoutLimit field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetTimeoutLimit() float32 { + if o == nil || IsNil(o.TimeoutLimit) { + var ret float32 + return ret + } + return *o.TimeoutLimit +} + +// GetTimeoutLimitOk returns a tuple with the TimeoutLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetTimeoutLimitOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutLimit) { + return nil, false + } + return o.TimeoutLimit, true +} + +// HasTimeoutLimit returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasTimeoutLimit() bool { + if o != nil && !IsNil(o.TimeoutLimit) { + return true + } + + return false +} + +// SetTimeoutLimit gets a reference to the given float32 and assigns it to the TimeoutLimit field. +func (o *IrohaBaseConfig) SetTimeoutLimit(v float32) { + o.TimeoutLimit = &v +} + +// GetTls returns the Tls field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetTls() bool { + if o == nil || IsNil(o.Tls) { + var ret bool + return ret + } + return *o.Tls +} + +// GetTlsOk returns a tuple with the Tls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetTlsOk() (*bool, bool) { + if o == nil || IsNil(o.Tls) { + return nil, false + } + return o.Tls, true +} + +// HasTls returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasTls() bool { + if o != nil && !IsNil(o.Tls) { + return true + } + + return false +} + +// SetTls gets a reference to the given bool and assigns it to the Tls field. +func (o *IrohaBaseConfig) SetTls(v bool) { + o.Tls = &v +} + +// GetMonitorMode returns the MonitorMode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IrohaBaseConfig) GetMonitorMode() bool { + if o == nil || IsNil(o.MonitorMode.Get()) { + var ret bool + return ret + } + return *o.MonitorMode.Get() +} + +// GetMonitorModeOk returns a tuple with the MonitorMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IrohaBaseConfig) GetMonitorModeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.MonitorMode.Get(), o.MonitorMode.IsSet() +} + +// HasMonitorMode returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasMonitorMode() bool { + if o != nil && o.MonitorMode.IsSet() { + return true + } + + return false +} + +// SetMonitorMode gets a reference to the given NullableBool and assigns it to the MonitorMode field. +func (o *IrohaBaseConfig) SetMonitorMode(v bool) { + o.MonitorMode.Set(&v) +} +// SetMonitorModeNil sets the value for MonitorMode to be an explicit nil +func (o *IrohaBaseConfig) SetMonitorModeNil() { + o.MonitorMode.Set(nil) +} + +// UnsetMonitorMode ensures that no value is present for MonitorMode, not even an explicit nil +func (o *IrohaBaseConfig) UnsetMonitorMode() { + o.MonitorMode.Unset() +} + +func (o IrohaBaseConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBaseConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IrohaHost) { + toSerialize["irohaHost"] = o.IrohaHost + } + if !IsNil(o.IrohaPort) { + toSerialize["irohaPort"] = o.IrohaPort + } + if !IsNil(o.CreatorAccountId) { + toSerialize["creatorAccountId"] = o.CreatorAccountId + } + if !IsNil(o.PrivKey) { + toSerialize["privKey"] = o.PrivKey + } + if !IsNil(o.Quorum) { + toSerialize["quorum"] = o.Quorum + } + if !IsNil(o.TimeoutLimit) { + toSerialize["timeoutLimit"] = o.TimeoutLimit + } + if !IsNil(o.Tls) { + toSerialize["tls"] = o.Tls + } + if o.MonitorMode.IsSet() { + toSerialize["monitorMode"] = o.MonitorMode.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IrohaBaseConfig) UnmarshalJSON(bytes []byte) (err error) { + varIrohaBaseConfig := _IrohaBaseConfig{} + + if err = json.Unmarshal(bytes, &varIrohaBaseConfig); err == nil { + *o = IrohaBaseConfig(varIrohaBaseConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "irohaHost") + delete(additionalProperties, "irohaPort") + delete(additionalProperties, "creatorAccountId") + delete(additionalProperties, "privKey") + delete(additionalProperties, "quorum") + delete(additionalProperties, "timeoutLimit") + delete(additionalProperties, "tls") + delete(additionalProperties, "monitorMode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIrohaBaseConfig struct { + value *IrohaBaseConfig + isSet bool +} + +func (v NullableIrohaBaseConfig) Get() *IrohaBaseConfig { + return v.value +} + +func (v *NullableIrohaBaseConfig) Set(val *IrohaBaseConfig) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBaseConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBaseConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBaseConfig(val *IrohaBaseConfig) *NullableIrohaBaseConfig { + return &NullableIrohaBaseConfig{value: val, isSet: true} +} + +func (v NullableIrohaBaseConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBaseConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go new file mode 100644 index 0000000000..fe53c86747 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBlockProgress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBlockProgress{} + +// IrohaBlockProgress struct for IrohaBlockProgress +type IrohaBlockProgress struct { + TransactionReceipt IrohaBlockResponse `json:"transactionReceipt"` +} + +// NewIrohaBlockProgress instantiates a new IrohaBlockProgress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaBlockProgress(transactionReceipt IrohaBlockResponse) *IrohaBlockProgress { + this := IrohaBlockProgress{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewIrohaBlockProgressWithDefaults instantiates a new IrohaBlockProgress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBlockProgressWithDefaults() *IrohaBlockProgress { + this := IrohaBlockProgress{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *IrohaBlockProgress) GetTransactionReceipt() IrohaBlockResponse { + if o == nil { + var ret IrohaBlockResponse + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockProgress) GetTransactionReceiptOk() (*IrohaBlockResponse, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *IrohaBlockProgress) SetTransactionReceipt(v IrohaBlockResponse) { + o.TransactionReceipt = v +} + +func (o IrohaBlockProgress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBlockProgress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableIrohaBlockProgress struct { + value *IrohaBlockProgress + isSet bool +} + +func (v NullableIrohaBlockProgress) Get() *IrohaBlockProgress { + return v.value +} + +func (v *NullableIrohaBlockProgress) Set(val *IrohaBlockProgress) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBlockProgress) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBlockProgress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBlockProgress(val *IrohaBlockProgress) *NullableIrohaBlockProgress { + return &NullableIrohaBlockProgress{value: val, isSet: true} +} + +func (v NullableIrohaBlockProgress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBlockProgress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go new file mode 100644 index 0000000000..3dbfe80be1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBlockResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBlockResponse{} + +// IrohaBlockResponse struct for IrohaBlockResponse +type IrohaBlockResponse struct { + Payload IrohaBlockResponsePayload `json:"payload"` + SignaturesList []interface{} `json:"signaturesList"` +} + +// NewIrohaBlockResponse instantiates a new IrohaBlockResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaBlockResponse(payload IrohaBlockResponsePayload, signaturesList []interface{}) *IrohaBlockResponse { + this := IrohaBlockResponse{} + this.Payload = payload + this.SignaturesList = signaturesList + return &this +} + +// NewIrohaBlockResponseWithDefaults instantiates a new IrohaBlockResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBlockResponseWithDefaults() *IrohaBlockResponse { + this := IrohaBlockResponse{} + return &this +} + +// GetPayload returns the Payload field value +func (o *IrohaBlockResponse) GetPayload() IrohaBlockResponsePayload { + if o == nil { + var ret IrohaBlockResponsePayload + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponse) GetPayloadOk() (*IrohaBlockResponsePayload, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *IrohaBlockResponse) SetPayload(v IrohaBlockResponsePayload) { + o.Payload = v +} + +// GetSignaturesList returns the SignaturesList field value +func (o *IrohaBlockResponse) GetSignaturesList() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.SignaturesList +} + +// GetSignaturesListOk returns a tuple with the SignaturesList field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponse) GetSignaturesListOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.SignaturesList, true +} + +// SetSignaturesList sets field value +func (o *IrohaBlockResponse) SetSignaturesList(v []interface{}) { + o.SignaturesList = v +} + +func (o IrohaBlockResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBlockResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + toSerialize["signaturesList"] = o.SignaturesList + return toSerialize, nil +} + +type NullableIrohaBlockResponse struct { + value *IrohaBlockResponse + isSet bool +} + +func (v NullableIrohaBlockResponse) Get() *IrohaBlockResponse { + return v.value +} + +func (v *NullableIrohaBlockResponse) Set(val *IrohaBlockResponse) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBlockResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBlockResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBlockResponse(val *IrohaBlockResponse) *NullableIrohaBlockResponse { + return &NullableIrohaBlockResponse{value: val, isSet: true} +} + +func (v NullableIrohaBlockResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBlockResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go new file mode 100644 index 0000000000..ab08c64059 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBlockResponsePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBlockResponsePayload{} + +// IrohaBlockResponsePayload struct for IrohaBlockResponsePayload +type IrohaBlockResponsePayload struct { + TransactionsList []interface{} `json:"transactionsList"` + TxNumber float32 `json:"txNumber"` + Height float32 `json:"height"` + PrevBlockHash string `json:"prevBlockHash"` + CreatedTime float32 `json:"createdTime"` + RejectedTransactionsHashesList []interface{} `json:"rejectedTransactionsHashesList"` +} + +// NewIrohaBlockResponsePayload instantiates a new IrohaBlockResponsePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaBlockResponsePayload(transactionsList []interface{}, txNumber float32, height float32, prevBlockHash string, createdTime float32, rejectedTransactionsHashesList []interface{}) *IrohaBlockResponsePayload { + this := IrohaBlockResponsePayload{} + this.TransactionsList = transactionsList + this.TxNumber = txNumber + this.Height = height + this.PrevBlockHash = prevBlockHash + this.CreatedTime = createdTime + this.RejectedTransactionsHashesList = rejectedTransactionsHashesList + return &this +} + +// NewIrohaBlockResponsePayloadWithDefaults instantiates a new IrohaBlockResponsePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBlockResponsePayloadWithDefaults() *IrohaBlockResponsePayload { + this := IrohaBlockResponsePayload{} + return &this +} + +// GetTransactionsList returns the TransactionsList field value +func (o *IrohaBlockResponsePayload) GetTransactionsList() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.TransactionsList +} + +// GetTransactionsListOk returns a tuple with the TransactionsList field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetTransactionsListOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.TransactionsList, true +} + +// SetTransactionsList sets field value +func (o *IrohaBlockResponsePayload) SetTransactionsList(v []interface{}) { + o.TransactionsList = v +} + +// GetTxNumber returns the TxNumber field value +func (o *IrohaBlockResponsePayload) GetTxNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TxNumber +} + +// GetTxNumberOk returns a tuple with the TxNumber field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetTxNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TxNumber, true +} + +// SetTxNumber sets field value +func (o *IrohaBlockResponsePayload) SetTxNumber(v float32) { + o.TxNumber = v +} + +// GetHeight returns the Height field value +func (o *IrohaBlockResponsePayload) GetHeight() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Height +} + +// GetHeightOk returns a tuple with the Height field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetHeightOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Height, true +} + +// SetHeight sets field value +func (o *IrohaBlockResponsePayload) SetHeight(v float32) { + o.Height = v +} + +// GetPrevBlockHash returns the PrevBlockHash field value +func (o *IrohaBlockResponsePayload) GetPrevBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.PrevBlockHash +} + +// GetPrevBlockHashOk returns a tuple with the PrevBlockHash field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetPrevBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrevBlockHash, true +} + +// SetPrevBlockHash sets field value +func (o *IrohaBlockResponsePayload) SetPrevBlockHash(v string) { + o.PrevBlockHash = v +} + +// GetCreatedTime returns the CreatedTime field value +func (o *IrohaBlockResponsePayload) GetCreatedTime() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetCreatedTimeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CreatedTime, true +} + +// SetCreatedTime sets field value +func (o *IrohaBlockResponsePayload) SetCreatedTime(v float32) { + o.CreatedTime = v +} + +// GetRejectedTransactionsHashesList returns the RejectedTransactionsHashesList field value +func (o *IrohaBlockResponsePayload) GetRejectedTransactionsHashesList() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.RejectedTransactionsHashesList +} + +// GetRejectedTransactionsHashesListOk returns a tuple with the RejectedTransactionsHashesList field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetRejectedTransactionsHashesListOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.RejectedTransactionsHashesList, true +} + +// SetRejectedTransactionsHashesList sets field value +func (o *IrohaBlockResponsePayload) SetRejectedTransactionsHashesList(v []interface{}) { + o.RejectedTransactionsHashesList = v +} + +func (o IrohaBlockResponsePayload) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBlockResponsePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionsList"] = o.TransactionsList + toSerialize["txNumber"] = o.TxNumber + toSerialize["height"] = o.Height + toSerialize["prevBlockHash"] = o.PrevBlockHash + toSerialize["createdTime"] = o.CreatedTime + toSerialize["rejectedTransactionsHashesList"] = o.RejectedTransactionsHashesList + return toSerialize, nil +} + +type NullableIrohaBlockResponsePayload struct { + value *IrohaBlockResponsePayload + isSet bool +} + +func (v NullableIrohaBlockResponsePayload) Get() *IrohaBlockResponsePayload { + return v.value +} + +func (v *NullableIrohaBlockResponsePayload) Set(val *IrohaBlockResponsePayload) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBlockResponsePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBlockResponsePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBlockResponsePayload(val *IrohaBlockResponsePayload) *NullableIrohaBlockResponsePayload { + return &NullableIrohaBlockResponsePayload{value: val, isSet: true} +} + +func (v NullableIrohaBlockResponsePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBlockResponsePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go new file mode 100644 index 0000000000..550fd94930 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go @@ -0,0 +1,147 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// IrohaCommand the model 'IrohaCommand' +type IrohaCommand string + +// List of IrohaCommand +const ( + CreateAccount IrohaCommand = "createAccount" + SetAccountDetail IrohaCommand = "setAccountDetail" + SetAccountQuorum IrohaCommand = "setAccountQuorum" + CompareAndSetAccountDetail IrohaCommand = "compareAndSetAccountDetail" + CreateAsset IrohaCommand = "createAsset" + AddAssetQuantity IrohaCommand = "addAssetQuantity" + SubtractAssetQuantity IrohaCommand = "subtractAssetQuantity" + TransferAsset IrohaCommand = "transferAsset" + CreateDomain IrohaCommand = "createDomain" + CreateRole IrohaCommand = "createRole" + DetachRole IrohaCommand = "detachRole" + AppendRole IrohaCommand = "appendRole" + AddSignatory IrohaCommand = "addSignatory" + RemoveSignatory IrohaCommand = "removeSignatory" + GrantPermission IrohaCommand = "grantPermission" + RevokePermission IrohaCommand = "revokePermission" + AddPeer IrohaCommand = "addPeer" + RemovePeer IrohaCommand = "removePeer" + SetSettingValue IrohaCommand = "setSettingValue" + CallEngine IrohaCommand = "callEngine" +) + +// All allowed values of IrohaCommand enum +var AllowedIrohaCommandEnumValues = []IrohaCommand{ + "createAccount", + "setAccountDetail", + "setAccountQuorum", + "compareAndSetAccountDetail", + "createAsset", + "addAssetQuantity", + "subtractAssetQuantity", + "transferAsset", + "createDomain", + "createRole", + "detachRole", + "appendRole", + "addSignatory", + "removeSignatory", + "grantPermission", + "revokePermission", + "addPeer", + "removePeer", + "setSettingValue", + "callEngine", +} + +func (v *IrohaCommand) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaCommand(value) + for _, existing := range AllowedIrohaCommandEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaCommand", value) +} + +// NewIrohaCommandFromValue returns a pointer to a valid IrohaCommand +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaCommandFromValue(v string) (*IrohaCommand, error) { + ev := IrohaCommand(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaCommand: valid values are %v", v, AllowedIrohaCommandEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaCommand) IsValid() bool { + for _, existing := range AllowedIrohaCommandEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaCommand value +func (v IrohaCommand) Ptr() *IrohaCommand { + return &v +} + +type NullableIrohaCommand struct { + value *IrohaCommand + isSet bool +} + +func (v NullableIrohaCommand) Get() *IrohaCommand { + return v.value +} + +func (v *NullableIrohaCommand) Set(val *IrohaCommand) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaCommand) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaCommand) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaCommand(val *IrohaCommand) *NullableIrohaCommand { + return &NullableIrohaCommand{value: val, isSet: true} +} + +func (v NullableIrohaCommand) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaCommand) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go new file mode 100644 index 0000000000..1179112663 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go @@ -0,0 +1,137 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// IrohaQuery the model 'IrohaQuery' +type IrohaQuery string + +// List of IrohaQuery +const ( + GetAccount IrohaQuery = "getAccount" + GetAccountDetail IrohaQuery = "getAccountDetail" + GetAssetInfo IrohaQuery = "getAssetInfo" + GetAccountAssets IrohaQuery = "getAccountAssets" + GetTransactions IrohaQuery = "getTransactions" + GetPendingTransactions IrohaQuery = "getPendingTransactions" + GetAccountTransactions IrohaQuery = "getAccountTransactions" + GetAccountAssetTransactions IrohaQuery = "getAccountAssetTransactions" + GetRoles IrohaQuery = "getRoles" + GetSignatories IrohaQuery = "getSignatories" + GetRolePermissions IrohaQuery = "getRolePermissions" + GetBlock IrohaQuery = "getBlock" + GetEngineReceipts IrohaQuery = "getEngineReceipts" + FetchCommits IrohaQuery = "fetchCommits" + GetPeers IrohaQuery = "getPeers" +) + +// All allowed values of IrohaQuery enum +var AllowedIrohaQueryEnumValues = []IrohaQuery{ + "getAccount", + "getAccountDetail", + "getAssetInfo", + "getAccountAssets", + "getTransactions", + "getPendingTransactions", + "getAccountTransactions", + "getAccountAssetTransactions", + "getRoles", + "getSignatories", + "getRolePermissions", + "getBlock", + "getEngineReceipts", + "fetchCommits", + "getPeers", +} + +func (v *IrohaQuery) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaQuery(value) + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaQuery", value) +} + +// NewIrohaQueryFromValue returns a pointer to a valid IrohaQuery +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaQueryFromValue(v string) (*IrohaQuery, error) { + ev := IrohaQuery(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaQuery: valid values are %v", v, AllowedIrohaQueryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaQuery) IsValid() bool { + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaQuery value +func (v IrohaQuery) Ptr() *IrohaQuery { + return &v +} + +type NullableIrohaQuery struct { + value *IrohaQuery + isSet bool +} + +func (v NullableIrohaQuery) Get() *IrohaQuery { + return v.value +} + +func (v *NullableIrohaQuery) Set(val *IrohaQuery) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaQuery(val *IrohaQuery) *NullableIrohaQuery { + return &NullableIrohaQuery{value: val, isSet: true} +} + +func (v NullableIrohaQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go new file mode 100644 index 0000000000..47478e0991 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// IrohaSocketIOTransactV1 the model 'IrohaSocketIOTransactV1' +type IrohaSocketIOTransactV1 string + +// List of IrohaSocketIOTransactV1 +const ( + SendAsyncRequest IrohaSocketIOTransactV1 = "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest" + SendSyncRequest IrohaSocketIOTransactV1 = "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest" +) + +// All allowed values of IrohaSocketIOTransactV1 enum +var AllowedIrohaSocketIOTransactV1EnumValues = []IrohaSocketIOTransactV1{ + "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest", + "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest", +} + +func (v *IrohaSocketIOTransactV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaSocketIOTransactV1(value) + for _, existing := range AllowedIrohaSocketIOTransactV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaSocketIOTransactV1", value) +} + +// NewIrohaSocketIOTransactV1FromValue returns a pointer to a valid IrohaSocketIOTransactV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaSocketIOTransactV1FromValue(v string) (*IrohaSocketIOTransactV1, error) { + ev := IrohaSocketIOTransactV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaSocketIOTransactV1: valid values are %v", v, AllowedIrohaSocketIOTransactV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaSocketIOTransactV1) IsValid() bool { + for _, existing := range AllowedIrohaSocketIOTransactV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaSocketIOTransactV1 value +func (v IrohaSocketIOTransactV1) Ptr() *IrohaSocketIOTransactV1 { + return &v +} + +type NullableIrohaSocketIOTransactV1 struct { + value *IrohaSocketIOTransactV1 + isSet bool +} + +func (v NullableIrohaSocketIOTransactV1) Get() *IrohaSocketIOTransactV1 { + return v.value +} + +func (v *NullableIrohaSocketIOTransactV1) Set(val *IrohaSocketIOTransactV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaSocketIOTransactV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaSocketIOTransactV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaSocketIOTransactV1(val *IrohaSocketIOTransactV1) *NullableIrohaSocketIOTransactV1 { + return &NullableIrohaSocketIOTransactV1{value: val, isSet: true} +} + +func (v NullableIrohaSocketIOTransactV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaSocketIOTransactV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go new file mode 100644 index 0000000000..b756f8c05d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the KeyPair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyPair{} + +// KeyPair struct for KeyPair +type KeyPair struct { + // SHA-3 ed25519 public keys of length 64 are recommended. + PublicKey string `json:"publicKey"` + // SHA-3 ed25519 private keys of length 64 are recommended. + PrivateKey string `json:"privateKey"` +} + +// NewKeyPair instantiates a new KeyPair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyPair(publicKey string, privateKey string) *KeyPair { + this := KeyPair{} + this.PublicKey = publicKey + this.PrivateKey = privateKey + return &this +} + +// NewKeyPairWithDefaults instantiates a new KeyPair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyPairWithDefaults() *KeyPair { + this := KeyPair{} + return &this +} + +// GetPublicKey returns the PublicKey field value +func (o *KeyPair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *KeyPair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *KeyPair) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetPrivateKey returns the PrivateKey field value +func (o *KeyPair) GetPrivateKey() string { + if o == nil { + var ret string + return ret + } + + return o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value +// and a boolean to check if the value has been set. +func (o *KeyPair) GetPrivateKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKey, true +} + +// SetPrivateKey sets field value +func (o *KeyPair) SetPrivateKey(v string) { + o.PrivateKey = v +} + +func (o KeyPair) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyPair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["publicKey"] = o.PublicKey + toSerialize["privateKey"] = o.PrivateKey + return toSerialize, nil +} + +type NullableKeyPair struct { + value *KeyPair + isSet bool +} + +func (v NullableKeyPair) Get() *KeyPair { + return v.value +} + +func (v *NullableKeyPair) Set(val *KeyPair) { + v.value = val + v.isSet = true +} + +func (v NullableKeyPair) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyPair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyPair(val *KeyPair) *NullableKeyPair { + return &NullableKeyPair{value: val, isSet: true} +} + +func (v NullableKeyPair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyPair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go new file mode 100644 index 0000000000..939ebfa64e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RemovePeerRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RemovePeerRequestParameters{} + +// RemovePeerRequestParameters The list of arguments to pass in to the transaction request to Remove Peer. +type RemovePeerRequestParameters struct { + PublicKey string `json:"publicKey"` +} + +// NewRemovePeerRequestParameters instantiates a new RemovePeerRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRemovePeerRequestParameters(publicKey string) *RemovePeerRequestParameters { + this := RemovePeerRequestParameters{} + this.PublicKey = publicKey + return &this +} + +// NewRemovePeerRequestParametersWithDefaults instantiates a new RemovePeerRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRemovePeerRequestParametersWithDefaults() *RemovePeerRequestParameters { + this := RemovePeerRequestParameters{} + return &this +} + +// GetPublicKey returns the PublicKey field value +func (o *RemovePeerRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *RemovePeerRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *RemovePeerRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o RemovePeerRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RemovePeerRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableRemovePeerRequestParameters struct { + value *RemovePeerRequestParameters + isSet bool +} + +func (v NullableRemovePeerRequestParameters) Get() *RemovePeerRequestParameters { + return v.value +} + +func (v *NullableRemovePeerRequestParameters) Set(val *RemovePeerRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableRemovePeerRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableRemovePeerRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRemovePeerRequestParameters(val *RemovePeerRequestParameters) *NullableRemovePeerRequestParameters { + return &NullableRemovePeerRequestParameters{value: val, isSet: true} +} + +func (v NullableRemovePeerRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRemovePeerRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go new file mode 100644 index 0000000000..456e887ed9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RemoveSignatoryRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RemoveSignatoryRequestParameters{} + +// RemoveSignatoryRequestParameters The list of arguments to pass in to the transaction request to Remove Signatory. +type RemoveSignatoryRequestParameters struct { + AccountId string `json:"accountId"` + PublicKey string `json:"publicKey"` +} + +// NewRemoveSignatoryRequestParameters instantiates a new RemoveSignatoryRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRemoveSignatoryRequestParameters(accountId string, publicKey string) *RemoveSignatoryRequestParameters { + this := RemoveSignatoryRequestParameters{} + this.AccountId = accountId + this.PublicKey = publicKey + return &this +} + +// NewRemoveSignatoryRequestParametersWithDefaults instantiates a new RemoveSignatoryRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRemoveSignatoryRequestParametersWithDefaults() *RemoveSignatoryRequestParameters { + this := RemoveSignatoryRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *RemoveSignatoryRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *RemoveSignatoryRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *RemoveSignatoryRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPublicKey returns the PublicKey field value +func (o *RemoveSignatoryRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *RemoveSignatoryRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *RemoveSignatoryRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o RemoveSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RemoveSignatoryRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableRemoveSignatoryRequestParameters struct { + value *RemoveSignatoryRequestParameters + isSet bool +} + +func (v NullableRemoveSignatoryRequestParameters) Get() *RemoveSignatoryRequestParameters { + return v.value +} + +func (v *NullableRemoveSignatoryRequestParameters) Set(val *RemoveSignatoryRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableRemoveSignatoryRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableRemoveSignatoryRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRemoveSignatoryRequestParameters(val *RemoveSignatoryRequestParameters) *NullableRemoveSignatoryRequestParameters { + return &NullableRemoveSignatoryRequestParameters{value: val, isSet: true} +} + +func (v NullableRemoveSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRemoveSignatoryRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go new file mode 100644 index 0000000000..c5a6ef2eba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RevokePermissionRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RevokePermissionRequestParameters{} + +// RevokePermissionRequestParameters The list of arguments to pass in to the transaction request to Revoke Permission. +type RevokePermissionRequestParameters struct { + AccountId string `json:"accountId"` + Permission float32 `json:"permission"` +} + +// NewRevokePermissionRequestParameters instantiates a new RevokePermissionRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRevokePermissionRequestParameters(accountId string, permission float32) *RevokePermissionRequestParameters { + this := RevokePermissionRequestParameters{} + this.AccountId = accountId + this.Permission = permission + return &this +} + +// NewRevokePermissionRequestParametersWithDefaults instantiates a new RevokePermissionRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRevokePermissionRequestParametersWithDefaults() *RevokePermissionRequestParameters { + this := RevokePermissionRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *RevokePermissionRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *RevokePermissionRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *RevokePermissionRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPermission returns the Permission field value +func (o *RevokePermissionRequestParameters) GetPermission() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *RevokePermissionRequestParameters) GetPermissionOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *RevokePermissionRequestParameters) SetPermission(v float32) { + o.Permission = v +} + +func (o RevokePermissionRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RevokePermissionRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["permission"] = o.Permission + return toSerialize, nil +} + +type NullableRevokePermissionRequestParameters struct { + value *RevokePermissionRequestParameters + isSet bool +} + +func (v NullableRevokePermissionRequestParameters) Get() *RevokePermissionRequestParameters { + return v.value +} + +func (v *NullableRevokePermissionRequestParameters) Set(val *RevokePermissionRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableRevokePermissionRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableRevokePermissionRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRevokePermissionRequestParameters(val *RevokePermissionRequestParameters) *NullableRevokePermissionRequestParameters { + return &NullableRevokePermissionRequestParameters{value: val, isSet: true} +} + +func (v NullableRevokePermissionRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRevokePermissionRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go new file mode 100644 index 0000000000..3f416b0d6b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequestV1{} + +// RunTransactionRequestV1 struct for RunTransactionRequestV1 +type RunTransactionRequestV1 struct { + CommandName string `json:"commandName"` + BaseConfig IrohaBaseConfig `json:"baseConfig"` + Params RunTransactionRequestV1Params `json:"params"` +} + +// NewRunTransactionRequestV1 instantiates a new RunTransactionRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionRequestV1(commandName string, baseConfig IrohaBaseConfig, params RunTransactionRequestV1Params) *RunTransactionRequestV1 { + this := RunTransactionRequestV1{} + this.CommandName = commandName + this.BaseConfig = baseConfig + this.Params = params + return &this +} + +// NewRunTransactionRequestV1WithDefaults instantiates a new RunTransactionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestV1WithDefaults() *RunTransactionRequestV1 { + this := RunTransactionRequestV1{} + return &this +} + +// GetCommandName returns the CommandName field value +func (o *RunTransactionRequestV1) GetCommandName() string { + if o == nil { + var ret string + return ret + } + + return o.CommandName +} + +// GetCommandNameOk returns a tuple with the CommandName field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequestV1) GetCommandNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommandName, true +} + +// SetCommandName sets field value +func (o *RunTransactionRequestV1) SetCommandName(v string) { + o.CommandName = v +} + +// GetBaseConfig returns the BaseConfig field value +func (o *RunTransactionRequestV1) GetBaseConfig() IrohaBaseConfig { + if o == nil { + var ret IrohaBaseConfig + return ret + } + + return o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequestV1) GetBaseConfigOk() (*IrohaBaseConfig, bool) { + if o == nil { + return nil, false + } + return &o.BaseConfig, true +} + +// SetBaseConfig sets field value +func (o *RunTransactionRequestV1) SetBaseConfig(v IrohaBaseConfig) { + o.BaseConfig = v +} + +// GetParams returns the Params field value +func (o *RunTransactionRequestV1) GetParams() RunTransactionRequestV1Params { + if o == nil { + var ret RunTransactionRequestV1Params + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequestV1) GetParamsOk() (*RunTransactionRequestV1Params, bool) { + if o == nil { + return nil, false + } + return &o.Params, true +} + +// SetParams sets field value +func (o *RunTransactionRequestV1) SetParams(v RunTransactionRequestV1Params) { + o.Params = v +} + +func (o RunTransactionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["commandName"] = o.CommandName + toSerialize["baseConfig"] = o.BaseConfig + toSerialize["params"] = o.Params + return toSerialize, nil +} + +type NullableRunTransactionRequestV1 struct { + value *RunTransactionRequestV1 + isSet bool +} + +func (v NullableRunTransactionRequestV1) Get() *RunTransactionRequestV1 { + return v.value +} + +func (v *NullableRunTransactionRequestV1) Set(val *RunTransactionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequestV1(val *RunTransactionRequestV1) *NullableRunTransactionRequestV1 { + return &NullableRunTransactionRequestV1{value: val, isSet: true} +} + +func (v NullableRunTransactionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go new file mode 100644 index 0000000000..a777d7d019 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// RunTransactionRequestV1Body - struct for RunTransactionRequestV1Body +type RunTransactionRequestV1Body struct { + RunTransactionRequestV1 *RunTransactionRequestV1 + RunTransactionSignedRequestV1 *RunTransactionSignedRequestV1 +} + +// RunTransactionRequestV1AsRunTransactionRequestV1Body is a convenience function that returns RunTransactionRequestV1 wrapped in RunTransactionRequestV1Body +func RunTransactionRequestV1AsRunTransactionRequestV1Body(v *RunTransactionRequestV1) RunTransactionRequestV1Body { + return RunTransactionRequestV1Body{ + RunTransactionRequestV1: v, + } +} + +// RunTransactionSignedRequestV1AsRunTransactionRequestV1Body is a convenience function that returns RunTransactionSignedRequestV1 wrapped in RunTransactionRequestV1Body +func RunTransactionSignedRequestV1AsRunTransactionRequestV1Body(v *RunTransactionSignedRequestV1) RunTransactionRequestV1Body { + return RunTransactionRequestV1Body{ + RunTransactionSignedRequestV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RunTransactionRequestV1Body) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into RunTransactionRequestV1 + err = newStrictDecoder(data).Decode(&dst.RunTransactionRequestV1) + if err == nil { + jsonRunTransactionRequestV1, _ := json.Marshal(dst.RunTransactionRequestV1) + if string(jsonRunTransactionRequestV1) == "{}" { // empty struct + dst.RunTransactionRequestV1 = nil + } else { + match++ + } + } else { + dst.RunTransactionRequestV1 = nil + } + + // try to unmarshal data into RunTransactionSignedRequestV1 + err = newStrictDecoder(data).Decode(&dst.RunTransactionSignedRequestV1) + if err == nil { + jsonRunTransactionSignedRequestV1, _ := json.Marshal(dst.RunTransactionSignedRequestV1) + if string(jsonRunTransactionSignedRequestV1) == "{}" { // empty struct + dst.RunTransactionSignedRequestV1 = nil + } else { + match++ + } + } else { + dst.RunTransactionSignedRequestV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.RunTransactionRequestV1 = nil + dst.RunTransactionSignedRequestV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RunTransactionRequestV1Body)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RunTransactionRequestV1Body)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RunTransactionRequestV1Body) MarshalJSON() ([]byte, error) { + if src.RunTransactionRequestV1 != nil { + return json.Marshal(&src.RunTransactionRequestV1) + } + + if src.RunTransactionSignedRequestV1 != nil { + return json.Marshal(&src.RunTransactionSignedRequestV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RunTransactionRequestV1Body) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.RunTransactionRequestV1 != nil { + return obj.RunTransactionRequestV1 + } + + if obj.RunTransactionSignedRequestV1 != nil { + return obj.RunTransactionSignedRequestV1 + } + + // all schemas are nil + return nil +} + +type NullableRunTransactionRequestV1Body struct { + value *RunTransactionRequestV1Body + isSet bool +} + +func (v NullableRunTransactionRequestV1Body) Get() *RunTransactionRequestV1Body { + return v.value +} + +func (v *NullableRunTransactionRequestV1Body) Set(val *RunTransactionRequestV1Body) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequestV1Body) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequestV1Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequestV1Body(val *RunTransactionRequestV1Body) *NullableRunTransactionRequestV1Body { + return &NullableRunTransactionRequestV1Body{value: val, isSet: true} +} + +func (v NullableRunTransactionRequestV1Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequestV1Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go new file mode 100644 index 0000000000..56c3d68991 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go @@ -0,0 +1,1048 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// RunTransactionRequestV1Params - struct for RunTransactionRequestV1Params +type RunTransactionRequestV1Params struct { + AddAssetQuantityRequestParameters *AddAssetQuantityRequestParameters + AddPeerRequestParameters *AddPeerRequestParameters + AddSignatoryRequestParameters *AddSignatoryRequestParameters + AppendRoleRequestParameters *AppendRoleRequestParameters + CallEngineRequestParameters *CallEngineRequestParameters + CompareAndSetAccountDetailRequestParameters *CompareAndSetAccountDetailRequestParameters + CreateAccountRequestParameters *CreateAccountRequestParameters + CreateAssetRequestParameters *CreateAssetRequestParameters + CreateDomainRequestParameters *CreateDomainRequestParameters + CreateRoleRequestParameters *CreateRoleRequestParameters + DetachRoleRequestParameters *DetachRoleRequestParameters + GetAccountAssetTransactionsRequestParameters *GetAccountAssetTransactionsRequestParameters + GetAccountAssetsRequestParameters *GetAccountAssetsRequestParameters + GetAccountDetailRequestParameters *GetAccountDetailRequestParameters + GetAccountRequestParameters *GetAccountRequestParameters + GetAccountTransactionsRequestParameters *GetAccountTransactionsRequestParameters + GetAssetInfoRequestParameters *GetAssetInfoRequestParameters + GetBlockRequestParameters *GetBlockRequestParameters + GetEngineReceiptsRequestParameters *GetEngineReceiptsRequestParameters + GetPendingTransactionsRequestParameters *GetPendingTransactionsRequestParameters + GetRolePermissionsRequestParameters *GetRolePermissionsRequestParameters + GetSignatoriesRequestParameters *GetSignatoriesRequestParameters + GetTransactionsRequestParameters *GetTransactionsRequestParameters + GrantPermissionRequestParameters *GrantPermissionRequestParameters + RemovePeerRequestParameters *RemovePeerRequestParameters + RemoveSignatoryRequestParameters *RemoveSignatoryRequestParameters + RevokePermissionRequestParameters *RevokePermissionRequestParameters + SetAccountDetailRequestParameters *SetAccountDetailRequestParameters + SetAccountQuorumRequestParameters *SetAccountQuorumRequestParameters + SubtractAssetQuantityRequestParameters *SubtractAssetQuantityRequestParameters + TransferAssetRequestParameters *TransferAssetRequestParameters + ArrayOfInterface{} *[]interface{} +} + +// AddAssetQuantityRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AddAssetQuantityRequestParameters wrapped in RunTransactionRequestV1Params +func AddAssetQuantityRequestParametersAsRunTransactionRequestV1Params(v *AddAssetQuantityRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AddAssetQuantityRequestParameters: v, + } +} + +// AddPeerRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AddPeerRequestParameters wrapped in RunTransactionRequestV1Params +func AddPeerRequestParametersAsRunTransactionRequestV1Params(v *AddPeerRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AddPeerRequestParameters: v, + } +} + +// AddSignatoryRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AddSignatoryRequestParameters wrapped in RunTransactionRequestV1Params +func AddSignatoryRequestParametersAsRunTransactionRequestV1Params(v *AddSignatoryRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AddSignatoryRequestParameters: v, + } +} + +// AppendRoleRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AppendRoleRequestParameters wrapped in RunTransactionRequestV1Params +func AppendRoleRequestParametersAsRunTransactionRequestV1Params(v *AppendRoleRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AppendRoleRequestParameters: v, + } +} + +// CallEngineRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CallEngineRequestParameters wrapped in RunTransactionRequestV1Params +func CallEngineRequestParametersAsRunTransactionRequestV1Params(v *CallEngineRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CallEngineRequestParameters: v, + } +} + +// CompareAndSetAccountDetailRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CompareAndSetAccountDetailRequestParameters wrapped in RunTransactionRequestV1Params +func CompareAndSetAccountDetailRequestParametersAsRunTransactionRequestV1Params(v *CompareAndSetAccountDetailRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CompareAndSetAccountDetailRequestParameters: v, + } +} + +// CreateAccountRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateAccountRequestParameters wrapped in RunTransactionRequestV1Params +func CreateAccountRequestParametersAsRunTransactionRequestV1Params(v *CreateAccountRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateAccountRequestParameters: v, + } +} + +// CreateAssetRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateAssetRequestParameters wrapped in RunTransactionRequestV1Params +func CreateAssetRequestParametersAsRunTransactionRequestV1Params(v *CreateAssetRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateAssetRequestParameters: v, + } +} + +// CreateDomainRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateDomainRequestParameters wrapped in RunTransactionRequestV1Params +func CreateDomainRequestParametersAsRunTransactionRequestV1Params(v *CreateDomainRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateDomainRequestParameters: v, + } +} + +// CreateRoleRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateRoleRequestParameters wrapped in RunTransactionRequestV1Params +func CreateRoleRequestParametersAsRunTransactionRequestV1Params(v *CreateRoleRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateRoleRequestParameters: v, + } +} + +// DetachRoleRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns DetachRoleRequestParameters wrapped in RunTransactionRequestV1Params +func DetachRoleRequestParametersAsRunTransactionRequestV1Params(v *DetachRoleRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + DetachRoleRequestParameters: v, + } +} + +// GetAccountAssetTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountAssetTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountAssetTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetAccountAssetTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountAssetTransactionsRequestParameters: v, + } +} + +// GetAccountAssetsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountAssetsRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountAssetsRequestParametersAsRunTransactionRequestV1Params(v *GetAccountAssetsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountAssetsRequestParameters: v, + } +} + +// GetAccountDetailRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountDetailRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountDetailRequestParametersAsRunTransactionRequestV1Params(v *GetAccountDetailRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountDetailRequestParameters: v, + } +} + +// GetAccountRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountRequestParametersAsRunTransactionRequestV1Params(v *GetAccountRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountRequestParameters: v, + } +} + +// GetAccountTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetAccountTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountTransactionsRequestParameters: v, + } +} + +// GetAssetInfoRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAssetInfoRequestParameters wrapped in RunTransactionRequestV1Params +func GetAssetInfoRequestParametersAsRunTransactionRequestV1Params(v *GetAssetInfoRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAssetInfoRequestParameters: v, + } +} + +// GetBlockRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetBlockRequestParameters wrapped in RunTransactionRequestV1Params +func GetBlockRequestParametersAsRunTransactionRequestV1Params(v *GetBlockRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetBlockRequestParameters: v, + } +} + +// GetEngineReceiptsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetEngineReceiptsRequestParameters wrapped in RunTransactionRequestV1Params +func GetEngineReceiptsRequestParametersAsRunTransactionRequestV1Params(v *GetEngineReceiptsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetEngineReceiptsRequestParameters: v, + } +} + +// GetPendingTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetPendingTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetPendingTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetPendingTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetPendingTransactionsRequestParameters: v, + } +} + +// GetRolePermissionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetRolePermissionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetRolePermissionsRequestParametersAsRunTransactionRequestV1Params(v *GetRolePermissionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetRolePermissionsRequestParameters: v, + } +} + +// GetSignatoriesRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetSignatoriesRequestParameters wrapped in RunTransactionRequestV1Params +func GetSignatoriesRequestParametersAsRunTransactionRequestV1Params(v *GetSignatoriesRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetSignatoriesRequestParameters: v, + } +} + +// GetTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetTransactionsRequestParameters: v, + } +} + +// GrantPermissionRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GrantPermissionRequestParameters wrapped in RunTransactionRequestV1Params +func GrantPermissionRequestParametersAsRunTransactionRequestV1Params(v *GrantPermissionRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GrantPermissionRequestParameters: v, + } +} + +// RemovePeerRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns RemovePeerRequestParameters wrapped in RunTransactionRequestV1Params +func RemovePeerRequestParametersAsRunTransactionRequestV1Params(v *RemovePeerRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + RemovePeerRequestParameters: v, + } +} + +// RemoveSignatoryRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns RemoveSignatoryRequestParameters wrapped in RunTransactionRequestV1Params +func RemoveSignatoryRequestParametersAsRunTransactionRequestV1Params(v *RemoveSignatoryRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + RemoveSignatoryRequestParameters: v, + } +} + +// RevokePermissionRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns RevokePermissionRequestParameters wrapped in RunTransactionRequestV1Params +func RevokePermissionRequestParametersAsRunTransactionRequestV1Params(v *RevokePermissionRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + RevokePermissionRequestParameters: v, + } +} + +// SetAccountDetailRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns SetAccountDetailRequestParameters wrapped in RunTransactionRequestV1Params +func SetAccountDetailRequestParametersAsRunTransactionRequestV1Params(v *SetAccountDetailRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + SetAccountDetailRequestParameters: v, + } +} + +// SetAccountQuorumRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns SetAccountQuorumRequestParameters wrapped in RunTransactionRequestV1Params +func SetAccountQuorumRequestParametersAsRunTransactionRequestV1Params(v *SetAccountQuorumRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + SetAccountQuorumRequestParameters: v, + } +} + +// SubtractAssetQuantityRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns SubtractAssetQuantityRequestParameters wrapped in RunTransactionRequestV1Params +func SubtractAssetQuantityRequestParametersAsRunTransactionRequestV1Params(v *SubtractAssetQuantityRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + SubtractAssetQuantityRequestParameters: v, + } +} + +// TransferAssetRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns TransferAssetRequestParameters wrapped in RunTransactionRequestV1Params +func TransferAssetRequestParametersAsRunTransactionRequestV1Params(v *TransferAssetRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + TransferAssetRequestParameters: v, + } +} + +// []interface{}AsRunTransactionRequestV1Params is a convenience function that returns []interface{} wrapped in RunTransactionRequestV1Params +func ArrayOfInterface{}AsRunTransactionRequestV1Params(v *[]interface{}) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + ArrayOfInterface{}: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RunTransactionRequestV1Params) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AddAssetQuantityRequestParameters + err = newStrictDecoder(data).Decode(&dst.AddAssetQuantityRequestParameters) + if err == nil { + jsonAddAssetQuantityRequestParameters, _ := json.Marshal(dst.AddAssetQuantityRequestParameters) + if string(jsonAddAssetQuantityRequestParameters) == "{}" { // empty struct + dst.AddAssetQuantityRequestParameters = nil + } else { + match++ + } + } else { + dst.AddAssetQuantityRequestParameters = nil + } + + // try to unmarshal data into AddPeerRequestParameters + err = newStrictDecoder(data).Decode(&dst.AddPeerRequestParameters) + if err == nil { + jsonAddPeerRequestParameters, _ := json.Marshal(dst.AddPeerRequestParameters) + if string(jsonAddPeerRequestParameters) == "{}" { // empty struct + dst.AddPeerRequestParameters = nil + } else { + match++ + } + } else { + dst.AddPeerRequestParameters = nil + } + + // try to unmarshal data into AddSignatoryRequestParameters + err = newStrictDecoder(data).Decode(&dst.AddSignatoryRequestParameters) + if err == nil { + jsonAddSignatoryRequestParameters, _ := json.Marshal(dst.AddSignatoryRequestParameters) + if string(jsonAddSignatoryRequestParameters) == "{}" { // empty struct + dst.AddSignatoryRequestParameters = nil + } else { + match++ + } + } else { + dst.AddSignatoryRequestParameters = nil + } + + // try to unmarshal data into AppendRoleRequestParameters + err = newStrictDecoder(data).Decode(&dst.AppendRoleRequestParameters) + if err == nil { + jsonAppendRoleRequestParameters, _ := json.Marshal(dst.AppendRoleRequestParameters) + if string(jsonAppendRoleRequestParameters) == "{}" { // empty struct + dst.AppendRoleRequestParameters = nil + } else { + match++ + } + } else { + dst.AppendRoleRequestParameters = nil + } + + // try to unmarshal data into CallEngineRequestParameters + err = newStrictDecoder(data).Decode(&dst.CallEngineRequestParameters) + if err == nil { + jsonCallEngineRequestParameters, _ := json.Marshal(dst.CallEngineRequestParameters) + if string(jsonCallEngineRequestParameters) == "{}" { // empty struct + dst.CallEngineRequestParameters = nil + } else { + match++ + } + } else { + dst.CallEngineRequestParameters = nil + } + + // try to unmarshal data into CompareAndSetAccountDetailRequestParameters + err = newStrictDecoder(data).Decode(&dst.CompareAndSetAccountDetailRequestParameters) + if err == nil { + jsonCompareAndSetAccountDetailRequestParameters, _ := json.Marshal(dst.CompareAndSetAccountDetailRequestParameters) + if string(jsonCompareAndSetAccountDetailRequestParameters) == "{}" { // empty struct + dst.CompareAndSetAccountDetailRequestParameters = nil + } else { + match++ + } + } else { + dst.CompareAndSetAccountDetailRequestParameters = nil + } + + // try to unmarshal data into CreateAccountRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateAccountRequestParameters) + if err == nil { + jsonCreateAccountRequestParameters, _ := json.Marshal(dst.CreateAccountRequestParameters) + if string(jsonCreateAccountRequestParameters) == "{}" { // empty struct + dst.CreateAccountRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateAccountRequestParameters = nil + } + + // try to unmarshal data into CreateAssetRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateAssetRequestParameters) + if err == nil { + jsonCreateAssetRequestParameters, _ := json.Marshal(dst.CreateAssetRequestParameters) + if string(jsonCreateAssetRequestParameters) == "{}" { // empty struct + dst.CreateAssetRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateAssetRequestParameters = nil + } + + // try to unmarshal data into CreateDomainRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateDomainRequestParameters) + if err == nil { + jsonCreateDomainRequestParameters, _ := json.Marshal(dst.CreateDomainRequestParameters) + if string(jsonCreateDomainRequestParameters) == "{}" { // empty struct + dst.CreateDomainRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateDomainRequestParameters = nil + } + + // try to unmarshal data into CreateRoleRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateRoleRequestParameters) + if err == nil { + jsonCreateRoleRequestParameters, _ := json.Marshal(dst.CreateRoleRequestParameters) + if string(jsonCreateRoleRequestParameters) == "{}" { // empty struct + dst.CreateRoleRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateRoleRequestParameters = nil + } + + // try to unmarshal data into DetachRoleRequestParameters + err = newStrictDecoder(data).Decode(&dst.DetachRoleRequestParameters) + if err == nil { + jsonDetachRoleRequestParameters, _ := json.Marshal(dst.DetachRoleRequestParameters) + if string(jsonDetachRoleRequestParameters) == "{}" { // empty struct + dst.DetachRoleRequestParameters = nil + } else { + match++ + } + } else { + dst.DetachRoleRequestParameters = nil + } + + // try to unmarshal data into GetAccountAssetTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountAssetTransactionsRequestParameters) + if err == nil { + jsonGetAccountAssetTransactionsRequestParameters, _ := json.Marshal(dst.GetAccountAssetTransactionsRequestParameters) + if string(jsonGetAccountAssetTransactionsRequestParameters) == "{}" { // empty struct + dst.GetAccountAssetTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountAssetTransactionsRequestParameters = nil + } + + // try to unmarshal data into GetAccountAssetsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountAssetsRequestParameters) + if err == nil { + jsonGetAccountAssetsRequestParameters, _ := json.Marshal(dst.GetAccountAssetsRequestParameters) + if string(jsonGetAccountAssetsRequestParameters) == "{}" { // empty struct + dst.GetAccountAssetsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountAssetsRequestParameters = nil + } + + // try to unmarshal data into GetAccountDetailRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountDetailRequestParameters) + if err == nil { + jsonGetAccountDetailRequestParameters, _ := json.Marshal(dst.GetAccountDetailRequestParameters) + if string(jsonGetAccountDetailRequestParameters) == "{}" { // empty struct + dst.GetAccountDetailRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountDetailRequestParameters = nil + } + + // try to unmarshal data into GetAccountRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountRequestParameters) + if err == nil { + jsonGetAccountRequestParameters, _ := json.Marshal(dst.GetAccountRequestParameters) + if string(jsonGetAccountRequestParameters) == "{}" { // empty struct + dst.GetAccountRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountRequestParameters = nil + } + + // try to unmarshal data into GetAccountTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountTransactionsRequestParameters) + if err == nil { + jsonGetAccountTransactionsRequestParameters, _ := json.Marshal(dst.GetAccountTransactionsRequestParameters) + if string(jsonGetAccountTransactionsRequestParameters) == "{}" { // empty struct + dst.GetAccountTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountTransactionsRequestParameters = nil + } + + // try to unmarshal data into GetAssetInfoRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAssetInfoRequestParameters) + if err == nil { + jsonGetAssetInfoRequestParameters, _ := json.Marshal(dst.GetAssetInfoRequestParameters) + if string(jsonGetAssetInfoRequestParameters) == "{}" { // empty struct + dst.GetAssetInfoRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAssetInfoRequestParameters = nil + } + + // try to unmarshal data into GetBlockRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetBlockRequestParameters) + if err == nil { + jsonGetBlockRequestParameters, _ := json.Marshal(dst.GetBlockRequestParameters) + if string(jsonGetBlockRequestParameters) == "{}" { // empty struct + dst.GetBlockRequestParameters = nil + } else { + match++ + } + } else { + dst.GetBlockRequestParameters = nil + } + + // try to unmarshal data into GetEngineReceiptsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetEngineReceiptsRequestParameters) + if err == nil { + jsonGetEngineReceiptsRequestParameters, _ := json.Marshal(dst.GetEngineReceiptsRequestParameters) + if string(jsonGetEngineReceiptsRequestParameters) == "{}" { // empty struct + dst.GetEngineReceiptsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetEngineReceiptsRequestParameters = nil + } + + // try to unmarshal data into GetPendingTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetPendingTransactionsRequestParameters) + if err == nil { + jsonGetPendingTransactionsRequestParameters, _ := json.Marshal(dst.GetPendingTransactionsRequestParameters) + if string(jsonGetPendingTransactionsRequestParameters) == "{}" { // empty struct + dst.GetPendingTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetPendingTransactionsRequestParameters = nil + } + + // try to unmarshal data into GetRolePermissionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetRolePermissionsRequestParameters) + if err == nil { + jsonGetRolePermissionsRequestParameters, _ := json.Marshal(dst.GetRolePermissionsRequestParameters) + if string(jsonGetRolePermissionsRequestParameters) == "{}" { // empty struct + dst.GetRolePermissionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetRolePermissionsRequestParameters = nil + } + + // try to unmarshal data into GetSignatoriesRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetSignatoriesRequestParameters) + if err == nil { + jsonGetSignatoriesRequestParameters, _ := json.Marshal(dst.GetSignatoriesRequestParameters) + if string(jsonGetSignatoriesRequestParameters) == "{}" { // empty struct + dst.GetSignatoriesRequestParameters = nil + } else { + match++ + } + } else { + dst.GetSignatoriesRequestParameters = nil + } + + // try to unmarshal data into GetTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetTransactionsRequestParameters) + if err == nil { + jsonGetTransactionsRequestParameters, _ := json.Marshal(dst.GetTransactionsRequestParameters) + if string(jsonGetTransactionsRequestParameters) == "{}" { // empty struct + dst.GetTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetTransactionsRequestParameters = nil + } + + // try to unmarshal data into GrantPermissionRequestParameters + err = newStrictDecoder(data).Decode(&dst.GrantPermissionRequestParameters) + if err == nil { + jsonGrantPermissionRequestParameters, _ := json.Marshal(dst.GrantPermissionRequestParameters) + if string(jsonGrantPermissionRequestParameters) == "{}" { // empty struct + dst.GrantPermissionRequestParameters = nil + } else { + match++ + } + } else { + dst.GrantPermissionRequestParameters = nil + } + + // try to unmarshal data into RemovePeerRequestParameters + err = newStrictDecoder(data).Decode(&dst.RemovePeerRequestParameters) + if err == nil { + jsonRemovePeerRequestParameters, _ := json.Marshal(dst.RemovePeerRequestParameters) + if string(jsonRemovePeerRequestParameters) == "{}" { // empty struct + dst.RemovePeerRequestParameters = nil + } else { + match++ + } + } else { + dst.RemovePeerRequestParameters = nil + } + + // try to unmarshal data into RemoveSignatoryRequestParameters + err = newStrictDecoder(data).Decode(&dst.RemoveSignatoryRequestParameters) + if err == nil { + jsonRemoveSignatoryRequestParameters, _ := json.Marshal(dst.RemoveSignatoryRequestParameters) + if string(jsonRemoveSignatoryRequestParameters) == "{}" { // empty struct + dst.RemoveSignatoryRequestParameters = nil + } else { + match++ + } + } else { + dst.RemoveSignatoryRequestParameters = nil + } + + // try to unmarshal data into RevokePermissionRequestParameters + err = newStrictDecoder(data).Decode(&dst.RevokePermissionRequestParameters) + if err == nil { + jsonRevokePermissionRequestParameters, _ := json.Marshal(dst.RevokePermissionRequestParameters) + if string(jsonRevokePermissionRequestParameters) == "{}" { // empty struct + dst.RevokePermissionRequestParameters = nil + } else { + match++ + } + } else { + dst.RevokePermissionRequestParameters = nil + } + + // try to unmarshal data into SetAccountDetailRequestParameters + err = newStrictDecoder(data).Decode(&dst.SetAccountDetailRequestParameters) + if err == nil { + jsonSetAccountDetailRequestParameters, _ := json.Marshal(dst.SetAccountDetailRequestParameters) + if string(jsonSetAccountDetailRequestParameters) == "{}" { // empty struct + dst.SetAccountDetailRequestParameters = nil + } else { + match++ + } + } else { + dst.SetAccountDetailRequestParameters = nil + } + + // try to unmarshal data into SetAccountQuorumRequestParameters + err = newStrictDecoder(data).Decode(&dst.SetAccountQuorumRequestParameters) + if err == nil { + jsonSetAccountQuorumRequestParameters, _ := json.Marshal(dst.SetAccountQuorumRequestParameters) + if string(jsonSetAccountQuorumRequestParameters) == "{}" { // empty struct + dst.SetAccountQuorumRequestParameters = nil + } else { + match++ + } + } else { + dst.SetAccountQuorumRequestParameters = nil + } + + // try to unmarshal data into SubtractAssetQuantityRequestParameters + err = newStrictDecoder(data).Decode(&dst.SubtractAssetQuantityRequestParameters) + if err == nil { + jsonSubtractAssetQuantityRequestParameters, _ := json.Marshal(dst.SubtractAssetQuantityRequestParameters) + if string(jsonSubtractAssetQuantityRequestParameters) == "{}" { // empty struct + dst.SubtractAssetQuantityRequestParameters = nil + } else { + match++ + } + } else { + dst.SubtractAssetQuantityRequestParameters = nil + } + + // try to unmarshal data into TransferAssetRequestParameters + err = newStrictDecoder(data).Decode(&dst.TransferAssetRequestParameters) + if err == nil { + jsonTransferAssetRequestParameters, _ := json.Marshal(dst.TransferAssetRequestParameters) + if string(jsonTransferAssetRequestParameters) == "{}" { // empty struct + dst.TransferAssetRequestParameters = nil + } else { + match++ + } + } else { + dst.TransferAssetRequestParameters = nil + } + + // try to unmarshal data into ArrayOfInterface{} + err = newStrictDecoder(data).Decode(&dst.ArrayOfInterface{}) + if err == nil { + jsonArrayOfInterface{}, _ := json.Marshal(dst.ArrayOfInterface{}) + if string(jsonArrayOfInterface{}) == "{}" { // empty struct + dst.ArrayOfInterface{} = nil + } else { + match++ + } + } else { + dst.ArrayOfInterface{} = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AddAssetQuantityRequestParameters = nil + dst.AddPeerRequestParameters = nil + dst.AddSignatoryRequestParameters = nil + dst.AppendRoleRequestParameters = nil + dst.CallEngineRequestParameters = nil + dst.CompareAndSetAccountDetailRequestParameters = nil + dst.CreateAccountRequestParameters = nil + dst.CreateAssetRequestParameters = nil + dst.CreateDomainRequestParameters = nil + dst.CreateRoleRequestParameters = nil + dst.DetachRoleRequestParameters = nil + dst.GetAccountAssetTransactionsRequestParameters = nil + dst.GetAccountAssetsRequestParameters = nil + dst.GetAccountDetailRequestParameters = nil + dst.GetAccountRequestParameters = nil + dst.GetAccountTransactionsRequestParameters = nil + dst.GetAssetInfoRequestParameters = nil + dst.GetBlockRequestParameters = nil + dst.GetEngineReceiptsRequestParameters = nil + dst.GetPendingTransactionsRequestParameters = nil + dst.GetRolePermissionsRequestParameters = nil + dst.GetSignatoriesRequestParameters = nil + dst.GetTransactionsRequestParameters = nil + dst.GrantPermissionRequestParameters = nil + dst.RemovePeerRequestParameters = nil + dst.RemoveSignatoryRequestParameters = nil + dst.RevokePermissionRequestParameters = nil + dst.SetAccountDetailRequestParameters = nil + dst.SetAccountQuorumRequestParameters = nil + dst.SubtractAssetQuantityRequestParameters = nil + dst.TransferAssetRequestParameters = nil + dst.ArrayOfInterface{} = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RunTransactionRequestV1Params)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RunTransactionRequestV1Params)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RunTransactionRequestV1Params) MarshalJSON() ([]byte, error) { + if src.AddAssetQuantityRequestParameters != nil { + return json.Marshal(&src.AddAssetQuantityRequestParameters) + } + + if src.AddPeerRequestParameters != nil { + return json.Marshal(&src.AddPeerRequestParameters) + } + + if src.AddSignatoryRequestParameters != nil { + return json.Marshal(&src.AddSignatoryRequestParameters) + } + + if src.AppendRoleRequestParameters != nil { + return json.Marshal(&src.AppendRoleRequestParameters) + } + + if src.CallEngineRequestParameters != nil { + return json.Marshal(&src.CallEngineRequestParameters) + } + + if src.CompareAndSetAccountDetailRequestParameters != nil { + return json.Marshal(&src.CompareAndSetAccountDetailRequestParameters) + } + + if src.CreateAccountRequestParameters != nil { + return json.Marshal(&src.CreateAccountRequestParameters) + } + + if src.CreateAssetRequestParameters != nil { + return json.Marshal(&src.CreateAssetRequestParameters) + } + + if src.CreateDomainRequestParameters != nil { + return json.Marshal(&src.CreateDomainRequestParameters) + } + + if src.CreateRoleRequestParameters != nil { + return json.Marshal(&src.CreateRoleRequestParameters) + } + + if src.DetachRoleRequestParameters != nil { + return json.Marshal(&src.DetachRoleRequestParameters) + } + + if src.GetAccountAssetTransactionsRequestParameters != nil { + return json.Marshal(&src.GetAccountAssetTransactionsRequestParameters) + } + + if src.GetAccountAssetsRequestParameters != nil { + return json.Marshal(&src.GetAccountAssetsRequestParameters) + } + + if src.GetAccountDetailRequestParameters != nil { + return json.Marshal(&src.GetAccountDetailRequestParameters) + } + + if src.GetAccountRequestParameters != nil { + return json.Marshal(&src.GetAccountRequestParameters) + } + + if src.GetAccountTransactionsRequestParameters != nil { + return json.Marshal(&src.GetAccountTransactionsRequestParameters) + } + + if src.GetAssetInfoRequestParameters != nil { + return json.Marshal(&src.GetAssetInfoRequestParameters) + } + + if src.GetBlockRequestParameters != nil { + return json.Marshal(&src.GetBlockRequestParameters) + } + + if src.GetEngineReceiptsRequestParameters != nil { + return json.Marshal(&src.GetEngineReceiptsRequestParameters) + } + + if src.GetPendingTransactionsRequestParameters != nil { + return json.Marshal(&src.GetPendingTransactionsRequestParameters) + } + + if src.GetRolePermissionsRequestParameters != nil { + return json.Marshal(&src.GetRolePermissionsRequestParameters) + } + + if src.GetSignatoriesRequestParameters != nil { + return json.Marshal(&src.GetSignatoriesRequestParameters) + } + + if src.GetTransactionsRequestParameters != nil { + return json.Marshal(&src.GetTransactionsRequestParameters) + } + + if src.GrantPermissionRequestParameters != nil { + return json.Marshal(&src.GrantPermissionRequestParameters) + } + + if src.RemovePeerRequestParameters != nil { + return json.Marshal(&src.RemovePeerRequestParameters) + } + + if src.RemoveSignatoryRequestParameters != nil { + return json.Marshal(&src.RemoveSignatoryRequestParameters) + } + + if src.RevokePermissionRequestParameters != nil { + return json.Marshal(&src.RevokePermissionRequestParameters) + } + + if src.SetAccountDetailRequestParameters != nil { + return json.Marshal(&src.SetAccountDetailRequestParameters) + } + + if src.SetAccountQuorumRequestParameters != nil { + return json.Marshal(&src.SetAccountQuorumRequestParameters) + } + + if src.SubtractAssetQuantityRequestParameters != nil { + return json.Marshal(&src.SubtractAssetQuantityRequestParameters) + } + + if src.TransferAssetRequestParameters != nil { + return json.Marshal(&src.TransferAssetRequestParameters) + } + + if src.ArrayOfInterface{} != nil { + return json.Marshal(&src.ArrayOfInterface{}) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RunTransactionRequestV1Params) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.AddAssetQuantityRequestParameters != nil { + return obj.AddAssetQuantityRequestParameters + } + + if obj.AddPeerRequestParameters != nil { + return obj.AddPeerRequestParameters + } + + if obj.AddSignatoryRequestParameters != nil { + return obj.AddSignatoryRequestParameters + } + + if obj.AppendRoleRequestParameters != nil { + return obj.AppendRoleRequestParameters + } + + if obj.CallEngineRequestParameters != nil { + return obj.CallEngineRequestParameters + } + + if obj.CompareAndSetAccountDetailRequestParameters != nil { + return obj.CompareAndSetAccountDetailRequestParameters + } + + if obj.CreateAccountRequestParameters != nil { + return obj.CreateAccountRequestParameters + } + + if obj.CreateAssetRequestParameters != nil { + return obj.CreateAssetRequestParameters + } + + if obj.CreateDomainRequestParameters != nil { + return obj.CreateDomainRequestParameters + } + + if obj.CreateRoleRequestParameters != nil { + return obj.CreateRoleRequestParameters + } + + if obj.DetachRoleRequestParameters != nil { + return obj.DetachRoleRequestParameters + } + + if obj.GetAccountAssetTransactionsRequestParameters != nil { + return obj.GetAccountAssetTransactionsRequestParameters + } + + if obj.GetAccountAssetsRequestParameters != nil { + return obj.GetAccountAssetsRequestParameters + } + + if obj.GetAccountDetailRequestParameters != nil { + return obj.GetAccountDetailRequestParameters + } + + if obj.GetAccountRequestParameters != nil { + return obj.GetAccountRequestParameters + } + + if obj.GetAccountTransactionsRequestParameters != nil { + return obj.GetAccountTransactionsRequestParameters + } + + if obj.GetAssetInfoRequestParameters != nil { + return obj.GetAssetInfoRequestParameters + } + + if obj.GetBlockRequestParameters != nil { + return obj.GetBlockRequestParameters + } + + if obj.GetEngineReceiptsRequestParameters != nil { + return obj.GetEngineReceiptsRequestParameters + } + + if obj.GetPendingTransactionsRequestParameters != nil { + return obj.GetPendingTransactionsRequestParameters + } + + if obj.GetRolePermissionsRequestParameters != nil { + return obj.GetRolePermissionsRequestParameters + } + + if obj.GetSignatoriesRequestParameters != nil { + return obj.GetSignatoriesRequestParameters + } + + if obj.GetTransactionsRequestParameters != nil { + return obj.GetTransactionsRequestParameters + } + + if obj.GrantPermissionRequestParameters != nil { + return obj.GrantPermissionRequestParameters + } + + if obj.RemovePeerRequestParameters != nil { + return obj.RemovePeerRequestParameters + } + + if obj.RemoveSignatoryRequestParameters != nil { + return obj.RemoveSignatoryRequestParameters + } + + if obj.RevokePermissionRequestParameters != nil { + return obj.RevokePermissionRequestParameters + } + + if obj.SetAccountDetailRequestParameters != nil { + return obj.SetAccountDetailRequestParameters + } + + if obj.SetAccountQuorumRequestParameters != nil { + return obj.SetAccountQuorumRequestParameters + } + + if obj.SubtractAssetQuantityRequestParameters != nil { + return obj.SubtractAssetQuantityRequestParameters + } + + if obj.TransferAssetRequestParameters != nil { + return obj.TransferAssetRequestParameters + } + + if obj.ArrayOfInterface{} != nil { + return obj.ArrayOfInterface{} + } + + // all schemas are nil + return nil +} + +type NullableRunTransactionRequestV1Params struct { + value *RunTransactionRequestV1Params + isSet bool +} + +func (v NullableRunTransactionRequestV1Params) Get() *RunTransactionRequestV1Params { + return v.value +} + +func (v *NullableRunTransactionRequestV1Params) Set(val *RunTransactionRequestV1Params) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequestV1Params) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequestV1Params) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequestV1Params(val *RunTransactionRequestV1Params) *NullableRunTransactionRequestV1Params { + return &NullableRunTransactionRequestV1Params{value: val, isSet: true} +} + +func (v NullableRunTransactionRequestV1Params) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequestV1Params) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 0000000000..1259fd117c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt interface{} `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt interface{}) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *RunTransactionResponse) GetTransactionReceipt() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*interface{}, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v interface{}) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.TransactionReceipt != nil { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go new file mode 100644 index 0000000000..0f901e75b1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go @@ -0,0 +1,154 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RunTransactionSignedRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionSignedRequestV1{} + +// RunTransactionSignedRequestV1 struct for RunTransactionSignedRequestV1 +type RunTransactionSignedRequestV1 struct { + // Signed transaction binary data received from generate-transaction endpoint. + SignedTransaction string `json:"signedTransaction"` + BaseConfig *IrohaBaseConfig `json:"baseConfig,omitempty"` +} + +// NewRunTransactionSignedRequestV1 instantiates a new RunTransactionSignedRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionSignedRequestV1(signedTransaction string) *RunTransactionSignedRequestV1 { + this := RunTransactionSignedRequestV1{} + this.SignedTransaction = signedTransaction + return &this +} + +// NewRunTransactionSignedRequestV1WithDefaults instantiates a new RunTransactionSignedRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionSignedRequestV1WithDefaults() *RunTransactionSignedRequestV1 { + this := RunTransactionSignedRequestV1{} + return &this +} + +// GetSignedTransaction returns the SignedTransaction field value +func (o *RunTransactionSignedRequestV1) GetSignedTransaction() string { + if o == nil { + var ret string + return ret + } + + return o.SignedTransaction +} + +// GetSignedTransactionOk returns a tuple with the SignedTransaction field value +// and a boolean to check if the value has been set. +func (o *RunTransactionSignedRequestV1) GetSignedTransactionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignedTransaction, true +} + +// SetSignedTransaction sets field value +func (o *RunTransactionSignedRequestV1) SetSignedTransaction(v string) { + o.SignedTransaction = v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *RunTransactionSignedRequestV1) GetBaseConfig() IrohaBaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret IrohaBaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionSignedRequestV1) GetBaseConfigOk() (*IrohaBaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *RunTransactionSignedRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given IrohaBaseConfig and assigns it to the BaseConfig field. +func (o *RunTransactionSignedRequestV1) SetBaseConfig(v IrohaBaseConfig) { + o.BaseConfig = &v +} + +func (o RunTransactionSignedRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionSignedRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signedTransaction"] = o.SignedTransaction + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableRunTransactionSignedRequestV1 struct { + value *RunTransactionSignedRequestV1 + isSet bool +} + +func (v NullableRunTransactionSignedRequestV1) Get() *RunTransactionSignedRequestV1 { + return v.value +} + +func (v *NullableRunTransactionSignedRequestV1) Set(val *RunTransactionSignedRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionSignedRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionSignedRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionSignedRequestV1(val *RunTransactionSignedRequestV1) *NullableRunTransactionSignedRequestV1 { + return &NullableRunTransactionSignedRequestV1{value: val, isSet: true} +} + +func (v NullableRunTransactionSignedRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionSignedRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go new file mode 100644 index 0000000000..4a0cd90628 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the SetAccountDetailRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetAccountDetailRequestParameters{} + +// SetAccountDetailRequestParameters The list of arguments to pass in to the transaction request to Set Account Detail. +type SetAccountDetailRequestParameters struct { + AccountId string `json:"accountId"` + Key string `json:"key"` + Value string `json:"value"` +} + +// NewSetAccountDetailRequestParameters instantiates a new SetAccountDetailRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetAccountDetailRequestParameters(accountId string, key string, value string) *SetAccountDetailRequestParameters { + this := SetAccountDetailRequestParameters{} + this.AccountId = accountId + this.Key = key + this.Value = value + return &this +} + +// NewSetAccountDetailRequestParametersWithDefaults instantiates a new SetAccountDetailRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetAccountDetailRequestParametersWithDefaults() *SetAccountDetailRequestParameters { + this := SetAccountDetailRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *SetAccountDetailRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *SetAccountDetailRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *SetAccountDetailRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetKey returns the Key field value +func (o *SetAccountDetailRequestParameters) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetAccountDetailRequestParameters) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetAccountDetailRequestParameters) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetAccountDetailRequestParameters) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetAccountDetailRequestParameters) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetAccountDetailRequestParameters) SetValue(v string) { + o.Value = v +} + +func (o SetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetAccountDetailRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetAccountDetailRequestParameters struct { + value *SetAccountDetailRequestParameters + isSet bool +} + +func (v NullableSetAccountDetailRequestParameters) Get() *SetAccountDetailRequestParameters { + return v.value +} + +func (v *NullableSetAccountDetailRequestParameters) Set(val *SetAccountDetailRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSetAccountDetailRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSetAccountDetailRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetAccountDetailRequestParameters(val *SetAccountDetailRequestParameters) *NullableSetAccountDetailRequestParameters { + return &NullableSetAccountDetailRequestParameters{value: val, isSet: true} +} + +func (v NullableSetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetAccountDetailRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go new file mode 100644 index 0000000000..a0fc4af8e9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the SetAccountQuorumRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetAccountQuorumRequestParameters{} + +// SetAccountQuorumRequestParameters The list of arguments to pass in to the transaction request to Set Account Quorum. +type SetAccountQuorumRequestParameters struct { + AccountId string `json:"accountId"` + Quorum int32 `json:"quorum"` +} + +// NewSetAccountQuorumRequestParameters instantiates a new SetAccountQuorumRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetAccountQuorumRequestParameters(accountId string, quorum int32) *SetAccountQuorumRequestParameters { + this := SetAccountQuorumRequestParameters{} + this.AccountId = accountId + this.Quorum = quorum + return &this +} + +// NewSetAccountQuorumRequestParametersWithDefaults instantiates a new SetAccountQuorumRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetAccountQuorumRequestParametersWithDefaults() *SetAccountQuorumRequestParameters { + this := SetAccountQuorumRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *SetAccountQuorumRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *SetAccountQuorumRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *SetAccountQuorumRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetQuorum returns the Quorum field value +func (o *SetAccountQuorumRequestParameters) GetQuorum() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Quorum +} + +// GetQuorumOk returns a tuple with the Quorum field value +// and a boolean to check if the value has been set. +func (o *SetAccountQuorumRequestParameters) GetQuorumOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Quorum, true +} + +// SetQuorum sets field value +func (o *SetAccountQuorumRequestParameters) SetQuorum(v int32) { + o.Quorum = v +} + +func (o SetAccountQuorumRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetAccountQuorumRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["quorum"] = o.Quorum + return toSerialize, nil +} + +type NullableSetAccountQuorumRequestParameters struct { + value *SetAccountQuorumRequestParameters + isSet bool +} + +func (v NullableSetAccountQuorumRequestParameters) Get() *SetAccountQuorumRequestParameters { + return v.value +} + +func (v *NullableSetAccountQuorumRequestParameters) Set(val *SetAccountQuorumRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSetAccountQuorumRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSetAccountQuorumRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetAccountQuorumRequestParameters(val *SetAccountQuorumRequestParameters) *NullableSetAccountQuorumRequestParameters { + return &NullableSetAccountQuorumRequestParameters{value: val, isSet: true} +} + +func (v NullableSetAccountQuorumRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetAccountQuorumRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go new file mode 100644 index 0000000000..57bcdb046f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the SubtractAssetQuantityRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SubtractAssetQuantityRequestParameters{} + +// SubtractAssetQuantityRequestParameters The list of arguments to pass in to the transaction request to Subtract Asset Quantity. +type SubtractAssetQuantityRequestParameters struct { + AssetId string `json:"assetId"` + Amount float32 `json:"amount"` +} + +// NewSubtractAssetQuantityRequestParameters instantiates a new SubtractAssetQuantityRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSubtractAssetQuantityRequestParameters(assetId string, amount float32) *SubtractAssetQuantityRequestParameters { + this := SubtractAssetQuantityRequestParameters{} + this.AssetId = assetId + this.Amount = amount + return &this +} + +// NewSubtractAssetQuantityRequestParametersWithDefaults instantiates a new SubtractAssetQuantityRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSubtractAssetQuantityRequestParametersWithDefaults() *SubtractAssetQuantityRequestParameters { + this := SubtractAssetQuantityRequestParameters{} + return &this +} + +// GetAssetId returns the AssetId field value +func (o *SubtractAssetQuantityRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *SubtractAssetQuantityRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *SubtractAssetQuantityRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetAmount returns the Amount field value +func (o *SubtractAssetQuantityRequestParameters) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *SubtractAssetQuantityRequestParameters) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *SubtractAssetQuantityRequestParameters) SetAmount(v float32) { + o.Amount = v +} + +func (o SubtractAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SubtractAssetQuantityRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetId"] = o.AssetId + toSerialize["amount"] = o.Amount + return toSerialize, nil +} + +type NullableSubtractAssetQuantityRequestParameters struct { + value *SubtractAssetQuantityRequestParameters + isSet bool +} + +func (v NullableSubtractAssetQuantityRequestParameters) Get() *SubtractAssetQuantityRequestParameters { + return v.value +} + +func (v *NullableSubtractAssetQuantityRequestParameters) Set(val *SubtractAssetQuantityRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSubtractAssetQuantityRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSubtractAssetQuantityRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubtractAssetQuantityRequestParameters(val *SubtractAssetQuantityRequestParameters) *NullableSubtractAssetQuantityRequestParameters { + return &NullableSubtractAssetQuantityRequestParameters{value: val, isSet: true} +} + +func (v NullableSubtractAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubtractAssetQuantityRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go new file mode 100644 index 0000000000..0b69a9e2dd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the TransferAssetRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferAssetRequestParameters{} + +// TransferAssetRequestParameters The list of arguments to pass in to the transaction request to Transfer Asset. +type TransferAssetRequestParameters struct { + SrcAccountId string `json:"srcAccountId"` + DestAccountId string `json:"destAccountId"` + AssetId string `json:"assetId"` + Description string `json:"description"` + Amount float32 `json:"amount"` +} + +// NewTransferAssetRequestParameters instantiates a new TransferAssetRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferAssetRequestParameters(srcAccountId string, destAccountId string, assetId string, description string, amount float32) *TransferAssetRequestParameters { + this := TransferAssetRequestParameters{} + this.SrcAccountId = srcAccountId + this.DestAccountId = destAccountId + this.AssetId = assetId + this.Description = description + this.Amount = amount + return &this +} + +// NewTransferAssetRequestParametersWithDefaults instantiates a new TransferAssetRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferAssetRequestParametersWithDefaults() *TransferAssetRequestParameters { + this := TransferAssetRequestParameters{} + return &this +} + +// GetSrcAccountId returns the SrcAccountId field value +func (o *TransferAssetRequestParameters) GetSrcAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.SrcAccountId +} + +// GetSrcAccountIdOk returns a tuple with the SrcAccountId field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetSrcAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SrcAccountId, true +} + +// SetSrcAccountId sets field value +func (o *TransferAssetRequestParameters) SetSrcAccountId(v string) { + o.SrcAccountId = v +} + +// GetDestAccountId returns the DestAccountId field value +func (o *TransferAssetRequestParameters) GetDestAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.DestAccountId +} + +// GetDestAccountIdOk returns a tuple with the DestAccountId field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetDestAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DestAccountId, true +} + +// SetDestAccountId sets field value +func (o *TransferAssetRequestParameters) SetDestAccountId(v string) { + o.DestAccountId = v +} + +// GetAssetId returns the AssetId field value +func (o *TransferAssetRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *TransferAssetRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetDescription returns the Description field value +func (o *TransferAssetRequestParameters) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *TransferAssetRequestParameters) SetDescription(v string) { + o.Description = v +} + +// GetAmount returns the Amount field value +func (o *TransferAssetRequestParameters) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *TransferAssetRequestParameters) SetAmount(v float32) { + o.Amount = v +} + +func (o TransferAssetRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferAssetRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["srcAccountId"] = o.SrcAccountId + toSerialize["destAccountId"] = o.DestAccountId + toSerialize["assetId"] = o.AssetId + toSerialize["description"] = o.Description + toSerialize["amount"] = o.Amount + return toSerialize, nil +} + +type NullableTransferAssetRequestParameters struct { + value *TransferAssetRequestParameters + isSet bool +} + +func (v NullableTransferAssetRequestParameters) Get() *TransferAssetRequestParameters { + return v.value +} + +func (v *NullableTransferAssetRequestParameters) Set(val *TransferAssetRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableTransferAssetRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferAssetRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferAssetRequestParameters(val *TransferAssetRequestParameters) *NullableTransferAssetRequestParameters { + return &NullableTransferAssetRequestParameters{value: val, isSet: true} +} + +func (v NullableTransferAssetRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferAssetRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 0000000000..d368ebf4c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..37268079d3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..c9fe54eb50 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-iroha + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-iroha_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GenerateTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GenerateTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 0000000000..6dff48e1b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..b3522e2c76 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Iroha + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..6079e073ee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,81 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java +src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java +src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java +src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java +src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java +src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java +src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java +src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java +src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java +src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java +src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java +src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java +src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java +src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java +src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java +src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java +src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java +src/main/java/org/openapitools/client/model/IrohaBaseConfig.java +src/main/java/org/openapitools/client/model/IrohaBlockProgress.java +src/main/java/org/openapitools/client/model/IrohaBlockResponse.java +src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java +src/main/java/org/openapitools/client/model/IrohaCommand.java +src/main/java/org/openapitools/client/model/IrohaQuery.java +src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java +src/main/java/org/openapitools/client/model/KeyPair.java +src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java +src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java +src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java +src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java +src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java +src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java +src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java +src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java +src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java +src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..bc1824e2cc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,186 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Iroha +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Iroha ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GenerateTransactionRequestV1 generateTransactionRequestV1 = new GenerateTransactionRequestV1(); // GenerateTransactionRequestV1 | + try { + String result = apiInstance.generateTransactionV1(generateTransactionRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#generateTransactionV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**generateTransactionV1**](docs/DefaultApi.md#generateTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction | Executes a transaction on a Iroha ledger + + +## Documentation for Models + + - [AddAssetQuantityRequestParameters](docs/AddAssetQuantityRequestParameters.md) + - [AddPeerRequestParameters](docs/AddPeerRequestParameters.md) + - [AddSignatoryRequestParameters](docs/AddSignatoryRequestParameters.md) + - [AppendRoleRequestParameters](docs/AppendRoleRequestParameters.md) + - [CallEngineRequestParameters](docs/CallEngineRequestParameters.md) + - [CompareAndSetAccountDetailRequestParameters](docs/CompareAndSetAccountDetailRequestParameters.md) + - [CreateAccountRequestParameters](docs/CreateAccountRequestParameters.md) + - [CreateAssetRequestParameters](docs/CreateAssetRequestParameters.md) + - [CreateDomainRequestParameters](docs/CreateDomainRequestParameters.md) + - [CreateRoleRequestParameters](docs/CreateRoleRequestParameters.md) + - [DetachRoleRequestParameters](docs/DetachRoleRequestParameters.md) + - [ErrorExceptionJsonResponseV1](docs/ErrorExceptionJsonResponseV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GetAccountAssetTransactionsRequestParameters](docs/GetAccountAssetTransactionsRequestParameters.md) + - [GetAccountAssetsRequestParameters](docs/GetAccountAssetsRequestParameters.md) + - [GetAccountDetailRequestParameters](docs/GetAccountDetailRequestParameters.md) + - [GetAccountRequestParameters](docs/GetAccountRequestParameters.md) + - [GetAccountTransactionsRequestParameters](docs/GetAccountTransactionsRequestParameters.md) + - [GetAssetInfoRequestParameters](docs/GetAssetInfoRequestParameters.md) + - [GetBlockRequestParameters](docs/GetBlockRequestParameters.md) + - [GetEngineReceiptsRequestParameters](docs/GetEngineReceiptsRequestParameters.md) + - [GetPendingTransactionsRequestParameters](docs/GetPendingTransactionsRequestParameters.md) + - [GetRolePermissionsRequestParameters](docs/GetRolePermissionsRequestParameters.md) + - [GetSignatoriesRequestParameters](docs/GetSignatoriesRequestParameters.md) + - [GetTransactionsRequestParameters](docs/GetTransactionsRequestParameters.md) + - [GrantPermissionRequestParameters](docs/GrantPermissionRequestParameters.md) + - [IrohaBaseConfig](docs/IrohaBaseConfig.md) + - [IrohaBlockProgress](docs/IrohaBlockProgress.md) + - [IrohaBlockResponse](docs/IrohaBlockResponse.md) + - [IrohaBlockResponsePayload](docs/IrohaBlockResponsePayload.md) + - [IrohaCommand](docs/IrohaCommand.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaSocketIOTransactV1](docs/IrohaSocketIOTransactV1.md) + - [KeyPair](docs/KeyPair.md) + - [RemovePeerRequestParameters](docs/RemovePeerRequestParameters.md) + - [RemoveSignatoryRequestParameters](docs/RemoveSignatoryRequestParameters.md) + - [RevokePermissionRequestParameters](docs/RevokePermissionRequestParameters.md) + - [RunTransactionRequestV1](docs/RunTransactionRequestV1.md) + - [RunTransactionRequestV1Body](docs/RunTransactionRequestV1Body.md) + - [RunTransactionRequestV1Params](docs/RunTransactionRequestV1Params.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [RunTransactionSignedRequestV1](docs/RunTransactionSignedRequestV1.md) + - [SetAccountDetailRequestParameters](docs/SetAccountDetailRequestParameters.md) + - [SetAccountQuorumRequestParameters](docs/SetAccountQuorumRequestParameters.md) + - [SubtractAssetQuantityRequestParameters](docs/SubtractAssetQuantityRequestParameters.md) + - [TransferAssetRequestParameters](docs/TransferAssetRequestParameters.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..3cb3d7dffa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,903 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequestV1Body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Bad Request error. + "405": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Method Not Allowed error. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + application/octet-stream: + schema: + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Bad Request Error + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + IrohaCommand: + enum: + - createAccount + - setAccountDetail + - setAccountQuorum + - compareAndSetAccountDetail + - createAsset + - addAssetQuantity + - subtractAssetQuantity + - transferAsset + - createDomain + - createRole + - detachRole + - appendRole + - addSignatory + - removeSignatory + - grantPermission + - revokePermission + - addPeer + - removePeer + - setSettingValue + - callEngine + type: string + x-enum-descriptions: + - "Make entity in the system, capable of sending transactions or queries, storing\ + \ signatories, personal data and identifiers." + - Set key-value information for a given account. + - "Set the number of signatories required to confirm the identity of a user,\ + \ who creates the transaction." + - Set key-value information for a given account if the old value matches the + value passed. + - "Create a new type of asset, unique in a domain. An asset is a countable representation\ + \ of a commodity." + - Increase the quantity of an asset on account of transaction creator. + - Decrease the number of assets on account of transaction creator. + - "Share assets within the account in peer network: in the way that source account\ + \ transfers assets to the target account." + - "Make new domain in Iroha network, which is a group of accounts." + - Create a new role in the system from the set of permissions. + - Detach a role from the set of roles of an account. + - "Promote an account to some created role in the system, where a role is a\ + \ set of permissions account has to perform an action (command or query)." + - Add an identifier to the account. Such identifier is a public key of another + device or a public key of another user. + - "Remove a public key, associated with an identity, from an account" + - Give another account rights to perform actions on the account of transaction + sender (give someone right to do something with my account). + - Revoke or dismiss given granted permission from another account in the network. + - Write into ledger the fact of peer addition into the peer network. + - Write into ledger the fact of peer removal from the network. + - "This command is not available for use, it was added for backward compatibility\ + \ with Iroha." + - This command is not availalbe for use because it is related to smart contract. + x-enum-varnames: + - CreateAccount + - SetAccountDetail + - SetAccountQuorum + - CompareAndSetAccountDetail + - CreateAsset + - AddAssetQuantity + - SubtractAssetQuantity + - TransferAsset + - CreateDomain + - CreateRole + - DetachRole + - AppendRole + - AddSignatory + - RemoveSignatory + - GrantPermission + - RevokePermission + - AddPeer + - RemovePeer + - SetSettingValue + - CallEngine + IrohaQuery: + enum: + - getAccount + - getAccountDetail + - getAssetInfo + - getAccountAssets + - getTransactions + - getPendingTransactions + - getAccountTransactions + - getAccountAssetTransactions + - getRoles + - getSignatories + - getRolePermissions + - getBlock + - getEngineReceipts + - fetchCommits + - getPeers + type: string + x-enum-descriptions: + - To get the state of an account + - To get details of the account. + - To get information on the given asset (as for now - its precision). + - To get the state of all assets in an account (a balance). + - "To retrieve information about transactions, based on their hashes." + - To retrieve a list of pending (not fully signed) multisignature transactions + or batches of transactions issued by account of query creator. + - To retrieve a list of transactions per account. + - To retrieve all transactions associated with given account and asset. + - To get existing roles in the system. + - "To get signatories, which act as an identity of the account." + - To get available permissions per role in the system. + - "To get a specific block, using its height as an identifier." + - To retrieve a receipt of a CallEngine command. Allows to access the event + log created during computations inside the EVM. + - "To get new blocks as soon as they are committed, a user can invoke FetchCommits\ + \ RPC call to Iroha network." + - A query that returns a list of peers in Iroha network. + x-enum-varnames: + - GetAccount + - GetAccountDetail + - GetAssetInfo + - GetAccountAssets + - GetTransactions + - GetPendingTransactions + - GetAccountTransactions + - GetAccountAssetTransactions + - GetRoles + - GetSignatories + - GetRolePermissions + - GetBlock + - GetEngineReceipts + - FetchCommits + - GetPeers + KeyPair: + properties: + publicKey: + description: SHA-3 ed25519 public keys of length 64 are recommended. + example: 313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910 + nullable: false + type: string + privateKey: + description: SHA-3 ed25519 private keys of length 64 are recommended. + example: f101537e319568c765b2cc89698325604991dca57b9716b58016b253506cab70 + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + RunTransactionRequestV1Params: + oneOf: + - items: {} + type: array + - $ref: '#/components/schemas/AddAssetQuantityRequestParameters' + - $ref: '#/components/schemas/AddPeerRequestParameters' + - $ref: '#/components/schemas/AddSignatoryRequestParameters' + - $ref: '#/components/schemas/AppendRoleRequestParameters' + - $ref: '#/components/schemas/CallEngineRequestParameters' + - $ref: '#/components/schemas/CreateAccountRequestParameters' + - $ref: '#/components/schemas/CreateAssetRequestParameters' + - $ref: '#/components/schemas/CreateDomainRequestParameters' + - $ref: '#/components/schemas/CreateRoleRequestParameters' + - $ref: '#/components/schemas/DetachRoleRequestParameters' + - $ref: '#/components/schemas/GrantPermissionRequestParameters' + - $ref: '#/components/schemas/RemovePeerRequestParameters' + - $ref: '#/components/schemas/RemoveSignatoryRequestParameters' + - $ref: '#/components/schemas/RevokePermissionRequestParameters' + - $ref: '#/components/schemas/SetAccountDetailRequestParameters' + - $ref: '#/components/schemas/SetAccountQuorumRequestParameters' + - $ref: '#/components/schemas/SubtractAssetQuantityRequestParameters' + - $ref: '#/components/schemas/TransferAssetRequestParameters' + - $ref: '#/components/schemas/CompareAndSetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAccountRequestParameters' + - $ref: '#/components/schemas/GetBlockRequestParameters' + - $ref: '#/components/schemas/GetSignatoriesRequestParameters' + - $ref: '#/components/schemas/GetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetPendingTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetsRequestParameters' + - $ref: '#/components/schemas/GetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAssetInfoRequestParameters' + - $ref: '#/components/schemas/GetRolePermissionsRequestParameters' + - $ref: '#/components/schemas/GetEngineReceiptsRequestParameters' + RunTransactionRequestV1Body: + oneOf: + - $ref: '#/components/schemas/RunTransactionRequestV1' + - $ref: '#/components/schemas/RunTransactionSignedRequestV1' + RunTransactionRequestV1: + additionalProperties: false + properties: + commandName: + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + params: + $ref: '#/components/schemas/RunTransactionRequestV1Params' + required: + - baseConfig + - commandName + - params + type: object + AddAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + AddPeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Peer. + properties: + address: + type: string + peerKey: + type: string + tlsCertificate: + type: string + syncingPeer: + type: boolean + required: + - address + - peerKey + type: object + AddSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + AppendRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Append Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + CallEngineRequestParameters: + description: The list of arguments to pass in to the transaction request to + Call Engine. + properties: + caller: + type: string + callee: + type: string + input: + type: string + required: + - callee + - caller + - input + type: object + CreateAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Account. + properties: + accountName: + type: string + domainId: + type: string + publicKey: + type: string + required: + - accountName + - domainId + - publicKey + type: object + CreateAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Asset. + properties: + assetName: + type: string + domainId: + type: string + precision: + type: integer + required: + - assetName + - domainId + - precision + type: object + CreateDomainRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Domain. + properties: + domainId: + type: string + defaultRole: + type: string + required: + - defaultRole + - domainId + type: object + CreateRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Role. + properties: + roleName: + type: string + permissionsList: + items: + type: number + type: array + required: + - permissionsList + - roleName + type: object + DetachRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Detach Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + GrantPermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Grant Permission. + properties: + accountId: + type: string + permission: + type: string + required: + - accountId + - permission + type: object + RemovePeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Peer. + properties: + publicKey: + type: string + required: + - publicKey + type: object + RemoveSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + RevokePermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Revoke Permission. + properties: + accountId: + type: string + permission: + type: number + required: + - accountId + - permission + type: object + SetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + required: + - accountId + - key + - value + type: object + SetAccountQuorumRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Quorum. + properties: + accountId: + type: string + quorum: + type: integer + required: + - accountId + - quorum + type: object + SubtractAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Subtract Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + TransferAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Transfer Asset. + properties: + srcAccountId: + type: string + destAccountId: + type: string + assetId: + type: string + description: + type: string + amount: + type: number + required: + - amount + - assetId + - description + - destAccountId + - srcAccountId + type: object + CompareAndSetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Compare And Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + oldValue: + type: string + check_empty: + type: boolean + required: + - accountId + - check_empty + - key + - value + type: object + GetAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account. + properties: + accountId: + type: string + required: + - accountId + type: object + GetBlockRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Block. + properties: + height: + type: integer + required: + - height + type: object + GetSignatoriesRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Signatories. + properties: + accountId: + type: string + required: + - accountId + type: object + GetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Transactions. + properties: + txHashesList: + items: + type: string + type: array + required: + - txHashesList + type: object + GetPendingTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Pending Transactions. + properties: + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + required: + - pageSize + type: object + GetAccountTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Transactions. + properties: + accountId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + firstTxHeight: + type: integer + lastTxHeight: + type: integer + required: + - accountId + - firstTxHash + - pageSize + type: object + GetAccountAssetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Asset Transactions. + properties: + accountId: + type: string + assetId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + required: + - accountId + - assetId + - firstTxHash + - pageSize + type: object + GetAccountAssetsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Assets. + properties: + accountId: + type: string + pageSize: + type: number + firstAssetId: + type: string + required: + - accountId + - pageSize + type: object + GetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Detail. + properties: + accountId: + type: string + key: + type: string + writer: + type: string + pageSize: + type: integer + paginationKey: + type: string + paginationWriter: + type: string + required: + - pageSize + - paginationKey + - paginationWriter + type: object + GetAssetInfoRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Asset Info. + properties: + assetId: + type: string + required: + - assetId + type: object + GetRolePermissionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Role Permissions. + properties: + roleId: + type: string + required: + - roleId + type: object + GetEngineReceiptsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Engine Receipts. + properties: + txHash: + type: string + required: + - txHash + type: object + RunTransactionSignedRequestV1: + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + required: + - signedTransaction + type: object + GenerateTransactionRequestV1: + additionalProperties: false + example: + creatorAccountId: creatorAccountId + commandName: "" + commandParams: "{}" + quorum: 0.8008281904610115 + properties: + commandName: + description: Iroha command name. + nullable: false + type: IrohaCommand + commandParams: + description: Parameters for iroha command specified in commandName + type: object + creatorAccountId: + description: Sender account id + nullable: false + type: string + quorum: + default: 1 + description: Requested transaction quorum + nullable: false + type: number + required: + - commandName + - commandParams + - creatorAccountId + type: object + IrohaBaseConfig: + additionalProperties: true + properties: + irohaHost: + nullable: false + type: string + irohaPort: + nullable: false + type: number + creatorAccountId: + nullable: false + type: string + privKey: + default: [] + items: {} + nullable: false + type: array + quorum: + nullable: false + type: number + timeoutLimit: + nullable: false + type: number + tls: + description: Can only be set to false for an insecure grpc connection. + nullable: false + type: boolean + monitorMode: + description: Flag used for monitoring. It changes default beahviour of transaction + wrapper so it return error to caller instead of throwing RuntimeError + straight away. + nullable: true + type: boolean + type: object + RunTransactionResponse: + example: + transactionReceipt: "" + properties: + transactionReceipt: {} + required: + - transactionReceipt + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + ErrorExceptionJsonResponseV1: + properties: + message: + nullable: false + type: string + name: + nullable: false + type: string + error: + nullable: false + type: string + stack: + nullable: false + type: string + cause: + nullable: false + type: string + required: + - message + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + - SendAsyncRequest + - SendSyncRequest + IrohaSocketIOTransactV1: + enum: + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest + type: string + x-enum-varnames: + - SendAsyncRequest + - SendSyncRequest + IrohaBlockResponse: + properties: + payload: + $ref: '#/components/schemas/IrohaBlockResponse_payload' + signaturesList: + items: {} + type: array + required: + - payload + - signaturesList + type: object + IrohaBlockProgress: + properties: + transactionReceipt: + $ref: '#/components/schemas/IrohaBlockResponse' + required: + - transactionReceipt + type: object + IrohaBlockResponse_payload: + properties: + transactionsList: + items: {} + type: array + txNumber: + type: number + height: + type: number + prevBlockHash: + type: string + createdTime: + type: number + rejectedTransactionsHashesList: + items: {} + type: array + required: + - createdTime + - height + - prevBlockHash + - rejectedTransactionsHashesList + - transactionsList + - txNumber + type: object + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..f7170e4302 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..a9d883bb7f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..4e5787fcff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..ff07a63845 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..c9acbf1133 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..61917580d3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,444 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AddAssetQuantityRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AddPeerRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AddSignatoryRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AppendRoleRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CallEngineRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CompareAndSetAccountDetailRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateAccountRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateAssetRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateDomainRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateRoleRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DetachRoleRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionJsonResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GenerateTransactionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountAssetTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountAssetsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountDetailRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAssetInfoRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetEngineReceiptsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetPendingTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetRolePermissionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetSignatoriesRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GrantPermissionRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBaseConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBlockProgress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBlockResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBlockResponsePayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.KeyPair.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RemovePeerRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RemoveSignatoryRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RevokePermissionRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequestV1Body.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequestV1Params.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionSignedRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetAccountDetailRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetAccountQuorumRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubtractAssetQuantityRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferAssetRequestParameters.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..1be3f99e70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..9a65171239 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..0851213f2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..05a88a73e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..8aa7c9caf5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,450 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.ErrorExceptionJsonResponseV1; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Body; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for generateTransactionV1 + * @param generateTransactionRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Call(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = generateTransactionRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/octet-stream", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call generateTransactionV1ValidateBeforeCall(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + return generateTransactionV1Call(generateTransactionRequestV1, _callback); + + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public String generateTransactionV1(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + ApiResponse localVarResp = generateTransactionV1WithHttpInfo(generateTransactionRequestV1); + return localVarResp.getData(); + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public ApiResponse generateTransactionV1WithHttpInfo(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate transaction that can be signed locally. (asynchronously) + * + * @param generateTransactionRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Async(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequestV1Body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequestV1Body runTransactionRequestV1Body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequestV1Body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call runTransactionV1ValidateBeforeCall(RunTransactionRequestV1Body runTransactionRequestV1Body, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequestV1Body, _callback); + + } + + /** + * Executes a transaction on a Iroha ledger + * + * @param runTransactionRequestV1Body (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequestV1Body runTransactionRequestV1Body) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequestV1Body); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a Iroha ledger + * + * @param runTransactionRequestV1Body (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequestV1Body runTransactionRequestV1Body) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequestV1Body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a Iroha ledger (asynchronously) + * + * @param runTransactionRequestV1Body (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequestV1Body runTransactionRequestV1Body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequestV1Body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..99e466edcc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..9515de28b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..356af7f278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..81e840e520 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..2685f9cc87 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java new file mode 100644 index 0000000000..c83542b945 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Add Asset Quantity. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddAssetQuantityRequestParameters { + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private BigDecimal amount; + + public AddAssetQuantityRequestParameters() { + } + + public AddAssetQuantityRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public AddAssetQuantityRequestParameters amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddAssetQuantityRequestParameters addAssetQuantityRequestParameters = (AddAssetQuantityRequestParameters) o; + return Objects.equals(this.assetId, addAssetQuantityRequestParameters.assetId) && + Objects.equals(this.amount, addAssetQuantityRequestParameters.amount); + } + + @Override + public int hashCode() { + return Objects.hash(assetId, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddAssetQuantityRequestParameters {\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetId"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddAssetQuantityRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddAssetQuantityRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddAssetQuantityRequestParameters is not found in the empty JSON string", AddAssetQuantityRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddAssetQuantityRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddAssetQuantityRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddAssetQuantityRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddAssetQuantityRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddAssetQuantityRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddAssetQuantityRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddAssetQuantityRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddAssetQuantityRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddAssetQuantityRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddAssetQuantityRequestParameters + * @throws IOException if the JSON string is invalid with respect to AddAssetQuantityRequestParameters + */ + public static AddAssetQuantityRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddAssetQuantityRequestParameters.class); + } + + /** + * Convert an instance of AddAssetQuantityRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java new file mode 100644 index 0000000000..e2a4d0187c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java @@ -0,0 +1,307 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Add Peer. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddPeerRequestParameters { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_PEER_KEY = "peerKey"; + @SerializedName(SERIALIZED_NAME_PEER_KEY) + private String peerKey; + + public static final String SERIALIZED_NAME_TLS_CERTIFICATE = "tlsCertificate"; + @SerializedName(SERIALIZED_NAME_TLS_CERTIFICATE) + private String tlsCertificate; + + public static final String SERIALIZED_NAME_SYNCING_PEER = "syncingPeer"; + @SerializedName(SERIALIZED_NAME_SYNCING_PEER) + private Boolean syncingPeer; + + public AddPeerRequestParameters() { + } + + public AddPeerRequestParameters address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public AddPeerRequestParameters peerKey(String peerKey) { + + this.peerKey = peerKey; + return this; + } + + /** + * Get peerKey + * @return peerKey + **/ + @javax.annotation.Nonnull + public String getPeerKey() { + return peerKey; + } + + + public void setPeerKey(String peerKey) { + this.peerKey = peerKey; + } + + + public AddPeerRequestParameters tlsCertificate(String tlsCertificate) { + + this.tlsCertificate = tlsCertificate; + return this; + } + + /** + * Get tlsCertificate + * @return tlsCertificate + **/ + @javax.annotation.Nullable + public String getTlsCertificate() { + return tlsCertificate; + } + + + public void setTlsCertificate(String tlsCertificate) { + this.tlsCertificate = tlsCertificate; + } + + + public AddPeerRequestParameters syncingPeer(Boolean syncingPeer) { + + this.syncingPeer = syncingPeer; + return this; + } + + /** + * Get syncingPeer + * @return syncingPeer + **/ + @javax.annotation.Nullable + public Boolean getSyncingPeer() { + return syncingPeer; + } + + + public void setSyncingPeer(Boolean syncingPeer) { + this.syncingPeer = syncingPeer; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPeerRequestParameters addPeerRequestParameters = (AddPeerRequestParameters) o; + return Objects.equals(this.address, addPeerRequestParameters.address) && + Objects.equals(this.peerKey, addPeerRequestParameters.peerKey) && + Objects.equals(this.tlsCertificate, addPeerRequestParameters.tlsCertificate) && + Objects.equals(this.syncingPeer, addPeerRequestParameters.syncingPeer); + } + + @Override + public int hashCode() { + return Objects.hash(address, peerKey, tlsCertificate, syncingPeer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPeerRequestParameters {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" peerKey: ").append(toIndentedString(peerKey)).append("\n"); + sb.append(" tlsCertificate: ").append(toIndentedString(tlsCertificate)).append("\n"); + sb.append(" syncingPeer: ").append(toIndentedString(syncingPeer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("peerKey"); + openapiFields.add("tlsCertificate"); + openapiFields.add("syncingPeer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("peerKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddPeerRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPeerRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddPeerRequestParameters is not found in the empty JSON string", AddPeerRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPeerRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPeerRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPeerRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("peerKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `peerKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("peerKey").toString())); + } + if ((jsonObj.get("tlsCertificate") != null && !jsonObj.get("tlsCertificate").isJsonNull()) && !jsonObj.get("tlsCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tlsCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tlsCertificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPeerRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPeerRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddPeerRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPeerRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPeerRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddPeerRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPeerRequestParameters + * @throws IOException if the JSON string is invalid with respect to AddPeerRequestParameters + */ + public static AddPeerRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPeerRequestParameters.class); + } + + /** + * Convert an instance of AddPeerRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java new file mode 100644 index 0000000000..a0ce2fc4d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Add Signatory. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddSignatoryRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public AddSignatoryRequestParameters() { + } + + public AddSignatoryRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public AddSignatoryRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddSignatoryRequestParameters addSignatoryRequestParameters = (AddSignatoryRequestParameters) o; + return Objects.equals(this.accountId, addSignatoryRequestParameters.accountId) && + Objects.equals(this.publicKey, addSignatoryRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddSignatoryRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddSignatoryRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddSignatoryRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddSignatoryRequestParameters is not found in the empty JSON string", AddSignatoryRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddSignatoryRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddSignatoryRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddSignatoryRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddSignatoryRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddSignatoryRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddSignatoryRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddSignatoryRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddSignatoryRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddSignatoryRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddSignatoryRequestParameters + * @throws IOException if the JSON string is invalid with respect to AddSignatoryRequestParameters + */ + public static AddSignatoryRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddSignatoryRequestParameters.class); + } + + /** + * Convert an instance of AddSignatoryRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java new file mode 100644 index 0000000000..a1e53639af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Append Role. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AppendRoleRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; + + public AppendRoleRequestParameters() { + } + + public AppendRoleRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public AppendRoleRequestParameters roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * Get roleName + * @return roleName + **/ + @javax.annotation.Nonnull + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppendRoleRequestParameters appendRoleRequestParameters = (AppendRoleRequestParameters) o; + return Objects.equals(this.accountId, appendRoleRequestParameters.accountId) && + Objects.equals(this.roleName, appendRoleRequestParameters.roleName); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, roleName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppendRoleRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("roleName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("roleName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AppendRoleRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AppendRoleRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AppendRoleRequestParameters is not found in the empty JSON string", AppendRoleRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AppendRoleRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AppendRoleRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AppendRoleRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AppendRoleRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AppendRoleRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AppendRoleRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AppendRoleRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AppendRoleRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AppendRoleRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppendRoleRequestParameters + * @throws IOException if the JSON string is invalid with respect to AppendRoleRequestParameters + */ + public static AppendRoleRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AppendRoleRequestParameters.class); + } + + /** + * Convert an instance of AppendRoleRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java new file mode 100644 index 0000000000..7857c5d5ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Call Engine. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CallEngineRequestParameters { + public static final String SERIALIZED_NAME_CALLER = "caller"; + @SerializedName(SERIALIZED_NAME_CALLER) + private String caller; + + public static final String SERIALIZED_NAME_CALLEE = "callee"; + @SerializedName(SERIALIZED_NAME_CALLEE) + private String callee; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public CallEngineRequestParameters() { + } + + public CallEngineRequestParameters caller(String caller) { + + this.caller = caller; + return this; + } + + /** + * Get caller + * @return caller + **/ + @javax.annotation.Nonnull + public String getCaller() { + return caller; + } + + + public void setCaller(String caller) { + this.caller = caller; + } + + + public CallEngineRequestParameters callee(String callee) { + + this.callee = callee; + return this; + } + + /** + * Get callee + * @return callee + **/ + @javax.annotation.Nonnull + public String getCallee() { + return callee; + } + + + public void setCallee(String callee) { + this.callee = callee; + } + + + public CallEngineRequestParameters input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nonnull + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallEngineRequestParameters callEngineRequestParameters = (CallEngineRequestParameters) o; + return Objects.equals(this.caller, callEngineRequestParameters.caller) && + Objects.equals(this.callee, callEngineRequestParameters.callee) && + Objects.equals(this.input, callEngineRequestParameters.input); + } + + @Override + public int hashCode() { + return Objects.hash(caller, callee, input); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallEngineRequestParameters {\n"); + sb.append(" caller: ").append(toIndentedString(caller)).append("\n"); + sb.append(" callee: ").append(toIndentedString(callee)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("caller"); + openapiFields.add("callee"); + openapiFields.add("input"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("caller"); + openapiRequiredFields.add("callee"); + openapiRequiredFields.add("input"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CallEngineRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CallEngineRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CallEngineRequestParameters is not found in the empty JSON string", CallEngineRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CallEngineRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CallEngineRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CallEngineRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("caller").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `caller` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caller").toString())); + } + if (!jsonObj.get("callee").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `callee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callee").toString())); + } + if (!jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallEngineRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallEngineRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallEngineRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallEngineRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CallEngineRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallEngineRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallEngineRequestParameters + * @throws IOException if the JSON string is invalid with respect to CallEngineRequestParameters + */ + public static CallEngineRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallEngineRequestParameters.class); + } + + /** + * Convert an instance of CallEngineRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java new file mode 100644 index 0000000000..ed357166fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java @@ -0,0 +1,340 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Compare And Set Account Detail. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompareAndSetAccountDetailRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_OLD_VALUE = "oldValue"; + @SerializedName(SERIALIZED_NAME_OLD_VALUE) + private String oldValue; + + public static final String SERIALIZED_NAME_CHECK_EMPTY = "check_empty"; + @SerializedName(SERIALIZED_NAME_CHECK_EMPTY) + private Boolean checkEmpty; + + public CompareAndSetAccountDetailRequestParameters() { + } + + public CompareAndSetAccountDetailRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public CompareAndSetAccountDetailRequestParameters key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public CompareAndSetAccountDetailRequestParameters value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public CompareAndSetAccountDetailRequestParameters oldValue(String oldValue) { + + this.oldValue = oldValue; + return this; + } + + /** + * Get oldValue + * @return oldValue + **/ + @javax.annotation.Nullable + public String getOldValue() { + return oldValue; + } + + + public void setOldValue(String oldValue) { + this.oldValue = oldValue; + } + + + public CompareAndSetAccountDetailRequestParameters checkEmpty(Boolean checkEmpty) { + + this.checkEmpty = checkEmpty; + return this; + } + + /** + * Get checkEmpty + * @return checkEmpty + **/ + @javax.annotation.Nonnull + public Boolean getCheckEmpty() { + return checkEmpty; + } + + + public void setCheckEmpty(Boolean checkEmpty) { + this.checkEmpty = checkEmpty; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompareAndSetAccountDetailRequestParameters compareAndSetAccountDetailRequestParameters = (CompareAndSetAccountDetailRequestParameters) o; + return Objects.equals(this.accountId, compareAndSetAccountDetailRequestParameters.accountId) && + Objects.equals(this.key, compareAndSetAccountDetailRequestParameters.key) && + Objects.equals(this.value, compareAndSetAccountDetailRequestParameters.value) && + Objects.equals(this.oldValue, compareAndSetAccountDetailRequestParameters.oldValue) && + Objects.equals(this.checkEmpty, compareAndSetAccountDetailRequestParameters.checkEmpty); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, key, value, oldValue, checkEmpty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompareAndSetAccountDetailRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" oldValue: ").append(toIndentedString(oldValue)).append("\n"); + sb.append(" checkEmpty: ").append(toIndentedString(checkEmpty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("oldValue"); + openapiFields.add("check_empty"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("check_empty"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CompareAndSetAccountDetailRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CompareAndSetAccountDetailRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CompareAndSetAccountDetailRequestParameters is not found in the empty JSON string", CompareAndSetAccountDetailRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CompareAndSetAccountDetailRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompareAndSetAccountDetailRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CompareAndSetAccountDetailRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("oldValue") != null && !jsonObj.get("oldValue").isJsonNull()) && !jsonObj.get("oldValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `oldValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oldValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CompareAndSetAccountDetailRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CompareAndSetAccountDetailRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CompareAndSetAccountDetailRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CompareAndSetAccountDetailRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CompareAndSetAccountDetailRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CompareAndSetAccountDetailRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CompareAndSetAccountDetailRequestParameters + * @throws IOException if the JSON string is invalid with respect to CompareAndSetAccountDetailRequestParameters + */ + public static CompareAndSetAccountDetailRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CompareAndSetAccountDetailRequestParameters.class); + } + + /** + * Convert an instance of CompareAndSetAccountDetailRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java new file mode 100644 index 0000000000..9e106f78eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Account. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAccountRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "accountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + private String accountName; + + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public CreateAccountRequestParameters() { + } + + public CreateAccountRequestParameters accountName(String accountName) { + + this.accountName = accountName; + return this; + } + + /** + * Get accountName + * @return accountName + **/ + @javax.annotation.Nonnull + public String getAccountName() { + return accountName; + } + + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + + public CreateAccountRequestParameters domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + public CreateAccountRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAccountRequestParameters createAccountRequestParameters = (CreateAccountRequestParameters) o; + return Objects.equals(this.accountName, createAccountRequestParameters.accountName) && + Objects.equals(this.domainId, createAccountRequestParameters.domainId) && + Objects.equals(this.publicKey, createAccountRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, domainId, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAccountRequestParameters {\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountName"); + openapiFields.add("domainId"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountName"); + openapiRequiredFields.add("domainId"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateAccountRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateAccountRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAccountRequestParameters is not found in the empty JSON string", CreateAccountRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateAccountRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAccountRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAccountRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountName").toString())); + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAccountRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAccountRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateAccountRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAccountRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAccountRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAccountRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAccountRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateAccountRequestParameters + */ + public static CreateAccountRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAccountRequestParameters.class); + } + + /** + * Convert an instance of CreateAccountRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java new file mode 100644 index 0000000000..66aa6380f8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Asset. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAssetRequestParameters { + public static final String SERIALIZED_NAME_ASSET_NAME = "assetName"; + @SerializedName(SERIALIZED_NAME_ASSET_NAME) + private String assetName; + + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public static final String SERIALIZED_NAME_PRECISION = "precision"; + @SerializedName(SERIALIZED_NAME_PRECISION) + private Integer precision; + + public CreateAssetRequestParameters() { + } + + public CreateAssetRequestParameters assetName(String assetName) { + + this.assetName = assetName; + return this; + } + + /** + * Get assetName + * @return assetName + **/ + @javax.annotation.Nonnull + public String getAssetName() { + return assetName; + } + + + public void setAssetName(String assetName) { + this.assetName = assetName; + } + + + public CreateAssetRequestParameters domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + public CreateAssetRequestParameters precision(Integer precision) { + + this.precision = precision; + return this; + } + + /** + * Get precision + * @return precision + **/ + @javax.annotation.Nonnull + public Integer getPrecision() { + return precision; + } + + + public void setPrecision(Integer precision) { + this.precision = precision; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAssetRequestParameters createAssetRequestParameters = (CreateAssetRequestParameters) o; + return Objects.equals(this.assetName, createAssetRequestParameters.assetName) && + Objects.equals(this.domainId, createAssetRequestParameters.domainId) && + Objects.equals(this.precision, createAssetRequestParameters.precision); + } + + @Override + public int hashCode() { + return Objects.hash(assetName, domainId, precision); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAssetRequestParameters {\n"); + sb.append(" assetName: ").append(toIndentedString(assetName)).append("\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" precision: ").append(toIndentedString(precision)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetName"); + openapiFields.add("domainId"); + openapiFields.add("precision"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetName"); + openapiRequiredFields.add("domainId"); + openapiRequiredFields.add("precision"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateAssetRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateAssetRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAssetRequestParameters is not found in the empty JSON string", CreateAssetRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateAssetRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAssetRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAssetRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetName").toString())); + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAssetRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAssetRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateAssetRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAssetRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAssetRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAssetRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAssetRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateAssetRequestParameters + */ + public static CreateAssetRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAssetRequestParameters.class); + } + + /** + * Convert an instance of CreateAssetRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java new file mode 100644 index 0000000000..aae1c86701 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Domain. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDomainRequestParameters { + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public static final String SERIALIZED_NAME_DEFAULT_ROLE = "defaultRole"; + @SerializedName(SERIALIZED_NAME_DEFAULT_ROLE) + private String defaultRole; + + public CreateDomainRequestParameters() { + } + + public CreateDomainRequestParameters domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + public CreateDomainRequestParameters defaultRole(String defaultRole) { + + this.defaultRole = defaultRole; + return this; + } + + /** + * Get defaultRole + * @return defaultRole + **/ + @javax.annotation.Nonnull + public String getDefaultRole() { + return defaultRole; + } + + + public void setDefaultRole(String defaultRole) { + this.defaultRole = defaultRole; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDomainRequestParameters createDomainRequestParameters = (CreateDomainRequestParameters) o; + return Objects.equals(this.domainId, createDomainRequestParameters.domainId) && + Objects.equals(this.defaultRole, createDomainRequestParameters.defaultRole); + } + + @Override + public int hashCode() { + return Objects.hash(domainId, defaultRole); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDomainRequestParameters {\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" defaultRole: ").append(toIndentedString(defaultRole)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("domainId"); + openapiFields.add("defaultRole"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("domainId"); + openapiRequiredFields.add("defaultRole"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateDomainRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDomainRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDomainRequestParameters is not found in the empty JSON string", CreateDomainRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDomainRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDomainRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDomainRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + if (!jsonObj.get("defaultRole").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `defaultRole` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultRole").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDomainRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDomainRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateDomainRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDomainRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDomainRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDomainRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDomainRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateDomainRequestParameters + */ + public static CreateDomainRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDomainRequestParameters.class); + } + + /** + * Convert an instance of CreateDomainRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java new file mode 100644 index 0000000000..55e3c25348 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java @@ -0,0 +1,262 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Role. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateRoleRequestParameters { + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; + + public static final String SERIALIZED_NAME_PERMISSIONS_LIST = "permissionsList"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS_LIST) + private List permissionsList = new ArrayList<>(); + + public CreateRoleRequestParameters() { + } + + public CreateRoleRequestParameters roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * Get roleName + * @return roleName + **/ + @javax.annotation.Nonnull + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + public CreateRoleRequestParameters permissionsList(List permissionsList) { + + this.permissionsList = permissionsList; + return this; + } + + public CreateRoleRequestParameters addPermissionsListItem(BigDecimal permissionsListItem) { + if (this.permissionsList == null) { + this.permissionsList = new ArrayList<>(); + } + this.permissionsList.add(permissionsListItem); + return this; + } + + /** + * Get permissionsList + * @return permissionsList + **/ + @javax.annotation.Nonnull + public List getPermissionsList() { + return permissionsList; + } + + + public void setPermissionsList(List permissionsList) { + this.permissionsList = permissionsList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRoleRequestParameters createRoleRequestParameters = (CreateRoleRequestParameters) o; + return Objects.equals(this.roleName, createRoleRequestParameters.roleName) && + Objects.equals(this.permissionsList, createRoleRequestParameters.permissionsList); + } + + @Override + public int hashCode() { + return Objects.hash(roleName, permissionsList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateRoleRequestParameters {\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append(" permissionsList: ").append(toIndentedString(permissionsList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("roleName"); + openapiFields.add("permissionsList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("roleName"); + openapiRequiredFields.add("permissionsList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateRoleRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateRoleRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateRoleRequestParameters is not found in the empty JSON string", CreateRoleRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateRoleRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateRoleRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateRoleRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("permissionsList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("permissionsList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `permissionsList` to be an array in the JSON string but got `%s`", jsonObj.get("permissionsList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateRoleRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateRoleRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateRoleRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateRoleRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateRoleRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateRoleRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateRoleRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateRoleRequestParameters + */ + public static CreateRoleRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateRoleRequestParameters.class); + } + + /** + * Convert an instance of CreateRoleRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java new file mode 100644 index 0000000000..90d1c4164d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Detach Role. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DetachRoleRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; + + public DetachRoleRequestParameters() { + } + + public DetachRoleRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public DetachRoleRequestParameters roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * Get roleName + * @return roleName + **/ + @javax.annotation.Nonnull + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetachRoleRequestParameters detachRoleRequestParameters = (DetachRoleRequestParameters) o; + return Objects.equals(this.accountId, detachRoleRequestParameters.accountId) && + Objects.equals(this.roleName, detachRoleRequestParameters.roleName); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, roleName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetachRoleRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("roleName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("roleName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DetachRoleRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DetachRoleRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DetachRoleRequestParameters is not found in the empty JSON string", DetachRoleRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DetachRoleRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DetachRoleRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DetachRoleRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DetachRoleRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DetachRoleRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DetachRoleRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DetachRoleRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DetachRoleRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DetachRoleRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of DetachRoleRequestParameters + * @throws IOException if the JSON string is invalid with respect to DetachRoleRequestParameters + */ + public static DetachRoleRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DetachRoleRequestParameters.class); + } + + /** + * Convert an instance of DetachRoleRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java new file mode 100644 index 0000000000..960b9cf890 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java @@ -0,0 +1,340 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionJsonResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionJsonResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public static final String SERIALIZED_NAME_STACK = "stack"; + @SerializedName(SERIALIZED_NAME_STACK) + private String stack; + + public static final String SERIALIZED_NAME_CAUSE = "cause"; + @SerializedName(SERIALIZED_NAME_CAUSE) + private String cause; + + public ErrorExceptionJsonResponseV1() { + } + + public ErrorExceptionJsonResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionJsonResponseV1 name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ErrorExceptionJsonResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + public ErrorExceptionJsonResponseV1 stack(String stack) { + + this.stack = stack; + return this; + } + + /** + * Get stack + * @return stack + **/ + @javax.annotation.Nullable + public String getStack() { + return stack; + } + + + public void setStack(String stack) { + this.stack = stack; + } + + + public ErrorExceptionJsonResponseV1 cause(String cause) { + + this.cause = cause; + return this; + } + + /** + * Get cause + * @return cause + **/ + @javax.annotation.Nullable + public String getCause() { + return cause; + } + + + public void setCause(String cause) { + this.cause = cause; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionJsonResponseV1 errorExceptionJsonResponseV1 = (ErrorExceptionJsonResponseV1) o; + return Objects.equals(this.message, errorExceptionJsonResponseV1.message) && + Objects.equals(this.name, errorExceptionJsonResponseV1.name) && + Objects.equals(this.error, errorExceptionJsonResponseV1.error) && + Objects.equals(this.stack, errorExceptionJsonResponseV1.stack) && + Objects.equals(this.cause, errorExceptionJsonResponseV1.cause); + } + + @Override + public int hashCode() { + return Objects.hash(message, name, error, stack, cause); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionJsonResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" stack: ").append(toIndentedString(stack)).append("\n"); + sb.append(" cause: ").append(toIndentedString(cause)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("name"); + openapiFields.add("error"); + openapiFields.add("stack"); + openapiFields.add("cause"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionJsonResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionJsonResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionJsonResponseV1 is not found in the empty JSON string", ErrorExceptionJsonResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionJsonResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionJsonResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionJsonResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + if ((jsonObj.get("stack") != null && !jsonObj.get("stack").isJsonNull()) && !jsonObj.get("stack").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stack` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stack").toString())); + } + if ((jsonObj.get("cause") != null && !jsonObj.get("cause").isJsonNull()) && !jsonObj.get("cause").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cause` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cause").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionJsonResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionJsonResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionJsonResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionJsonResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionJsonResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionJsonResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionJsonResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionJsonResponseV1 + */ + public static ErrorExceptionJsonResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionJsonResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionJsonResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 0000000000..ed59db5de9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java new file mode 100644 index 0000000000..c4076874c0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java @@ -0,0 +1,304 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.IrohaCommand; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GenerateTransactionRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GenerateTransactionRequestV1 { + public static final String SERIALIZED_NAME_COMMAND_NAME = "commandName"; + @SerializedName(SERIALIZED_NAME_COMMAND_NAME) + private IrohaCommand commandName = null; + + public static final String SERIALIZED_NAME_COMMAND_PARAMS = "commandParams"; + @SerializedName(SERIALIZED_NAME_COMMAND_PARAMS) + private Object commandParams; + + public static final String SERIALIZED_NAME_CREATOR_ACCOUNT_ID = "creatorAccountId"; + @SerializedName(SERIALIZED_NAME_CREATOR_ACCOUNT_ID) + private String creatorAccountId; + + public static final String SERIALIZED_NAME_QUORUM = "quorum"; + @SerializedName(SERIALIZED_NAME_QUORUM) + private BigDecimal quorum = new BigDecimal("1"); + + public GenerateTransactionRequestV1() { + } + + public GenerateTransactionRequestV1 commandName(IrohaCommand commandName) { + + this.commandName = commandName; + return this; + } + + /** + * Iroha command name. + * @return commandName + **/ + @javax.annotation.Nonnull + public IrohaCommand getCommandName() { + return commandName; + } + + + public void setCommandName(IrohaCommand commandName) { + this.commandName = commandName; + } + + + public GenerateTransactionRequestV1 commandParams(Object commandParams) { + + this.commandParams = commandParams; + return this; + } + + /** + * Parameters for iroha command specified in commandName + * @return commandParams + **/ + @javax.annotation.Nonnull + public Object getCommandParams() { + return commandParams; + } + + + public void setCommandParams(Object commandParams) { + this.commandParams = commandParams; + } + + + public GenerateTransactionRequestV1 creatorAccountId(String creatorAccountId) { + + this.creatorAccountId = creatorAccountId; + return this; + } + + /** + * Sender account id + * @return creatorAccountId + **/ + @javax.annotation.Nonnull + public String getCreatorAccountId() { + return creatorAccountId; + } + + + public void setCreatorAccountId(String creatorAccountId) { + this.creatorAccountId = creatorAccountId; + } + + + public GenerateTransactionRequestV1 quorum(BigDecimal quorum) { + + this.quorum = quorum; + return this; + } + + /** + * Requested transaction quorum + * @return quorum + **/ + @javax.annotation.Nullable + public BigDecimal getQuorum() { + return quorum; + } + + + public void setQuorum(BigDecimal quorum) { + this.quorum = quorum; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateTransactionRequestV1 generateTransactionRequestV1 = (GenerateTransactionRequestV1) o; + return Objects.equals(this.commandName, generateTransactionRequestV1.commandName) && + Objects.equals(this.commandParams, generateTransactionRequestV1.commandParams) && + Objects.equals(this.creatorAccountId, generateTransactionRequestV1.creatorAccountId) && + Objects.equals(this.quorum, generateTransactionRequestV1.quorum); + } + + @Override + public int hashCode() { + return Objects.hash(commandName, commandParams, creatorAccountId, quorum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateTransactionRequestV1 {\n"); + sb.append(" commandName: ").append(toIndentedString(commandName)).append("\n"); + sb.append(" commandParams: ").append(toIndentedString(commandParams)).append("\n"); + sb.append(" creatorAccountId: ").append(toIndentedString(creatorAccountId)).append("\n"); + sb.append(" quorum: ").append(toIndentedString(quorum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commandName"); + openapiFields.add("commandParams"); + openapiFields.add("creatorAccountId"); + openapiFields.add("quorum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("commandName"); + openapiRequiredFields.add("commandParams"); + openapiRequiredFields.add("creatorAccountId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenerateTransactionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GenerateTransactionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateTransactionRequestV1 is not found in the empty JSON string", GenerateTransactionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GenerateTransactionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateTransactionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GenerateTransactionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("creatorAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorAccountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateTransactionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTransactionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenerateTransactionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenerateTransactionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenerateTransactionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateTransactionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTransactionRequestV1 + * @throws IOException if the JSON string is invalid with respect to GenerateTransactionRequestV1 + */ + public static GenerateTransactionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTransactionRequestV1.class); + } + + /** + * Convert an instance of GenerateTransactionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java new file mode 100644 index 0000000000..5487f043ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Asset Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAssetTransactionsRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_FIRST_TX_HASH = "firstTxHash"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HASH) + private String firstTxHash; + + public GetAccountAssetTransactionsRequestParameters() { + } + + public GetAccountAssetTransactionsRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountAssetTransactionsRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public GetAccountAssetTransactionsRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountAssetTransactionsRequestParameters firstTxHash(String firstTxHash) { + + this.firstTxHash = firstTxHash; + return this; + } + + /** + * Get firstTxHash + * @return firstTxHash + **/ + @javax.annotation.Nonnull + public String getFirstTxHash() { + return firstTxHash; + } + + + public void setFirstTxHash(String firstTxHash) { + this.firstTxHash = firstTxHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAssetTransactionsRequestParameters getAccountAssetTransactionsRequestParameters = (GetAccountAssetTransactionsRequestParameters) o; + return Objects.equals(this.accountId, getAccountAssetTransactionsRequestParameters.accountId) && + Objects.equals(this.assetId, getAccountAssetTransactionsRequestParameters.assetId) && + Objects.equals(this.pageSize, getAccountAssetTransactionsRequestParameters.pageSize) && + Objects.equals(this.firstTxHash, getAccountAssetTransactionsRequestParameters.firstTxHash); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, assetId, pageSize, firstTxHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAssetTransactionsRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstTxHash: ").append(toIndentedString(firstTxHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("assetId"); + openapiFields.add("pageSize"); + openapiFields.add("firstTxHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("firstTxHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountAssetTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountAssetTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountAssetTransactionsRequestParameters is not found in the empty JSON string", GetAccountAssetTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountAssetTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountAssetTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountAssetTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + if (!jsonObj.get("firstTxHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstTxHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstTxHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountAssetTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountAssetTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountAssetTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountAssetTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountAssetTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountAssetTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountAssetTransactionsRequestParameters + */ + public static GetAccountAssetTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountAssetTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetAccountAssetTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java new file mode 100644 index 0000000000..042367f709 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Assets. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAssetsRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private BigDecimal pageSize; + + public static final String SERIALIZED_NAME_FIRST_ASSET_ID = "firstAssetId"; + @SerializedName(SERIALIZED_NAME_FIRST_ASSET_ID) + private String firstAssetId; + + public GetAccountAssetsRequestParameters() { + } + + public GetAccountAssetsRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountAssetsRequestParameters pageSize(BigDecimal pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public BigDecimal getPageSize() { + return pageSize; + } + + + public void setPageSize(BigDecimal pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountAssetsRequestParameters firstAssetId(String firstAssetId) { + + this.firstAssetId = firstAssetId; + return this; + } + + /** + * Get firstAssetId + * @return firstAssetId + **/ + @javax.annotation.Nullable + public String getFirstAssetId() { + return firstAssetId; + } + + + public void setFirstAssetId(String firstAssetId) { + this.firstAssetId = firstAssetId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAssetsRequestParameters getAccountAssetsRequestParameters = (GetAccountAssetsRequestParameters) o; + return Objects.equals(this.accountId, getAccountAssetsRequestParameters.accountId) && + Objects.equals(this.pageSize, getAccountAssetsRequestParameters.pageSize) && + Objects.equals(this.firstAssetId, getAccountAssetsRequestParameters.firstAssetId); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, pageSize, firstAssetId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAssetsRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstAssetId: ").append(toIndentedString(firstAssetId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("pageSize"); + openapiFields.add("firstAssetId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("pageSize"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountAssetsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountAssetsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountAssetsRequestParameters is not found in the empty JSON string", GetAccountAssetsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountAssetsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountAssetsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountAssetsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if ((jsonObj.get("firstAssetId") != null && !jsonObj.get("firstAssetId").isJsonNull()) && !jsonObj.get("firstAssetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstAssetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstAssetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountAssetsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountAssetsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountAssetsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountAssetsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountAssetsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountAssetsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountAssetsRequestParameters + */ + public static GetAccountAssetsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountAssetsRequestParameters.class); + } + + /** + * Convert an instance of GetAccountAssetsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java new file mode 100644 index 0000000000..e0663161ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java @@ -0,0 +1,370 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Detail. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountDetailRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_WRITER = "writer"; + @SerializedName(SERIALIZED_NAME_WRITER) + private String writer; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_PAGINATION_KEY = "paginationKey"; + @SerializedName(SERIALIZED_NAME_PAGINATION_KEY) + private String paginationKey; + + public static final String SERIALIZED_NAME_PAGINATION_WRITER = "paginationWriter"; + @SerializedName(SERIALIZED_NAME_PAGINATION_WRITER) + private String paginationWriter; + + public GetAccountDetailRequestParameters() { + } + + public GetAccountDetailRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nullable + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountDetailRequestParameters key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetAccountDetailRequestParameters writer(String writer) { + + this.writer = writer; + return this; + } + + /** + * Get writer + * @return writer + **/ + @javax.annotation.Nullable + public String getWriter() { + return writer; + } + + + public void setWriter(String writer) { + this.writer = writer; + } + + + public GetAccountDetailRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountDetailRequestParameters paginationKey(String paginationKey) { + + this.paginationKey = paginationKey; + return this; + } + + /** + * Get paginationKey + * @return paginationKey + **/ + @javax.annotation.Nonnull + public String getPaginationKey() { + return paginationKey; + } + + + public void setPaginationKey(String paginationKey) { + this.paginationKey = paginationKey; + } + + + public GetAccountDetailRequestParameters paginationWriter(String paginationWriter) { + + this.paginationWriter = paginationWriter; + return this; + } + + /** + * Get paginationWriter + * @return paginationWriter + **/ + @javax.annotation.Nonnull + public String getPaginationWriter() { + return paginationWriter; + } + + + public void setPaginationWriter(String paginationWriter) { + this.paginationWriter = paginationWriter; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountDetailRequestParameters getAccountDetailRequestParameters = (GetAccountDetailRequestParameters) o; + return Objects.equals(this.accountId, getAccountDetailRequestParameters.accountId) && + Objects.equals(this.key, getAccountDetailRequestParameters.key) && + Objects.equals(this.writer, getAccountDetailRequestParameters.writer) && + Objects.equals(this.pageSize, getAccountDetailRequestParameters.pageSize) && + Objects.equals(this.paginationKey, getAccountDetailRequestParameters.paginationKey) && + Objects.equals(this.paginationWriter, getAccountDetailRequestParameters.paginationWriter); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, key, writer, pageSize, paginationKey, paginationWriter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountDetailRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" writer: ").append(toIndentedString(writer)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" paginationKey: ").append(toIndentedString(paginationKey)).append("\n"); + sb.append(" paginationWriter: ").append(toIndentedString(paginationWriter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("key"); + openapiFields.add("writer"); + openapiFields.add("pageSize"); + openapiFields.add("paginationKey"); + openapiFields.add("paginationWriter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("paginationKey"); + openapiRequiredFields.add("paginationWriter"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountDetailRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountDetailRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountDetailRequestParameters is not found in the empty JSON string", GetAccountDetailRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountDetailRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountDetailRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountDetailRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) && !jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if ((jsonObj.get("writer") != null && !jsonObj.get("writer").isJsonNull()) && !jsonObj.get("writer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `writer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("writer").toString())); + } + if (!jsonObj.get("paginationKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paginationKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paginationKey").toString())); + } + if (!jsonObj.get("paginationWriter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paginationWriter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paginationWriter").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountDetailRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountDetailRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountDetailRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountDetailRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountDetailRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountDetailRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountDetailRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountDetailRequestParameters + */ + public static GetAccountDetailRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountDetailRequestParameters.class); + } + + /** + * Convert an instance of GetAccountDetailRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java new file mode 100644 index 0000000000..34b7f182e9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public GetAccountRequestParameters() { + } + + public GetAccountRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountRequestParameters getAccountRequestParameters = (GetAccountRequestParameters) o; + return Objects.equals(this.accountId, getAccountRequestParameters.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountRequestParameters is not found in the empty JSON string", GetAccountRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountRequestParameters + */ + public static GetAccountRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountRequestParameters.class); + } + + /** + * Convert an instance of GetAccountRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java new file mode 100644 index 0000000000..bc12bd1d97 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java @@ -0,0 +1,389 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountTransactionsRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_FIRST_TX_HASH = "firstTxHash"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HASH) + private String firstTxHash; + + public static final String SERIALIZED_NAME_FIRST_TX_TIME = "firstTxTime"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_TIME) + private Object firstTxTime; + + public static final String SERIALIZED_NAME_LAST_TX_TIME = "lastTxTime"; + @SerializedName(SERIALIZED_NAME_LAST_TX_TIME) + private Object lastTxTime; + + public static final String SERIALIZED_NAME_FIRST_TX_HEIGHT = "firstTxHeight"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HEIGHT) + private Integer firstTxHeight; + + public static final String SERIALIZED_NAME_LAST_TX_HEIGHT = "lastTxHeight"; + @SerializedName(SERIALIZED_NAME_LAST_TX_HEIGHT) + private Integer lastTxHeight; + + public GetAccountTransactionsRequestParameters() { + } + + public GetAccountTransactionsRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountTransactionsRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountTransactionsRequestParameters firstTxHash(String firstTxHash) { + + this.firstTxHash = firstTxHash; + return this; + } + + /** + * Get firstTxHash + * @return firstTxHash + **/ + @javax.annotation.Nonnull + public String getFirstTxHash() { + return firstTxHash; + } + + + public void setFirstTxHash(String firstTxHash) { + this.firstTxHash = firstTxHash; + } + + + public GetAccountTransactionsRequestParameters firstTxTime(Object firstTxTime) { + + this.firstTxTime = firstTxTime; + return this; + } + + /** + * Get firstTxTime + * @return firstTxTime + **/ + @javax.annotation.Nullable + public Object getFirstTxTime() { + return firstTxTime; + } + + + public void setFirstTxTime(Object firstTxTime) { + this.firstTxTime = firstTxTime; + } + + + public GetAccountTransactionsRequestParameters lastTxTime(Object lastTxTime) { + + this.lastTxTime = lastTxTime; + return this; + } + + /** + * Get lastTxTime + * @return lastTxTime + **/ + @javax.annotation.Nullable + public Object getLastTxTime() { + return lastTxTime; + } + + + public void setLastTxTime(Object lastTxTime) { + this.lastTxTime = lastTxTime; + } + + + public GetAccountTransactionsRequestParameters firstTxHeight(Integer firstTxHeight) { + + this.firstTxHeight = firstTxHeight; + return this; + } + + /** + * Get firstTxHeight + * @return firstTxHeight + **/ + @javax.annotation.Nullable + public Integer getFirstTxHeight() { + return firstTxHeight; + } + + + public void setFirstTxHeight(Integer firstTxHeight) { + this.firstTxHeight = firstTxHeight; + } + + + public GetAccountTransactionsRequestParameters lastTxHeight(Integer lastTxHeight) { + + this.lastTxHeight = lastTxHeight; + return this; + } + + /** + * Get lastTxHeight + * @return lastTxHeight + **/ + @javax.annotation.Nullable + public Integer getLastTxHeight() { + return lastTxHeight; + } + + + public void setLastTxHeight(Integer lastTxHeight) { + this.lastTxHeight = lastTxHeight; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountTransactionsRequestParameters getAccountTransactionsRequestParameters = (GetAccountTransactionsRequestParameters) o; + return Objects.equals(this.accountId, getAccountTransactionsRequestParameters.accountId) && + Objects.equals(this.pageSize, getAccountTransactionsRequestParameters.pageSize) && + Objects.equals(this.firstTxHash, getAccountTransactionsRequestParameters.firstTxHash) && + Objects.equals(this.firstTxTime, getAccountTransactionsRequestParameters.firstTxTime) && + Objects.equals(this.lastTxTime, getAccountTransactionsRequestParameters.lastTxTime) && + Objects.equals(this.firstTxHeight, getAccountTransactionsRequestParameters.firstTxHeight) && + Objects.equals(this.lastTxHeight, getAccountTransactionsRequestParameters.lastTxHeight); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, pageSize, firstTxHash, firstTxTime, lastTxTime, firstTxHeight, lastTxHeight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountTransactionsRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstTxHash: ").append(toIndentedString(firstTxHash)).append("\n"); + sb.append(" firstTxTime: ").append(toIndentedString(firstTxTime)).append("\n"); + sb.append(" lastTxTime: ").append(toIndentedString(lastTxTime)).append("\n"); + sb.append(" firstTxHeight: ").append(toIndentedString(firstTxHeight)).append("\n"); + sb.append(" lastTxHeight: ").append(toIndentedString(lastTxHeight)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("pageSize"); + openapiFields.add("firstTxHash"); + openapiFields.add("firstTxTime"); + openapiFields.add("lastTxTime"); + openapiFields.add("firstTxHeight"); + openapiFields.add("lastTxHeight"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("firstTxHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountTransactionsRequestParameters is not found in the empty JSON string", GetAccountTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("firstTxHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstTxHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstTxHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountTransactionsRequestParameters + */ + public static GetAccountTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetAccountTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java new file mode 100644 index 0000000000..4d379789da --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Asset Info. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAssetInfoRequestParameters { + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public GetAssetInfoRequestParameters() { + } + + public GetAssetInfoRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAssetInfoRequestParameters getAssetInfoRequestParameters = (GetAssetInfoRequestParameters) o; + return Objects.equals(this.assetId, getAssetInfoRequestParameters.assetId); + } + + @Override + public int hashCode() { + return Objects.hash(assetId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAssetInfoRequestParameters {\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAssetInfoRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAssetInfoRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAssetInfoRequestParameters is not found in the empty JSON string", GetAssetInfoRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAssetInfoRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAssetInfoRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAssetInfoRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAssetInfoRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAssetInfoRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAssetInfoRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAssetInfoRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAssetInfoRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAssetInfoRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAssetInfoRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAssetInfoRequestParameters + */ + public static GetAssetInfoRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAssetInfoRequestParameters.class); + } + + /** + * Convert an instance of GetAssetInfoRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java new file mode 100644 index 0000000000..b772a54c09 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Block. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestParameters { + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + private Integer height; + + public GetBlockRequestParameters() { + } + + public GetBlockRequestParameters height(Integer height) { + + this.height = height; + return this; + } + + /** + * Get height + * @return height + **/ + @javax.annotation.Nonnull + public Integer getHeight() { + return height; + } + + + public void setHeight(Integer height) { + this.height = height; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestParameters getBlockRequestParameters = (GetBlockRequestParameters) o; + return Objects.equals(this.height, getBlockRequestParameters.height); + } + + @Override + public int hashCode() { + return Objects.hash(height); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestParameters {\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("height"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("height"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestParameters is not found in the empty JSON string", GetBlockRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestParameters + */ + public static GetBlockRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestParameters.class); + } + + /** + * Convert an instance of GetBlockRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java new file mode 100644 index 0000000000..b70f547190 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Engine Receipts. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEngineReceiptsRequestParameters { + public static final String SERIALIZED_NAME_TX_HASH = "txHash"; + @SerializedName(SERIALIZED_NAME_TX_HASH) + private String txHash; + + public GetEngineReceiptsRequestParameters() { + } + + public GetEngineReceiptsRequestParameters txHash(String txHash) { + + this.txHash = txHash; + return this; + } + + /** + * Get txHash + * @return txHash + **/ + @javax.annotation.Nonnull + public String getTxHash() { + return txHash; + } + + + public void setTxHash(String txHash) { + this.txHash = txHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEngineReceiptsRequestParameters getEngineReceiptsRequestParameters = (GetEngineReceiptsRequestParameters) o; + return Objects.equals(this.txHash, getEngineReceiptsRequestParameters.txHash); + } + + @Override + public int hashCode() { + return Objects.hash(txHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEngineReceiptsRequestParameters {\n"); + sb.append(" txHash: ").append(toIndentedString(txHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("txHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("txHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetEngineReceiptsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetEngineReceiptsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetEngineReceiptsRequestParameters is not found in the empty JSON string", GetEngineReceiptsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetEngineReceiptsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetEngineReceiptsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetEngineReceiptsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("txHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `txHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetEngineReceiptsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetEngineReceiptsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetEngineReceiptsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetEngineReceiptsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetEngineReceiptsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetEngineReceiptsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEngineReceiptsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetEngineReceiptsRequestParameters + */ + public static GetEngineReceiptsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetEngineReceiptsRequestParameters.class); + } + + /** + * Convert an instance of GetEngineReceiptsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java new file mode 100644 index 0000000000..19773253ef --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java @@ -0,0 +1,300 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Pending Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetPendingTransactionsRequestParameters { + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_FIRST_TX_HASH = "firstTxHash"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HASH) + private String firstTxHash; + + public static final String SERIALIZED_NAME_FIRST_TX_TIME = "firstTxTime"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_TIME) + private Object firstTxTime; + + public static final String SERIALIZED_NAME_LAST_TX_TIME = "lastTxTime"; + @SerializedName(SERIALIZED_NAME_LAST_TX_TIME) + private Object lastTxTime; + + public GetPendingTransactionsRequestParameters() { + } + + public GetPendingTransactionsRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetPendingTransactionsRequestParameters firstTxHash(String firstTxHash) { + + this.firstTxHash = firstTxHash; + return this; + } + + /** + * Get firstTxHash + * @return firstTxHash + **/ + @javax.annotation.Nullable + public String getFirstTxHash() { + return firstTxHash; + } + + + public void setFirstTxHash(String firstTxHash) { + this.firstTxHash = firstTxHash; + } + + + public GetPendingTransactionsRequestParameters firstTxTime(Object firstTxTime) { + + this.firstTxTime = firstTxTime; + return this; + } + + /** + * Get firstTxTime + * @return firstTxTime + **/ + @javax.annotation.Nullable + public Object getFirstTxTime() { + return firstTxTime; + } + + + public void setFirstTxTime(Object firstTxTime) { + this.firstTxTime = firstTxTime; + } + + + public GetPendingTransactionsRequestParameters lastTxTime(Object lastTxTime) { + + this.lastTxTime = lastTxTime; + return this; + } + + /** + * Get lastTxTime + * @return lastTxTime + **/ + @javax.annotation.Nullable + public Object getLastTxTime() { + return lastTxTime; + } + + + public void setLastTxTime(Object lastTxTime) { + this.lastTxTime = lastTxTime; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPendingTransactionsRequestParameters getPendingTransactionsRequestParameters = (GetPendingTransactionsRequestParameters) o; + return Objects.equals(this.pageSize, getPendingTransactionsRequestParameters.pageSize) && + Objects.equals(this.firstTxHash, getPendingTransactionsRequestParameters.firstTxHash) && + Objects.equals(this.firstTxTime, getPendingTransactionsRequestParameters.firstTxTime) && + Objects.equals(this.lastTxTime, getPendingTransactionsRequestParameters.lastTxTime); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, firstTxHash, firstTxTime, lastTxTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPendingTransactionsRequestParameters {\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstTxHash: ").append(toIndentedString(firstTxHash)).append("\n"); + sb.append(" firstTxTime: ").append(toIndentedString(firstTxTime)).append("\n"); + sb.append(" lastTxTime: ").append(toIndentedString(lastTxTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pageSize"); + openapiFields.add("firstTxHash"); + openapiFields.add("firstTxTime"); + openapiFields.add("lastTxTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pageSize"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPendingTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetPendingTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPendingTransactionsRequestParameters is not found in the empty JSON string", GetPendingTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPendingTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPendingTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPendingTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("firstTxHash") != null && !jsonObj.get("firstTxHash").isJsonNull()) && !jsonObj.get("firstTxHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstTxHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstTxHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPendingTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPendingTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPendingTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPendingTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPendingTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPendingTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPendingTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetPendingTransactionsRequestParameters + */ + public static GetPendingTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPendingTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetPendingTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java new file mode 100644 index 0000000000..750cf4c213 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Role Permissions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetRolePermissionsRequestParameters { + public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + private String roleId; + + public GetRolePermissionsRequestParameters() { + } + + public GetRolePermissionsRequestParameters roleId(String roleId) { + + this.roleId = roleId; + return this; + } + + /** + * Get roleId + * @return roleId + **/ + @javax.annotation.Nonnull + public String getRoleId() { + return roleId; + } + + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRolePermissionsRequestParameters getRolePermissionsRequestParameters = (GetRolePermissionsRequestParameters) o; + return Objects.equals(this.roleId, getRolePermissionsRequestParameters.roleId); + } + + @Override + public int hashCode() { + return Objects.hash(roleId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRolePermissionsRequestParameters {\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("roleId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("roleId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetRolePermissionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetRolePermissionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetRolePermissionsRequestParameters is not found in the empty JSON string", GetRolePermissionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetRolePermissionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetRolePermissionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetRolePermissionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("roleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRolePermissionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRolePermissionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetRolePermissionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRolePermissionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRolePermissionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetRolePermissionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRolePermissionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetRolePermissionsRequestParameters + */ + public static GetRolePermissionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRolePermissionsRequestParameters.class); + } + + /** + * Convert an instance of GetRolePermissionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java new file mode 100644 index 0000000000..0da6b0de62 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Signatories. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSignatoriesRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public GetSignatoriesRequestParameters() { + } + + public GetSignatoriesRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSignatoriesRequestParameters getSignatoriesRequestParameters = (GetSignatoriesRequestParameters) o; + return Objects.equals(this.accountId, getSignatoriesRequestParameters.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSignatoriesRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSignatoriesRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSignatoriesRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSignatoriesRequestParameters is not found in the empty JSON string", GetSignatoriesRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSignatoriesRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSignatoriesRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSignatoriesRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSignatoriesRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSignatoriesRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSignatoriesRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSignatoriesRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSignatoriesRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSignatoriesRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSignatoriesRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetSignatoriesRequestParameters + */ + public static GetSignatoriesRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSignatoriesRequestParameters.class); + } + + /** + * Convert an instance of GetSignatoriesRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java new file mode 100644 index 0000000000..f19cf2cac3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionsRequestParameters { + public static final String SERIALIZED_NAME_TX_HASHES_LIST = "txHashesList"; + @SerializedName(SERIALIZED_NAME_TX_HASHES_LIST) + private List txHashesList = new ArrayList<>(); + + public GetTransactionsRequestParameters() { + } + + public GetTransactionsRequestParameters txHashesList(List txHashesList) { + + this.txHashesList = txHashesList; + return this; + } + + public GetTransactionsRequestParameters addTxHashesListItem(String txHashesListItem) { + if (this.txHashesList == null) { + this.txHashesList = new ArrayList<>(); + } + this.txHashesList.add(txHashesListItem); + return this; + } + + /** + * Get txHashesList + * @return txHashesList + **/ + @javax.annotation.Nonnull + public List getTxHashesList() { + return txHashesList; + } + + + public void setTxHashesList(List txHashesList) { + this.txHashesList = txHashesList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionsRequestParameters getTransactionsRequestParameters = (GetTransactionsRequestParameters) o; + return Objects.equals(this.txHashesList, getTransactionsRequestParameters.txHashesList); + } + + @Override + public int hashCode() { + return Objects.hash(txHashesList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionsRequestParameters {\n"); + sb.append(" txHashesList: ").append(toIndentedString(txHashesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("txHashesList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("txHashesList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionsRequestParameters is not found in the empty JSON string", GetTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("txHashesList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("txHashesList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `txHashesList` to be an array in the JSON string but got `%s`", jsonObj.get("txHashesList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetTransactionsRequestParameters + */ + public static GetTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java new file mode 100644 index 0000000000..b2c0945d6a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Grant Permission. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GrantPermissionRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + private String permission; + + public GrantPermissionRequestParameters() { + } + + public GrantPermissionRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GrantPermissionRequestParameters permission(String permission) { + + this.permission = permission; + return this; + } + + /** + * Get permission + * @return permission + **/ + @javax.annotation.Nonnull + public String getPermission() { + return permission; + } + + + public void setPermission(String permission) { + this.permission = permission; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantPermissionRequestParameters grantPermissionRequestParameters = (GrantPermissionRequestParameters) o; + return Objects.equals(this.accountId, grantPermissionRequestParameters.accountId) && + Objects.equals(this.permission, grantPermissionRequestParameters.permission); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, permission); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantPermissionRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("permission"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("permission"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrantPermissionRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GrantPermissionRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GrantPermissionRequestParameters is not found in the empty JSON string", GrantPermissionRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GrantPermissionRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GrantPermissionRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GrantPermissionRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permission").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrantPermissionRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrantPermissionRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrantPermissionRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrantPermissionRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GrantPermissionRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GrantPermissionRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantPermissionRequestParameters + * @throws IOException if the JSON string is invalid with respect to GrantPermissionRequestParameters + */ + public static GrantPermissionRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrantPermissionRequestParameters.class); + } + + /** + * Convert an instance of GrantPermissionRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java new file mode 100644 index 0000000000..921e962cc2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java @@ -0,0 +1,509 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBaseConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBaseConfig { + public static final String SERIALIZED_NAME_IROHA_HOST = "irohaHost"; + @SerializedName(SERIALIZED_NAME_IROHA_HOST) + private String irohaHost; + + public static final String SERIALIZED_NAME_IROHA_PORT = "irohaPort"; + @SerializedName(SERIALIZED_NAME_IROHA_PORT) + private BigDecimal irohaPort; + + public static final String SERIALIZED_NAME_CREATOR_ACCOUNT_ID = "creatorAccountId"; + @SerializedName(SERIALIZED_NAME_CREATOR_ACCOUNT_ID) + private String creatorAccountId; + + public static final String SERIALIZED_NAME_PRIV_KEY = "privKey"; + @SerializedName(SERIALIZED_NAME_PRIV_KEY) + private List privKey = null; + + public static final String SERIALIZED_NAME_QUORUM = "quorum"; + @SerializedName(SERIALIZED_NAME_QUORUM) + private BigDecimal quorum; + + public static final String SERIALIZED_NAME_TIMEOUT_LIMIT = "timeoutLimit"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_LIMIT) + private BigDecimal timeoutLimit; + + public static final String SERIALIZED_NAME_TLS = "tls"; + @SerializedName(SERIALIZED_NAME_TLS) + private Boolean tls; + + public static final String SERIALIZED_NAME_MONITOR_MODE = "monitorMode"; + @SerializedName(SERIALIZED_NAME_MONITOR_MODE) + private Boolean monitorMode; + + public IrohaBaseConfig() { + } + + public IrohaBaseConfig irohaHost(String irohaHost) { + + this.irohaHost = irohaHost; + return this; + } + + /** + * Get irohaHost + * @return irohaHost + **/ + @javax.annotation.Nullable + public String getIrohaHost() { + return irohaHost; + } + + + public void setIrohaHost(String irohaHost) { + this.irohaHost = irohaHost; + } + + + public IrohaBaseConfig irohaPort(BigDecimal irohaPort) { + + this.irohaPort = irohaPort; + return this; + } + + /** + * Get irohaPort + * @return irohaPort + **/ + @javax.annotation.Nullable + public BigDecimal getIrohaPort() { + return irohaPort; + } + + + public void setIrohaPort(BigDecimal irohaPort) { + this.irohaPort = irohaPort; + } + + + public IrohaBaseConfig creatorAccountId(String creatorAccountId) { + + this.creatorAccountId = creatorAccountId; + return this; + } + + /** + * Get creatorAccountId + * @return creatorAccountId + **/ + @javax.annotation.Nullable + public String getCreatorAccountId() { + return creatorAccountId; + } + + + public void setCreatorAccountId(String creatorAccountId) { + this.creatorAccountId = creatorAccountId; + } + + + public IrohaBaseConfig privKey(List privKey) { + + this.privKey = privKey; + return this; + } + + public IrohaBaseConfig addPrivKeyItem(Object privKeyItem) { + if (this.privKey == null) { + this.privKey = null; + } + this.privKey.add(privKeyItem); + return this; + } + + /** + * Get privKey + * @return privKey + **/ + @javax.annotation.Nullable + public List getPrivKey() { + return privKey; + } + + + public void setPrivKey(List privKey) { + this.privKey = privKey; + } + + + public IrohaBaseConfig quorum(BigDecimal quorum) { + + this.quorum = quorum; + return this; + } + + /** + * Get quorum + * @return quorum + **/ + @javax.annotation.Nullable + public BigDecimal getQuorum() { + return quorum; + } + + + public void setQuorum(BigDecimal quorum) { + this.quorum = quorum; + } + + + public IrohaBaseConfig timeoutLimit(BigDecimal timeoutLimit) { + + this.timeoutLimit = timeoutLimit; + return this; + } + + /** + * Get timeoutLimit + * @return timeoutLimit + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutLimit() { + return timeoutLimit; + } + + + public void setTimeoutLimit(BigDecimal timeoutLimit) { + this.timeoutLimit = timeoutLimit; + } + + + public IrohaBaseConfig tls(Boolean tls) { + + this.tls = tls; + return this; + } + + /** + * Can only be set to false for an insecure grpc connection. + * @return tls + **/ + @javax.annotation.Nullable + public Boolean getTls() { + return tls; + } + + + public void setTls(Boolean tls) { + this.tls = tls; + } + + + public IrohaBaseConfig monitorMode(Boolean monitorMode) { + + this.monitorMode = monitorMode; + return this; + } + + /** + * Flag used for monitoring. It changes default beahviour of transaction wrapper so it return error to caller instead of throwing RuntimeError straight away. + * @return monitorMode + **/ + @javax.annotation.Nullable + public Boolean getMonitorMode() { + return monitorMode; + } + + + public void setMonitorMode(Boolean monitorMode) { + this.monitorMode = monitorMode; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IrohaBaseConfig instance itself + */ + public IrohaBaseConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBaseConfig irohaBaseConfig = (IrohaBaseConfig) o; + return Objects.equals(this.irohaHost, irohaBaseConfig.irohaHost) && + Objects.equals(this.irohaPort, irohaBaseConfig.irohaPort) && + Objects.equals(this.creatorAccountId, irohaBaseConfig.creatorAccountId) && + Objects.equals(this.privKey, irohaBaseConfig.privKey) && + Objects.equals(this.quorum, irohaBaseConfig.quorum) && + Objects.equals(this.timeoutLimit, irohaBaseConfig.timeoutLimit) && + Objects.equals(this.tls, irohaBaseConfig.tls) && + Objects.equals(this.monitorMode, irohaBaseConfig.monitorMode)&& + Objects.equals(this.additionalProperties, irohaBaseConfig.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(irohaHost, irohaPort, creatorAccountId, privKey, quorum, timeoutLimit, tls, monitorMode, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBaseConfig {\n"); + sb.append(" irohaHost: ").append(toIndentedString(irohaHost)).append("\n"); + sb.append(" irohaPort: ").append(toIndentedString(irohaPort)).append("\n"); + sb.append(" creatorAccountId: ").append(toIndentedString(creatorAccountId)).append("\n"); + sb.append(" privKey: ").append(toIndentedString(privKey)).append("\n"); + sb.append(" quorum: ").append(toIndentedString(quorum)).append("\n"); + sb.append(" timeoutLimit: ").append(toIndentedString(timeoutLimit)).append("\n"); + sb.append(" tls: ").append(toIndentedString(tls)).append("\n"); + sb.append(" monitorMode: ").append(toIndentedString(monitorMode)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("irohaHost"); + openapiFields.add("irohaPort"); + openapiFields.add("creatorAccountId"); + openapiFields.add("privKey"); + openapiFields.add("quorum"); + openapiFields.add("timeoutLimit"); + openapiFields.add("tls"); + openapiFields.add("monitorMode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBaseConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBaseConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBaseConfig is not found in the empty JSON string", IrohaBaseConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("irohaHost") != null && !jsonObj.get("irohaHost").isJsonNull()) && !jsonObj.get("irohaHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `irohaHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("irohaHost").toString())); + } + if ((jsonObj.get("creatorAccountId") != null && !jsonObj.get("creatorAccountId").isJsonNull()) && !jsonObj.get("creatorAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorAccountId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("privKey") != null && !jsonObj.get("privKey").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `privKey` to be an array in the JSON string but got `%s`", jsonObj.get("privKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBaseConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBaseConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBaseConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBaseConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IrohaBaseConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + IrohaBaseConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBaseConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBaseConfig + * @throws IOException if the JSON string is invalid with respect to IrohaBaseConfig + */ + public static IrohaBaseConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBaseConfig.class); + } + + /** + * Convert an instance of IrohaBaseConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java new file mode 100644 index 0000000000..c1f9494800 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBlockResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBlockProgress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBlockProgress { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private IrohaBlockResponse transactionReceipt; + + public IrohaBlockProgress() { + } + + public IrohaBlockProgress transactionReceipt(IrohaBlockResponse transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public IrohaBlockResponse getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(IrohaBlockResponse transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBlockProgress irohaBlockProgress = (IrohaBlockProgress) o; + return Objects.equals(this.transactionReceipt, irohaBlockProgress.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBlockProgress {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBlockProgress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBlockProgress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBlockProgress is not found in the empty JSON string", IrohaBlockProgress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaBlockProgress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaBlockProgress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaBlockProgress.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `transactionReceipt` + IrohaBlockResponse.validateJsonObject(jsonObj.getAsJsonObject("transactionReceipt")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBlockProgress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBlockProgress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBlockProgress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBlockProgress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaBlockProgress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBlockProgress given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBlockProgress + * @throws IOException if the JSON string is invalid with respect to IrohaBlockProgress + */ + public static IrohaBlockProgress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBlockProgress.class); + } + + /** + * Convert an instance of IrohaBlockProgress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java new file mode 100644 index 0000000000..075b42980e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java @@ -0,0 +1,261 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaBlockResponsePayload; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBlockResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBlockResponse { + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private IrohaBlockResponsePayload payload; + + public static final String SERIALIZED_NAME_SIGNATURES_LIST = "signaturesList"; + @SerializedName(SERIALIZED_NAME_SIGNATURES_LIST) + private List signaturesList = new ArrayList<>(); + + public IrohaBlockResponse() { + } + + public IrohaBlockResponse payload(IrohaBlockResponsePayload payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public IrohaBlockResponsePayload getPayload() { + return payload; + } + + + public void setPayload(IrohaBlockResponsePayload payload) { + this.payload = payload; + } + + + public IrohaBlockResponse signaturesList(List signaturesList) { + + this.signaturesList = signaturesList; + return this; + } + + public IrohaBlockResponse addSignaturesListItem(Object signaturesListItem) { + if (this.signaturesList == null) { + this.signaturesList = new ArrayList<>(); + } + this.signaturesList.add(signaturesListItem); + return this; + } + + /** + * Get signaturesList + * @return signaturesList + **/ + @javax.annotation.Nonnull + public List getSignaturesList() { + return signaturesList; + } + + + public void setSignaturesList(List signaturesList) { + this.signaturesList = signaturesList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBlockResponse irohaBlockResponse = (IrohaBlockResponse) o; + return Objects.equals(this.payload, irohaBlockResponse.payload) && + Objects.equals(this.signaturesList, irohaBlockResponse.signaturesList); + } + + @Override + public int hashCode() { + return Objects.hash(payload, signaturesList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBlockResponse {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" signaturesList: ").append(toIndentedString(signaturesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload"); + openapiFields.add("signaturesList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("signaturesList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBlockResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBlockResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBlockResponse is not found in the empty JSON string", IrohaBlockResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaBlockResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaBlockResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaBlockResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `payload` + IrohaBlockResponsePayload.validateJsonObject(jsonObj.getAsJsonObject("payload")); + // ensure the required json array is present + if (jsonObj.get("signaturesList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("signaturesList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signaturesList` to be an array in the JSON string but got `%s`", jsonObj.get("signaturesList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBlockResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBlockResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBlockResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBlockResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaBlockResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBlockResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBlockResponse + * @throws IOException if the JSON string is invalid with respect to IrohaBlockResponse + */ + public static IrohaBlockResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBlockResponse.class); + } + + /** + * Convert an instance of IrohaBlockResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java new file mode 100644 index 0000000000..582e64be84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java @@ -0,0 +1,392 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBlockResponsePayload + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBlockResponsePayload { + public static final String SERIALIZED_NAME_TRANSACTIONS_LIST = "transactionsList"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_LIST) + private List transactionsList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TX_NUMBER = "txNumber"; + @SerializedName(SERIALIZED_NAME_TX_NUMBER) + private BigDecimal txNumber; + + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + private BigDecimal height; + + public static final String SERIALIZED_NAME_PREV_BLOCK_HASH = "prevBlockHash"; + @SerializedName(SERIALIZED_NAME_PREV_BLOCK_HASH) + private String prevBlockHash; + + public static final String SERIALIZED_NAME_CREATED_TIME = "createdTime"; + @SerializedName(SERIALIZED_NAME_CREATED_TIME) + private BigDecimal createdTime; + + public static final String SERIALIZED_NAME_REJECTED_TRANSACTIONS_HASHES_LIST = "rejectedTransactionsHashesList"; + @SerializedName(SERIALIZED_NAME_REJECTED_TRANSACTIONS_HASHES_LIST) + private List rejectedTransactionsHashesList = new ArrayList<>(); + + public IrohaBlockResponsePayload() { + } + + public IrohaBlockResponsePayload transactionsList(List transactionsList) { + + this.transactionsList = transactionsList; + return this; + } + + public IrohaBlockResponsePayload addTransactionsListItem(Object transactionsListItem) { + if (this.transactionsList == null) { + this.transactionsList = new ArrayList<>(); + } + this.transactionsList.add(transactionsListItem); + return this; + } + + /** + * Get transactionsList + * @return transactionsList + **/ + @javax.annotation.Nonnull + public List getTransactionsList() { + return transactionsList; + } + + + public void setTransactionsList(List transactionsList) { + this.transactionsList = transactionsList; + } + + + public IrohaBlockResponsePayload txNumber(BigDecimal txNumber) { + + this.txNumber = txNumber; + return this; + } + + /** + * Get txNumber + * @return txNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getTxNumber() { + return txNumber; + } + + + public void setTxNumber(BigDecimal txNumber) { + this.txNumber = txNumber; + } + + + public IrohaBlockResponsePayload height(BigDecimal height) { + + this.height = height; + return this; + } + + /** + * Get height + * @return height + **/ + @javax.annotation.Nonnull + public BigDecimal getHeight() { + return height; + } + + + public void setHeight(BigDecimal height) { + this.height = height; + } + + + public IrohaBlockResponsePayload prevBlockHash(String prevBlockHash) { + + this.prevBlockHash = prevBlockHash; + return this; + } + + /** + * Get prevBlockHash + * @return prevBlockHash + **/ + @javax.annotation.Nonnull + public String getPrevBlockHash() { + return prevBlockHash; + } + + + public void setPrevBlockHash(String prevBlockHash) { + this.prevBlockHash = prevBlockHash; + } + + + public IrohaBlockResponsePayload createdTime(BigDecimal createdTime) { + + this.createdTime = createdTime; + return this; + } + + /** + * Get createdTime + * @return createdTime + **/ + @javax.annotation.Nonnull + public BigDecimal getCreatedTime() { + return createdTime; + } + + + public void setCreatedTime(BigDecimal createdTime) { + this.createdTime = createdTime; + } + + + public IrohaBlockResponsePayload rejectedTransactionsHashesList(List rejectedTransactionsHashesList) { + + this.rejectedTransactionsHashesList = rejectedTransactionsHashesList; + return this; + } + + public IrohaBlockResponsePayload addRejectedTransactionsHashesListItem(Object rejectedTransactionsHashesListItem) { + if (this.rejectedTransactionsHashesList == null) { + this.rejectedTransactionsHashesList = new ArrayList<>(); + } + this.rejectedTransactionsHashesList.add(rejectedTransactionsHashesListItem); + return this; + } + + /** + * Get rejectedTransactionsHashesList + * @return rejectedTransactionsHashesList + **/ + @javax.annotation.Nonnull + public List getRejectedTransactionsHashesList() { + return rejectedTransactionsHashesList; + } + + + public void setRejectedTransactionsHashesList(List rejectedTransactionsHashesList) { + this.rejectedTransactionsHashesList = rejectedTransactionsHashesList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBlockResponsePayload irohaBlockResponsePayload = (IrohaBlockResponsePayload) o; + return Objects.equals(this.transactionsList, irohaBlockResponsePayload.transactionsList) && + Objects.equals(this.txNumber, irohaBlockResponsePayload.txNumber) && + Objects.equals(this.height, irohaBlockResponsePayload.height) && + Objects.equals(this.prevBlockHash, irohaBlockResponsePayload.prevBlockHash) && + Objects.equals(this.createdTime, irohaBlockResponsePayload.createdTime) && + Objects.equals(this.rejectedTransactionsHashesList, irohaBlockResponsePayload.rejectedTransactionsHashesList); + } + + @Override + public int hashCode() { + return Objects.hash(transactionsList, txNumber, height, prevBlockHash, createdTime, rejectedTransactionsHashesList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBlockResponsePayload {\n"); + sb.append(" transactionsList: ").append(toIndentedString(transactionsList)).append("\n"); + sb.append(" txNumber: ").append(toIndentedString(txNumber)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" prevBlockHash: ").append(toIndentedString(prevBlockHash)).append("\n"); + sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n"); + sb.append(" rejectedTransactionsHashesList: ").append(toIndentedString(rejectedTransactionsHashesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionsList"); + openapiFields.add("txNumber"); + openapiFields.add("height"); + openapiFields.add("prevBlockHash"); + openapiFields.add("createdTime"); + openapiFields.add("rejectedTransactionsHashesList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionsList"); + openapiRequiredFields.add("txNumber"); + openapiRequiredFields.add("height"); + openapiRequiredFields.add("prevBlockHash"); + openapiRequiredFields.add("createdTime"); + openapiRequiredFields.add("rejectedTransactionsHashesList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBlockResponsePayload + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBlockResponsePayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBlockResponsePayload is not found in the empty JSON string", IrohaBlockResponsePayload.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaBlockResponsePayload.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaBlockResponsePayload` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaBlockResponsePayload.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("transactionsList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("transactionsList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsList` to be an array in the JSON string but got `%s`", jsonObj.get("transactionsList").toString())); + } + if (!jsonObj.get("prevBlockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `prevBlockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prevBlockHash").toString())); + } + // ensure the required json array is present + if (jsonObj.get("rejectedTransactionsHashesList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("rejectedTransactionsHashesList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rejectedTransactionsHashesList` to be an array in the JSON string but got `%s`", jsonObj.get("rejectedTransactionsHashesList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBlockResponsePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBlockResponsePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBlockResponsePayload.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBlockResponsePayload value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaBlockResponsePayload read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBlockResponsePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBlockResponsePayload + * @throws IOException if the JSON string is invalid with respect to IrohaBlockResponsePayload + */ + public static IrohaBlockResponsePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBlockResponsePayload.class); + } + + /** + * Convert an instance of IrohaBlockResponsePayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java new file mode 100644 index 0000000000..d5d7c0c027 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java @@ -0,0 +1,169 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IrohaCommand + */ +@JsonAdapter(IrohaCommand.Adapter.class) +public enum IrohaCommand { + + /** + * Make entity in the system, capable of sending transactions or queries, storing signatories, personal data and identifiers. + */ + CreateAccount("createAccount"), + + /** + * Set key-value information for a given account. + */ + SetAccountDetail("setAccountDetail"), + + /** + * Set the number of signatories required to confirm the identity of a user, who creates the transaction. + */ + SetAccountQuorum("setAccountQuorum"), + + /** + * Set key-value information for a given account if the old value matches the value passed. + */ + CompareAndSetAccountDetail("compareAndSetAccountDetail"), + + /** + * Create a new type of asset, unique in a domain. An asset is a countable representation of a commodity. + */ + CreateAsset("createAsset"), + + /** + * Increase the quantity of an asset on account of transaction creator. + */ + AddAssetQuantity("addAssetQuantity"), + + /** + * Decrease the number of assets on account of transaction creator. + */ + SubtractAssetQuantity("subtractAssetQuantity"), + + /** + * Share assets within the account in peer network: in the way that source account transfers assets to the target account. + */ + TransferAsset("transferAsset"), + + /** + * Make new domain in Iroha network, which is a group of accounts. + */ + CreateDomain("createDomain"), + + /** + * Create a new role in the system from the set of permissions. + */ + CreateRole("createRole"), + + /** + * Detach a role from the set of roles of an account. + */ + DetachRole("detachRole"), + + /** + * Promote an account to some created role in the system, where a role is a set of permissions account has to perform an action (command or query). + */ + AppendRole("appendRole"), + + /** + * Add an identifier to the account. Such identifier is a public key of another device or a public key of another user. + */ + AddSignatory("addSignatory"), + + /** + * Remove a public key, associated with an identity, from an account + */ + RemoveSignatory("removeSignatory"), + + /** + * Give another account rights to perform actions on the account of transaction sender (give someone right to do something with my account). + */ + GrantPermission("grantPermission"), + + /** + * Revoke or dismiss given granted permission from another account in the network. + */ + RevokePermission("revokePermission"), + + /** + * Write into ledger the fact of peer addition into the peer network. + */ + AddPeer("addPeer"), + + /** + * Write into ledger the fact of peer removal from the network. + */ + RemovePeer("removePeer"), + + /** + * This command is not available for use, it was added for backward compatibility with Iroha. + */ + SetSettingValue("setSettingValue"), + + /** + * This command is not availalbe for use because it is related to smart contract. + */ + CallEngine("callEngine"); + + private String value; + + IrohaCommand(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaCommand fromValue(String value) { + for (IrohaCommand b : IrohaCommand.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaCommand enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaCommand read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaCommand.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java new file mode 100644 index 0000000000..9b93867db2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java @@ -0,0 +1,144 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IrohaQuery + */ +@JsonAdapter(IrohaQuery.Adapter.class) +public enum IrohaQuery { + + /** + * To get the state of an account + */ + GetAccount("getAccount"), + + /** + * To get details of the account. + */ + GetAccountDetail("getAccountDetail"), + + /** + * To get information on the given asset (as for now - its precision). + */ + GetAssetInfo("getAssetInfo"), + + /** + * To get the state of all assets in an account (a balance). + */ + GetAccountAssets("getAccountAssets"), + + /** + * To retrieve information about transactions, based on their hashes. + */ + GetTransactions("getTransactions"), + + /** + * To retrieve a list of pending (not fully signed) multisignature transactions or batches of transactions issued by account of query creator. + */ + GetPendingTransactions("getPendingTransactions"), + + /** + * To retrieve a list of transactions per account. + */ + GetAccountTransactions("getAccountTransactions"), + + /** + * To retrieve all transactions associated with given account and asset. + */ + GetAccountAssetTransactions("getAccountAssetTransactions"), + + /** + * To get existing roles in the system. + */ + GetRoles("getRoles"), + + /** + * To get signatories, which act as an identity of the account. + */ + GetSignatories("getSignatories"), + + /** + * To get available permissions per role in the system. + */ + GetRolePermissions("getRolePermissions"), + + /** + * To get a specific block, using its height as an identifier. + */ + GetBlock("getBlock"), + + /** + * To retrieve a receipt of a CallEngine command. Allows to access the event log created during computations inside the EVM. + */ + GetEngineReceipts("getEngineReceipts"), + + /** + * To get new blocks as soon as they are committed, a user can invoke FetchCommits RPC call to Iroha network. + */ + FetchCommits("fetchCommits"), + + /** + * A query that returns a list of peers in Iroha network. + */ + GetPeers("getPeers"); + + private String value; + + IrohaQuery(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaQuery fromValue(String value) { + for (IrohaQuery b : IrohaQuery.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaQuery enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaQuery read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaQuery.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java new file mode 100644 index 0000000000..6b8866c29a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IrohaSocketIOTransactV1 + */ +@JsonAdapter(IrohaSocketIOTransactV1.Adapter.class) +public enum IrohaSocketIOTransactV1 { + + SendAsyncRequest("org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest"), + + SendSyncRequest("org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest"); + + private String value; + + IrohaSocketIOTransactV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaSocketIOTransactV1 fromValue(String value) { + for (IrohaSocketIOTransactV1 b : IrohaSocketIOTransactV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaSocketIOTransactV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaSocketIOTransactV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaSocketIOTransactV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java new file mode 100644 index 0000000000..51603eddf3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * KeyPair + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class KeyPair { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private String privateKey; + + public KeyPair() { + } + + public KeyPair publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * SHA-3 ed25519 public keys of length 64 are recommended. + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + public KeyPair privateKey(String privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * SHA-3 ed25519 private keys of length 64 are recommended. + * @return privateKey + **/ + @javax.annotation.Nonnull + public String getPrivateKey() { + return privateKey; + } + + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeyPair keyPair = (KeyPair) o; + return Objects.equals(this.publicKey, keyPair.publicKey) && + Objects.equals(this.privateKey, keyPair.privateKey); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, privateKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class KeyPair {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("publicKey"); + openapiFields.add("privateKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("publicKey"); + openapiRequiredFields.add("privateKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to KeyPair + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!KeyPair.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in KeyPair is not found in the empty JSON string", KeyPair.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!KeyPair.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KeyPair` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : KeyPair.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + if (!jsonObj.get("privateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!KeyPair.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KeyPair' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(KeyPair.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, KeyPair value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public KeyPair read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of KeyPair given an JSON string + * + * @param jsonString JSON string + * @return An instance of KeyPair + * @throws IOException if the JSON string is invalid with respect to KeyPair + */ + public static KeyPair fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KeyPair.class); + } + + /** + * Convert an instance of KeyPair to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java new file mode 100644 index 0000000000..cec47f580f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Remove Peer. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemovePeerRequestParameters { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public RemovePeerRequestParameters() { + } + + public RemovePeerRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemovePeerRequestParameters removePeerRequestParameters = (RemovePeerRequestParameters) o; + return Objects.equals(this.publicKey, removePeerRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemovePeerRequestParameters {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RemovePeerRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemovePeerRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RemovePeerRequestParameters is not found in the empty JSON string", RemovePeerRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemovePeerRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RemovePeerRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemovePeerRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemovePeerRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemovePeerRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RemovePeerRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RemovePeerRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemovePeerRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RemovePeerRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemovePeerRequestParameters + * @throws IOException if the JSON string is invalid with respect to RemovePeerRequestParameters + */ + public static RemovePeerRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemovePeerRequestParameters.class); + } + + /** + * Convert an instance of RemovePeerRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java new file mode 100644 index 0000000000..5b5fe8fac5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Remove Signatory. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveSignatoryRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public RemoveSignatoryRequestParameters() { + } + + public RemoveSignatoryRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public RemoveSignatoryRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveSignatoryRequestParameters removeSignatoryRequestParameters = (RemoveSignatoryRequestParameters) o; + return Objects.equals(this.accountId, removeSignatoryRequestParameters.accountId) && + Objects.equals(this.publicKey, removeSignatoryRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveSignatoryRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RemoveSignatoryRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveSignatoryRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RemoveSignatoryRequestParameters is not found in the empty JSON string", RemoveSignatoryRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveSignatoryRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RemoveSignatoryRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveSignatoryRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveSignatoryRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveSignatoryRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RemoveSignatoryRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveSignatoryRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveSignatoryRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveSignatoryRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveSignatoryRequestParameters + * @throws IOException if the JSON string is invalid with respect to RemoveSignatoryRequestParameters + */ + public static RemoveSignatoryRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveSignatoryRequestParameters.class); + } + + /** + * Convert an instance of RemoveSignatoryRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java new file mode 100644 index 0000000000..e2754311c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Revoke Permission. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RevokePermissionRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + private BigDecimal permission; + + public RevokePermissionRequestParameters() { + } + + public RevokePermissionRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public RevokePermissionRequestParameters permission(BigDecimal permission) { + + this.permission = permission; + return this; + } + + /** + * Get permission + * @return permission + **/ + @javax.annotation.Nonnull + public BigDecimal getPermission() { + return permission; + } + + + public void setPermission(BigDecimal permission) { + this.permission = permission; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokePermissionRequestParameters revokePermissionRequestParameters = (RevokePermissionRequestParameters) o; + return Objects.equals(this.accountId, revokePermissionRequestParameters.accountId) && + Objects.equals(this.permission, revokePermissionRequestParameters.permission); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, permission); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RevokePermissionRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("permission"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("permission"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RevokePermissionRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RevokePermissionRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RevokePermissionRequestParameters is not found in the empty JSON string", RevokePermissionRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RevokePermissionRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RevokePermissionRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RevokePermissionRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RevokePermissionRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RevokePermissionRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RevokePermissionRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RevokePermissionRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RevokePermissionRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RevokePermissionRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of RevokePermissionRequestParameters + * @throws IOException if the JSON string is invalid with respect to RevokePermissionRequestParameters + */ + public static RevokePermissionRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RevokePermissionRequestParameters.class); + } + + /** + * Convert an instance of RevokePermissionRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java new file mode 100644 index 0000000000..3d2390cff8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1Params; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequestV1 { + public static final String SERIALIZED_NAME_COMMAND_NAME = "commandName"; + @SerializedName(SERIALIZED_NAME_COMMAND_NAME) + private String commandName; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private IrohaBaseConfig baseConfig; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private RunTransactionRequestV1Params params; + + public RunTransactionRequestV1() { + } + + public RunTransactionRequestV1 commandName(String commandName) { + + this.commandName = commandName; + return this; + } + + /** + * Get commandName + * @return commandName + **/ + @javax.annotation.Nonnull + public String getCommandName() { + return commandName; + } + + + public void setCommandName(String commandName) { + this.commandName = commandName; + } + + + public RunTransactionRequestV1 baseConfig(IrohaBaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nonnull + public IrohaBaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(IrohaBaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + public RunTransactionRequestV1 params(RunTransactionRequestV1Params params) { + + this.params = params; + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nonnull + public RunTransactionRequestV1Params getParams() { + return params; + } + + + public void setParams(RunTransactionRequestV1Params params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequestV1 runTransactionRequestV1 = (RunTransactionRequestV1) o; + return Objects.equals(this.commandName, runTransactionRequestV1.commandName) && + Objects.equals(this.baseConfig, runTransactionRequestV1.baseConfig) && + Objects.equals(this.params, runTransactionRequestV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(commandName, baseConfig, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequestV1 {\n"); + sb.append(" commandName: ").append(toIndentedString(commandName)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commandName"); + openapiFields.add("baseConfig"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("commandName"); + openapiRequiredFields.add("baseConfig"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequestV1 is not found in the empty JSON string", RunTransactionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("commandName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commandName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commandName").toString())); + } + // validate the required field `params` + RunTransactionRequestV1Params.validateJsonObject(jsonObj.getAsJsonObject("params")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequestV1 + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequestV1 + */ + public static RunTransactionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequestV1.class); + } + + /** + * Convert an instance of RunTransactionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java new file mode 100644 index 0000000000..5c36ec7428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java @@ -0,0 +1,286 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Params; +import org.openapitools.client.model.RunTransactionSignedRequestV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequestV1Body extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RunTransactionRequestV1Body.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequestV1Body.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequestV1Body' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterRunTransactionRequestV1 = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequestV1.class)); + final TypeAdapter adapterRunTransactionSignedRequestV1 = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionSignedRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequestV1Body value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `RunTransactionRequestV1` + if (value.getActualInstance() instanceof RunTransactionRequestV1) { + JsonObject obj = adapterRunTransactionRequestV1.toJsonTree((RunTransactionRequestV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RunTransactionSignedRequestV1` + if (value.getActualInstance() instanceof RunTransactionSignedRequestV1) { + JsonObject obj = adapterRunTransactionSignedRequestV1.toJsonTree((RunTransactionSignedRequestV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: RunTransactionRequestV1, RunTransactionSignedRequestV1"); + } + + @Override + public RunTransactionRequestV1Body read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize RunTransactionRequestV1 + try { + // validate the JSON object to see if any exception is thrown + RunTransactionRequestV1.validateJsonObject(jsonObject); + actualAdapter = adapterRunTransactionRequestV1; + match++; + log.log(Level.FINER, "Input data matches schema 'RunTransactionRequestV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RunTransactionRequestV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunTransactionRequestV1'", e); + } + + // deserialize RunTransactionSignedRequestV1 + try { + // validate the JSON object to see if any exception is thrown + RunTransactionSignedRequestV1.validateJsonObject(jsonObject); + actualAdapter = adapterRunTransactionSignedRequestV1; + match++; + log.log(Level.FINER, "Input data matches schema 'RunTransactionSignedRequestV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RunTransactionSignedRequestV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunTransactionSignedRequestV1'", e); + } + + if (match == 1) { + RunTransactionRequestV1Body ret = new RunTransactionRequestV1Body(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for RunTransactionRequestV1Body: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public RunTransactionRequestV1Body() { + super("oneOf", Boolean.FALSE); + } + + public RunTransactionRequestV1Body(RunTransactionRequestV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Body(RunTransactionSignedRequestV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("RunTransactionRequestV1", new GenericType() { + }); + schemas.put("RunTransactionSignedRequestV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return RunTransactionRequestV1Body.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * RunTransactionRequestV1, RunTransactionSignedRequestV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof RunTransactionRequestV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RunTransactionSignedRequestV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be RunTransactionRequestV1, RunTransactionSignedRequestV1"); + } + + /** + * Get the actual instance, which can be the following: + * RunTransactionRequestV1, RunTransactionSignedRequestV1 + * + * @return The actual instance (RunTransactionRequestV1, RunTransactionSignedRequestV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `RunTransactionRequestV1`. If the actual instance is not `RunTransactionRequestV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunTransactionRequestV1` + * @throws ClassCastException if the instance is not `RunTransactionRequestV1` + */ + public RunTransactionRequestV1 getRunTransactionRequestV1() throws ClassCastException { + return (RunTransactionRequestV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `RunTransactionSignedRequestV1`. If the actual instance is not `RunTransactionSignedRequestV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunTransactionSignedRequestV1` + * @throws ClassCastException if the instance is not `RunTransactionSignedRequestV1` + */ + public RunTransactionSignedRequestV1 getRunTransactionSignedRequestV1() throws ClassCastException { + return (RunTransactionSignedRequestV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequestV1Body + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with RunTransactionRequestV1 + try { + RunTransactionRequestV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RunTransactionRequestV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RunTransactionSignedRequestV1 + try { + RunTransactionSignedRequestV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RunTransactionSignedRequestV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for RunTransactionRequestV1Body with oneOf schemas: RunTransactionRequestV1, RunTransactionSignedRequestV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of RunTransactionRequestV1Body given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequestV1Body + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequestV1Body + */ + public static RunTransactionRequestV1Body fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequestV1Body.class); + } + + /** + * Convert an instance of RunTransactionRequestV1Body to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java new file mode 100644 index 0000000000..e4df4d607a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java @@ -0,0 +1,1876 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AddAssetQuantityRequestParameters; +import org.openapitools.client.model.AddPeerRequestParameters; +import org.openapitools.client.model.AddSignatoryRequestParameters; +import org.openapitools.client.model.AppendRoleRequestParameters; +import org.openapitools.client.model.CallEngineRequestParameters; +import org.openapitools.client.model.CompareAndSetAccountDetailRequestParameters; +import org.openapitools.client.model.CreateAccountRequestParameters; +import org.openapitools.client.model.CreateAssetRequestParameters; +import org.openapitools.client.model.CreateDomainRequestParameters; +import org.openapitools.client.model.CreateRoleRequestParameters; +import org.openapitools.client.model.DetachRoleRequestParameters; +import org.openapitools.client.model.GetAccountAssetTransactionsRequestParameters; +import org.openapitools.client.model.GetAccountAssetsRequestParameters; +import org.openapitools.client.model.GetAccountDetailRequestParameters; +import org.openapitools.client.model.GetAccountRequestParameters; +import org.openapitools.client.model.GetAccountTransactionsRequestParameters; +import org.openapitools.client.model.GetAssetInfoRequestParameters; +import org.openapitools.client.model.GetBlockRequestParameters; +import org.openapitools.client.model.GetEngineReceiptsRequestParameters; +import org.openapitools.client.model.GetPendingTransactionsRequestParameters; +import org.openapitools.client.model.GetRolePermissionsRequestParameters; +import org.openapitools.client.model.GetSignatoriesRequestParameters; +import org.openapitools.client.model.GetTransactionsRequestParameters; +import org.openapitools.client.model.GrantPermissionRequestParameters; +import org.openapitools.client.model.RemovePeerRequestParameters; +import org.openapitools.client.model.RemoveSignatoryRequestParameters; +import org.openapitools.client.model.RevokePermissionRequestParameters; +import org.openapitools.client.model.SetAccountDetailRequestParameters; +import org.openapitools.client.model.SetAccountQuorumRequestParameters; +import org.openapitools.client.model.SubtractAssetQuantityRequestParameters; +import org.openapitools.client.model.TransferAssetRequestParameters; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequestV1Params extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RunTransactionRequestV1Params.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequestV1Params.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequestV1Params' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAddAssetQuantityRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AddAssetQuantityRequestParameters.class)); + final TypeAdapter adapterAddPeerRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AddPeerRequestParameters.class)); + final TypeAdapter adapterAddSignatoryRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AddSignatoryRequestParameters.class)); + final TypeAdapter adapterAppendRoleRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AppendRoleRequestParameters.class)); + final TypeAdapter adapterCallEngineRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CallEngineRequestParameters.class)); + final TypeAdapter adapterCompareAndSetAccountDetailRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CompareAndSetAccountDetailRequestParameters.class)); + final TypeAdapter adapterCreateAccountRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateAccountRequestParameters.class)); + final TypeAdapter adapterCreateAssetRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateAssetRequestParameters.class)); + final TypeAdapter adapterCreateDomainRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateDomainRequestParameters.class)); + final TypeAdapter adapterCreateRoleRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateRoleRequestParameters.class)); + final TypeAdapter adapterDetachRoleRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(DetachRoleRequestParameters.class)); + final TypeAdapter adapterGetAccountAssetTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetTransactionsRequestParameters.class)); + final TypeAdapter adapterGetAccountAssetsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetsRequestParameters.class)); + final TypeAdapter adapterGetAccountDetailRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountDetailRequestParameters.class)); + final TypeAdapter adapterGetAccountRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountRequestParameters.class)); + final TypeAdapter adapterGetAccountTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountTransactionsRequestParameters.class)); + final TypeAdapter adapterGetAssetInfoRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAssetInfoRequestParameters.class)); + final TypeAdapter adapterGetBlockRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestParameters.class)); + final TypeAdapter adapterGetEngineReceiptsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetEngineReceiptsRequestParameters.class)); + final TypeAdapter adapterGetPendingTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetPendingTransactionsRequestParameters.class)); + final TypeAdapter adapterGetRolePermissionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetRolePermissionsRequestParameters.class)); + final TypeAdapter adapterGetSignatoriesRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetSignatoriesRequestParameters.class)); + final TypeAdapter adapterGetTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionsRequestParameters.class)); + final TypeAdapter adapterGrantPermissionRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GrantPermissionRequestParameters.class)); + final TypeAdapter adapterList<Object> = gson.getDelegateAdapter(this, TypeToken.get(List<Object>.class)); + final TypeAdapter adapterRemovePeerRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(RemovePeerRequestParameters.class)); + final TypeAdapter adapterRemoveSignatoryRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(RemoveSignatoryRequestParameters.class)); + final TypeAdapter adapterRevokePermissionRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(RevokePermissionRequestParameters.class)); + final TypeAdapter adapterSetAccountDetailRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(SetAccountDetailRequestParameters.class)); + final TypeAdapter adapterSetAccountQuorumRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(SetAccountQuorumRequestParameters.class)); + final TypeAdapter adapterSubtractAssetQuantityRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(SubtractAssetQuantityRequestParameters.class)); + final TypeAdapter adapterTransferAssetRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(TransferAssetRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequestV1Params value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AddAssetQuantityRequestParameters` + if (value.getActualInstance() instanceof AddAssetQuantityRequestParameters) { + JsonObject obj = adapterAddAssetQuantityRequestParameters.toJsonTree((AddAssetQuantityRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `AddPeerRequestParameters` + if (value.getActualInstance() instanceof AddPeerRequestParameters) { + JsonObject obj = adapterAddPeerRequestParameters.toJsonTree((AddPeerRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `AddSignatoryRequestParameters` + if (value.getActualInstance() instanceof AddSignatoryRequestParameters) { + JsonObject obj = adapterAddSignatoryRequestParameters.toJsonTree((AddSignatoryRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `AppendRoleRequestParameters` + if (value.getActualInstance() instanceof AppendRoleRequestParameters) { + JsonObject obj = adapterAppendRoleRequestParameters.toJsonTree((AppendRoleRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CallEngineRequestParameters` + if (value.getActualInstance() instanceof CallEngineRequestParameters) { + JsonObject obj = adapterCallEngineRequestParameters.toJsonTree((CallEngineRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CompareAndSetAccountDetailRequestParameters` + if (value.getActualInstance() instanceof CompareAndSetAccountDetailRequestParameters) { + JsonObject obj = adapterCompareAndSetAccountDetailRequestParameters.toJsonTree((CompareAndSetAccountDetailRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateAccountRequestParameters` + if (value.getActualInstance() instanceof CreateAccountRequestParameters) { + JsonObject obj = adapterCreateAccountRequestParameters.toJsonTree((CreateAccountRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateAssetRequestParameters` + if (value.getActualInstance() instanceof CreateAssetRequestParameters) { + JsonObject obj = adapterCreateAssetRequestParameters.toJsonTree((CreateAssetRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateDomainRequestParameters` + if (value.getActualInstance() instanceof CreateDomainRequestParameters) { + JsonObject obj = adapterCreateDomainRequestParameters.toJsonTree((CreateDomainRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateRoleRequestParameters` + if (value.getActualInstance() instanceof CreateRoleRequestParameters) { + JsonObject obj = adapterCreateRoleRequestParameters.toJsonTree((CreateRoleRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `DetachRoleRequestParameters` + if (value.getActualInstance() instanceof DetachRoleRequestParameters) { + JsonObject obj = adapterDetachRoleRequestParameters.toJsonTree((DetachRoleRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountAssetTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetAccountAssetTransactionsRequestParameters) { + JsonObject obj = adapterGetAccountAssetTransactionsRequestParameters.toJsonTree((GetAccountAssetTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountAssetsRequestParameters` + if (value.getActualInstance() instanceof GetAccountAssetsRequestParameters) { + JsonObject obj = adapterGetAccountAssetsRequestParameters.toJsonTree((GetAccountAssetsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountDetailRequestParameters` + if (value.getActualInstance() instanceof GetAccountDetailRequestParameters) { + JsonObject obj = adapterGetAccountDetailRequestParameters.toJsonTree((GetAccountDetailRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountRequestParameters` + if (value.getActualInstance() instanceof GetAccountRequestParameters) { + JsonObject obj = adapterGetAccountRequestParameters.toJsonTree((GetAccountRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetAccountTransactionsRequestParameters) { + JsonObject obj = adapterGetAccountTransactionsRequestParameters.toJsonTree((GetAccountTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAssetInfoRequestParameters` + if (value.getActualInstance() instanceof GetAssetInfoRequestParameters) { + JsonObject obj = adapterGetAssetInfoRequestParameters.toJsonTree((GetAssetInfoRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetBlockRequestParameters` + if (value.getActualInstance() instanceof GetBlockRequestParameters) { + JsonObject obj = adapterGetBlockRequestParameters.toJsonTree((GetBlockRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetEngineReceiptsRequestParameters` + if (value.getActualInstance() instanceof GetEngineReceiptsRequestParameters) { + JsonObject obj = adapterGetEngineReceiptsRequestParameters.toJsonTree((GetEngineReceiptsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetPendingTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetPendingTransactionsRequestParameters) { + JsonObject obj = adapterGetPendingTransactionsRequestParameters.toJsonTree((GetPendingTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetRolePermissionsRequestParameters` + if (value.getActualInstance() instanceof GetRolePermissionsRequestParameters) { + JsonObject obj = adapterGetRolePermissionsRequestParameters.toJsonTree((GetRolePermissionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetSignatoriesRequestParameters` + if (value.getActualInstance() instanceof GetSignatoriesRequestParameters) { + JsonObject obj = adapterGetSignatoriesRequestParameters.toJsonTree((GetSignatoriesRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetTransactionsRequestParameters) { + JsonObject obj = adapterGetTransactionsRequestParameters.toJsonTree((GetTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GrantPermissionRequestParameters` + if (value.getActualInstance() instanceof GrantPermissionRequestParameters) { + JsonObject obj = adapterGrantPermissionRequestParameters.toJsonTree((GrantPermissionRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<Object>) { + JsonObject obj = adapterList<Object>.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RemovePeerRequestParameters` + if (value.getActualInstance() instanceof RemovePeerRequestParameters) { + JsonObject obj = adapterRemovePeerRequestParameters.toJsonTree((RemovePeerRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RemoveSignatoryRequestParameters` + if (value.getActualInstance() instanceof RemoveSignatoryRequestParameters) { + JsonObject obj = adapterRemoveSignatoryRequestParameters.toJsonTree((RemoveSignatoryRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RevokePermissionRequestParameters` + if (value.getActualInstance() instanceof RevokePermissionRequestParameters) { + JsonObject obj = adapterRevokePermissionRequestParameters.toJsonTree((RevokePermissionRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SetAccountDetailRequestParameters` + if (value.getActualInstance() instanceof SetAccountDetailRequestParameters) { + JsonObject obj = adapterSetAccountDetailRequestParameters.toJsonTree((SetAccountDetailRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SetAccountQuorumRequestParameters` + if (value.getActualInstance() instanceof SetAccountQuorumRequestParameters) { + JsonObject obj = adapterSetAccountQuorumRequestParameters.toJsonTree((SetAccountQuorumRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SubtractAssetQuantityRequestParameters` + if (value.getActualInstance() instanceof SubtractAssetQuantityRequestParameters) { + JsonObject obj = adapterSubtractAssetQuantityRequestParameters.toJsonTree((SubtractAssetQuantityRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TransferAssetRequestParameters` + if (value.getActualInstance() instanceof TransferAssetRequestParameters) { + JsonObject obj = adapterTransferAssetRequestParameters.toJsonTree((TransferAssetRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters"); + } + + @Override + public RunTransactionRequestV1Params read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AddAssetQuantityRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AddAssetQuantityRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAddAssetQuantityRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AddAssetQuantityRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddAssetQuantityRequestParameters'", e); + } + + // deserialize AddPeerRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AddPeerRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAddPeerRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AddPeerRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddPeerRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddPeerRequestParameters'", e); + } + + // deserialize AddSignatoryRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AddSignatoryRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAddSignatoryRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AddSignatoryRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddSignatoryRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddSignatoryRequestParameters'", e); + } + + // deserialize AppendRoleRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AppendRoleRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAppendRoleRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AppendRoleRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AppendRoleRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AppendRoleRequestParameters'", e); + } + + // deserialize CallEngineRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CallEngineRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCallEngineRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CallEngineRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CallEngineRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CallEngineRequestParameters'", e); + } + + // deserialize CompareAndSetAccountDetailRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CompareAndSetAccountDetailRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCompareAndSetAccountDetailRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CompareAndSetAccountDetailRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CompareAndSetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CompareAndSetAccountDetailRequestParameters'", e); + } + + // deserialize CreateAccountRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateAccountRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateAccountRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateAccountRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateAccountRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateAccountRequestParameters'", e); + } + + // deserialize CreateAssetRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateAssetRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateAssetRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateAssetRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateAssetRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateAssetRequestParameters'", e); + } + + // deserialize CreateDomainRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateDomainRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateDomainRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateDomainRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateDomainRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateDomainRequestParameters'", e); + } + + // deserialize CreateRoleRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateRoleRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateRoleRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateRoleRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateRoleRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateRoleRequestParameters'", e); + } + + // deserialize DetachRoleRequestParameters + try { + // validate the JSON object to see if any exception is thrown + DetachRoleRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterDetachRoleRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'DetachRoleRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DetachRoleRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DetachRoleRequestParameters'", e); + } + + // deserialize GetAccountAssetTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountAssetTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountAssetTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountAssetTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountAssetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountAssetTransactionsRequestParameters'", e); + } + + // deserialize GetAccountAssetsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountAssetsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountAssetsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountAssetsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountAssetsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountAssetsRequestParameters'", e); + } + + // deserialize GetAccountDetailRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountDetailRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountDetailRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountDetailRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountDetailRequestParameters'", e); + } + + // deserialize GetAccountRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountRequestParameters'", e); + } + + // deserialize GetAccountTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountTransactionsRequestParameters'", e); + } + + // deserialize GetAssetInfoRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAssetInfoRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAssetInfoRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAssetInfoRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAssetInfoRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAssetInfoRequestParameters'", e); + } + + // deserialize GetBlockRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetBlockRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetBlockRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetBlockRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetBlockRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetBlockRequestParameters'", e); + } + + // deserialize GetEngineReceiptsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetEngineReceiptsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetEngineReceiptsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetEngineReceiptsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetEngineReceiptsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetEngineReceiptsRequestParameters'", e); + } + + // deserialize GetPendingTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetPendingTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetPendingTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetPendingTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetPendingTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetPendingTransactionsRequestParameters'", e); + } + + // deserialize GetRolePermissionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetRolePermissionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetRolePermissionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetRolePermissionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetRolePermissionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetRolePermissionsRequestParameters'", e); + } + + // deserialize GetSignatoriesRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetSignatoriesRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetSignatoriesRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetSignatoriesRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetSignatoriesRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetSignatoriesRequestParameters'", e); + } + + // deserialize GetTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetTransactionsRequestParameters'", e); + } + + // deserialize GrantPermissionRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GrantPermissionRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGrantPermissionRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GrantPermissionRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GrantPermissionRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GrantPermissionRequestParameters'", e); + } + + // deserialize List + try { + // validate the JSON object to see if any exception is thrown + List<Object>.validateJsonObject(jsonObject); + actualAdapter = adapterList<Object>; + match++; + log.log(Level.FINER, "Input data matches schema 'List'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + // deserialize RemovePeerRequestParameters + try { + // validate the JSON object to see if any exception is thrown + RemovePeerRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterRemovePeerRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'RemovePeerRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RemovePeerRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RemovePeerRequestParameters'", e); + } + + // deserialize RemoveSignatoryRequestParameters + try { + // validate the JSON object to see if any exception is thrown + RemoveSignatoryRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterRemoveSignatoryRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'RemoveSignatoryRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RemoveSignatoryRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RemoveSignatoryRequestParameters'", e); + } + + // deserialize RevokePermissionRequestParameters + try { + // validate the JSON object to see if any exception is thrown + RevokePermissionRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterRevokePermissionRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'RevokePermissionRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RevokePermissionRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RevokePermissionRequestParameters'", e); + } + + // deserialize SetAccountDetailRequestParameters + try { + // validate the JSON object to see if any exception is thrown + SetAccountDetailRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterSetAccountDetailRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'SetAccountDetailRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SetAccountDetailRequestParameters'", e); + } + + // deserialize SetAccountQuorumRequestParameters + try { + // validate the JSON object to see if any exception is thrown + SetAccountQuorumRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterSetAccountQuorumRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'SetAccountQuorumRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SetAccountQuorumRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SetAccountQuorumRequestParameters'", e); + } + + // deserialize SubtractAssetQuantityRequestParameters + try { + // validate the JSON object to see if any exception is thrown + SubtractAssetQuantityRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterSubtractAssetQuantityRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'SubtractAssetQuantityRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SubtractAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SubtractAssetQuantityRequestParameters'", e); + } + + // deserialize TransferAssetRequestParameters + try { + // validate the JSON object to see if any exception is thrown + TransferAssetRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterTransferAssetRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'TransferAssetRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TransferAssetRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TransferAssetRequestParameters'", e); + } + + if (match == 1) { + RunTransactionRequestV1Params ret = new RunTransactionRequestV1Params(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for RunTransactionRequestV1Params: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public RunTransactionRequestV1Params() { + super("oneOf", Boolean.FALSE); + } + + public RunTransactionRequestV1Params(AddAssetQuantityRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(AddPeerRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(AddSignatoryRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(AppendRoleRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CallEngineRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CompareAndSetAccountDetailRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateAccountRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateAssetRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateDomainRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateRoleRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(DetachRoleRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountAssetTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountAssetsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountDetailRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAssetInfoRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetBlockRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetEngineReceiptsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetPendingTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetRolePermissionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetSignatoriesRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GrantPermissionRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(RemovePeerRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(RemoveSignatoryRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(RevokePermissionRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(SetAccountDetailRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(SetAccountQuorumRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(SubtractAssetQuantityRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(TransferAssetRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AddAssetQuantityRequestParameters", new GenericType() { + }); + schemas.put("AddPeerRequestParameters", new GenericType() { + }); + schemas.put("AddSignatoryRequestParameters", new GenericType() { + }); + schemas.put("AppendRoleRequestParameters", new GenericType() { + }); + schemas.put("CallEngineRequestParameters", new GenericType() { + }); + schemas.put("CompareAndSetAccountDetailRequestParameters", new GenericType() { + }); + schemas.put("CreateAccountRequestParameters", new GenericType() { + }); + schemas.put("CreateAssetRequestParameters", new GenericType() { + }); + schemas.put("CreateDomainRequestParameters", new GenericType() { + }); + schemas.put("CreateRoleRequestParameters", new GenericType() { + }); + schemas.put("DetachRoleRequestParameters", new GenericType() { + }); + schemas.put("GetAccountAssetTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GetAccountAssetsRequestParameters", new GenericType() { + }); + schemas.put("GetAccountDetailRequestParameters", new GenericType() { + }); + schemas.put("GetAccountRequestParameters", new GenericType() { + }); + schemas.put("GetAccountTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GetAssetInfoRequestParameters", new GenericType() { + }); + schemas.put("GetBlockRequestParameters", new GenericType() { + }); + schemas.put("GetEngineReceiptsRequestParameters", new GenericType() { + }); + schemas.put("GetPendingTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GetRolePermissionsRequestParameters", new GenericType() { + }); + schemas.put("GetSignatoriesRequestParameters", new GenericType() { + }); + schemas.put("GetTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GrantPermissionRequestParameters", new GenericType() { + }); + schemas.put("List", new GenericType>() { + }); + schemas.put("RemovePeerRequestParameters", new GenericType() { + }); + schemas.put("RemoveSignatoryRequestParameters", new GenericType() { + }); + schemas.put("RevokePermissionRequestParameters", new GenericType() { + }); + schemas.put("SetAccountDetailRequestParameters", new GenericType() { + }); + schemas.put("SetAccountQuorumRequestParameters", new GenericType() { + }); + schemas.put("SubtractAssetQuantityRequestParameters", new GenericType() { + }); + schemas.put("TransferAssetRequestParameters", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return RunTransactionRequestV1Params.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AddAssetQuantityRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AddPeerRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AddSignatoryRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AppendRoleRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CallEngineRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CompareAndSetAccountDetailRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateAccountRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateAssetRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateDomainRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateRoleRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DetachRoleRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountAssetTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountAssetsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountDetailRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAssetInfoRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetBlockRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetEngineReceiptsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetPendingTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetRolePermissionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetSignatoriesRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GrantPermissionRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RemovePeerRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RemoveSignatoryRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RevokePermissionRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SetAccountDetailRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SetAccountQuorumRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SubtractAssetQuantityRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TransferAssetRequestParameters) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters"); + } + + /** + * Get the actual instance, which can be the following: + * AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters + * + * @return The actual instance (AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AddAssetQuantityRequestParameters`. If the actual instance is not `AddAssetQuantityRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddAssetQuantityRequestParameters` + * @throws ClassCastException if the instance is not `AddAssetQuantityRequestParameters` + */ + public AddAssetQuantityRequestParameters getAddAssetQuantityRequestParameters() throws ClassCastException { + return (AddAssetQuantityRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `AddPeerRequestParameters`. If the actual instance is not `AddPeerRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddPeerRequestParameters` + * @throws ClassCastException if the instance is not `AddPeerRequestParameters` + */ + public AddPeerRequestParameters getAddPeerRequestParameters() throws ClassCastException { + return (AddPeerRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `AddSignatoryRequestParameters`. If the actual instance is not `AddSignatoryRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddSignatoryRequestParameters` + * @throws ClassCastException if the instance is not `AddSignatoryRequestParameters` + */ + public AddSignatoryRequestParameters getAddSignatoryRequestParameters() throws ClassCastException { + return (AddSignatoryRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `AppendRoleRequestParameters`. If the actual instance is not `AppendRoleRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AppendRoleRequestParameters` + * @throws ClassCastException if the instance is not `AppendRoleRequestParameters` + */ + public AppendRoleRequestParameters getAppendRoleRequestParameters() throws ClassCastException { + return (AppendRoleRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CallEngineRequestParameters`. If the actual instance is not `CallEngineRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CallEngineRequestParameters` + * @throws ClassCastException if the instance is not `CallEngineRequestParameters` + */ + public CallEngineRequestParameters getCallEngineRequestParameters() throws ClassCastException { + return (CallEngineRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CompareAndSetAccountDetailRequestParameters`. If the actual instance is not `CompareAndSetAccountDetailRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CompareAndSetAccountDetailRequestParameters` + * @throws ClassCastException if the instance is not `CompareAndSetAccountDetailRequestParameters` + */ + public CompareAndSetAccountDetailRequestParameters getCompareAndSetAccountDetailRequestParameters() throws ClassCastException { + return (CompareAndSetAccountDetailRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateAccountRequestParameters`. If the actual instance is not `CreateAccountRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateAccountRequestParameters` + * @throws ClassCastException if the instance is not `CreateAccountRequestParameters` + */ + public CreateAccountRequestParameters getCreateAccountRequestParameters() throws ClassCastException { + return (CreateAccountRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateAssetRequestParameters`. If the actual instance is not `CreateAssetRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateAssetRequestParameters` + * @throws ClassCastException if the instance is not `CreateAssetRequestParameters` + */ + public CreateAssetRequestParameters getCreateAssetRequestParameters() throws ClassCastException { + return (CreateAssetRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateDomainRequestParameters`. If the actual instance is not `CreateDomainRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateDomainRequestParameters` + * @throws ClassCastException if the instance is not `CreateDomainRequestParameters` + */ + public CreateDomainRequestParameters getCreateDomainRequestParameters() throws ClassCastException { + return (CreateDomainRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateRoleRequestParameters`. If the actual instance is not `CreateRoleRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateRoleRequestParameters` + * @throws ClassCastException if the instance is not `CreateRoleRequestParameters` + */ + public CreateRoleRequestParameters getCreateRoleRequestParameters() throws ClassCastException { + return (CreateRoleRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `DetachRoleRequestParameters`. If the actual instance is not `DetachRoleRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DetachRoleRequestParameters` + * @throws ClassCastException if the instance is not `DetachRoleRequestParameters` + */ + public DetachRoleRequestParameters getDetachRoleRequestParameters() throws ClassCastException { + return (DetachRoleRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountAssetTransactionsRequestParameters`. If the actual instance is not `GetAccountAssetTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountAssetTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountAssetTransactionsRequestParameters` + */ + public GetAccountAssetTransactionsRequestParameters getGetAccountAssetTransactionsRequestParameters() throws ClassCastException { + return (GetAccountAssetTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountAssetsRequestParameters`. If the actual instance is not `GetAccountAssetsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountAssetsRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountAssetsRequestParameters` + */ + public GetAccountAssetsRequestParameters getGetAccountAssetsRequestParameters() throws ClassCastException { + return (GetAccountAssetsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountDetailRequestParameters`. If the actual instance is not `GetAccountDetailRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountDetailRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountDetailRequestParameters` + */ + public GetAccountDetailRequestParameters getGetAccountDetailRequestParameters() throws ClassCastException { + return (GetAccountDetailRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountRequestParameters`. If the actual instance is not `GetAccountRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountRequestParameters` + */ + public GetAccountRequestParameters getGetAccountRequestParameters() throws ClassCastException { + return (GetAccountRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountTransactionsRequestParameters`. If the actual instance is not `GetAccountTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountTransactionsRequestParameters` + */ + public GetAccountTransactionsRequestParameters getGetAccountTransactionsRequestParameters() throws ClassCastException { + return (GetAccountTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAssetInfoRequestParameters`. If the actual instance is not `GetAssetInfoRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAssetInfoRequestParameters` + * @throws ClassCastException if the instance is not `GetAssetInfoRequestParameters` + */ + public GetAssetInfoRequestParameters getGetAssetInfoRequestParameters() throws ClassCastException { + return (GetAssetInfoRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetBlockRequestParameters`. If the actual instance is not `GetBlockRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetBlockRequestParameters` + * @throws ClassCastException if the instance is not `GetBlockRequestParameters` + */ + public GetBlockRequestParameters getGetBlockRequestParameters() throws ClassCastException { + return (GetBlockRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetEngineReceiptsRequestParameters`. If the actual instance is not `GetEngineReceiptsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetEngineReceiptsRequestParameters` + * @throws ClassCastException if the instance is not `GetEngineReceiptsRequestParameters` + */ + public GetEngineReceiptsRequestParameters getGetEngineReceiptsRequestParameters() throws ClassCastException { + return (GetEngineReceiptsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetPendingTransactionsRequestParameters`. If the actual instance is not `GetPendingTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetPendingTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetPendingTransactionsRequestParameters` + */ + public GetPendingTransactionsRequestParameters getGetPendingTransactionsRequestParameters() throws ClassCastException { + return (GetPendingTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetRolePermissionsRequestParameters`. If the actual instance is not `GetRolePermissionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetRolePermissionsRequestParameters` + * @throws ClassCastException if the instance is not `GetRolePermissionsRequestParameters` + */ + public GetRolePermissionsRequestParameters getGetRolePermissionsRequestParameters() throws ClassCastException { + return (GetRolePermissionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetSignatoriesRequestParameters`. If the actual instance is not `GetSignatoriesRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetSignatoriesRequestParameters` + * @throws ClassCastException if the instance is not `GetSignatoriesRequestParameters` + */ + public GetSignatoriesRequestParameters getGetSignatoriesRequestParameters() throws ClassCastException { + return (GetSignatoriesRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetTransactionsRequestParameters`. If the actual instance is not `GetTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetTransactionsRequestParameters` + */ + public GetTransactionsRequestParameters getGetTransactionsRequestParameters() throws ClassCastException { + return (GetTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GrantPermissionRequestParameters`. If the actual instance is not `GrantPermissionRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GrantPermissionRequestParameters` + * @throws ClassCastException if the instance is not `GrantPermissionRequestParameters` + */ + public GrantPermissionRequestParameters getGrantPermissionRequestParameters() throws ClassCastException { + return (GrantPermissionRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `List`. If the actual instance is not `List`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List` + * @throws ClassCastException if the instance is not `List` + */ + public List getList() throws ClassCastException { + return (List)super.getActualInstance(); + } + + /** + * Get the actual instance of `RemovePeerRequestParameters`. If the actual instance is not `RemovePeerRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RemovePeerRequestParameters` + * @throws ClassCastException if the instance is not `RemovePeerRequestParameters` + */ + public RemovePeerRequestParameters getRemovePeerRequestParameters() throws ClassCastException { + return (RemovePeerRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `RemoveSignatoryRequestParameters`. If the actual instance is not `RemoveSignatoryRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RemoveSignatoryRequestParameters` + * @throws ClassCastException if the instance is not `RemoveSignatoryRequestParameters` + */ + public RemoveSignatoryRequestParameters getRemoveSignatoryRequestParameters() throws ClassCastException { + return (RemoveSignatoryRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `RevokePermissionRequestParameters`. If the actual instance is not `RevokePermissionRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RevokePermissionRequestParameters` + * @throws ClassCastException if the instance is not `RevokePermissionRequestParameters` + */ + public RevokePermissionRequestParameters getRevokePermissionRequestParameters() throws ClassCastException { + return (RevokePermissionRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `SetAccountDetailRequestParameters`. If the actual instance is not `SetAccountDetailRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SetAccountDetailRequestParameters` + * @throws ClassCastException if the instance is not `SetAccountDetailRequestParameters` + */ + public SetAccountDetailRequestParameters getSetAccountDetailRequestParameters() throws ClassCastException { + return (SetAccountDetailRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `SetAccountQuorumRequestParameters`. If the actual instance is not `SetAccountQuorumRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SetAccountQuorumRequestParameters` + * @throws ClassCastException if the instance is not `SetAccountQuorumRequestParameters` + */ + public SetAccountQuorumRequestParameters getSetAccountQuorumRequestParameters() throws ClassCastException { + return (SetAccountQuorumRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `SubtractAssetQuantityRequestParameters`. If the actual instance is not `SubtractAssetQuantityRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SubtractAssetQuantityRequestParameters` + * @throws ClassCastException if the instance is not `SubtractAssetQuantityRequestParameters` + */ + public SubtractAssetQuantityRequestParameters getSubtractAssetQuantityRequestParameters() throws ClassCastException { + return (SubtractAssetQuantityRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `TransferAssetRequestParameters`. If the actual instance is not `TransferAssetRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TransferAssetRequestParameters` + * @throws ClassCastException if the instance is not `TransferAssetRequestParameters` + */ + public TransferAssetRequestParameters getTransferAssetRequestParameters() throws ClassCastException { + return (TransferAssetRequestParameters)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequestV1Params + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AddAssetQuantityRequestParameters + try { + AddAssetQuantityRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AddPeerRequestParameters + try { + AddPeerRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddPeerRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AddSignatoryRequestParameters + try { + AddSignatoryRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddSignatoryRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AppendRoleRequestParameters + try { + AppendRoleRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AppendRoleRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CallEngineRequestParameters + try { + CallEngineRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CallEngineRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CompareAndSetAccountDetailRequestParameters + try { + CompareAndSetAccountDetailRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CompareAndSetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateAccountRequestParameters + try { + CreateAccountRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateAccountRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateAssetRequestParameters + try { + CreateAssetRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateAssetRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateDomainRequestParameters + try { + CreateDomainRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateDomainRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateRoleRequestParameters + try { + CreateRoleRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateRoleRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DetachRoleRequestParameters + try { + DetachRoleRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DetachRoleRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountAssetTransactionsRequestParameters + try { + GetAccountAssetTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountAssetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountAssetsRequestParameters + try { + GetAccountAssetsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountAssetsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountDetailRequestParameters + try { + GetAccountDetailRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountRequestParameters + try { + GetAccountRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountTransactionsRequestParameters + try { + GetAccountTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAssetInfoRequestParameters + try { + GetAssetInfoRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAssetInfoRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetBlockRequestParameters + try { + GetBlockRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetBlockRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetEngineReceiptsRequestParameters + try { + GetEngineReceiptsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetEngineReceiptsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetPendingTransactionsRequestParameters + try { + GetPendingTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetPendingTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetRolePermissionsRequestParameters + try { + GetRolePermissionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetRolePermissionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetSignatoriesRequestParameters + try { + GetSignatoriesRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetSignatoriesRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetTransactionsRequestParameters + try { + GetTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GrantPermissionRequestParameters + try { + GrantPermissionRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GrantPermissionRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List + try { + List.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RemovePeerRequestParameters + try { + RemovePeerRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RemovePeerRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RemoveSignatoryRequestParameters + try { + RemoveSignatoryRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RemoveSignatoryRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RevokePermissionRequestParameters + try { + RevokePermissionRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RevokePermissionRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SetAccountDetailRequestParameters + try { + SetAccountDetailRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SetAccountQuorumRequestParameters + try { + SetAccountQuorumRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SetAccountQuorumRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SubtractAssetQuantityRequestParameters + try { + SubtractAssetQuantityRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SubtractAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TransferAssetRequestParameters + try { + TransferAssetRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TransferAssetRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for RunTransactionRequestV1Params with oneOf schemas: AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of RunTransactionRequestV1Params given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequestV1Params + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequestV1Params + */ + public static RunTransactionRequestV1Params fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequestV1Params.class); + } + + /** + * Convert an instance of RunTransactionRequestV1Params to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..1838315f21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Object transactionReceipt = null; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Object transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Object getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Object transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java new file mode 100644 index 0000000000..cf252af00b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionSignedRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionSignedRequestV1 { + public static final String SERIALIZED_NAME_SIGNED_TRANSACTION = "signedTransaction"; + @SerializedName(SERIALIZED_NAME_SIGNED_TRANSACTION) + private String signedTransaction; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private IrohaBaseConfig baseConfig; + + public RunTransactionSignedRequestV1() { + } + + public RunTransactionSignedRequestV1 signedTransaction(String signedTransaction) { + + this.signedTransaction = signedTransaction; + return this; + } + + /** + * Signed transaction binary data received from generate-transaction endpoint. + * @return signedTransaction + **/ + @javax.annotation.Nonnull + public String getSignedTransaction() { + return signedTransaction; + } + + + public void setSignedTransaction(String signedTransaction) { + this.signedTransaction = signedTransaction; + } + + + public RunTransactionSignedRequestV1 baseConfig(IrohaBaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public IrohaBaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(IrohaBaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionSignedRequestV1 runTransactionSignedRequestV1 = (RunTransactionSignedRequestV1) o; + return Objects.equals(this.signedTransaction, runTransactionSignedRequestV1.signedTransaction) && + Objects.equals(this.baseConfig, runTransactionSignedRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(signedTransaction, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionSignedRequestV1 {\n"); + sb.append(" signedTransaction: ").append(toIndentedString(signedTransaction)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signedTransaction"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signedTransaction"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionSignedRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionSignedRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionSignedRequestV1 is not found in the empty JSON string", RunTransactionSignedRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionSignedRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionSignedRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionSignedRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signedTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedTransaction").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionSignedRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionSignedRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionSignedRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionSignedRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionSignedRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionSignedRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionSignedRequestV1 + * @throws IOException if the JSON string is invalid with respect to RunTransactionSignedRequestV1 + */ + public static RunTransactionSignedRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionSignedRequestV1.class); + } + + /** + * Convert an instance of RunTransactionSignedRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java new file mode 100644 index 0000000000..0ecc03e77a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Set Account Detail. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetAccountDetailRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetAccountDetailRequestParameters() { + } + + public SetAccountDetailRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public SetAccountDetailRequestParameters key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetAccountDetailRequestParameters value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetAccountDetailRequestParameters setAccountDetailRequestParameters = (SetAccountDetailRequestParameters) o; + return Objects.equals(this.accountId, setAccountDetailRequestParameters.accountId) && + Objects.equals(this.key, setAccountDetailRequestParameters.key) && + Objects.equals(this.value, setAccountDetailRequestParameters.value); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetAccountDetailRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetAccountDetailRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetAccountDetailRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetAccountDetailRequestParameters is not found in the empty JSON string", SetAccountDetailRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetAccountDetailRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetAccountDetailRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetAccountDetailRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetAccountDetailRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetAccountDetailRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetAccountDetailRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetAccountDetailRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetAccountDetailRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetAccountDetailRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetAccountDetailRequestParameters + * @throws IOException if the JSON string is invalid with respect to SetAccountDetailRequestParameters + */ + public static SetAccountDetailRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetAccountDetailRequestParameters.class); + } + + /** + * Convert an instance of SetAccountDetailRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java new file mode 100644 index 0000000000..07a10ea1b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Set Account Quorum. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetAccountQuorumRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_QUORUM = "quorum"; + @SerializedName(SERIALIZED_NAME_QUORUM) + private Integer quorum; + + public SetAccountQuorumRequestParameters() { + } + + public SetAccountQuorumRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public SetAccountQuorumRequestParameters quorum(Integer quorum) { + + this.quorum = quorum; + return this; + } + + /** + * Get quorum + * @return quorum + **/ + @javax.annotation.Nonnull + public Integer getQuorum() { + return quorum; + } + + + public void setQuorum(Integer quorum) { + this.quorum = quorum; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetAccountQuorumRequestParameters setAccountQuorumRequestParameters = (SetAccountQuorumRequestParameters) o; + return Objects.equals(this.accountId, setAccountQuorumRequestParameters.accountId) && + Objects.equals(this.quorum, setAccountQuorumRequestParameters.quorum); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, quorum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetAccountQuorumRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" quorum: ").append(toIndentedString(quorum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("quorum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("quorum"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetAccountQuorumRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetAccountQuorumRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetAccountQuorumRequestParameters is not found in the empty JSON string", SetAccountQuorumRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetAccountQuorumRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetAccountQuorumRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetAccountQuorumRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetAccountQuorumRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetAccountQuorumRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetAccountQuorumRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetAccountQuorumRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetAccountQuorumRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetAccountQuorumRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetAccountQuorumRequestParameters + * @throws IOException if the JSON string is invalid with respect to SetAccountQuorumRequestParameters + */ + public static SetAccountQuorumRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetAccountQuorumRequestParameters.class); + } + + /** + * Convert an instance of SetAccountQuorumRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java new file mode 100644 index 0000000000..1d3409f203 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Subtract Asset Quantity. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubtractAssetQuantityRequestParameters { + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private BigDecimal amount; + + public SubtractAssetQuantityRequestParameters() { + } + + public SubtractAssetQuantityRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public SubtractAssetQuantityRequestParameters amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubtractAssetQuantityRequestParameters subtractAssetQuantityRequestParameters = (SubtractAssetQuantityRequestParameters) o; + return Objects.equals(this.assetId, subtractAssetQuantityRequestParameters.assetId) && + Objects.equals(this.amount, subtractAssetQuantityRequestParameters.amount); + } + + @Override + public int hashCode() { + return Objects.hash(assetId, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubtractAssetQuantityRequestParameters {\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetId"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubtractAssetQuantityRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SubtractAssetQuantityRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SubtractAssetQuantityRequestParameters is not found in the empty JSON string", SubtractAssetQuantityRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SubtractAssetQuantityRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubtractAssetQuantityRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubtractAssetQuantityRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubtractAssetQuantityRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubtractAssetQuantityRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubtractAssetQuantityRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubtractAssetQuantityRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubtractAssetQuantityRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubtractAssetQuantityRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubtractAssetQuantityRequestParameters + * @throws IOException if the JSON string is invalid with respect to SubtractAssetQuantityRequestParameters + */ + public static SubtractAssetQuantityRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubtractAssetQuantityRequestParameters.class); + } + + /** + * Convert an instance of SubtractAssetQuantityRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java new file mode 100644 index 0000000000..0495346f26 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java @@ -0,0 +1,342 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Transfer Asset. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferAssetRequestParameters { + public static final String SERIALIZED_NAME_SRC_ACCOUNT_ID = "srcAccountId"; + @SerializedName(SERIALIZED_NAME_SRC_ACCOUNT_ID) + private String srcAccountId; + + public static final String SERIALIZED_NAME_DEST_ACCOUNT_ID = "destAccountId"; + @SerializedName(SERIALIZED_NAME_DEST_ACCOUNT_ID) + private String destAccountId; + + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private BigDecimal amount; + + public TransferAssetRequestParameters() { + } + + public TransferAssetRequestParameters srcAccountId(String srcAccountId) { + + this.srcAccountId = srcAccountId; + return this; + } + + /** + * Get srcAccountId + * @return srcAccountId + **/ + @javax.annotation.Nonnull + public String getSrcAccountId() { + return srcAccountId; + } + + + public void setSrcAccountId(String srcAccountId) { + this.srcAccountId = srcAccountId; + } + + + public TransferAssetRequestParameters destAccountId(String destAccountId) { + + this.destAccountId = destAccountId; + return this; + } + + /** + * Get destAccountId + * @return destAccountId + **/ + @javax.annotation.Nonnull + public String getDestAccountId() { + return destAccountId; + } + + + public void setDestAccountId(String destAccountId) { + this.destAccountId = destAccountId; + } + + + public TransferAssetRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public TransferAssetRequestParameters description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public TransferAssetRequestParameters amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferAssetRequestParameters transferAssetRequestParameters = (TransferAssetRequestParameters) o; + return Objects.equals(this.srcAccountId, transferAssetRequestParameters.srcAccountId) && + Objects.equals(this.destAccountId, transferAssetRequestParameters.destAccountId) && + Objects.equals(this.assetId, transferAssetRequestParameters.assetId) && + Objects.equals(this.description, transferAssetRequestParameters.description) && + Objects.equals(this.amount, transferAssetRequestParameters.amount); + } + + @Override + public int hashCode() { + return Objects.hash(srcAccountId, destAccountId, assetId, description, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferAssetRequestParameters {\n"); + sb.append(" srcAccountId: ").append(toIndentedString(srcAccountId)).append("\n"); + sb.append(" destAccountId: ").append(toIndentedString(destAccountId)).append("\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("srcAccountId"); + openapiFields.add("destAccountId"); + openapiFields.add("assetId"); + openapiFields.add("description"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("srcAccountId"); + openapiRequiredFields.add("destAccountId"); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferAssetRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferAssetRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferAssetRequestParameters is not found in the empty JSON string", TransferAssetRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferAssetRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferAssetRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferAssetRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("srcAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `srcAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("srcAccountId").toString())); + } + if (!jsonObj.get("destAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destAccountId").toString())); + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferAssetRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferAssetRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferAssetRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferAssetRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferAssetRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferAssetRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferAssetRequestParameters + * @throws IOException if the JSON string is invalid with respect to TransferAssetRequestParameters + */ + public static TransferAssetRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferAssetRequestParameters.class); + } + + /** + * Convert an instance of TransferAssetRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 0000000000..03031b5739 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..b685eb55f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.ErrorExceptionJsonResponseV1; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Body; +import org.openapitools.client.model.RunTransactionResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Generate transaction that can be signed locally. + * + * @throws ApiException if the Api call fails + */ + @Test + public void generateTransactionV1Test() throws ApiException { + GenerateTransactionRequestV1 generateTransactionRequestV1 = null; + String response = api.generateTransactionV1(generateTransactionRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Executes a transaction on a Iroha ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequestV1Body runTransactionRequestV1Body = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequestV1Body); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java new file mode 100644 index 0000000000..6c29f91df2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AddAssetQuantityRequestParameters + */ +public class AddAssetQuantityRequestParametersTest { + private final AddAssetQuantityRequestParameters model = new AddAssetQuantityRequestParameters(); + + /** + * Model tests for AddAssetQuantityRequestParameters + */ + @Test + public void testAddAssetQuantityRequestParameters() { + // TODO: test AddAssetQuantityRequestParameters + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java new file mode 100644 index 0000000000..21c909ae04 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AddPeerRequestParameters + */ +public class AddPeerRequestParametersTest { + private final AddPeerRequestParameters model = new AddPeerRequestParameters(); + + /** + * Model tests for AddPeerRequestParameters + */ + @Test + public void testAddPeerRequestParameters() { + // TODO: test AddPeerRequestParameters + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'peerKey' + */ + @Test + public void peerKeyTest() { + // TODO: test peerKey + } + + /** + * Test the property 'tlsCertificate' + */ + @Test + public void tlsCertificateTest() { + // TODO: test tlsCertificate + } + + /** + * Test the property 'syncingPeer' + */ + @Test + public void syncingPeerTest() { + // TODO: test syncingPeer + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java new file mode 100644 index 0000000000..7228ed8498 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AddSignatoryRequestParameters + */ +public class AddSignatoryRequestParametersTest { + private final AddSignatoryRequestParameters model = new AddSignatoryRequestParameters(); + + /** + * Model tests for AddSignatoryRequestParameters + */ + @Test + public void testAddSignatoryRequestParameters() { + // TODO: test AddSignatoryRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java new file mode 100644 index 0000000000..71aac26784 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AppendRoleRequestParameters + */ +public class AppendRoleRequestParametersTest { + private final AppendRoleRequestParameters model = new AppendRoleRequestParameters(); + + /** + * Model tests for AppendRoleRequestParameters + */ + @Test + public void testAppendRoleRequestParameters() { + // TODO: test AppendRoleRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java new file mode 100644 index 0000000000..607f5aced4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CallEngineRequestParameters + */ +public class CallEngineRequestParametersTest { + private final CallEngineRequestParameters model = new CallEngineRequestParameters(); + + /** + * Model tests for CallEngineRequestParameters + */ + @Test + public void testCallEngineRequestParameters() { + // TODO: test CallEngineRequestParameters + } + + /** + * Test the property 'caller' + */ + @Test + public void callerTest() { + // TODO: test caller + } + + /** + * Test the property 'callee' + */ + @Test + public void calleeTest() { + // TODO: test callee + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java new file mode 100644 index 0000000000..9556214153 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CompareAndSetAccountDetailRequestParameters + */ +public class CompareAndSetAccountDetailRequestParametersTest { + private final CompareAndSetAccountDetailRequestParameters model = new CompareAndSetAccountDetailRequestParameters(); + + /** + * Model tests for CompareAndSetAccountDetailRequestParameters + */ + @Test + public void testCompareAndSetAccountDetailRequestParameters() { + // TODO: test CompareAndSetAccountDetailRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'oldValue' + */ + @Test + public void oldValueTest() { + // TODO: test oldValue + } + + /** + * Test the property 'checkEmpty' + */ + @Test + public void checkEmptyTest() { + // TODO: test checkEmpty + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java new file mode 100644 index 0000000000..bece167c94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateAccountRequestParameters + */ +public class CreateAccountRequestParametersTest { + private final CreateAccountRequestParameters model = new CreateAccountRequestParameters(); + + /** + * Model tests for CreateAccountRequestParameters + */ + @Test + public void testCreateAccountRequestParameters() { + // TODO: test CreateAccountRequestParameters + } + + /** + * Test the property 'accountName' + */ + @Test + public void accountNameTest() { + // TODO: test accountName + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java new file mode 100644 index 0000000000..92e8a6f0bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateAssetRequestParameters + */ +public class CreateAssetRequestParametersTest { + private final CreateAssetRequestParameters model = new CreateAssetRequestParameters(); + + /** + * Model tests for CreateAssetRequestParameters + */ + @Test + public void testCreateAssetRequestParameters() { + // TODO: test CreateAssetRequestParameters + } + + /** + * Test the property 'assetName' + */ + @Test + public void assetNameTest() { + // TODO: test assetName + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'precision' + */ + @Test + public void precisionTest() { + // TODO: test precision + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java new file mode 100644 index 0000000000..7cc3f42f0a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateDomainRequestParameters + */ +public class CreateDomainRequestParametersTest { + private final CreateDomainRequestParameters model = new CreateDomainRequestParameters(); + + /** + * Model tests for CreateDomainRequestParameters + */ + @Test + public void testCreateDomainRequestParameters() { + // TODO: test CreateDomainRequestParameters + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'defaultRole' + */ + @Test + public void defaultRoleTest() { + // TODO: test defaultRole + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java new file mode 100644 index 0000000000..5950210923 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateRoleRequestParameters + */ +public class CreateRoleRequestParametersTest { + private final CreateRoleRequestParameters model = new CreateRoleRequestParameters(); + + /** + * Model tests for CreateRoleRequestParameters + */ + @Test + public void testCreateRoleRequestParameters() { + // TODO: test CreateRoleRequestParameters + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + + /** + * Test the property 'permissionsList' + */ + @Test + public void permissionsListTest() { + // TODO: test permissionsList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java new file mode 100644 index 0000000000..ff68126b2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DetachRoleRequestParameters + */ +public class DetachRoleRequestParametersTest { + private final DetachRoleRequestParameters model = new DetachRoleRequestParameters(); + + /** + * Model tests for DetachRoleRequestParameters + */ + @Test + public void testDetachRoleRequestParameters() { + // TODO: test DetachRoleRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java new file mode 100644 index 0000000000..a7a633d44f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionJsonResponseV1 + */ +public class ErrorExceptionJsonResponseV1Test { + private final ErrorExceptionJsonResponseV1 model = new ErrorExceptionJsonResponseV1(); + + /** + * Model tests for ErrorExceptionJsonResponseV1 + */ + @Test + public void testErrorExceptionJsonResponseV1() { + // TODO: test ErrorExceptionJsonResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + + /** + * Test the property 'stack' + */ + @Test + public void stackTest() { + // TODO: test stack + } + + /** + * Test the property 'cause' + */ + @Test + public void causeTest() { + // TODO: test cause + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 0000000000..cfcee18bd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java new file mode 100644 index 0000000000..b2fe8179d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.IrohaCommand; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GenerateTransactionRequestV1 + */ +public class GenerateTransactionRequestV1Test { + private final GenerateTransactionRequestV1 model = new GenerateTransactionRequestV1(); + + /** + * Model tests for GenerateTransactionRequestV1 + */ + @Test + public void testGenerateTransactionRequestV1() { + // TODO: test GenerateTransactionRequestV1 + } + + /** + * Test the property 'commandName' + */ + @Test + public void commandNameTest() { + // TODO: test commandName + } + + /** + * Test the property 'commandParams' + */ + @Test + public void commandParamsTest() { + // TODO: test commandParams + } + + /** + * Test the property 'creatorAccountId' + */ + @Test + public void creatorAccountIdTest() { + // TODO: test creatorAccountId + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java new file mode 100644 index 0000000000..2aa356bae9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountAssetTransactionsRequestParameters + */ +public class GetAccountAssetTransactionsRequestParametersTest { + private final GetAccountAssetTransactionsRequestParameters model = new GetAccountAssetTransactionsRequestParameters(); + + /** + * Model tests for GetAccountAssetTransactionsRequestParameters + */ + @Test + public void testGetAccountAssetTransactionsRequestParameters() { + // TODO: test GetAccountAssetTransactionsRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java new file mode 100644 index 0000000000..b40f85141b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountAssetsRequestParameters + */ +public class GetAccountAssetsRequestParametersTest { + private final GetAccountAssetsRequestParameters model = new GetAccountAssetsRequestParameters(); + + /** + * Model tests for GetAccountAssetsRequestParameters + */ + @Test + public void testGetAccountAssetsRequestParameters() { + // TODO: test GetAccountAssetsRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstAssetId' + */ + @Test + public void firstAssetIdTest() { + // TODO: test firstAssetId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java new file mode 100644 index 0000000000..643999e256 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java @@ -0,0 +1,88 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountDetailRequestParameters + */ +public class GetAccountDetailRequestParametersTest { + private final GetAccountDetailRequestParameters model = new GetAccountDetailRequestParameters(); + + /** + * Model tests for GetAccountDetailRequestParameters + */ + @Test + public void testGetAccountDetailRequestParameters() { + // TODO: test GetAccountDetailRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'writer' + */ + @Test + public void writerTest() { + // TODO: test writer + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'paginationKey' + */ + @Test + public void paginationKeyTest() { + // TODO: test paginationKey + } + + /** + * Test the property 'paginationWriter' + */ + @Test + public void paginationWriterTest() { + // TODO: test paginationWriter + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java new file mode 100644 index 0000000000..96314199b1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountRequestParameters + */ +public class GetAccountRequestParametersTest { + private final GetAccountRequestParameters model = new GetAccountRequestParameters(); + + /** + * Model tests for GetAccountRequestParameters + */ + @Test + public void testGetAccountRequestParameters() { + // TODO: test GetAccountRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java new file mode 100644 index 0000000000..bf411b6b68 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java @@ -0,0 +1,96 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountTransactionsRequestParameters + */ +public class GetAccountTransactionsRequestParametersTest { + private final GetAccountTransactionsRequestParameters model = new GetAccountTransactionsRequestParameters(); + + /** + * Model tests for GetAccountTransactionsRequestParameters + */ + @Test + public void testGetAccountTransactionsRequestParameters() { + // TODO: test GetAccountTransactionsRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + + /** + * Test the property 'firstTxTime' + */ + @Test + public void firstTxTimeTest() { + // TODO: test firstTxTime + } + + /** + * Test the property 'lastTxTime' + */ + @Test + public void lastTxTimeTest() { + // TODO: test lastTxTime + } + + /** + * Test the property 'firstTxHeight' + */ + @Test + public void firstTxHeightTest() { + // TODO: test firstTxHeight + } + + /** + * Test the property 'lastTxHeight' + */ + @Test + public void lastTxHeightTest() { + // TODO: test lastTxHeight + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java new file mode 100644 index 0000000000..8343eb67cd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAssetInfoRequestParameters + */ +public class GetAssetInfoRequestParametersTest { + private final GetAssetInfoRequestParameters model = new GetAssetInfoRequestParameters(); + + /** + * Model tests for GetAssetInfoRequestParameters + */ + @Test + public void testGetAssetInfoRequestParameters() { + // TODO: test GetAssetInfoRequestParameters + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java new file mode 100644 index 0000000000..c2596282e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestParameters + */ +public class GetBlockRequestParametersTest { + private final GetBlockRequestParameters model = new GetBlockRequestParameters(); + + /** + * Model tests for GetBlockRequestParameters + */ + @Test + public void testGetBlockRequestParameters() { + // TODO: test GetBlockRequestParameters + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java new file mode 100644 index 0000000000..b31fe06e9b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetEngineReceiptsRequestParameters + */ +public class GetEngineReceiptsRequestParametersTest { + private final GetEngineReceiptsRequestParameters model = new GetEngineReceiptsRequestParameters(); + + /** + * Model tests for GetEngineReceiptsRequestParameters + */ + @Test + public void testGetEngineReceiptsRequestParameters() { + // TODO: test GetEngineReceiptsRequestParameters + } + + /** + * Test the property 'txHash' + */ + @Test + public void txHashTest() { + // TODO: test txHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java new file mode 100644 index 0000000000..7a5ab839fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetPendingTransactionsRequestParameters + */ +public class GetPendingTransactionsRequestParametersTest { + private final GetPendingTransactionsRequestParameters model = new GetPendingTransactionsRequestParameters(); + + /** + * Model tests for GetPendingTransactionsRequestParameters + */ + @Test + public void testGetPendingTransactionsRequestParameters() { + // TODO: test GetPendingTransactionsRequestParameters + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + + /** + * Test the property 'firstTxTime' + */ + @Test + public void firstTxTimeTest() { + // TODO: test firstTxTime + } + + /** + * Test the property 'lastTxTime' + */ + @Test + public void lastTxTimeTest() { + // TODO: test lastTxTime + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java new file mode 100644 index 0000000000..322af46d47 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetRolePermissionsRequestParameters + */ +public class GetRolePermissionsRequestParametersTest { + private final GetRolePermissionsRequestParameters model = new GetRolePermissionsRequestParameters(); + + /** + * Model tests for GetRolePermissionsRequestParameters + */ + @Test + public void testGetRolePermissionsRequestParameters() { + // TODO: test GetRolePermissionsRequestParameters + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java new file mode 100644 index 0000000000..03893a02eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetSignatoriesRequestParameters + */ +public class GetSignatoriesRequestParametersTest { + private final GetSignatoriesRequestParameters model = new GetSignatoriesRequestParameters(); + + /** + * Model tests for GetSignatoriesRequestParameters + */ + @Test + public void testGetSignatoriesRequestParameters() { + // TODO: test GetSignatoriesRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java new file mode 100644 index 0000000000..ec2fd79f45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionsRequestParameters + */ +public class GetTransactionsRequestParametersTest { + private final GetTransactionsRequestParameters model = new GetTransactionsRequestParameters(); + + /** + * Model tests for GetTransactionsRequestParameters + */ + @Test + public void testGetTransactionsRequestParameters() { + // TODO: test GetTransactionsRequestParameters + } + + /** + * Test the property 'txHashesList' + */ + @Test + public void txHashesListTest() { + // TODO: test txHashesList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java new file mode 100644 index 0000000000..0de8eb11f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GrantPermissionRequestParameters + */ +public class GrantPermissionRequestParametersTest { + private final GrantPermissionRequestParameters model = new GrantPermissionRequestParameters(); + + /** + * Model tests for GrantPermissionRequestParameters + */ + @Test + public void testGrantPermissionRequestParameters() { + // TODO: test GrantPermissionRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java new file mode 100644 index 0000000000..3d68717706 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java @@ -0,0 +1,108 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBaseConfig + */ +public class IrohaBaseConfigTest { + private final IrohaBaseConfig model = new IrohaBaseConfig(); + + /** + * Model tests for IrohaBaseConfig + */ + @Test + public void testIrohaBaseConfig() { + // TODO: test IrohaBaseConfig + } + + /** + * Test the property 'irohaHost' + */ + @Test + public void irohaHostTest() { + // TODO: test irohaHost + } + + /** + * Test the property 'irohaPort' + */ + @Test + public void irohaPortTest() { + // TODO: test irohaPort + } + + /** + * Test the property 'creatorAccountId' + */ + @Test + public void creatorAccountIdTest() { + // TODO: test creatorAccountId + } + + /** + * Test the property 'privKey' + */ + @Test + public void privKeyTest() { + // TODO: test privKey + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + + /** + * Test the property 'timeoutLimit' + */ + @Test + public void timeoutLimitTest() { + // TODO: test timeoutLimit + } + + /** + * Test the property 'tls' + */ + @Test + public void tlsTest() { + // TODO: test tls + } + + /** + * Test the property 'monitorMode' + */ + @Test + public void monitorModeTest() { + // TODO: test monitorMode + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java new file mode 100644 index 0000000000..f71e21feea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBlockResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBlockProgress + */ +public class IrohaBlockProgressTest { + private final IrohaBlockProgress model = new IrohaBlockProgress(); + + /** + * Model tests for IrohaBlockProgress + */ + @Test + public void testIrohaBlockProgress() { + // TODO: test IrohaBlockProgress + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java new file mode 100644 index 0000000000..7b9c92d22f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBlockResponsePayload + */ +public class IrohaBlockResponsePayloadTest { + private final IrohaBlockResponsePayload model = new IrohaBlockResponsePayload(); + + /** + * Model tests for IrohaBlockResponsePayload + */ + @Test + public void testIrohaBlockResponsePayload() { + // TODO: test IrohaBlockResponsePayload + } + + /** + * Test the property 'transactionsList' + */ + @Test + public void transactionsListTest() { + // TODO: test transactionsList + } + + /** + * Test the property 'txNumber' + */ + @Test + public void txNumberTest() { + // TODO: test txNumber + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'prevBlockHash' + */ + @Test + public void prevBlockHashTest() { + // TODO: test prevBlockHash + } + + /** + * Test the property 'createdTime' + */ + @Test + public void createdTimeTest() { + // TODO: test createdTime + } + + /** + * Test the property 'rejectedTransactionsHashesList' + */ + @Test + public void rejectedTransactionsHashesListTest() { + // TODO: test rejectedTransactionsHashesList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java new file mode 100644 index 0000000000..7fa3bc6047 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaBlockResponsePayload; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBlockResponse + */ +public class IrohaBlockResponseTest { + private final IrohaBlockResponse model = new IrohaBlockResponse(); + + /** + * Model tests for IrohaBlockResponse + */ + @Test + public void testIrohaBlockResponse() { + // TODO: test IrohaBlockResponse + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'signaturesList' + */ + @Test + public void signaturesListTest() { + // TODO: test signaturesList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java new file mode 100644 index 0000000000..e9a7a661a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaCommand + */ +public class IrohaCommandTest { + /** + * Model tests for IrohaCommand + */ + @Test + public void testIrohaCommand() { + // TODO: test IrohaCommand + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java new file mode 100644 index 0000000000..9cae27ec45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaQuery + */ +public class IrohaQueryTest { + /** + * Model tests for IrohaQuery + */ + @Test + public void testIrohaQuery() { + // TODO: test IrohaQuery + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java new file mode 100644 index 0000000000..b8237e4055 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaSocketIOTransactV1 + */ +public class IrohaSocketIOTransactV1Test { + /** + * Model tests for IrohaSocketIOTransactV1 + */ + @Test + public void testIrohaSocketIOTransactV1() { + // TODO: test IrohaSocketIOTransactV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java new file mode 100644 index 0000000000..0f21bf6ac3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for KeyPair + */ +public class KeyPairTest { + private final KeyPair model = new KeyPair(); + + /** + * Model tests for KeyPair + */ + @Test + public void testKeyPair() { + // TODO: test KeyPair + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java new file mode 100644 index 0000000000..1d55c51936 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RemovePeerRequestParameters + */ +public class RemovePeerRequestParametersTest { + private final RemovePeerRequestParameters model = new RemovePeerRequestParameters(); + + /** + * Model tests for RemovePeerRequestParameters + */ + @Test + public void testRemovePeerRequestParameters() { + // TODO: test RemovePeerRequestParameters + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java new file mode 100644 index 0000000000..7f0145ff3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RemoveSignatoryRequestParameters + */ +public class RemoveSignatoryRequestParametersTest { + private final RemoveSignatoryRequestParameters model = new RemoveSignatoryRequestParameters(); + + /** + * Model tests for RemoveSignatoryRequestParameters + */ + @Test + public void testRemoveSignatoryRequestParameters() { + // TODO: test RemoveSignatoryRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java new file mode 100644 index 0000000000..6a8f721214 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RevokePermissionRequestParameters + */ +public class RevokePermissionRequestParametersTest { + private final RevokePermissionRequestParameters model = new RevokePermissionRequestParameters(); + + /** + * Model tests for RevokePermissionRequestParameters + */ + @Test + public void testRevokePermissionRequestParameters() { + // TODO: test RevokePermissionRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java new file mode 100644 index 0000000000..cfcd699f50 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Params; +import org.openapitools.client.model.RunTransactionSignedRequestV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequestV1Body + */ +public class RunTransactionRequestV1BodyTest { + private final RunTransactionRequestV1Body model = new RunTransactionRequestV1Body(); + + /** + * Model tests for RunTransactionRequestV1Body + */ + @Test + public void testRunTransactionRequestV1Body() { + // TODO: test RunTransactionRequestV1Body + } + + /** + * Test the property 'commandName' + */ + @Test + public void commandNameTest() { + // TODO: test commandName + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'signedTransaction' + */ + @Test + public void signedTransactionTest() { + // TODO: test signedTransaction + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java new file mode 100644 index 0000000000..6e26c59e6c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java @@ -0,0 +1,402 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AddAssetQuantityRequestParameters; +import org.openapitools.client.model.AddPeerRequestParameters; +import org.openapitools.client.model.AddSignatoryRequestParameters; +import org.openapitools.client.model.AppendRoleRequestParameters; +import org.openapitools.client.model.CallEngineRequestParameters; +import org.openapitools.client.model.CompareAndSetAccountDetailRequestParameters; +import org.openapitools.client.model.CreateAccountRequestParameters; +import org.openapitools.client.model.CreateAssetRequestParameters; +import org.openapitools.client.model.CreateDomainRequestParameters; +import org.openapitools.client.model.CreateRoleRequestParameters; +import org.openapitools.client.model.DetachRoleRequestParameters; +import org.openapitools.client.model.GetAccountAssetTransactionsRequestParameters; +import org.openapitools.client.model.GetAccountAssetsRequestParameters; +import org.openapitools.client.model.GetAccountDetailRequestParameters; +import org.openapitools.client.model.GetAccountRequestParameters; +import org.openapitools.client.model.GetAccountTransactionsRequestParameters; +import org.openapitools.client.model.GetAssetInfoRequestParameters; +import org.openapitools.client.model.GetBlockRequestParameters; +import org.openapitools.client.model.GetEngineReceiptsRequestParameters; +import org.openapitools.client.model.GetPendingTransactionsRequestParameters; +import org.openapitools.client.model.GetRolePermissionsRequestParameters; +import org.openapitools.client.model.GetSignatoriesRequestParameters; +import org.openapitools.client.model.GetTransactionsRequestParameters; +import org.openapitools.client.model.GrantPermissionRequestParameters; +import org.openapitools.client.model.RemovePeerRequestParameters; +import org.openapitools.client.model.RemoveSignatoryRequestParameters; +import org.openapitools.client.model.RevokePermissionRequestParameters; +import org.openapitools.client.model.SetAccountDetailRequestParameters; +import org.openapitools.client.model.SetAccountQuorumRequestParameters; +import org.openapitools.client.model.SubtractAssetQuantityRequestParameters; +import org.openapitools.client.model.TransferAssetRequestParameters; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequestV1Params + */ +public class RunTransactionRequestV1ParamsTest { + private final RunTransactionRequestV1Params model = new RunTransactionRequestV1Params(); + + /** + * Model tests for RunTransactionRequestV1Params + */ + @Test + public void testRunTransactionRequestV1Params() { + // TODO: test RunTransactionRequestV1Params + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'peerKey' + */ + @Test + public void peerKeyTest() { + // TODO: test peerKey + } + + /** + * Test the property 'tlsCertificate' + */ + @Test + public void tlsCertificateTest() { + // TODO: test tlsCertificate + } + + /** + * Test the property 'syncingPeer' + */ + @Test + public void syncingPeerTest() { + // TODO: test syncingPeer + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + + /** + * Test the property 'caller' + */ + @Test + public void callerTest() { + // TODO: test caller + } + + /** + * Test the property 'callee' + */ + @Test + public void calleeTest() { + // TODO: test callee + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + + /** + * Test the property 'accountName' + */ + @Test + public void accountNameTest() { + // TODO: test accountName + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'assetName' + */ + @Test + public void assetNameTest() { + // TODO: test assetName + } + + /** + * Test the property 'precision' + */ + @Test + public void precisionTest() { + // TODO: test precision + } + + /** + * Test the property 'defaultRole' + */ + @Test + public void defaultRoleTest() { + // TODO: test defaultRole + } + + /** + * Test the property 'permissionsList' + */ + @Test + public void permissionsListTest() { + // TODO: test permissionsList + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + + /** + * Test the property 'srcAccountId' + */ + @Test + public void srcAccountIdTest() { + // TODO: test srcAccountId + } + + /** + * Test the property 'destAccountId' + */ + @Test + public void destAccountIdTest() { + // TODO: test destAccountId + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'oldValue' + */ + @Test + public void oldValueTest() { + // TODO: test oldValue + } + + /** + * Test the property 'checkEmpty' + */ + @Test + public void checkEmptyTest() { + // TODO: test checkEmpty + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'txHashesList' + */ + @Test + public void txHashesListTest() { + // TODO: test txHashesList + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + + /** + * Test the property 'firstTxTime' + */ + @Test + public void firstTxTimeTest() { + // TODO: test firstTxTime + } + + /** + * Test the property 'lastTxTime' + */ + @Test + public void lastTxTimeTest() { + // TODO: test lastTxTime + } + + /** + * Test the property 'firstTxHeight' + */ + @Test + public void firstTxHeightTest() { + // TODO: test firstTxHeight + } + + /** + * Test the property 'lastTxHeight' + */ + @Test + public void lastTxHeightTest() { + // TODO: test lastTxHeight + } + + /** + * Test the property 'firstAssetId' + */ + @Test + public void firstAssetIdTest() { + // TODO: test firstAssetId + } + + /** + * Test the property 'writer' + */ + @Test + public void writerTest() { + // TODO: test writer + } + + /** + * Test the property 'paginationKey' + */ + @Test + public void paginationKeyTest() { + // TODO: test paginationKey + } + + /** + * Test the property 'paginationWriter' + */ + @Test + public void paginationWriterTest() { + // TODO: test paginationWriter + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + + /** + * Test the property 'txHash' + */ + @Test + public void txHashTest() { + // TODO: test txHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java new file mode 100644 index 0000000000..310ab409c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1Params; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequestV1 + */ +public class RunTransactionRequestV1Test { + private final RunTransactionRequestV1 model = new RunTransactionRequestV1(); + + /** + * Model tests for RunTransactionRequestV1 + */ + @Test + public void testRunTransactionRequestV1() { + // TODO: test RunTransactionRequestV1 + } + + /** + * Test the property 'commandName' + */ + @Test + public void commandNameTest() { + // TODO: test commandName + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..ed231afe42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java new file mode 100644 index 0000000000..9493269c0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionSignedRequestV1 + */ +public class RunTransactionSignedRequestV1Test { + private final RunTransactionSignedRequestV1 model = new RunTransactionSignedRequestV1(); + + /** + * Model tests for RunTransactionSignedRequestV1 + */ + @Test + public void testRunTransactionSignedRequestV1() { + // TODO: test RunTransactionSignedRequestV1 + } + + /** + * Test the property 'signedTransaction' + */ + @Test + public void signedTransactionTest() { + // TODO: test signedTransaction + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java new file mode 100644 index 0000000000..ba15d08ce0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetAccountDetailRequestParameters + */ +public class SetAccountDetailRequestParametersTest { + private final SetAccountDetailRequestParameters model = new SetAccountDetailRequestParameters(); + + /** + * Model tests for SetAccountDetailRequestParameters + */ + @Test + public void testSetAccountDetailRequestParameters() { + // TODO: test SetAccountDetailRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java new file mode 100644 index 0000000000..5e260fb250 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetAccountQuorumRequestParameters + */ +public class SetAccountQuorumRequestParametersTest { + private final SetAccountQuorumRequestParameters model = new SetAccountQuorumRequestParameters(); + + /** + * Model tests for SetAccountQuorumRequestParameters + */ + @Test + public void testSetAccountQuorumRequestParameters() { + // TODO: test SetAccountQuorumRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java new file mode 100644 index 0000000000..a353cb8220 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SubtractAssetQuantityRequestParameters + */ +public class SubtractAssetQuantityRequestParametersTest { + private final SubtractAssetQuantityRequestParameters model = new SubtractAssetQuantityRequestParameters(); + + /** + * Model tests for SubtractAssetQuantityRequestParameters + */ + @Test + public void testSubtractAssetQuantityRequestParameters() { + // TODO: test SubtractAssetQuantityRequestParameters + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java new file mode 100644 index 0000000000..a72ecd3e49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java @@ -0,0 +1,81 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferAssetRequestParameters + */ +public class TransferAssetRequestParametersTest { + private final TransferAssetRequestParameters model = new TransferAssetRequestParameters(); + + /** + * Model tests for TransferAssetRequestParameters + */ + @Test + public void testTransferAssetRequestParameters() { + // TODO: test TransferAssetRequestParameters + } + + /** + * Test the property 'srcAccountId' + */ + @Test + public void srcAccountIdTest() { + // TODO: test srcAccountId + } + + /** + * Test the property 'destAccountId' + */ + @Test + public void destAccountIdTest() { + // TODO: test destAccountId + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 0000000000..53a4708001 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/package.json b/packages/cactus-plugin-ledger-connector-iroha2/package.json index 8e912dd731..ba27a87d4e 100644 --- a/packages/cactus-plugin-ledger-connector-iroha2/package.json +++ b/packages/cactus-plugin-ledger-connector-iroha2/package.json @@ -43,7 +43,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore" + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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" }, "dependencies": { "@hyperledger/cactus-common": "2.0.0-alpha.2", diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..09bee155a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..1a77910f3e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,142 @@ +# Go API client for cactus-plugin-ledger-connector-iroha2 + +Can perform basic tasks on a Iroha V2 ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-iroha2 "github.com/hyperledger/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GenerateTransactionV1**](docs/DefaultApi.md#generatetransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**QueryV1**](docs/DefaultApi.md#queryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query | Executes a query on a Iroha V2 ledger and returns it's results. +*DefaultApi* | [**TransactV1**](docs/DefaultApi.md#transactv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact | Executes a transaction on a Iroha V2 ledger (by sending some instructions) + + +## Documentation For Models + + - [BlockTypeV1](docs/BlockTypeV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GenerateTransactionRequestV1Request](docs/GenerateTransactionRequestV1Request.md) + - [Iroha2AccountId](docs/Iroha2AccountId.md) + - [Iroha2BaseConfig](docs/Iroha2BaseConfig.md) + - [Iroha2BaseConfigSigningCredential](docs/Iroha2BaseConfigSigningCredential.md) + - [Iroha2BaseConfigTorii](docs/Iroha2BaseConfigTorii.md) + - [Iroha2KeyJson](docs/Iroha2KeyJson.md) + - [Iroha2KeyPair](docs/Iroha2KeyPair.md) + - [IrohaInstruction](docs/IrohaInstruction.md) + - [IrohaInstructionRequestV1](docs/IrohaInstructionRequestV1.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaQueryDefinitionV1](docs/IrohaQueryDefinitionV1.md) + - [IrohaSignedQueryDefinitionV1](docs/IrohaSignedQueryDefinitionV1.md) + - [IrohaTransactionDefinitionV1](docs/IrohaTransactionDefinitionV1.md) + - [IrohaTransactionDefinitionV1Instruction](docs/IrohaTransactionDefinitionV1Instruction.md) + - [IrohaTransactionParametersV1](docs/IrohaTransactionParametersV1.md) + - [KeychainReference](docs/KeychainReference.md) + - [QueryRequestV1](docs/QueryRequestV1.md) + - [QueryResponseV1](docs/QueryResponseV1.md) + - [TransactRequestV1](docs/TransactRequestV1.md) + - [TransactResponseV1](docs/TransactResponseV1.md) + - [TransactionStatusV1](docs/TransactionStatusV1.md) + - [WatchBlocksBinaryResponseV1](docs/WatchBlocksBinaryResponseV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksRawResponseV1](docs/WatchBlocksRawResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..a355d74501 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,585 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha V2 ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha V2 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact: + post: + operationId: TransactV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransactRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha V2 ledger (by sending some instructions) + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..4c599015a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,368 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGenerateTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + generateTransactionRequestV1 *GenerateTransactionRequestV1 +} + +func (r ApiGenerateTransactionV1Request) GenerateTransactionRequestV1(generateTransactionRequestV1 GenerateTransactionRequestV1) ApiGenerateTransactionV1Request { + r.generateTransactionRequestV1 = &generateTransactionRequestV1 + return r +} + +func (r ApiGenerateTransactionV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GenerateTransactionV1Execute(r) +} + +/* +GenerateTransactionV1 Generate transaction that can be signed locally. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateTransactionV1Request +*/ +func (a *DefaultApiService) GenerateTransactionV1(ctx context.Context) ApiGenerateTransactionV1Request { + return ApiGenerateTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GenerateTransactionV1Execute(r ApiGenerateTransactionV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GenerateTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.generateTransactionRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiQueryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + queryRequestV1 *QueryRequestV1 +} + +func (r ApiQueryV1Request) QueryRequestV1(queryRequestV1 QueryRequestV1) ApiQueryV1Request { + r.queryRequestV1 = &queryRequestV1 + return r +} + +func (r ApiQueryV1Request) Execute() (*QueryResponseV1, *http.Response, error) { + return r.ApiService.QueryV1Execute(r) +} + +/* +QueryV1 Executes a query on a Iroha V2 ledger and returns it's results. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiQueryV1Request +*/ +func (a *DefaultApiService) QueryV1(ctx context.Context) ApiQueryV1Request { + return ApiQueryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return QueryResponseV1 +func (a *DefaultApiService) QueryV1Execute(r ApiQueryV1Request) (*QueryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QueryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.QueryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.queryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTransactV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transactRequestV1 *TransactRequestV1 +} + +func (r ApiTransactV1Request) TransactRequestV1(transactRequestV1 TransactRequestV1) ApiTransactV1Request { + r.transactRequestV1 = &transactRequestV1 + return r +} + +func (r ApiTransactV1Request) Execute() (*TransactResponseV1, *http.Response, error) { + return r.ApiService.TransactV1Execute(r) +} + +/* +TransactV1 Executes a transaction on a Iroha V2 ledger (by sending some instructions) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTransactV1Request +*/ +func (a *DefaultApiService) TransactV1(ctx context.Context) ApiTransactV1Request { + return ApiTransactV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TransactResponseV1 +func (a *DefaultApiService) TransactV1Execute(r ApiTransactV1Request) (*TransactResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransactResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TransactV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transactRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..feaeb4ab57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Iroha V2 API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..6e408b5287 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..53dead7bae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..2a2fe99e0e --- /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 0000000000..c966c8ddfd --- /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 0000000000..5ad1706ecd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_block_type_v1.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// BlockTypeV1 Iroha V2 block response type. +type BlockTypeV1 string + +// List of BlockTypeV1 +const ( + Raw BlockTypeV1 = "raw" + Binary BlockTypeV1 = "binary" +) + +// All allowed values of BlockTypeV1 enum +var AllowedBlockTypeV1EnumValues = []BlockTypeV1{ + "raw", + "binary", +} + +func (v *BlockTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BlockTypeV1(value) + for _, existing := range AllowedBlockTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BlockTypeV1", value) +} + +// NewBlockTypeV1FromValue returns a pointer to a valid BlockTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBlockTypeV1FromValue(v string) (*BlockTypeV1, error) { + ev := BlockTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BlockTypeV1: valid values are %v", v, AllowedBlockTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BlockTypeV1) IsValid() bool { + for _, existing := range AllowedBlockTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BlockTypeV1 value +func (v BlockTypeV1) Ptr() *BlockTypeV1 { + return &v +} + +type NullableBlockTypeV1 struct { + value *BlockTypeV1 + isSet bool +} + +func (v NullableBlockTypeV1) Get() *BlockTypeV1 { + return v.value +} + +func (v *NullableBlockTypeV1) Set(val *BlockTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableBlockTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableBlockTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlockTypeV1(val *BlockTypeV1) *NullableBlockTypeV1 { + return &NullableBlockTypeV1{value: val, isSet: true} +} + +func (v NullableBlockTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlockTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 0000000000..1c2eab38a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 Error response from the connector. +type ErrorExceptionResponseV1 struct { + // Short error description message. + Message string `json:"message"` + // Detailed error information. + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go new file mode 100644 index 0000000000..f76d80a23a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the GenerateTransactionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenerateTransactionRequestV1{} + +// GenerateTransactionRequestV1 Request for generating transaction or query payload that can be signed on the client side. +type GenerateTransactionRequestV1 struct { + Request GenerateTransactionRequestV1Request `json:"request"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewGenerateTransactionRequestV1 instantiates a new GenerateTransactionRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenerateTransactionRequestV1(request GenerateTransactionRequestV1Request) *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + this.Request = request + return &this +} + +// NewGenerateTransactionRequestV1WithDefaults instantiates a new GenerateTransactionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenerateTransactionRequestV1WithDefaults() *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + return &this +} + +// GetRequest returns the Request field value +func (o *GenerateTransactionRequestV1) GetRequest() GenerateTransactionRequestV1Request { + if o == nil { + var ret GenerateTransactionRequestV1Request + return ret + } + + return o.Request +} + +// GetRequestOk returns a tuple with the Request field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetRequestOk() (*GenerateTransactionRequestV1Request, bool) { + if o == nil { + return nil, false + } + return &o.Request, true +} + +// SetRequest sets field value +func (o *GenerateTransactionRequestV1) SetRequest(v GenerateTransactionRequestV1Request) { + o.Request = v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *GenerateTransactionRequestV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *GenerateTransactionRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *GenerateTransactionRequestV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o GenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenerateTransactionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["request"] = o.Request + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableGenerateTransactionRequestV1 struct { + value *GenerateTransactionRequestV1 + isSet bool +} + +func (v NullableGenerateTransactionRequestV1) Get() *GenerateTransactionRequestV1 { + return v.value +} + +func (v *NullableGenerateTransactionRequestV1) Set(val *GenerateTransactionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateTransactionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateTransactionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateTransactionRequestV1(val *GenerateTransactionRequestV1) *NullableGenerateTransactionRequestV1 { + return &NullableGenerateTransactionRequestV1{value: val, isSet: true} +} + +func (v NullableGenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateTransactionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go new file mode 100644 index 0000000000..0c0f16a642 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// GenerateTransactionRequestV1Request - struct for GenerateTransactionRequestV1Request +type GenerateTransactionRequestV1Request struct { + IrohaQueryDefinitionV1 *IrohaQueryDefinitionV1 + IrohaTransactionDefinitionV1 *IrohaTransactionDefinitionV1 +} + +// IrohaQueryDefinitionV1AsGenerateTransactionRequestV1Request is a convenience function that returns IrohaQueryDefinitionV1 wrapped in GenerateTransactionRequestV1Request +func IrohaQueryDefinitionV1AsGenerateTransactionRequestV1Request(v *IrohaQueryDefinitionV1) GenerateTransactionRequestV1Request { + return GenerateTransactionRequestV1Request{ + IrohaQueryDefinitionV1: v, + } +} + +// IrohaTransactionDefinitionV1AsGenerateTransactionRequestV1Request is a convenience function that returns IrohaTransactionDefinitionV1 wrapped in GenerateTransactionRequestV1Request +func IrohaTransactionDefinitionV1AsGenerateTransactionRequestV1Request(v *IrohaTransactionDefinitionV1) GenerateTransactionRequestV1Request { + return GenerateTransactionRequestV1Request{ + IrohaTransactionDefinitionV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GenerateTransactionRequestV1Request) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IrohaQueryDefinitionV1 + err = newStrictDecoder(data).Decode(&dst.IrohaQueryDefinitionV1) + if err == nil { + jsonIrohaQueryDefinitionV1, _ := json.Marshal(dst.IrohaQueryDefinitionV1) + if string(jsonIrohaQueryDefinitionV1) == "{}" { // empty struct + dst.IrohaQueryDefinitionV1 = nil + } else { + match++ + } + } else { + dst.IrohaQueryDefinitionV1 = nil + } + + // try to unmarshal data into IrohaTransactionDefinitionV1 + err = newStrictDecoder(data).Decode(&dst.IrohaTransactionDefinitionV1) + if err == nil { + jsonIrohaTransactionDefinitionV1, _ := json.Marshal(dst.IrohaTransactionDefinitionV1) + if string(jsonIrohaTransactionDefinitionV1) == "{}" { // empty struct + dst.IrohaTransactionDefinitionV1 = nil + } else { + match++ + } + } else { + dst.IrohaTransactionDefinitionV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IrohaQueryDefinitionV1 = nil + dst.IrohaTransactionDefinitionV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GenerateTransactionRequestV1Request)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GenerateTransactionRequestV1Request)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GenerateTransactionRequestV1Request) MarshalJSON() ([]byte, error) { + if src.IrohaQueryDefinitionV1 != nil { + return json.Marshal(&src.IrohaQueryDefinitionV1) + } + + if src.IrohaTransactionDefinitionV1 != nil { + return json.Marshal(&src.IrohaTransactionDefinitionV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GenerateTransactionRequestV1Request) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.IrohaQueryDefinitionV1 != nil { + return obj.IrohaQueryDefinitionV1 + } + + if obj.IrohaTransactionDefinitionV1 != nil { + return obj.IrohaTransactionDefinitionV1 + } + + // all schemas are nil + return nil +} + +type NullableGenerateTransactionRequestV1Request struct { + value *GenerateTransactionRequestV1Request + isSet bool +} + +func (v NullableGenerateTransactionRequestV1Request) Get() *GenerateTransactionRequestV1Request { + return v.value +} + +func (v *NullableGenerateTransactionRequestV1Request) Set(val *GenerateTransactionRequestV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateTransactionRequestV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateTransactionRequestV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateTransactionRequestV1Request(val *GenerateTransactionRequestV1Request) *NullableGenerateTransactionRequestV1Request { + return &NullableGenerateTransactionRequestV1Request{value: val, isSet: true} +} + +func (v NullableGenerateTransactionRequestV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateTransactionRequestV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go new file mode 100644 index 0000000000..871a94cd6e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2AccountId type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2AccountId{} + +// Iroha2AccountId Iroha V2 account ID. +type Iroha2AccountId struct { + Name string `json:"name"` + DomainId string `json:"domainId"` +} + +// NewIroha2AccountId instantiates a new Iroha2AccountId object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIroha2AccountId(name string, domainId string) *Iroha2AccountId { + this := Iroha2AccountId{} + this.Name = name + this.DomainId = domainId + return &this +} + +// NewIroha2AccountIdWithDefaults instantiates a new Iroha2AccountId object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2AccountIdWithDefaults() *Iroha2AccountId { + this := Iroha2AccountId{} + return &this +} + +// GetName returns the Name field value +func (o *Iroha2AccountId) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Iroha2AccountId) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Iroha2AccountId) SetName(v string) { + o.Name = v +} + +// GetDomainId returns the DomainId field value +func (o *Iroha2AccountId) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *Iroha2AccountId) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *Iroha2AccountId) SetDomainId(v string) { + o.DomainId = v +} + +func (o Iroha2AccountId) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2AccountId) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["domainId"] = o.DomainId + return toSerialize, nil +} + +type NullableIroha2AccountId struct { + value *Iroha2AccountId + isSet bool +} + +func (v NullableIroha2AccountId) Get() *Iroha2AccountId { + return v.value +} + +func (v *NullableIroha2AccountId) Set(val *Iroha2AccountId) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2AccountId) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2AccountId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2AccountId(val *Iroha2AccountId) *NullableIroha2AccountId { + return &NullableIroha2AccountId{value: val, isSet: true} +} + +func (v NullableIroha2AccountId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2AccountId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go new file mode 100644 index 0000000000..638f79d92b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2BaseConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2BaseConfig{} + +// Iroha2BaseConfig Iroha V2 connection configuration. +type Iroha2BaseConfig struct { + Torii Iroha2BaseConfigTorii `json:"torii"` + AccountId *Iroha2AccountId `json:"accountId,omitempty"` + SigningCredential *Iroha2BaseConfigSigningCredential `json:"signingCredential,omitempty"` +} + +// NewIroha2BaseConfig instantiates a new Iroha2BaseConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIroha2BaseConfig(torii Iroha2BaseConfigTorii) *Iroha2BaseConfig { + this := Iroha2BaseConfig{} + this.Torii = torii + return &this +} + +// NewIroha2BaseConfigWithDefaults instantiates a new Iroha2BaseConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2BaseConfigWithDefaults() *Iroha2BaseConfig { + this := Iroha2BaseConfig{} + return &this +} + +// GetTorii returns the Torii field value +func (o *Iroha2BaseConfig) GetTorii() Iroha2BaseConfigTorii { + if o == nil { + var ret Iroha2BaseConfigTorii + return ret + } + + return o.Torii +} + +// GetToriiOk returns a tuple with the Torii field value +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfig) GetToriiOk() (*Iroha2BaseConfigTorii, bool) { + if o == nil { + return nil, false + } + return &o.Torii, true +} + +// SetTorii sets field value +func (o *Iroha2BaseConfig) SetTorii(v Iroha2BaseConfigTorii) { + o.Torii = v +} + +// GetAccountId returns the AccountId field value if set, zero value otherwise. +func (o *Iroha2BaseConfig) GetAccountId() Iroha2AccountId { + if o == nil || IsNil(o.AccountId) { + var ret Iroha2AccountId + return ret + } + return *o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfig) GetAccountIdOk() (*Iroha2AccountId, bool) { + if o == nil || IsNil(o.AccountId) { + return nil, false + } + return o.AccountId, true +} + +// HasAccountId returns a boolean if a field has been set. +func (o *Iroha2BaseConfig) HasAccountId() bool { + if o != nil && !IsNil(o.AccountId) { + return true + } + + return false +} + +// SetAccountId gets a reference to the given Iroha2AccountId and assigns it to the AccountId field. +func (o *Iroha2BaseConfig) SetAccountId(v Iroha2AccountId) { + o.AccountId = &v +} + +// GetSigningCredential returns the SigningCredential field value if set, zero value otherwise. +func (o *Iroha2BaseConfig) GetSigningCredential() Iroha2BaseConfigSigningCredential { + if o == nil || IsNil(o.SigningCredential) { + var ret Iroha2BaseConfigSigningCredential + return ret + } + return *o.SigningCredential +} + +// GetSigningCredentialOk returns a tuple with the SigningCredential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfig) GetSigningCredentialOk() (*Iroha2BaseConfigSigningCredential, bool) { + if o == nil || IsNil(o.SigningCredential) { + return nil, false + } + return o.SigningCredential, true +} + +// HasSigningCredential returns a boolean if a field has been set. +func (o *Iroha2BaseConfig) HasSigningCredential() bool { + if o != nil && !IsNil(o.SigningCredential) { + return true + } + + return false +} + +// SetSigningCredential gets a reference to the given Iroha2BaseConfigSigningCredential and assigns it to the SigningCredential field. +func (o *Iroha2BaseConfig) SetSigningCredential(v Iroha2BaseConfigSigningCredential) { + o.SigningCredential = &v +} + +func (o Iroha2BaseConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2BaseConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["torii"] = o.Torii + if !IsNil(o.AccountId) { + toSerialize["accountId"] = o.AccountId + } + if !IsNil(o.SigningCredential) { + toSerialize["signingCredential"] = o.SigningCredential + } + return toSerialize, nil +} + +type NullableIroha2BaseConfig struct { + value *Iroha2BaseConfig + isSet bool +} + +func (v NullableIroha2BaseConfig) Get() *Iroha2BaseConfig { + return v.value +} + +func (v *NullableIroha2BaseConfig) Set(val *Iroha2BaseConfig) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2BaseConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2BaseConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2BaseConfig(val *Iroha2BaseConfig) *NullableIroha2BaseConfig { + return &NullableIroha2BaseConfig{value: val, isSet: true} +} + +func (v NullableIroha2BaseConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2BaseConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go new file mode 100644 index 0000000000..9967a35c8c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// Iroha2BaseConfigSigningCredential - struct for Iroha2BaseConfigSigningCredential +type Iroha2BaseConfigSigningCredential struct { + Iroha2KeyPair *Iroha2KeyPair + KeychainReference *KeychainReference +} + +// Iroha2KeyPairAsIroha2BaseConfigSigningCredential is a convenience function that returns Iroha2KeyPair wrapped in Iroha2BaseConfigSigningCredential +func Iroha2KeyPairAsIroha2BaseConfigSigningCredential(v *Iroha2KeyPair) Iroha2BaseConfigSigningCredential { + return Iroha2BaseConfigSigningCredential{ + Iroha2KeyPair: v, + } +} + +// KeychainReferenceAsIroha2BaseConfigSigningCredential is a convenience function that returns KeychainReference wrapped in Iroha2BaseConfigSigningCredential +func KeychainReferenceAsIroha2BaseConfigSigningCredential(v *KeychainReference) Iroha2BaseConfigSigningCredential { + return Iroha2BaseConfigSigningCredential{ + KeychainReference: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Iroha2BaseConfigSigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Iroha2KeyPair + err = newStrictDecoder(data).Decode(&dst.Iroha2KeyPair) + if err == nil { + jsonIroha2KeyPair, _ := json.Marshal(dst.Iroha2KeyPair) + if string(jsonIroha2KeyPair) == "{}" { // empty struct + dst.Iroha2KeyPair = nil + } else { + match++ + } + } else { + dst.Iroha2KeyPair = nil + } + + // try to unmarshal data into KeychainReference + err = newStrictDecoder(data).Decode(&dst.KeychainReference) + if err == nil { + jsonKeychainReference, _ := json.Marshal(dst.KeychainReference) + if string(jsonKeychainReference) == "{}" { // empty struct + dst.KeychainReference = nil + } else { + match++ + } + } else { + dst.KeychainReference = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Iroha2KeyPair = nil + dst.KeychainReference = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Iroha2BaseConfigSigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Iroha2BaseConfigSigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Iroha2BaseConfigSigningCredential) MarshalJSON() ([]byte, error) { + if src.Iroha2KeyPair != nil { + return json.Marshal(&src.Iroha2KeyPair) + } + + if src.KeychainReference != nil { + return json.Marshal(&src.KeychainReference) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Iroha2BaseConfigSigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Iroha2KeyPair != nil { + return obj.Iroha2KeyPair + } + + if obj.KeychainReference != nil { + return obj.KeychainReference + } + + // all schemas are nil + return nil +} + +type NullableIroha2BaseConfigSigningCredential struct { + value *Iroha2BaseConfigSigningCredential + isSet bool +} + +func (v NullableIroha2BaseConfigSigningCredential) Get() *Iroha2BaseConfigSigningCredential { + return v.value +} + +func (v *NullableIroha2BaseConfigSigningCredential) Set(val *Iroha2BaseConfigSigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2BaseConfigSigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2BaseConfigSigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2BaseConfigSigningCredential(val *Iroha2BaseConfigSigningCredential) *NullableIroha2BaseConfigSigningCredential { + return &NullableIroha2BaseConfigSigningCredential{value: val, isSet: true} +} + +func (v NullableIroha2BaseConfigSigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2BaseConfigSigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go new file mode 100644 index 0000000000..98dcbb3433 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2BaseConfigTorii type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2BaseConfigTorii{} + +// Iroha2BaseConfigTorii Iroha V2 peer connection information. +type Iroha2BaseConfigTorii struct { + ApiURL *string `json:"apiURL,omitempty"` + TelemetryURL *string `json:"telemetryURL,omitempty"` +} + +// NewIroha2BaseConfigTorii instantiates a new Iroha2BaseConfigTorii object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIroha2BaseConfigTorii() *Iroha2BaseConfigTorii { + this := Iroha2BaseConfigTorii{} + return &this +} + +// NewIroha2BaseConfigToriiWithDefaults instantiates a new Iroha2BaseConfigTorii object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2BaseConfigToriiWithDefaults() *Iroha2BaseConfigTorii { + this := Iroha2BaseConfigTorii{} + return &this +} + +// GetApiURL returns the ApiURL field value if set, zero value otherwise. +func (o *Iroha2BaseConfigTorii) GetApiURL() string { + if o == nil || IsNil(o.ApiURL) { + var ret string + return ret + } + return *o.ApiURL +} + +// GetApiURLOk returns a tuple with the ApiURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfigTorii) GetApiURLOk() (*string, bool) { + if o == nil || IsNil(o.ApiURL) { + return nil, false + } + return o.ApiURL, true +} + +// HasApiURL returns a boolean if a field has been set. +func (o *Iroha2BaseConfigTorii) HasApiURL() bool { + if o != nil && !IsNil(o.ApiURL) { + return true + } + + return false +} + +// SetApiURL gets a reference to the given string and assigns it to the ApiURL field. +func (o *Iroha2BaseConfigTorii) SetApiURL(v string) { + o.ApiURL = &v +} + +// GetTelemetryURL returns the TelemetryURL field value if set, zero value otherwise. +func (o *Iroha2BaseConfigTorii) GetTelemetryURL() string { + if o == nil || IsNil(o.TelemetryURL) { + var ret string + return ret + } + return *o.TelemetryURL +} + +// GetTelemetryURLOk returns a tuple with the TelemetryURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfigTorii) GetTelemetryURLOk() (*string, bool) { + if o == nil || IsNil(o.TelemetryURL) { + return nil, false + } + return o.TelemetryURL, true +} + +// HasTelemetryURL returns a boolean if a field has been set. +func (o *Iroha2BaseConfigTorii) HasTelemetryURL() bool { + if o != nil && !IsNil(o.TelemetryURL) { + return true + } + + return false +} + +// SetTelemetryURL gets a reference to the given string and assigns it to the TelemetryURL field. +func (o *Iroha2BaseConfigTorii) SetTelemetryURL(v string) { + o.TelemetryURL = &v +} + +func (o Iroha2BaseConfigTorii) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2BaseConfigTorii) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ApiURL) { + toSerialize["apiURL"] = o.ApiURL + } + if !IsNil(o.TelemetryURL) { + toSerialize["telemetryURL"] = o.TelemetryURL + } + return toSerialize, nil +} + +type NullableIroha2BaseConfigTorii struct { + value *Iroha2BaseConfigTorii + isSet bool +} + +func (v NullableIroha2BaseConfigTorii) Get() *Iroha2BaseConfigTorii { + return v.value +} + +func (v *NullableIroha2BaseConfigTorii) Set(val *Iroha2BaseConfigTorii) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2BaseConfigTorii) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2BaseConfigTorii) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2BaseConfigTorii(val *Iroha2BaseConfigTorii) *NullableIroha2BaseConfigTorii { + return &NullableIroha2BaseConfigTorii{value: val, isSet: true} +} + +func (v NullableIroha2BaseConfigTorii) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2BaseConfigTorii) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go new file mode 100644 index 0000000000..695510712f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2KeyJson type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2KeyJson{} + +// Iroha2KeyJson Private/Public key JSON containing payload and digest function. +type Iroha2KeyJson struct { + DigestFunction string `json:"digestFunction"` + Payload string `json:"payload"` +} + +// NewIroha2KeyJson instantiates a new Iroha2KeyJson object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIroha2KeyJson(digestFunction string, payload string) *Iroha2KeyJson { + this := Iroha2KeyJson{} + this.DigestFunction = digestFunction + this.Payload = payload + return &this +} + +// NewIroha2KeyJsonWithDefaults instantiates a new Iroha2KeyJson object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2KeyJsonWithDefaults() *Iroha2KeyJson { + this := Iroha2KeyJson{} + return &this +} + +// GetDigestFunction returns the DigestFunction field value +func (o *Iroha2KeyJson) GetDigestFunction() string { + if o == nil { + var ret string + return ret + } + + return o.DigestFunction +} + +// GetDigestFunctionOk returns a tuple with the DigestFunction field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyJson) GetDigestFunctionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DigestFunction, true +} + +// SetDigestFunction sets field value +func (o *Iroha2KeyJson) SetDigestFunction(v string) { + o.DigestFunction = v +} + +// GetPayload returns the Payload field value +func (o *Iroha2KeyJson) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyJson) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *Iroha2KeyJson) SetPayload(v string) { + o.Payload = v +} + +func (o Iroha2KeyJson) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2KeyJson) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["digestFunction"] = o.DigestFunction + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +type NullableIroha2KeyJson struct { + value *Iroha2KeyJson + isSet bool +} + +func (v NullableIroha2KeyJson) Get() *Iroha2KeyJson { + return v.value +} + +func (v *NullableIroha2KeyJson) Set(val *Iroha2KeyJson) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2KeyJson) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2KeyJson) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2KeyJson(val *Iroha2KeyJson) *NullableIroha2KeyJson { + return &NullableIroha2KeyJson{value: val, isSet: true} +} + +func (v NullableIroha2KeyJson) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2KeyJson) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go new file mode 100644 index 0000000000..31b7dbc0d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2KeyPair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2KeyPair{} + +// Iroha2KeyPair Pair of Iroha account private and public keys. +type Iroha2KeyPair struct { + PrivateKey Iroha2KeyJson `json:"privateKey"` + PublicKey string `json:"publicKey"` +} + +// NewIroha2KeyPair instantiates a new Iroha2KeyPair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIroha2KeyPair(privateKey Iroha2KeyJson, publicKey string) *Iroha2KeyPair { + this := Iroha2KeyPair{} + this.PrivateKey = privateKey + this.PublicKey = publicKey + return &this +} + +// NewIroha2KeyPairWithDefaults instantiates a new Iroha2KeyPair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2KeyPairWithDefaults() *Iroha2KeyPair { + this := Iroha2KeyPair{} + return &this +} + +// GetPrivateKey returns the PrivateKey field value +func (o *Iroha2KeyPair) GetPrivateKey() Iroha2KeyJson { + if o == nil { + var ret Iroha2KeyJson + return ret + } + + return o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyPair) GetPrivateKeyOk() (*Iroha2KeyJson, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKey, true +} + +// SetPrivateKey sets field value +func (o *Iroha2KeyPair) SetPrivateKey(v Iroha2KeyJson) { + o.PrivateKey = v +} + +// GetPublicKey returns the PublicKey field value +func (o *Iroha2KeyPair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyPair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *Iroha2KeyPair) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o Iroha2KeyPair) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2KeyPair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["privateKey"] = o.PrivateKey + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableIroha2KeyPair struct { + value *Iroha2KeyPair + isSet bool +} + +func (v NullableIroha2KeyPair) Get() *Iroha2KeyPair { + return v.value +} + +func (v *NullableIroha2KeyPair) Set(val *Iroha2KeyPair) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2KeyPair) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2KeyPair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2KeyPair(val *Iroha2KeyPair) *NullableIroha2KeyPair { + return &NullableIroha2KeyPair{value: val, isSet: true} +} + +func (v NullableIroha2KeyPair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2KeyPair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go new file mode 100644 index 0000000000..e59196c5c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// IrohaInstruction Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) +type IrohaInstruction string + +// List of IrohaInstruction +const ( + RegisterDomain IrohaInstruction = "registerDomain" + RegisterAssetDefinition IrohaInstruction = "registerAssetDefinition" + RegisterAsset IrohaInstruction = "registerAsset" + MintAsset IrohaInstruction = "mintAsset" + BurnAsset IrohaInstruction = "burnAsset" + TransferAsset IrohaInstruction = "transferAsset" + RegisterAccount IrohaInstruction = "registerAccount" +) + +// All allowed values of IrohaInstruction enum +var AllowedIrohaInstructionEnumValues = []IrohaInstruction{ + "registerDomain", + "registerAssetDefinition", + "registerAsset", + "mintAsset", + "burnAsset", + "transferAsset", + "registerAccount", +} + +func (v *IrohaInstruction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaInstruction(value) + for _, existing := range AllowedIrohaInstructionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaInstruction", value) +} + +// NewIrohaInstructionFromValue returns a pointer to a valid IrohaInstruction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaInstructionFromValue(v string) (*IrohaInstruction, error) { + ev := IrohaInstruction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaInstruction: valid values are %v", v, AllowedIrohaInstructionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaInstruction) IsValid() bool { + for _, existing := range AllowedIrohaInstructionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaInstruction value +func (v IrohaInstruction) Ptr() *IrohaInstruction { + return &v +} + +type NullableIrohaInstruction struct { + value *IrohaInstruction + isSet bool +} + +func (v NullableIrohaInstruction) Get() *IrohaInstruction { + return v.value +} + +func (v *NullableIrohaInstruction) Set(val *IrohaInstruction) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaInstruction) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaInstruction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaInstruction(val *IrohaInstruction) *NullableIrohaInstruction { + return &NullableIrohaInstruction{value: val, isSet: true} +} + +func (v NullableIrohaInstruction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaInstruction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go new file mode 100644 index 0000000000..143d03a775 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaInstructionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaInstructionRequestV1{} + +// IrohaInstructionRequestV1 Single Iroha V2 instruction to be executed request. +type IrohaInstructionRequestV1 struct { + // Iroha V2 instruction name. + Name IrohaInstruction `json:"name"` + // The list of arguments to pass with specified instruction. + Params []interface{} `json:"params"` +} + +// NewIrohaInstructionRequestV1 instantiates a new IrohaInstructionRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaInstructionRequestV1(name IrohaInstruction, params []interface{}) *IrohaInstructionRequestV1 { + this := IrohaInstructionRequestV1{} + this.Name = name + this.Params = params + return &this +} + +// NewIrohaInstructionRequestV1WithDefaults instantiates a new IrohaInstructionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaInstructionRequestV1WithDefaults() *IrohaInstructionRequestV1 { + this := IrohaInstructionRequestV1{} + return &this +} + +// GetName returns the Name field value +func (o *IrohaInstructionRequestV1) GetName() IrohaInstruction { + if o == nil { + var ret IrohaInstruction + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IrohaInstructionRequestV1) GetNameOk() (*IrohaInstruction, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IrohaInstructionRequestV1) SetName(v IrohaInstruction) { + o.Name = v +} + +// GetParams returns the Params field value +func (o *IrohaInstructionRequestV1) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *IrohaInstructionRequestV1) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *IrohaInstructionRequestV1) SetParams(v []interface{}) { + o.Params = v +} + +func (o IrohaInstructionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaInstructionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["params"] = o.Params + return toSerialize, nil +} + +type NullableIrohaInstructionRequestV1 struct { + value *IrohaInstructionRequestV1 + isSet bool +} + +func (v NullableIrohaInstructionRequestV1) Get() *IrohaInstructionRequestV1 { + return v.value +} + +func (v *NullableIrohaInstructionRequestV1) Set(val *IrohaInstructionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaInstructionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaInstructionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaInstructionRequestV1(val *IrohaInstructionRequestV1) *NullableIrohaInstructionRequestV1 { + return &NullableIrohaInstructionRequestV1{value: val, isSet: true} +} + +func (v NullableIrohaInstructionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaInstructionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go new file mode 100644 index 0000000000..98f0985de0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go @@ -0,0 +1,131 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// IrohaQuery Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) +type IrohaQuery string + +// List of IrohaQuery +const ( + FindAllDomains IrohaQuery = "findAllDomains" + FindDomainById IrohaQuery = "findDomainById" + FindAssetDefinitionById IrohaQuery = "findAssetDefinitionById" + FindAllAssetsDefinitions IrohaQuery = "findAllAssetsDefinitions" + FindAssetById IrohaQuery = "findAssetById" + FindAllAssets IrohaQuery = "findAllAssets" + FindAllPeers IrohaQuery = "findAllPeers" + FindAllBlocks IrohaQuery = "findAllBlocks" + FindAccountById IrohaQuery = "findAccountById" + FindAllAccounts IrohaQuery = "findAllAccounts" + FindAllTransactions IrohaQuery = "findAllTransactions" + FindTransactionByHash IrohaQuery = "findTransactionByHash" +) + +// All allowed values of IrohaQuery enum +var AllowedIrohaQueryEnumValues = []IrohaQuery{ + "findAllDomains", + "findDomainById", + "findAssetDefinitionById", + "findAllAssetsDefinitions", + "findAssetById", + "findAllAssets", + "findAllPeers", + "findAllBlocks", + "findAccountById", + "findAllAccounts", + "findAllTransactions", + "findTransactionByHash", +} + +func (v *IrohaQuery) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaQuery(value) + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaQuery", value) +} + +// NewIrohaQueryFromValue returns a pointer to a valid IrohaQuery +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaQueryFromValue(v string) (*IrohaQuery, error) { + ev := IrohaQuery(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaQuery: valid values are %v", v, AllowedIrohaQueryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaQuery) IsValid() bool { + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaQuery value +func (v IrohaQuery) Ptr() *IrohaQuery { + return &v +} + +type NullableIrohaQuery struct { + value *IrohaQuery + isSet bool +} + +func (v NullableIrohaQuery) Get() *IrohaQuery { + return v.value +} + +func (v *NullableIrohaQuery) Set(val *IrohaQuery) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaQuery(val *IrohaQuery) *NullableIrohaQuery { + return &NullableIrohaQuery{value: val, isSet: true} +} + +func (v NullableIrohaQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go new file mode 100644 index 0000000000..d34ef73358 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaQueryDefinitionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaQueryDefinitionV1{} + +// IrohaQueryDefinitionV1 Iroha V2 query definition. +type IrohaQueryDefinitionV1 struct { + // Name of the query to be executed. + Query IrohaQuery `json:"query"` + // The list of arguments to pass with the query. + Params []interface{} `json:"params,omitempty"` +} + +// NewIrohaQueryDefinitionV1 instantiates a new IrohaQueryDefinitionV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaQueryDefinitionV1(query IrohaQuery) *IrohaQueryDefinitionV1 { + this := IrohaQueryDefinitionV1{} + this.Query = query + return &this +} + +// NewIrohaQueryDefinitionV1WithDefaults instantiates a new IrohaQueryDefinitionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaQueryDefinitionV1WithDefaults() *IrohaQueryDefinitionV1 { + this := IrohaQueryDefinitionV1{} + return &this +} + +// GetQuery returns the Query field value +func (o *IrohaQueryDefinitionV1) GetQuery() IrohaQuery { + if o == nil { + var ret IrohaQuery + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *IrohaQueryDefinitionV1) GetQueryOk() (*IrohaQuery, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *IrohaQueryDefinitionV1) SetQuery(v IrohaQuery) { + o.Query = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *IrohaQueryDefinitionV1) GetParams() []interface{} { + if o == nil || IsNil(o.Params) { + var ret []interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaQueryDefinitionV1) GetParamsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *IrohaQueryDefinitionV1) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []interface{} and assigns it to the Params field. +func (o *IrohaQueryDefinitionV1) SetParams(v []interface{}) { + o.Params = v +} + +func (o IrohaQueryDefinitionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaQueryDefinitionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["query"] = o.Query + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableIrohaQueryDefinitionV1 struct { + value *IrohaQueryDefinitionV1 + isSet bool +} + +func (v NullableIrohaQueryDefinitionV1) Get() *IrohaQueryDefinitionV1 { + return v.value +} + +func (v *NullableIrohaQueryDefinitionV1) Set(val *IrohaQueryDefinitionV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaQueryDefinitionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaQueryDefinitionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaQueryDefinitionV1(val *IrohaQueryDefinitionV1) *NullableIrohaQueryDefinitionV1 { + return &NullableIrohaQueryDefinitionV1{value: val, isSet: true} +} + +func (v NullableIrohaQueryDefinitionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaQueryDefinitionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go new file mode 100644 index 0000000000..ccaafbebec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaSignedQueryDefinitionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaSignedQueryDefinitionV1{} + +// IrohaSignedQueryDefinitionV1 Iroha V2 signed query definition +type IrohaSignedQueryDefinitionV1 struct { + // Name of the query to be executed. + Query IrohaQuery `json:"query"` + // Signed query transaction binary data received from generate-transaction endpoint. + Payload string `json:"payload"` +} + +// NewIrohaSignedQueryDefinitionV1 instantiates a new IrohaSignedQueryDefinitionV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaSignedQueryDefinitionV1(query IrohaQuery, payload string) *IrohaSignedQueryDefinitionV1 { + this := IrohaSignedQueryDefinitionV1{} + this.Query = query + this.Payload = payload + return &this +} + +// NewIrohaSignedQueryDefinitionV1WithDefaults instantiates a new IrohaSignedQueryDefinitionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaSignedQueryDefinitionV1WithDefaults() *IrohaSignedQueryDefinitionV1 { + this := IrohaSignedQueryDefinitionV1{} + return &this +} + +// GetQuery returns the Query field value +func (o *IrohaSignedQueryDefinitionV1) GetQuery() IrohaQuery { + if o == nil { + var ret IrohaQuery + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *IrohaSignedQueryDefinitionV1) GetQueryOk() (*IrohaQuery, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *IrohaSignedQueryDefinitionV1) SetQuery(v IrohaQuery) { + o.Query = v +} + +// GetPayload returns the Payload field value +func (o *IrohaSignedQueryDefinitionV1) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *IrohaSignedQueryDefinitionV1) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *IrohaSignedQueryDefinitionV1) SetPayload(v string) { + o.Payload = v +} + +func (o IrohaSignedQueryDefinitionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaSignedQueryDefinitionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["query"] = o.Query + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +type NullableIrohaSignedQueryDefinitionV1 struct { + value *IrohaSignedQueryDefinitionV1 + isSet bool +} + +func (v NullableIrohaSignedQueryDefinitionV1) Get() *IrohaSignedQueryDefinitionV1 { + return v.value +} + +func (v *NullableIrohaSignedQueryDefinitionV1) Set(val *IrohaSignedQueryDefinitionV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaSignedQueryDefinitionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaSignedQueryDefinitionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaSignedQueryDefinitionV1(val *IrohaSignedQueryDefinitionV1) *NullableIrohaSignedQueryDefinitionV1 { + return &NullableIrohaSignedQueryDefinitionV1{value: val, isSet: true} +} + +func (v NullableIrohaSignedQueryDefinitionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaSignedQueryDefinitionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go new file mode 100644 index 0000000000..97f8e67ac2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaTransactionDefinitionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaTransactionDefinitionV1{} + +// IrohaTransactionDefinitionV1 Iroha V2 transaction definition +type IrohaTransactionDefinitionV1 struct { + Instruction IrohaTransactionDefinitionV1Instruction `json:"instruction"` + Params *IrohaTransactionParametersV1 `json:"params,omitempty"` +} + +// NewIrohaTransactionDefinitionV1 instantiates a new IrohaTransactionDefinitionV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaTransactionDefinitionV1(instruction IrohaTransactionDefinitionV1Instruction) *IrohaTransactionDefinitionV1 { + this := IrohaTransactionDefinitionV1{} + this.Instruction = instruction + return &this +} + +// NewIrohaTransactionDefinitionV1WithDefaults instantiates a new IrohaTransactionDefinitionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaTransactionDefinitionV1WithDefaults() *IrohaTransactionDefinitionV1 { + this := IrohaTransactionDefinitionV1{} + return &this +} + +// GetInstruction returns the Instruction field value +func (o *IrohaTransactionDefinitionV1) GetInstruction() IrohaTransactionDefinitionV1Instruction { + if o == nil { + var ret IrohaTransactionDefinitionV1Instruction + return ret + } + + return o.Instruction +} + +// GetInstructionOk returns a tuple with the Instruction field value +// and a boolean to check if the value has been set. +func (o *IrohaTransactionDefinitionV1) GetInstructionOk() (*IrohaTransactionDefinitionV1Instruction, bool) { + if o == nil { + return nil, false + } + return &o.Instruction, true +} + +// SetInstruction sets field value +func (o *IrohaTransactionDefinitionV1) SetInstruction(v IrohaTransactionDefinitionV1Instruction) { + o.Instruction = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *IrohaTransactionDefinitionV1) GetParams() IrohaTransactionParametersV1 { + if o == nil || IsNil(o.Params) { + var ret IrohaTransactionParametersV1 + return ret + } + return *o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionDefinitionV1) GetParamsOk() (*IrohaTransactionParametersV1, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *IrohaTransactionDefinitionV1) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given IrohaTransactionParametersV1 and assigns it to the Params field. +func (o *IrohaTransactionDefinitionV1) SetParams(v IrohaTransactionParametersV1) { + o.Params = &v +} + +func (o IrohaTransactionDefinitionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaTransactionDefinitionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instruction"] = o.Instruction + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableIrohaTransactionDefinitionV1 struct { + value *IrohaTransactionDefinitionV1 + isSet bool +} + +func (v NullableIrohaTransactionDefinitionV1) Get() *IrohaTransactionDefinitionV1 { + return v.value +} + +func (v *NullableIrohaTransactionDefinitionV1) Set(val *IrohaTransactionDefinitionV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaTransactionDefinitionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaTransactionDefinitionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaTransactionDefinitionV1(val *IrohaTransactionDefinitionV1) *NullableIrohaTransactionDefinitionV1 { + return &NullableIrohaTransactionDefinitionV1{value: val, isSet: true} +} + +func (v NullableIrohaTransactionDefinitionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaTransactionDefinitionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go new file mode 100644 index 0000000000..2242a4a2a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// IrohaTransactionDefinitionV1Instruction - struct for IrohaTransactionDefinitionV1Instruction +type IrohaTransactionDefinitionV1Instruction struct { + IrohaInstructionRequestV1 *IrohaInstructionRequestV1 + ArrayOfIrohaInstructionRequestV1 *[]IrohaInstructionRequestV1 +} + +// IrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction is a convenience function that returns IrohaInstructionRequestV1 wrapped in IrohaTransactionDefinitionV1Instruction +func IrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction(v *IrohaInstructionRequestV1) IrohaTransactionDefinitionV1Instruction { + return IrohaTransactionDefinitionV1Instruction{ + IrohaInstructionRequestV1: v, + } +} + +// []IrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction is a convenience function that returns []IrohaInstructionRequestV1 wrapped in IrohaTransactionDefinitionV1Instruction +func ArrayOfIrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction(v *[]IrohaInstructionRequestV1) IrohaTransactionDefinitionV1Instruction { + return IrohaTransactionDefinitionV1Instruction{ + ArrayOfIrohaInstructionRequestV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *IrohaTransactionDefinitionV1Instruction) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IrohaInstructionRequestV1 + err = newStrictDecoder(data).Decode(&dst.IrohaInstructionRequestV1) + if err == nil { + jsonIrohaInstructionRequestV1, _ := json.Marshal(dst.IrohaInstructionRequestV1) + if string(jsonIrohaInstructionRequestV1) == "{}" { // empty struct + dst.IrohaInstructionRequestV1 = nil + } else { + match++ + } + } else { + dst.IrohaInstructionRequestV1 = nil + } + + // try to unmarshal data into ArrayOfIrohaInstructionRequestV1 + err = newStrictDecoder(data).Decode(&dst.ArrayOfIrohaInstructionRequestV1) + if err == nil { + jsonArrayOfIrohaInstructionRequestV1, _ := json.Marshal(dst.ArrayOfIrohaInstructionRequestV1) + if string(jsonArrayOfIrohaInstructionRequestV1) == "{}" { // empty struct + dst.ArrayOfIrohaInstructionRequestV1 = nil + } else { + match++ + } + } else { + dst.ArrayOfIrohaInstructionRequestV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IrohaInstructionRequestV1 = nil + dst.ArrayOfIrohaInstructionRequestV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(IrohaTransactionDefinitionV1Instruction)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(IrohaTransactionDefinitionV1Instruction)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src IrohaTransactionDefinitionV1Instruction) MarshalJSON() ([]byte, error) { + if src.IrohaInstructionRequestV1 != nil { + return json.Marshal(&src.IrohaInstructionRequestV1) + } + + if src.ArrayOfIrohaInstructionRequestV1 != nil { + return json.Marshal(&src.ArrayOfIrohaInstructionRequestV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *IrohaTransactionDefinitionV1Instruction) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.IrohaInstructionRequestV1 != nil { + return obj.IrohaInstructionRequestV1 + } + + if obj.ArrayOfIrohaInstructionRequestV1 != nil { + return obj.ArrayOfIrohaInstructionRequestV1 + } + + // all schemas are nil + return nil +} + +type NullableIrohaTransactionDefinitionV1Instruction struct { + value *IrohaTransactionDefinitionV1Instruction + isSet bool +} + +func (v NullableIrohaTransactionDefinitionV1Instruction) Get() *IrohaTransactionDefinitionV1Instruction { + return v.value +} + +func (v *NullableIrohaTransactionDefinitionV1Instruction) Set(val *IrohaTransactionDefinitionV1Instruction) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaTransactionDefinitionV1Instruction) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaTransactionDefinitionV1Instruction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaTransactionDefinitionV1Instruction(val *IrohaTransactionDefinitionV1Instruction) *NullableIrohaTransactionDefinitionV1Instruction { + return &NullableIrohaTransactionDefinitionV1Instruction{value: val, isSet: true} +} + +func (v NullableIrohaTransactionDefinitionV1Instruction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaTransactionDefinitionV1Instruction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go new file mode 100644 index 0000000000..e69be44440 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go @@ -0,0 +1,228 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaTransactionParametersV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaTransactionParametersV1{} + +// IrohaTransactionParametersV1 Iroha V2 transaction payload parameters +type IrohaTransactionParametersV1 struct { + // BigInt time to live. + Ttl *string `json:"ttl,omitempty"` + // BigInt creation time + CreationTime *string `json:"creationTime,omitempty"` + // Transaction nonce + Nonce *float32 `json:"nonce,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IrohaTransactionParametersV1 IrohaTransactionParametersV1 + +// NewIrohaTransactionParametersV1 instantiates a new IrohaTransactionParametersV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIrohaTransactionParametersV1() *IrohaTransactionParametersV1 { + this := IrohaTransactionParametersV1{} + return &this +} + +// NewIrohaTransactionParametersV1WithDefaults instantiates a new IrohaTransactionParametersV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaTransactionParametersV1WithDefaults() *IrohaTransactionParametersV1 { + this := IrohaTransactionParametersV1{} + return &this +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *IrohaTransactionParametersV1) GetTtl() string { + if o == nil || IsNil(o.Ttl) { + var ret string + return ret + } + return *o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionParametersV1) GetTtlOk() (*string, bool) { + if o == nil || IsNil(o.Ttl) { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *IrohaTransactionParametersV1) HasTtl() bool { + if o != nil && !IsNil(o.Ttl) { + return true + } + + return false +} + +// SetTtl gets a reference to the given string and assigns it to the Ttl field. +func (o *IrohaTransactionParametersV1) SetTtl(v string) { + o.Ttl = &v +} + +// GetCreationTime returns the CreationTime field value if set, zero value otherwise. +func (o *IrohaTransactionParametersV1) GetCreationTime() string { + if o == nil || IsNil(o.CreationTime) { + var ret string + return ret + } + return *o.CreationTime +} + +// GetCreationTimeOk returns a tuple with the CreationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionParametersV1) GetCreationTimeOk() (*string, bool) { + if o == nil || IsNil(o.CreationTime) { + return nil, false + } + return o.CreationTime, true +} + +// HasCreationTime returns a boolean if a field has been set. +func (o *IrohaTransactionParametersV1) HasCreationTime() bool { + if o != nil && !IsNil(o.CreationTime) { + return true + } + + return false +} + +// SetCreationTime gets a reference to the given string and assigns it to the CreationTime field. +func (o *IrohaTransactionParametersV1) SetCreationTime(v string) { + o.CreationTime = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *IrohaTransactionParametersV1) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionParametersV1) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *IrohaTransactionParametersV1) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *IrohaTransactionParametersV1) SetNonce(v float32) { + o.Nonce = &v +} + +func (o IrohaTransactionParametersV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaTransactionParametersV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ttl) { + toSerialize["ttl"] = o.Ttl + } + if !IsNil(o.CreationTime) { + toSerialize["creationTime"] = o.CreationTime + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IrohaTransactionParametersV1) UnmarshalJSON(bytes []byte) (err error) { + varIrohaTransactionParametersV1 := _IrohaTransactionParametersV1{} + + if err = json.Unmarshal(bytes, &varIrohaTransactionParametersV1); err == nil { + *o = IrohaTransactionParametersV1(varIrohaTransactionParametersV1) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ttl") + delete(additionalProperties, "creationTime") + delete(additionalProperties, "nonce") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIrohaTransactionParametersV1 struct { + value *IrohaTransactionParametersV1 + isSet bool +} + +func (v NullableIrohaTransactionParametersV1) Get() *IrohaTransactionParametersV1 { + return v.value +} + +func (v *NullableIrohaTransactionParametersV1) Set(val *IrohaTransactionParametersV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaTransactionParametersV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaTransactionParametersV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaTransactionParametersV1(val *IrohaTransactionParametersV1) *NullableIrohaTransactionParametersV1 { + return &NullableIrohaTransactionParametersV1{value: val, isSet: true} +} + +func (v NullableIrohaTransactionParametersV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaTransactionParametersV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go new file mode 100644 index 0000000000..d93bceb3d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the KeychainReference type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeychainReference{} + +// KeychainReference Reference to entry stored in Cactus keychain plugin. +type KeychainReference struct { + // Keychain plugin ID. + KeychainId string `json:"keychainId"` + // Key reference name. + KeychainRef string `json:"keychainRef"` +} + +// NewKeychainReference instantiates a new KeychainReference object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeychainReference(keychainId string, keychainRef string) *KeychainReference { + this := KeychainReference{} + this.KeychainId = keychainId + this.KeychainRef = keychainRef + return &this +} + +// NewKeychainReferenceWithDefaults instantiates a new KeychainReference object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeychainReferenceWithDefaults() *KeychainReference { + this := KeychainReference{} + return &this +} + +// GetKeychainId returns the KeychainId field value +func (o *KeychainReference) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *KeychainReference) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *KeychainReference) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetKeychainRef returns the KeychainRef field value +func (o *KeychainReference) GetKeychainRef() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainRef +} + +// GetKeychainRefOk returns a tuple with the KeychainRef field value +// and a boolean to check if the value has been set. +func (o *KeychainReference) GetKeychainRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainRef, true +} + +// SetKeychainRef sets field value +func (o *KeychainReference) SetKeychainRef(v string) { + o.KeychainRef = v +} + +func (o KeychainReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeychainReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keychainId"] = o.KeychainId + toSerialize["keychainRef"] = o.KeychainRef + return toSerialize, nil +} + +type NullableKeychainReference struct { + value *KeychainReference + isSet bool +} + +func (v NullableKeychainReference) Get() *KeychainReference { + return v.value +} + +func (v *NullableKeychainReference) Set(val *KeychainReference) { + v.value = val + v.isSet = true +} + +func (v NullableKeychainReference) IsSet() bool { + return v.isSet +} + +func (v *NullableKeychainReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeychainReference(val *KeychainReference) *NullableKeychainReference { + return &NullableKeychainReference{value: val, isSet: true} +} + +func (v NullableKeychainReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeychainReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go new file mode 100644 index 0000000000..e1f547c09a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the QueryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueryRequestV1{} + +// QueryRequestV1 Request to query endpoint. +type QueryRequestV1 struct { + Query *IrohaQueryDefinitionV1 `json:"query,omitempty"` + SignedQuery *IrohaSignedQueryDefinitionV1 `json:"signedQuery,omitempty"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewQueryRequestV1 instantiates a new QueryRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQueryRequestV1() *QueryRequestV1 { + this := QueryRequestV1{} + return &this +} + +// NewQueryRequestV1WithDefaults instantiates a new QueryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueryRequestV1WithDefaults() *QueryRequestV1 { + this := QueryRequestV1{} + return &this +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *QueryRequestV1) GetQuery() IrohaQueryDefinitionV1 { + if o == nil || IsNil(o.Query) { + var ret IrohaQueryDefinitionV1 + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryRequestV1) GetQueryOk() (*IrohaQueryDefinitionV1, bool) { + if o == nil || IsNil(o.Query) { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *QueryRequestV1) HasQuery() bool { + if o != nil && !IsNil(o.Query) { + return true + } + + return false +} + +// SetQuery gets a reference to the given IrohaQueryDefinitionV1 and assigns it to the Query field. +func (o *QueryRequestV1) SetQuery(v IrohaQueryDefinitionV1) { + o.Query = &v +} + +// GetSignedQuery returns the SignedQuery field value if set, zero value otherwise. +func (o *QueryRequestV1) GetSignedQuery() IrohaSignedQueryDefinitionV1 { + if o == nil || IsNil(o.SignedQuery) { + var ret IrohaSignedQueryDefinitionV1 + return ret + } + return *o.SignedQuery +} + +// GetSignedQueryOk returns a tuple with the SignedQuery field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryRequestV1) GetSignedQueryOk() (*IrohaSignedQueryDefinitionV1, bool) { + if o == nil || IsNil(o.SignedQuery) { + return nil, false + } + return o.SignedQuery, true +} + +// HasSignedQuery returns a boolean if a field has been set. +func (o *QueryRequestV1) HasSignedQuery() bool { + if o != nil && !IsNil(o.SignedQuery) { + return true + } + + return false +} + +// SetSignedQuery gets a reference to the given IrohaSignedQueryDefinitionV1 and assigns it to the SignedQuery field. +func (o *QueryRequestV1) SetSignedQuery(v IrohaSignedQueryDefinitionV1) { + o.SignedQuery = &v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *QueryRequestV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryRequestV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *QueryRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *QueryRequestV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o QueryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QueryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Query) { + toSerialize["query"] = o.Query + } + if !IsNil(o.SignedQuery) { + toSerialize["signedQuery"] = o.SignedQuery + } + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableQueryRequestV1 struct { + value *QueryRequestV1 + isSet bool +} + +func (v NullableQueryRequestV1) Get() *QueryRequestV1 { + return v.value +} + +func (v *NullableQueryRequestV1) Set(val *QueryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableQueryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableQueryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueryRequestV1(val *QueryRequestV1) *NullableQueryRequestV1 { + return &NullableQueryRequestV1{value: val, isSet: true} +} + +func (v NullableQueryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go new file mode 100644 index 0000000000..eec5c64718 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the QueryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueryResponseV1{} + +// QueryResponseV1 Response with the query results. +type QueryResponseV1 struct { + // Query response data that varies between different queries. + Response interface{} `json:"response"` +} + +// NewQueryResponseV1 instantiates a new QueryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQueryResponseV1(response interface{}) *QueryResponseV1 { + this := QueryResponseV1{} + this.Response = response + return &this +} + +// NewQueryResponseV1WithDefaults instantiates a new QueryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueryResponseV1WithDefaults() *QueryResponseV1 { + this := QueryResponseV1{} + return &this +} + +// GetResponse returns the Response field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *QueryResponseV1) GetResponse() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QueryResponseV1) GetResponseOk() (*interface{}, bool) { + if o == nil || IsNil(o.Response) { + return nil, false + } + return &o.Response, true +} + +// SetResponse sets field value +func (o *QueryResponseV1) SetResponse(v interface{}) { + o.Response = v +} + +func (o QueryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QueryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Response != nil { + toSerialize["response"] = o.Response + } + return toSerialize, nil +} + +type NullableQueryResponseV1 struct { + value *QueryResponseV1 + isSet bool +} + +func (v NullableQueryResponseV1) Get() *QueryResponseV1 { + return v.value +} + +func (v *NullableQueryResponseV1) Set(val *QueryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableQueryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableQueryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueryResponseV1(val *QueryResponseV1) *NullableQueryResponseV1 { + return &NullableQueryResponseV1{value: val, isSet: true} +} + +func (v NullableQueryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go new file mode 100644 index 0000000000..5e9149ce29 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go @@ -0,0 +1,240 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the TransactRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactRequestV1{} + +// TransactRequestV1 Request to transact endpoint. +type TransactRequestV1 struct { + // Signed transaction binary data received from generate-transaction endpoint. + SignedTransaction *string `json:"signedTransaction,omitempty"` + Transaction *IrohaTransactionDefinitionV1 `json:"transaction,omitempty"` + // Wait unitl transaction is sent and return the final status (committed / rejected) + WaitForCommit *bool `json:"waitForCommit,omitempty"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewTransactRequestV1 instantiates a new TransactRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactRequestV1() *TransactRequestV1 { + this := TransactRequestV1{} + var waitForCommit bool = false + this.WaitForCommit = &waitForCommit + return &this +} + +// NewTransactRequestV1WithDefaults instantiates a new TransactRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactRequestV1WithDefaults() *TransactRequestV1 { + this := TransactRequestV1{} + var waitForCommit bool = false + this.WaitForCommit = &waitForCommit + return &this +} + +// GetSignedTransaction returns the SignedTransaction field value if set, zero value otherwise. +func (o *TransactRequestV1) GetSignedTransaction() string { + if o == nil || IsNil(o.SignedTransaction) { + var ret string + return ret + } + return *o.SignedTransaction +} + +// GetSignedTransactionOk returns a tuple with the SignedTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetSignedTransactionOk() (*string, bool) { + if o == nil || IsNil(o.SignedTransaction) { + return nil, false + } + return o.SignedTransaction, true +} + +// HasSignedTransaction returns a boolean if a field has been set. +func (o *TransactRequestV1) HasSignedTransaction() bool { + if o != nil && !IsNil(o.SignedTransaction) { + return true + } + + return false +} + +// SetSignedTransaction gets a reference to the given string and assigns it to the SignedTransaction field. +func (o *TransactRequestV1) SetSignedTransaction(v string) { + o.SignedTransaction = &v +} + +// GetTransaction returns the Transaction field value if set, zero value otherwise. +func (o *TransactRequestV1) GetTransaction() IrohaTransactionDefinitionV1 { + if o == nil || IsNil(o.Transaction) { + var ret IrohaTransactionDefinitionV1 + return ret + } + return *o.Transaction +} + +// GetTransactionOk returns a tuple with the Transaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetTransactionOk() (*IrohaTransactionDefinitionV1, bool) { + if o == nil || IsNil(o.Transaction) { + return nil, false + } + return o.Transaction, true +} + +// HasTransaction returns a boolean if a field has been set. +func (o *TransactRequestV1) HasTransaction() bool { + if o != nil && !IsNil(o.Transaction) { + return true + } + + return false +} + +// SetTransaction gets a reference to the given IrohaTransactionDefinitionV1 and assigns it to the Transaction field. +func (o *TransactRequestV1) SetTransaction(v IrohaTransactionDefinitionV1) { + o.Transaction = &v +} + +// GetWaitForCommit returns the WaitForCommit field value if set, zero value otherwise. +func (o *TransactRequestV1) GetWaitForCommit() bool { + if o == nil || IsNil(o.WaitForCommit) { + var ret bool + return ret + } + return *o.WaitForCommit +} + +// GetWaitForCommitOk returns a tuple with the WaitForCommit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetWaitForCommitOk() (*bool, bool) { + if o == nil || IsNil(o.WaitForCommit) { + return nil, false + } + return o.WaitForCommit, true +} + +// HasWaitForCommit returns a boolean if a field has been set. +func (o *TransactRequestV1) HasWaitForCommit() bool { + if o != nil && !IsNil(o.WaitForCommit) { + return true + } + + return false +} + +// SetWaitForCommit gets a reference to the given bool and assigns it to the WaitForCommit field. +func (o *TransactRequestV1) SetWaitForCommit(v bool) { + o.WaitForCommit = &v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *TransactRequestV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *TransactRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *TransactRequestV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o TransactRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SignedTransaction) { + toSerialize["signedTransaction"] = o.SignedTransaction + } + if !IsNil(o.Transaction) { + toSerialize["transaction"] = o.Transaction + } + if !IsNil(o.WaitForCommit) { + toSerialize["waitForCommit"] = o.WaitForCommit + } + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableTransactRequestV1 struct { + value *TransactRequestV1 + isSet bool +} + +func (v NullableTransactRequestV1) Get() *TransactRequestV1 { + return v.value +} + +func (v *NullableTransactRequestV1) Set(val *TransactRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableTransactRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactRequestV1(val *TransactRequestV1) *NullableTransactRequestV1 { + return &NullableTransactRequestV1{value: val, isSet: true} +} + +func (v NullableTransactRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go new file mode 100644 index 0000000000..2ae1c04f35 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go @@ -0,0 +1,182 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the TransactResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactResponseV1{} + +// TransactResponseV1 Response from transaction endpoint with operation status. +type TransactResponseV1 struct { + // Hexadecimal hash of the transaction sent to the ledger. + Hash string `json:"hash"` + Status TransactionStatusV1 `json:"status"` + // When waitForCommit was suplied and the transaction was rejected, contains the reason of the rejection. + RejectReason *string `json:"rejectReason,omitempty"` +} + +// NewTransactResponseV1 instantiates a new TransactResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactResponseV1(hash string, status TransactionStatusV1) *TransactResponseV1 { + this := TransactResponseV1{} + this.Hash = hash + this.Status = status + return &this +} + +// NewTransactResponseV1WithDefaults instantiates a new TransactResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactResponseV1WithDefaults() *TransactResponseV1 { + this := TransactResponseV1{} + return &this +} + +// GetHash returns the Hash field value +func (o *TransactResponseV1) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *TransactResponseV1) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *TransactResponseV1) SetHash(v string) { + o.Hash = v +} + +// GetStatus returns the Status field value +func (o *TransactResponseV1) GetStatus() TransactionStatusV1 { + if o == nil { + var ret TransactionStatusV1 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TransactResponseV1) GetStatusOk() (*TransactionStatusV1, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TransactResponseV1) SetStatus(v TransactionStatusV1) { + o.Status = v +} + +// GetRejectReason returns the RejectReason field value if set, zero value otherwise. +func (o *TransactResponseV1) GetRejectReason() string { + if o == nil || IsNil(o.RejectReason) { + var ret string + return ret + } + return *o.RejectReason +} + +// GetRejectReasonOk returns a tuple with the RejectReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactResponseV1) GetRejectReasonOk() (*string, bool) { + if o == nil || IsNil(o.RejectReason) { + return nil, false + } + return o.RejectReason, true +} + +// HasRejectReason returns a boolean if a field has been set. +func (o *TransactResponseV1) HasRejectReason() bool { + if o != nil && !IsNil(o.RejectReason) { + return true + } + + return false +} + +// SetRejectReason gets a reference to the given string and assigns it to the RejectReason field. +func (o *TransactResponseV1) SetRejectReason(v string) { + o.RejectReason = &v +} + +func (o TransactResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["status"] = o.Status + if !IsNil(o.RejectReason) { + toSerialize["rejectReason"] = o.RejectReason + } + return toSerialize, nil +} + +type NullableTransactResponseV1 struct { + value *TransactResponseV1 + isSet bool +} + +func (v NullableTransactResponseV1) Get() *TransactResponseV1 { + return v.value +} + +func (v *NullableTransactResponseV1) Set(val *TransactResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableTransactResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactResponseV1(val *TransactResponseV1) *NullableTransactResponseV1 { + return &NullableTransactResponseV1{value: val, isSet: true} +} + +func (v NullableTransactResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go new file mode 100644 index 0000000000..6b2510af13 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// TransactionStatusV1 Status of Iroha V2 transaction. +type TransactionStatusV1 string + +// List of TransactionStatusV1 +const ( + Submitted TransactionStatusV1 = "submitted" + Committed TransactionStatusV1 = "committed" + Rejected TransactionStatusV1 = "rejected" +) + +// All allowed values of TransactionStatusV1 enum +var AllowedTransactionStatusV1EnumValues = []TransactionStatusV1{ + "submitted", + "committed", + "rejected", +} + +func (v *TransactionStatusV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TransactionStatusV1(value) + for _, existing := range AllowedTransactionStatusV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TransactionStatusV1", value) +} + +// NewTransactionStatusV1FromValue returns a pointer to a valid TransactionStatusV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTransactionStatusV1FromValue(v string) (*TransactionStatusV1, error) { + ev := TransactionStatusV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TransactionStatusV1: valid values are %v", v, AllowedTransactionStatusV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TransactionStatusV1) IsValid() bool { + for _, existing := range AllowedTransactionStatusV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TransactionStatusV1 value +func (v TransactionStatusV1) Ptr() *TransactionStatusV1 { + return &v +} + +type NullableTransactionStatusV1 struct { + value *TransactionStatusV1 + isSet bool +} + +func (v NullableTransactionStatusV1) Get() *TransactionStatusV1 { + return v.value +} + +func (v *NullableTransactionStatusV1) Set(val *TransactionStatusV1) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionStatusV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionStatusV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionStatusV1(val *TransactionStatusV1) *NullableTransactionStatusV1 { + return &NullableTransactionStatusV1{value: val, isSet: true} +} + +func (v NullableTransactionStatusV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionStatusV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go new file mode 100644 index 0000000000..068a3cc109 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the WatchBlocksBinaryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksBinaryResponseV1{} + +// WatchBlocksBinaryResponseV1 Binary encoded response of block data. +type WatchBlocksBinaryResponseV1 struct { + BinaryBlock string `json:"binaryBlock"` +} + +// NewWatchBlocksBinaryResponseV1 instantiates a new WatchBlocksBinaryResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksBinaryResponseV1(binaryBlock string) *WatchBlocksBinaryResponseV1 { + this := WatchBlocksBinaryResponseV1{} + this.BinaryBlock = binaryBlock + return &this +} + +// NewWatchBlocksBinaryResponseV1WithDefaults instantiates a new WatchBlocksBinaryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksBinaryResponseV1WithDefaults() *WatchBlocksBinaryResponseV1 { + this := WatchBlocksBinaryResponseV1{} + return &this +} + +// GetBinaryBlock returns the BinaryBlock field value +func (o *WatchBlocksBinaryResponseV1) GetBinaryBlock() string { + if o == nil { + var ret string + return ret + } + + return o.BinaryBlock +} + +// GetBinaryBlockOk returns a tuple with the BinaryBlock field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksBinaryResponseV1) GetBinaryBlockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BinaryBlock, true +} + +// SetBinaryBlock sets field value +func (o *WatchBlocksBinaryResponseV1) SetBinaryBlock(v string) { + o.BinaryBlock = v +} + +func (o WatchBlocksBinaryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksBinaryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["binaryBlock"] = o.BinaryBlock + return toSerialize, nil +} + +type NullableWatchBlocksBinaryResponseV1 struct { + value *WatchBlocksBinaryResponseV1 + isSet bool +} + +func (v NullableWatchBlocksBinaryResponseV1) Get() *WatchBlocksBinaryResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksBinaryResponseV1) Set(val *WatchBlocksBinaryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksBinaryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksBinaryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksBinaryResponseV1(val *WatchBlocksBinaryResponseV1) *NullableWatchBlocksBinaryResponseV1 { + return &NullableWatchBlocksBinaryResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksBinaryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksBinaryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go new file mode 100644 index 0000000000..b73c554e6a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go @@ -0,0 +1,199 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the WatchBlocksOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksOptionsV1{} + +// WatchBlocksOptionsV1 Options passed when subscribing to block monitoring. +type WatchBlocksOptionsV1 struct { + Type *BlockTypeV1 `json:"type,omitempty"` + // Number of block to start monitoring from. + StartBlock *string `json:"startBlock,omitempty"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewWatchBlocksOptionsV1 instantiates a new WatchBlocksOptionsV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksOptionsV1() *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + return &this +} + +// NewWatchBlocksOptionsV1WithDefaults instantiates a new WatchBlocksOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksOptionsV1WithDefaults() *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetType() BlockTypeV1 { + if o == nil || IsNil(o.Type) { + var ret BlockTypeV1 + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetTypeOk() (*BlockTypeV1, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given BlockTypeV1 and assigns it to the Type field. +func (o *WatchBlocksOptionsV1) SetType(v BlockTypeV1) { + o.Type = &v +} + +// GetStartBlock returns the StartBlock field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetStartBlock() string { + if o == nil || IsNil(o.StartBlock) { + var ret string + return ret + } + return *o.StartBlock +} + +// GetStartBlockOk returns a tuple with the StartBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetStartBlockOk() (*string, bool) { + if o == nil || IsNil(o.StartBlock) { + return nil, false + } + return o.StartBlock, true +} + +// HasStartBlock returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasStartBlock() bool { + if o != nil && !IsNil(o.StartBlock) { + return true + } + + return false +} + +// SetStartBlock gets a reference to the given string and assigns it to the StartBlock field. +func (o *WatchBlocksOptionsV1) SetStartBlock(v string) { + o.StartBlock = &v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *WatchBlocksOptionsV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o WatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.StartBlock) { + toSerialize["startBlock"] = o.StartBlock + } + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableWatchBlocksOptionsV1 struct { + value *WatchBlocksOptionsV1 + isSet bool +} + +func (v NullableWatchBlocksOptionsV1) Get() *WatchBlocksOptionsV1 { + return v.value +} + +func (v *NullableWatchBlocksOptionsV1) Set(val *WatchBlocksOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksOptionsV1(val *WatchBlocksOptionsV1) *NullableWatchBlocksOptionsV1 { + return &NullableWatchBlocksOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go new file mode 100644 index 0000000000..bce3355eb1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the WatchBlocksRawResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksRawResponseV1{} + +// WatchBlocksRawResponseV1 Default JSON-encoded string full block data. +type WatchBlocksRawResponseV1 struct { + BlockData string `json:"blockData"` +} + +// NewWatchBlocksRawResponseV1 instantiates a new WatchBlocksRawResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksRawResponseV1(blockData string) *WatchBlocksRawResponseV1 { + this := WatchBlocksRawResponseV1{} + this.BlockData = blockData + return &this +} + +// NewWatchBlocksRawResponseV1WithDefaults instantiates a new WatchBlocksRawResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksRawResponseV1WithDefaults() *WatchBlocksRawResponseV1 { + this := WatchBlocksRawResponseV1{} + return &this +} + +// GetBlockData returns the BlockData field value +func (o *WatchBlocksRawResponseV1) GetBlockData() string { + if o == nil { + var ret string + return ret + } + + return o.BlockData +} + +// GetBlockDataOk returns a tuple with the BlockData field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksRawResponseV1) GetBlockDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockData, true +} + +// SetBlockData sets field value +func (o *WatchBlocksRawResponseV1) SetBlockData(v string) { + o.BlockData = v +} + +func (o WatchBlocksRawResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksRawResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockData"] = o.BlockData + return toSerialize, nil +} + +type NullableWatchBlocksRawResponseV1 struct { + value *WatchBlocksRawResponseV1 + isSet bool +} + +func (v NullableWatchBlocksRawResponseV1) Get() *WatchBlocksRawResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksRawResponseV1) Set(val *WatchBlocksRawResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksRawResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksRawResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksRawResponseV1(val *WatchBlocksRawResponseV1) *NullableWatchBlocksRawResponseV1 { + return &NullableWatchBlocksRawResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksRawResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksRawResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go new file mode 100644 index 0000000000..78de66d26c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksResponseV1 - struct for WatchBlocksResponseV1 +type WatchBlocksResponseV1 struct { + ErrorExceptionResponseV1 *ErrorExceptionResponseV1 + WatchBlocksBinaryResponseV1 *WatchBlocksBinaryResponseV1 + WatchBlocksRawResponseV1 *WatchBlocksRawResponseV1 +} + +// ErrorExceptionResponseV1AsWatchBlocksResponseV1 is a convenience function that returns ErrorExceptionResponseV1 wrapped in WatchBlocksResponseV1 +func ErrorExceptionResponseV1AsWatchBlocksResponseV1(v *ErrorExceptionResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + ErrorExceptionResponseV1: v, + } +} + +// WatchBlocksBinaryResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksBinaryResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksBinaryResponseV1AsWatchBlocksResponseV1(v *WatchBlocksBinaryResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksBinaryResponseV1: v, + } +} + +// WatchBlocksRawResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksRawResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksRawResponseV1AsWatchBlocksResponseV1(v *WatchBlocksRawResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksRawResponseV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksResponseV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ErrorExceptionResponseV1 + err = newStrictDecoder(data).Decode(&dst.ErrorExceptionResponseV1) + if err == nil { + jsonErrorExceptionResponseV1, _ := json.Marshal(dst.ErrorExceptionResponseV1) + if string(jsonErrorExceptionResponseV1) == "{}" { // empty struct + dst.ErrorExceptionResponseV1 = nil + } else { + match++ + } + } else { + dst.ErrorExceptionResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksBinaryResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksBinaryResponseV1) + if err == nil { + jsonWatchBlocksBinaryResponseV1, _ := json.Marshal(dst.WatchBlocksBinaryResponseV1) + if string(jsonWatchBlocksBinaryResponseV1) == "{}" { // empty struct + dst.WatchBlocksBinaryResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksBinaryResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksRawResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksRawResponseV1) + if err == nil { + jsonWatchBlocksRawResponseV1, _ := json.Marshal(dst.WatchBlocksRawResponseV1) + if string(jsonWatchBlocksRawResponseV1) == "{}" { // empty struct + dst.WatchBlocksRawResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksRawResponseV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ErrorExceptionResponseV1 = nil + dst.WatchBlocksBinaryResponseV1 = nil + dst.WatchBlocksRawResponseV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksResponseV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksResponseV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + if src.ErrorExceptionResponseV1 != nil { + return json.Marshal(&src.ErrorExceptionResponseV1) + } + + if src.WatchBlocksBinaryResponseV1 != nil { + return json.Marshal(&src.WatchBlocksBinaryResponseV1) + } + + if src.WatchBlocksRawResponseV1 != nil { + return json.Marshal(&src.WatchBlocksRawResponseV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksResponseV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ErrorExceptionResponseV1 != nil { + return obj.ErrorExceptionResponseV1 + } + + if obj.WatchBlocksBinaryResponseV1 != nil { + return obj.WatchBlocksBinaryResponseV1 + } + + if obj.WatchBlocksRawResponseV1 != nil { + return obj.WatchBlocksRawResponseV1 + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksResponseV1 struct { + value *WatchBlocksResponseV1 + isSet bool +} + +func (v NullableWatchBlocksResponseV1) Get() *WatchBlocksResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksResponseV1) Set(val *WatchBlocksResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksResponseV1(val *WatchBlocksResponseV1) *NullableWatchBlocksResponseV1 { + return &NullableWatchBlocksResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 0000000000..61bcb00a53 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 Websocket requests for monitoring new blocks. +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..4b19d786a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..ef61ecb479 --- /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 0000000000..25703c5fc8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..f2fa20fbb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Iroha V2 + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..991fbdb7bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/BlockTypeV1.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java +src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java +src/main/java/org/openapitools/client/model/Iroha2AccountId.java +src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java +src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java +src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java +src/main/java/org/openapitools/client/model/Iroha2KeyJson.java +src/main/java/org/openapitools/client/model/Iroha2KeyPair.java +src/main/java/org/openapitools/client/model/IrohaInstruction.java +src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java +src/main/java/org/openapitools/client/model/IrohaQuery.java +src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java +src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java +src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java +src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java +src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java +src/main/java/org/openapitools/client/model/KeychainReference.java +src/main/java/org/openapitools/client/model/QueryRequestV1.java +src/main/java/org/openapitools/client/model/QueryResponseV1.java +src/main/java/org/openapitools/client/model/TransactRequestV1.java +src/main/java/org/openapitools/client/model/TransactResponseV1.java +src/main/java/org/openapitools/client/model/TransactionStatusV1.java +src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java +src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..7b414204b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,167 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Iroha V2 +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Iroha V2 ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GenerateTransactionRequestV1 generateTransactionRequestV1 = new GenerateTransactionRequestV1(); // GenerateTransactionRequestV1 | + try { + String result = apiInstance.generateTransactionV1(generateTransactionRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#generateTransactionV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**generateTransactionV1**](docs/DefaultApi.md#generateTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**queryV1**](docs/DefaultApi.md#queryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query | Executes a query on a Iroha V2 ledger and returns it's results. +*DefaultApi* | [**transactV1**](docs/DefaultApi.md#transactV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact | Executes a transaction on a Iroha V2 ledger (by sending some instructions) + + +## Documentation for Models + + - [BlockTypeV1](docs/BlockTypeV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GenerateTransactionRequestV1Request](docs/GenerateTransactionRequestV1Request.md) + - [Iroha2AccountId](docs/Iroha2AccountId.md) + - [Iroha2BaseConfig](docs/Iroha2BaseConfig.md) + - [Iroha2BaseConfigSigningCredential](docs/Iroha2BaseConfigSigningCredential.md) + - [Iroha2BaseConfigTorii](docs/Iroha2BaseConfigTorii.md) + - [Iroha2KeyJson](docs/Iroha2KeyJson.md) + - [Iroha2KeyPair](docs/Iroha2KeyPair.md) + - [IrohaInstruction](docs/IrohaInstruction.md) + - [IrohaInstructionRequestV1](docs/IrohaInstructionRequestV1.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaQueryDefinitionV1](docs/IrohaQueryDefinitionV1.md) + - [IrohaSignedQueryDefinitionV1](docs/IrohaSignedQueryDefinitionV1.md) + - [IrohaTransactionDefinitionV1](docs/IrohaTransactionDefinitionV1.md) + - [IrohaTransactionDefinitionV1Instruction](docs/IrohaTransactionDefinitionV1Instruction.md) + - [IrohaTransactionParametersV1](docs/IrohaTransactionParametersV1.md) + - [KeychainReference](docs/KeychainReference.md) + - [QueryRequestV1](docs/QueryRequestV1.md) + - [QueryResponseV1](docs/QueryResponseV1.md) + - [TransactRequestV1](docs/TransactRequestV1.md) + - [TransactResponseV1](docs/TransactResponseV1.md) + - [TransactionStatusV1](docs/TransactionStatusV1.md) + - [WatchBlocksBinaryResponseV1](docs/WatchBlocksBinaryResponseV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksRawResponseV1](docs/WatchBlocksRawResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..4a95000b9d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,592 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha V2 ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha V2 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact: + post: + operationId: TransactV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransactRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha V2 ledger (by sending some instructions) + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + text/plain: + schema: + type: string + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query: + post: + operationId: QueryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a query on a Iroha V2 ledger and returns it's results. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query + x-content-type: application/json + x-accepts: application/json +components: + schemas: + IrohaInstruction: + description: Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) + enum: + - registerDomain + - registerAssetDefinition + - registerAsset + - mintAsset + - burnAsset + - transferAsset + - registerAccount + type: string + x-enum-descriptions: + - Register new domain + - Register new asset definition + - Register new asset + - Mint asset value + - Burn asset value + - Transfer asset between accounts + - Register new account + x-enum-varnames: + - RegisterDomain + - RegisterAssetDefinition + - RegisterAsset + - MintAsset + - BurnAsset + - TransferAsset + - RegisterAccount + IrohaQuery: + description: Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) + enum: + - findAllDomains + - findDomainById + - findAssetDefinitionById + - findAllAssetsDefinitions + - findAssetById + - findAllAssets + - findAllPeers + - findAllBlocks + - findAccountById + - findAllAccounts + - findAllTransactions + - findTransactionByHash + type: string + x-enum-descriptions: + - Get list of all registered domains + - Get domain with specified ID + - Get asset definition with specified ID + - Get list of all registered asset definition + - Get asset with specified ID + - Get list of all registered assets + - Get list of all ledger peers + - Get list of all ledger blocks + - Get account with specified ID + - Get list of all registered accounts + - Get list of all transactions + - Get transaction with specified hash + x-enum-varnames: + - FindAllDomains + - FindDomainById + - FindAssetDefinitionById + - FindAllAssetsDefinitions + - FindAssetById + - FindAllAssets + - FindAllPeers + - FindAllBlocks + - FindAccountById + - FindAllAccounts + - FindAllTransactions + - FindTransactionByHash + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + BlockTypeV1: + description: Iroha V2 block response type. + enum: + - raw + - binary + type: string + x-enum-descriptions: + - Default JSON-encoded string full block data. + - Encoded format that must be decoded with Iroha SDK on client side before use + x-enum-varnames: + - Raw + - Binary + TransactionStatusV1: + description: Status of Iroha V2 transaction. + enum: + - submitted + - committed + - rejected + type: string + x-enum-descriptions: + - Transaction was submitted to the ledger - use other tools to check if it was + accepted and committed. + - Transaction was committed to the ledger. + - Transaction was rejected. + x-enum-varnames: + - Submitted + - Committed + - Rejected + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + type: + $ref: '#/components/schemas/BlockTypeV1' + startBlock: + description: Number of block to start monitoring from. + minLength: 1 + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + WatchBlocksRawResponseV1: + description: Default JSON-encoded string full block data. + properties: + blockData: + nullable: false + type: string + required: + - blockData + type: object + WatchBlocksBinaryResponseV1: + description: Binary encoded response of block data. + properties: + binaryBlock: + nullable: false + type: string + required: + - binaryBlock + type: object + WatchBlocksResponseV1: + oneOf: + - $ref: '#/components/schemas/WatchBlocksRawResponseV1' + - $ref: '#/components/schemas/WatchBlocksBinaryResponseV1' + - $ref: '#/components/schemas/ErrorExceptionResponseV1' + Iroha2AccountId: + additionalProperties: false + description: Iroha V2 account ID. + example: + name: name + domainId: domainId + nullable: false + properties: + name: + nullable: false + type: string + domainId: + nullable: false + type: string + required: + - domainId + - name + type: object + Iroha2KeyJson: + additionalProperties: false + description: Private/Public key JSON containing payload and digest function. + nullable: false + properties: + digestFunction: + nullable: false + type: string + payload: + nullable: false + type: string + required: + - digestFunction + - payload + type: object + KeychainReference: + description: Reference to entry stored in Cactus keychain plugin. + properties: + keychainId: + description: Keychain plugin ID. + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + description: Key reference name. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - keychainId + - keychainRef + type: object + Iroha2KeyPair: + description: Pair of Iroha account private and public keys. + properties: + privateKey: + $ref: '#/components/schemas/Iroha2KeyJson' + publicKey: + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + Iroha2BaseConfigTorii: + additionalProperties: false + description: Iroha V2 peer connection information. + example: + apiURL: apiURL + telemetryURL: telemetryURL + nullable: false + properties: + apiURL: + nullable: false + type: string + telemetryURL: + nullable: false + type: string + type: object + Iroha2BaseConfig: + additionalProperties: false + description: Iroha V2 connection configuration. + example: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + torii: + $ref: '#/components/schemas/Iroha2BaseConfigTorii' + accountId: + $ref: '#/components/schemas/Iroha2AccountId' + signingCredential: + $ref: '#/components/schemas/Iroha2BaseConfig_signingCredential' + required: + - torii + type: object + IrohaInstructionRequestV1: + additionalProperties: false + description: Single Iroha V2 instruction to be executed request. + properties: + name: + description: Iroha V2 instruction name. + nullable: false + type: IrohaInstruction + params: + description: The list of arguments to pass with specified instruction. + items: {} + type: array + required: + - name + - params + type: object + IrohaTransactionParametersV1: + additionalProperties: true + description: Iroha V2 transaction payload parameters + example: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + properties: + ttl: + description: BigInt time to live. + nullable: false + type: string + creationTime: + description: BigInt creation time + nullable: false + type: string + nonce: + description: Transaction nonce + nullable: false + type: number + type: object + IrohaTransactionDefinitionV1: + additionalProperties: false + description: Iroha V2 transaction definition + example: + instruction: null + params: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + properties: + instruction: + $ref: '#/components/schemas/IrohaTransactionDefinitionV1_instruction' + params: + $ref: '#/components/schemas/IrohaTransactionParametersV1' + required: + - instruction + type: object + IrohaQueryDefinitionV1: + additionalProperties: false + description: Iroha V2 query definition. + example: + query: "" + params: + - "" + - "" + properties: + query: + description: Name of the query to be executed. + nullable: false + type: IrohaQuery + params: + description: The list of arguments to pass with the query. + items: {} + type: array + required: + - query + type: object + IrohaSignedQueryDefinitionV1: + additionalProperties: false + description: Iroha V2 signed query definition + example: + payload: payload + query: "" + properties: + query: + description: Name of the query to be executed. + nullable: false + type: IrohaQuery + payload: + description: Signed query transaction binary data received from generate-transaction + endpoint. + nullable: false + type: string + required: + - payload + - query + type: object + TransactRequestV1: + additionalProperties: false + description: Request to transact endpoint. + example: + waitForCommit: false + signedTransaction: signedTransaction + transaction: + instruction: null + params: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + nullable: false + type: string + transaction: + $ref: '#/components/schemas/IrohaTransactionDefinitionV1' + waitForCommit: + default: false + description: Wait unitl transaction is sent and return the final status + (committed / rejected) + nullable: false + type: boolean + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + TransactResponseV1: + description: Response from transaction endpoint with operation status. + example: + rejectReason: rejectReason + hash: hash + status: null + properties: + hash: + description: Hexadecimal hash of the transaction sent to the ledger. + nullable: false + type: string + status: + $ref: '#/components/schemas/TransactionStatusV1' + rejectReason: + description: "When waitForCommit was suplied and the transaction was rejected,\ + \ contains the reason of the rejection." + nullable: false + type: string + required: + - hash + - status + type: object + QueryRequestV1: + additionalProperties: false + description: Request to query endpoint. + example: + query: + query: "" + params: + - "" + - "" + signedQuery: + payload: payload + query: "" + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + query: + $ref: '#/components/schemas/IrohaQueryDefinitionV1' + signedQuery: + $ref: '#/components/schemas/IrohaSignedQueryDefinitionV1' + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + QueryResponseV1: + description: Response with the query results. + example: + response: "" + properties: + response: + description: Query response data that varies between different queries. + nullable: false + required: + - response + type: object + GenerateTransactionRequestV1: + additionalProperties: false + description: Request for generating transaction or query payload that can be + signed on the client side. + example: + request: null + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + request: + $ref: '#/components/schemas/GenerateTransactionRequestV1_request' + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + required: + - request + type: object + ErrorExceptionResponseV1: + description: Error response from the connector. + properties: + message: + description: Short error description message. + nullable: false + type: string + error: + description: Detailed error information. + nullable: false + type: string + required: + - error + - message + type: object + Iroha2BaseConfig_signingCredential: + oneOf: + - $ref: '#/components/schemas/Iroha2KeyPair' + - $ref: '#/components/schemas/KeychainReference' + IrohaTransactionDefinitionV1_instruction: + oneOf: + - $ref: '#/components/schemas/IrohaInstructionRequestV1' + - items: + $ref: '#/components/schemas/IrohaInstructionRequestV1' + type: array + GenerateTransactionRequestV1_request: + oneOf: + - $ref: '#/components/schemas/IrohaTransactionDefinitionV1' + - $ref: '#/components/schemas/IrohaQueryDefinitionV1' + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..b0c75a0a49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..16d5dcb4e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..7fddf5d9b1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..9fc3def545 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..33638e9567 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..1e4d427775 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,424 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GenerateTransactionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GenerateTransactionRequestV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2AccountId.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2BaseConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2BaseConfigSigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2BaseConfigTorii.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2KeyJson.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2KeyPair.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaInstructionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaQueryDefinitionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaSignedQueryDefinitionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaTransactionDefinitionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaTransactionParametersV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.KeychainReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QueryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QueryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksBinaryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksOptionsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksRawResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksResponseV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..77817efd7a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..9d1b0681d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..3940b6f8e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..ecb2b6a372 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..0553203663 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,448 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.QueryRequestV1; +import org.openapitools.client.model.QueryResponseV1; +import org.openapitools.client.model.TransactRequestV1; +import org.openapitools.client.model.TransactResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for generateTransactionV1 + * @param generateTransactionRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Call(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = generateTransactionRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call generateTransactionV1ValidateBeforeCall(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + return generateTransactionV1Call(generateTransactionRequestV1, _callback); + + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public String generateTransactionV1(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + ApiResponse localVarResp = generateTransactionV1WithHttpInfo(generateTransactionRequestV1); + return localVarResp.getData(); + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse generateTransactionV1WithHttpInfo(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate transaction that can be signed locally. (asynchronously) + * + * @param generateTransactionRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Async(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryV1 + * @param queryRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call queryV1Call(QueryRequestV1 queryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = queryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryV1ValidateBeforeCall(QueryRequestV1 queryRequestV1, final ApiCallback _callback) throws ApiException { + return queryV1Call(queryRequestV1, _callback); + + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. + * + * @param queryRequestV1 (optional) + * @return QueryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public QueryResponseV1 queryV1(QueryRequestV1 queryRequestV1) throws ApiException { + ApiResponse localVarResp = queryV1WithHttpInfo(queryRequestV1); + return localVarResp.getData(); + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. + * + * @param queryRequestV1 (optional) + * @return ApiResponse<QueryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public ApiResponse queryV1WithHttpInfo(QueryRequestV1 queryRequestV1) throws ApiException { + okhttp3.Call localVarCall = queryV1ValidateBeforeCall(queryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. (asynchronously) + * + * @param queryRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call queryV1Async(QueryRequestV1 queryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = queryV1ValidateBeforeCall(queryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for transactV1 + * @param transactRequestV1 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call transactV1Call(TransactRequestV1 transactRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transactRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call transactV1ValidateBeforeCall(TransactRequestV1 transactRequestV1, final ApiCallback _callback) throws ApiException { + return transactV1Call(transactRequestV1, _callback); + + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) + * + * @param transactRequestV1 (optional) + * @return TransactResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public TransactResponseV1 transactV1(TransactRequestV1 transactRequestV1) throws ApiException { + ApiResponse localVarResp = transactV1WithHttpInfo(transactRequestV1); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) + * + * @param transactRequestV1 (optional) + * @return ApiResponse<TransactResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public ApiResponse transactV1WithHttpInfo(TransactRequestV1 transactRequestV1) throws ApiException { + okhttp3.Call localVarCall = transactV1ValidateBeforeCall(transactRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) (asynchronously) + * + * @param transactRequestV1 (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call transactV1Async(TransactRequestV1 transactRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = transactV1ValidateBeforeCall(transactRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..68161c54ee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..9be9fd6718 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..054a7d0c4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..81f0698077 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..39d6ba0cdb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java new file mode 100644 index 0000000000..0fad06da3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Iroha V2 block response type. + */ +@JsonAdapter(BlockTypeV1.Adapter.class) +public enum BlockTypeV1 { + + /** + * Default JSON-encoded string full block data. + */ + Raw("raw"), + + /** + * Encoded format that must be decoded with Iroha SDK on client side before use + */ + Binary("binary"); + + private String value; + + BlockTypeV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BlockTypeV1 fromValue(String value) { + for (BlockTypeV1 b : BlockTypeV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BlockTypeV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BlockTypeV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BlockTypeV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 0000000000..0cca3cb4a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Error response from the connector. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Short error description message. + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Detailed error information. + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java new file mode 100644 index 0000000000..4132520b01 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java @@ -0,0 +1,249 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GenerateTransactionRequestV1Request; +import org.openapitools.client.model.Iroha2BaseConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request for generating transaction or query payload that can be signed on the client side. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GenerateTransactionRequestV1 { + public static final String SERIALIZED_NAME_REQUEST = "request"; + @SerializedName(SERIALIZED_NAME_REQUEST) + private GenerateTransactionRequestV1Request request; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public GenerateTransactionRequestV1() { + } + + public GenerateTransactionRequestV1 request(GenerateTransactionRequestV1Request request) { + + this.request = request; + return this; + } + + /** + * Get request + * @return request + **/ + @javax.annotation.Nonnull + public GenerateTransactionRequestV1Request getRequest() { + return request; + } + + + public void setRequest(GenerateTransactionRequestV1Request request) { + this.request = request; + } + + + public GenerateTransactionRequestV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateTransactionRequestV1 generateTransactionRequestV1 = (GenerateTransactionRequestV1) o; + return Objects.equals(this.request, generateTransactionRequestV1.request) && + Objects.equals(this.baseConfig, generateTransactionRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(request, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateTransactionRequestV1 {\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("request"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("request"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenerateTransactionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GenerateTransactionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateTransactionRequestV1 is not found in the empty JSON string", GenerateTransactionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GenerateTransactionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateTransactionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GenerateTransactionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `request` + GenerateTransactionRequestV1Request.validateJsonObject(jsonObj.getAsJsonObject("request")); + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateTransactionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTransactionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenerateTransactionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenerateTransactionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenerateTransactionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateTransactionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTransactionRequestV1 + * @throws IOException if the JSON string is invalid with respect to GenerateTransactionRequestV1 + */ + public static GenerateTransactionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTransactionRequestV1.class); + } + + /** + * Convert an instance of GenerateTransactionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java new file mode 100644 index 0000000000..8b1e1364a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java @@ -0,0 +1,288 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaQuery; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GenerateTransactionRequestV1Request extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GenerateTransactionRequestV1Request.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateTransactionRequestV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTransactionRequestV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIrohaQueryDefinitionV1 = gson.getDelegateAdapter(this, TypeToken.get(IrohaQueryDefinitionV1.class)); + final TypeAdapter adapterIrohaTransactionDefinitionV1 = gson.getDelegateAdapter(this, TypeToken.get(IrohaTransactionDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenerateTransactionRequestV1Request value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IrohaQueryDefinitionV1` + if (value.getActualInstance() instanceof IrohaQueryDefinitionV1) { + JsonObject obj = adapterIrohaQueryDefinitionV1.toJsonTree((IrohaQueryDefinitionV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `IrohaTransactionDefinitionV1` + if (value.getActualInstance() instanceof IrohaTransactionDefinitionV1) { + JsonObject obj = adapterIrohaTransactionDefinitionV1.toJsonTree((IrohaTransactionDefinitionV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1"); + } + + @Override + public GenerateTransactionRequestV1Request read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IrohaQueryDefinitionV1 + try { + // validate the JSON object to see if any exception is thrown + IrohaQueryDefinitionV1.validateJsonObject(jsonObject); + actualAdapter = adapterIrohaQueryDefinitionV1; + match++; + log.log(Level.FINER, "Input data matches schema 'IrohaQueryDefinitionV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IrohaQueryDefinitionV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IrohaQueryDefinitionV1'", e); + } + + // deserialize IrohaTransactionDefinitionV1 + try { + // validate the JSON object to see if any exception is thrown + IrohaTransactionDefinitionV1.validateJsonObject(jsonObject); + actualAdapter = adapterIrohaTransactionDefinitionV1; + match++; + log.log(Level.FINER, "Input data matches schema 'IrohaTransactionDefinitionV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IrohaTransactionDefinitionV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IrohaTransactionDefinitionV1'", e); + } + + if (match == 1) { + GenerateTransactionRequestV1Request ret = new GenerateTransactionRequestV1Request(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GenerateTransactionRequestV1Request: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GenerateTransactionRequestV1Request() { + super("oneOf", Boolean.FALSE); + } + + public GenerateTransactionRequestV1Request(IrohaQueryDefinitionV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GenerateTransactionRequestV1Request(IrohaTransactionDefinitionV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IrohaQueryDefinitionV1", new GenericType() { + }); + schemas.put("IrohaTransactionDefinitionV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GenerateTransactionRequestV1Request.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IrohaQueryDefinitionV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IrohaTransactionDefinitionV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1"); + } + + /** + * Get the actual instance, which can be the following: + * IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1 + * + * @return The actual instance (IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IrohaQueryDefinitionV1`. If the actual instance is not `IrohaQueryDefinitionV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IrohaQueryDefinitionV1` + * @throws ClassCastException if the instance is not `IrohaQueryDefinitionV1` + */ + public IrohaQueryDefinitionV1 getIrohaQueryDefinitionV1() throws ClassCastException { + return (IrohaQueryDefinitionV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `IrohaTransactionDefinitionV1`. If the actual instance is not `IrohaTransactionDefinitionV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IrohaTransactionDefinitionV1` + * @throws ClassCastException if the instance is not `IrohaTransactionDefinitionV1` + */ + public IrohaTransactionDefinitionV1 getIrohaTransactionDefinitionV1() throws ClassCastException { + return (IrohaTransactionDefinitionV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenerateTransactionRequestV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IrohaQueryDefinitionV1 + try { + IrohaQueryDefinitionV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IrohaQueryDefinitionV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IrohaTransactionDefinitionV1 + try { + IrohaTransactionDefinitionV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IrohaTransactionDefinitionV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GenerateTransactionRequestV1Request with oneOf schemas: IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of GenerateTransactionRequestV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTransactionRequestV1Request + * @throws IOException if the JSON string is invalid with respect to GenerateTransactionRequestV1Request + */ + public static GenerateTransactionRequestV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTransactionRequestV1Request.class); + } + + /** + * Convert an instance of GenerateTransactionRequestV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java new file mode 100644 index 0000000000..bb98c51178 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 account ID. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2AccountId { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public Iroha2AccountId() { + } + + public Iroha2AccountId name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Iroha2AccountId domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2AccountId iroha2AccountId = (Iroha2AccountId) o; + return Objects.equals(this.name, iroha2AccountId.name) && + Objects.equals(this.domainId, iroha2AccountId.domainId); + } + + @Override + public int hashCode() { + return Objects.hash(name, domainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2AccountId {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("domainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("domainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2AccountId + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2AccountId.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2AccountId is not found in the empty JSON string", Iroha2AccountId.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2AccountId.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2AccountId` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2AccountId.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2AccountId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2AccountId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2AccountId.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2AccountId value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2AccountId read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2AccountId given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2AccountId + * @throws IOException if the JSON string is invalid with respect to Iroha2AccountId + */ + public static Iroha2AccountId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2AccountId.class); + } + + /** + * Convert an instance of Iroha2AccountId to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java new file mode 100644 index 0000000000..0143a90984 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2AccountId; +import org.openapitools.client.model.Iroha2BaseConfigSigningCredential; +import org.openapitools.client.model.Iroha2BaseConfigTorii; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 connection configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2BaseConfig { + public static final String SERIALIZED_NAME_TORII = "torii"; + @SerializedName(SERIALIZED_NAME_TORII) + private Iroha2BaseConfigTorii torii; + + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private Iroha2AccountId accountId; + + public static final String SERIALIZED_NAME_SIGNING_CREDENTIAL = "signingCredential"; + @SerializedName(SERIALIZED_NAME_SIGNING_CREDENTIAL) + private Iroha2BaseConfigSigningCredential signingCredential; + + public Iroha2BaseConfig() { + } + + public Iroha2BaseConfig torii(Iroha2BaseConfigTorii torii) { + + this.torii = torii; + return this; + } + + /** + * Get torii + * @return torii + **/ + @javax.annotation.Nonnull + public Iroha2BaseConfigTorii getTorii() { + return torii; + } + + + public void setTorii(Iroha2BaseConfigTorii torii) { + this.torii = torii; + } + + + public Iroha2BaseConfig accountId(Iroha2AccountId accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nullable + public Iroha2AccountId getAccountId() { + return accountId; + } + + + public void setAccountId(Iroha2AccountId accountId) { + this.accountId = accountId; + } + + + public Iroha2BaseConfig signingCredential(Iroha2BaseConfigSigningCredential signingCredential) { + + this.signingCredential = signingCredential; + return this; + } + + /** + * Get signingCredential + * @return signingCredential + **/ + @javax.annotation.Nullable + public Iroha2BaseConfigSigningCredential getSigningCredential() { + return signingCredential; + } + + + public void setSigningCredential(Iroha2BaseConfigSigningCredential signingCredential) { + this.signingCredential = signingCredential; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2BaseConfig iroha2BaseConfig = (Iroha2BaseConfig) o; + return Objects.equals(this.torii, iroha2BaseConfig.torii) && + Objects.equals(this.accountId, iroha2BaseConfig.accountId) && + Objects.equals(this.signingCredential, iroha2BaseConfig.signingCredential); + } + + @Override + public int hashCode() { + return Objects.hash(torii, accountId, signingCredential); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2BaseConfig {\n"); + sb.append(" torii: ").append(toIndentedString(torii)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" signingCredential: ").append(toIndentedString(signingCredential)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("torii"); + openapiFields.add("accountId"); + openapiFields.add("signingCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("torii"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2BaseConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2BaseConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2BaseConfig is not found in the empty JSON string", Iroha2BaseConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2BaseConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2BaseConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2BaseConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `torii` + Iroha2BaseConfigTorii.validateJsonObject(jsonObj.getAsJsonObject("torii")); + // validate the optional field `accountId` + if (jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) { + Iroha2AccountId.validateJsonObject(jsonObj.getAsJsonObject("accountId")); + } + // validate the optional field `signingCredential` + if (jsonObj.get("signingCredential") != null && !jsonObj.get("signingCredential").isJsonNull()) { + Iroha2BaseConfigSigningCredential.validateJsonObject(jsonObj.getAsJsonObject("signingCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2BaseConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2BaseConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2BaseConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2BaseConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2BaseConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2BaseConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2BaseConfig + * @throws IOException if the JSON string is invalid with respect to Iroha2BaseConfig + */ + public static Iroha2BaseConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2BaseConfig.class); + } + + /** + * Convert an instance of Iroha2BaseConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java new file mode 100644 index 0000000000..3f7ecb8561 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2KeyJson; +import org.openapitools.client.model.Iroha2KeyPair; +import org.openapitools.client.model.KeychainReference; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2BaseConfigSigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Iroha2BaseConfigSigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2BaseConfigSigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2BaseConfigSigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIroha2KeyPair = gson.getDelegateAdapter(this, TypeToken.get(Iroha2KeyPair.class)); + final TypeAdapter adapterKeychainReference = gson.getDelegateAdapter(this, TypeToken.get(KeychainReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2BaseConfigSigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Iroha2KeyPair` + if (value.getActualInstance() instanceof Iroha2KeyPair) { + JsonObject obj = adapterIroha2KeyPair.toJsonTree((Iroha2KeyPair)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `KeychainReference` + if (value.getActualInstance() instanceof KeychainReference) { + JsonObject obj = adapterKeychainReference.toJsonTree((KeychainReference)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Iroha2KeyPair, KeychainReference"); + } + + @Override + public Iroha2BaseConfigSigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Iroha2KeyPair + try { + // validate the JSON object to see if any exception is thrown + Iroha2KeyPair.validateJsonObject(jsonObject); + actualAdapter = adapterIroha2KeyPair; + match++; + log.log(Level.FINER, "Input data matches schema 'Iroha2KeyPair'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Iroha2KeyPair failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Iroha2KeyPair'", e); + } + + // deserialize KeychainReference + try { + // validate the JSON object to see if any exception is thrown + KeychainReference.validateJsonObject(jsonObject); + actualAdapter = adapterKeychainReference; + match++; + log.log(Level.FINER, "Input data matches schema 'KeychainReference'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for KeychainReference failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'KeychainReference'", e); + } + + if (match == 1) { + Iroha2BaseConfigSigningCredential ret = new Iroha2BaseConfigSigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Iroha2BaseConfigSigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Iroha2BaseConfigSigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Iroha2BaseConfigSigningCredential(Iroha2KeyPair o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Iroha2BaseConfigSigningCredential(KeychainReference o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Iroha2KeyPair", new GenericType() { + }); + schemas.put("KeychainReference", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Iroha2BaseConfigSigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Iroha2KeyPair, KeychainReference + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Iroha2KeyPair) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof KeychainReference) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Iroha2KeyPair, KeychainReference"); + } + + /** + * Get the actual instance, which can be the following: + * Iroha2KeyPair, KeychainReference + * + * @return The actual instance (Iroha2KeyPair, KeychainReference) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Iroha2KeyPair`. If the actual instance is not `Iroha2KeyPair`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Iroha2KeyPair` + * @throws ClassCastException if the instance is not `Iroha2KeyPair` + */ + public Iroha2KeyPair getIroha2KeyPair() throws ClassCastException { + return (Iroha2KeyPair)super.getActualInstance(); + } + + /** + * Get the actual instance of `KeychainReference`. If the actual instance is not `KeychainReference`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `KeychainReference` + * @throws ClassCastException if the instance is not `KeychainReference` + */ + public KeychainReference getKeychainReference() throws ClassCastException { + return (KeychainReference)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2BaseConfigSigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Iroha2KeyPair + try { + Iroha2KeyPair.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Iroha2KeyPair failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with KeychainReference + try { + KeychainReference.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for KeychainReference failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Iroha2BaseConfigSigningCredential with oneOf schemas: Iroha2KeyPair, KeychainReference. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Iroha2BaseConfigSigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2BaseConfigSigningCredential + * @throws IOException if the JSON string is invalid with respect to Iroha2BaseConfigSigningCredential + */ + public static Iroha2BaseConfigSigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2BaseConfigSigningCredential.class); + } + + /** + * Convert an instance of Iroha2BaseConfigSigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java new file mode 100644 index 0000000000..63aa09eb1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java @@ -0,0 +1,239 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 peer connection information. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2BaseConfigTorii { + public static final String SERIALIZED_NAME_API_U_R_L = "apiURL"; + @SerializedName(SERIALIZED_NAME_API_U_R_L) + private String apiURL; + + public static final String SERIALIZED_NAME_TELEMETRY_U_R_L = "telemetryURL"; + @SerializedName(SERIALIZED_NAME_TELEMETRY_U_R_L) + private String telemetryURL; + + public Iroha2BaseConfigTorii() { + } + + public Iroha2BaseConfigTorii apiURL(String apiURL) { + + this.apiURL = apiURL; + return this; + } + + /** + * Get apiURL + * @return apiURL + **/ + @javax.annotation.Nullable + public String getApiURL() { + return apiURL; + } + + + public void setApiURL(String apiURL) { + this.apiURL = apiURL; + } + + + public Iroha2BaseConfigTorii telemetryURL(String telemetryURL) { + + this.telemetryURL = telemetryURL; + return this; + } + + /** + * Get telemetryURL + * @return telemetryURL + **/ + @javax.annotation.Nullable + public String getTelemetryURL() { + return telemetryURL; + } + + + public void setTelemetryURL(String telemetryURL) { + this.telemetryURL = telemetryURL; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2BaseConfigTorii iroha2BaseConfigTorii = (Iroha2BaseConfigTorii) o; + return Objects.equals(this.apiURL, iroha2BaseConfigTorii.apiURL) && + Objects.equals(this.telemetryURL, iroha2BaseConfigTorii.telemetryURL); + } + + @Override + public int hashCode() { + return Objects.hash(apiURL, telemetryURL); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2BaseConfigTorii {\n"); + sb.append(" apiURL: ").append(toIndentedString(apiURL)).append("\n"); + sb.append(" telemetryURL: ").append(toIndentedString(telemetryURL)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("apiURL"); + openapiFields.add("telemetryURL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2BaseConfigTorii + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2BaseConfigTorii.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2BaseConfigTorii is not found in the empty JSON string", Iroha2BaseConfigTorii.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2BaseConfigTorii.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2BaseConfigTorii` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("apiURL") != null && !jsonObj.get("apiURL").isJsonNull()) && !jsonObj.get("apiURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `apiURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiURL").toString())); + } + if ((jsonObj.get("telemetryURL") != null && !jsonObj.get("telemetryURL").isJsonNull()) && !jsonObj.get("telemetryURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `telemetryURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telemetryURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2BaseConfigTorii.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2BaseConfigTorii' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2BaseConfigTorii.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2BaseConfigTorii value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2BaseConfigTorii read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2BaseConfigTorii given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2BaseConfigTorii + * @throws IOException if the JSON string is invalid with respect to Iroha2BaseConfigTorii + */ + public static Iroha2BaseConfigTorii fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2BaseConfigTorii.class); + } + + /** + * Convert an instance of Iroha2BaseConfigTorii to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java new file mode 100644 index 0000000000..57e45964cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Private/Public key JSON containing payload and digest function. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2KeyJson { + public static final String SERIALIZED_NAME_DIGEST_FUNCTION = "digestFunction"; + @SerializedName(SERIALIZED_NAME_DIGEST_FUNCTION) + private String digestFunction; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public Iroha2KeyJson() { + } + + public Iroha2KeyJson digestFunction(String digestFunction) { + + this.digestFunction = digestFunction; + return this; + } + + /** + * Get digestFunction + * @return digestFunction + **/ + @javax.annotation.Nonnull + public String getDigestFunction() { + return digestFunction; + } + + + public void setDigestFunction(String digestFunction) { + this.digestFunction = digestFunction; + } + + + public Iroha2KeyJson payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2KeyJson iroha2KeyJson = (Iroha2KeyJson) o; + return Objects.equals(this.digestFunction, iroha2KeyJson.digestFunction) && + Objects.equals(this.payload, iroha2KeyJson.payload); + } + + @Override + public int hashCode() { + return Objects.hash(digestFunction, payload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2KeyJson {\n"); + sb.append(" digestFunction: ").append(toIndentedString(digestFunction)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("digestFunction"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("digestFunction"); + openapiRequiredFields.add("payload"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2KeyJson + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2KeyJson.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2KeyJson is not found in the empty JSON string", Iroha2KeyJson.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2KeyJson.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2KeyJson` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2KeyJson.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("digestFunction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `digestFunction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("digestFunction").toString())); + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2KeyJson.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2KeyJson' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2KeyJson.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2KeyJson value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2KeyJson read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2KeyJson given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2KeyJson + * @throws IOException if the JSON string is invalid with respect to Iroha2KeyJson + */ + public static Iroha2KeyJson fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2KeyJson.class); + } + + /** + * Convert an instance of Iroha2KeyJson to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java new file mode 100644 index 0000000000..ed5a700625 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2KeyJson; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Pair of Iroha account private and public keys. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2KeyPair { + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private Iroha2KeyJson privateKey; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public Iroha2KeyPair() { + } + + public Iroha2KeyPair privateKey(Iroha2KeyJson privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + **/ + @javax.annotation.Nonnull + public Iroha2KeyJson getPrivateKey() { + return privateKey; + } + + + public void setPrivateKey(Iroha2KeyJson privateKey) { + this.privateKey = privateKey; + } + + + public Iroha2KeyPair publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2KeyPair iroha2KeyPair = (Iroha2KeyPair) o; + return Objects.equals(this.privateKey, iroha2KeyPair.privateKey) && + Objects.equals(this.publicKey, iroha2KeyPair.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(privateKey, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2KeyPair {\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateKey"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateKey"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2KeyPair + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2KeyPair.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2KeyPair is not found in the empty JSON string", Iroha2KeyPair.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2KeyPair.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2KeyPair` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2KeyPair.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `privateKey` + Iroha2KeyJson.validateJsonObject(jsonObj.getAsJsonObject("privateKey")); + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2KeyPair.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2KeyPair' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2KeyPair.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2KeyPair value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2KeyPair read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2KeyPair given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2KeyPair + * @throws IOException if the JSON string is invalid with respect to Iroha2KeyPair + */ + public static Iroha2KeyPair fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2KeyPair.class); + } + + /** + * Convert an instance of Iroha2KeyPair to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java new file mode 100644 index 0000000000..63e382156f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java @@ -0,0 +1,104 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) + */ +@JsonAdapter(IrohaInstruction.Adapter.class) +public enum IrohaInstruction { + + /** + * Register new domain + */ + RegisterDomain("registerDomain"), + + /** + * Register new asset definition + */ + RegisterAssetDefinition("registerAssetDefinition"), + + /** + * Register new asset + */ + RegisterAsset("registerAsset"), + + /** + * Mint asset value + */ + MintAsset("mintAsset"), + + /** + * Burn asset value + */ + BurnAsset("burnAsset"), + + /** + * Transfer asset between accounts + */ + TransferAsset("transferAsset"), + + /** + * Register new account + */ + RegisterAccount("registerAccount"); + + private String value; + + IrohaInstruction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaInstruction fromValue(String value) { + for (IrohaInstruction b : IrohaInstruction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaInstruction enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaInstruction read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaInstruction.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java new file mode 100644 index 0000000000..7fdcb4de49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java @@ -0,0 +1,259 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaInstruction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Single Iroha V2 instruction to be executed request. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaInstructionRequestV1 { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private IrohaInstruction name = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = new ArrayList<>(); + + public IrohaInstructionRequestV1() { + } + + public IrohaInstructionRequestV1 name(IrohaInstruction name) { + + this.name = name; + return this; + } + + /** + * Iroha V2 instruction name. + * @return name + **/ + @javax.annotation.Nonnull + public IrohaInstruction getName() { + return name; + } + + + public void setName(IrohaInstruction name) { + this.name = name; + } + + + public IrohaInstructionRequestV1 params(List params) { + + this.params = params; + return this; + } + + public IrohaInstructionRequestV1 addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass with specified instruction. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaInstructionRequestV1 irohaInstructionRequestV1 = (IrohaInstructionRequestV1) o; + return Objects.equals(this.name, irohaInstructionRequestV1.name) && + Objects.equals(this.params, irohaInstructionRequestV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(name, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaInstructionRequestV1 {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaInstructionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaInstructionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaInstructionRequestV1 is not found in the empty JSON string", IrohaInstructionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaInstructionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaInstructionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaInstructionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaInstructionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaInstructionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaInstructionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaInstructionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaInstructionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaInstructionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaInstructionRequestV1 + * @throws IOException if the JSON string is invalid with respect to IrohaInstructionRequestV1 + */ + public static IrohaInstructionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaInstructionRequestV1.class); + } + + /** + * Convert an instance of IrohaInstructionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java new file mode 100644 index 0000000000..3790013c5e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java @@ -0,0 +1,129 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) + */ +@JsonAdapter(IrohaQuery.Adapter.class) +public enum IrohaQuery { + + /** + * Get list of all registered domains + */ + FindAllDomains("findAllDomains"), + + /** + * Get domain with specified ID + */ + FindDomainById("findDomainById"), + + /** + * Get asset definition with specified ID + */ + FindAssetDefinitionById("findAssetDefinitionById"), + + /** + * Get list of all registered asset definition + */ + FindAllAssetsDefinitions("findAllAssetsDefinitions"), + + /** + * Get asset with specified ID + */ + FindAssetById("findAssetById"), + + /** + * Get list of all registered assets + */ + FindAllAssets("findAllAssets"), + + /** + * Get list of all ledger peers + */ + FindAllPeers("findAllPeers"), + + /** + * Get list of all ledger blocks + */ + FindAllBlocks("findAllBlocks"), + + /** + * Get account with specified ID + */ + FindAccountById("findAccountById"), + + /** + * Get list of all registered accounts + */ + FindAllAccounts("findAllAccounts"), + + /** + * Get list of all transactions + */ + FindAllTransactions("findAllTransactions"), + + /** + * Get transaction with specified hash + */ + FindTransactionByHash("findTransactionByHash"); + + private String value; + + IrohaQuery(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaQuery fromValue(String value) { + for (IrohaQuery b : IrohaQuery.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaQuery enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaQuery read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaQuery.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java new file mode 100644 index 0000000000..36db7ae495 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaQuery; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 query definition. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaQueryDefinitionV1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private IrohaQuery query = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params; + + public IrohaQueryDefinitionV1() { + } + + public IrohaQueryDefinitionV1 query(IrohaQuery query) { + + this.query = query; + return this; + } + + /** + * Name of the query to be executed. + * @return query + **/ + @javax.annotation.Nonnull + public IrohaQuery getQuery() { + return query; + } + + + public void setQuery(IrohaQuery query) { + this.query = query; + } + + + public IrohaQueryDefinitionV1 params(List params) { + + this.params = params; + return this; + } + + public IrohaQueryDefinitionV1 addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass with the query. + * @return params + **/ + @javax.annotation.Nullable + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaQueryDefinitionV1 irohaQueryDefinitionV1 = (IrohaQueryDefinitionV1) o; + return Objects.equals(this.query, irohaQueryDefinitionV1.query) && + Objects.equals(this.params, irohaQueryDefinitionV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(query, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaQueryDefinitionV1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaQueryDefinitionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaQueryDefinitionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaQueryDefinitionV1 is not found in the empty JSON string", IrohaQueryDefinitionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaQueryDefinitionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaQueryDefinitionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaQueryDefinitionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("params") != null && !jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaQueryDefinitionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaQueryDefinitionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaQueryDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaQueryDefinitionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaQueryDefinitionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaQueryDefinitionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaQueryDefinitionV1 + * @throws IOException if the JSON string is invalid with respect to IrohaQueryDefinitionV1 + */ + public static IrohaQueryDefinitionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaQueryDefinitionV1.class); + } + + /** + * Convert an instance of IrohaQueryDefinitionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java new file mode 100644 index 0000000000..49cd8668c9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaQuery; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 signed query definition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaSignedQueryDefinitionV1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private IrohaQuery query = null; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public IrohaSignedQueryDefinitionV1() { + } + + public IrohaSignedQueryDefinitionV1 query(IrohaQuery query) { + + this.query = query; + return this; + } + + /** + * Name of the query to be executed. + * @return query + **/ + @javax.annotation.Nonnull + public IrohaQuery getQuery() { + return query; + } + + + public void setQuery(IrohaQuery query) { + this.query = query; + } + + + public IrohaSignedQueryDefinitionV1 payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Signed query transaction binary data received from generate-transaction endpoint. + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaSignedQueryDefinitionV1 irohaSignedQueryDefinitionV1 = (IrohaSignedQueryDefinitionV1) o; + return Objects.equals(this.query, irohaSignedQueryDefinitionV1.query) && + Objects.equals(this.payload, irohaSignedQueryDefinitionV1.payload); + } + + @Override + public int hashCode() { + return Objects.hash(query, payload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaSignedQueryDefinitionV1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("payload"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaSignedQueryDefinitionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaSignedQueryDefinitionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaSignedQueryDefinitionV1 is not found in the empty JSON string", IrohaSignedQueryDefinitionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaSignedQueryDefinitionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaSignedQueryDefinitionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaSignedQueryDefinitionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaSignedQueryDefinitionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaSignedQueryDefinitionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaSignedQueryDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaSignedQueryDefinitionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaSignedQueryDefinitionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaSignedQueryDefinitionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaSignedQueryDefinitionV1 + * @throws IOException if the JSON string is invalid with respect to IrohaSignedQueryDefinitionV1 + */ + public static IrohaSignedQueryDefinitionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaSignedQueryDefinitionV1.class); + } + + /** + * Convert an instance of IrohaSignedQueryDefinitionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java new file mode 100644 index 0000000000..06df56aa73 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; +import org.openapitools.client.model.IrohaTransactionParametersV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 transaction definition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaTransactionDefinitionV1 { + public static final String SERIALIZED_NAME_INSTRUCTION = "instruction"; + @SerializedName(SERIALIZED_NAME_INSTRUCTION) + private IrohaTransactionDefinitionV1Instruction instruction; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private IrohaTransactionParametersV1 params; + + public IrohaTransactionDefinitionV1() { + } + + public IrohaTransactionDefinitionV1 instruction(IrohaTransactionDefinitionV1Instruction instruction) { + + this.instruction = instruction; + return this; + } + + /** + * Get instruction + * @return instruction + **/ + @javax.annotation.Nonnull + public IrohaTransactionDefinitionV1Instruction getInstruction() { + return instruction; + } + + + public void setInstruction(IrohaTransactionDefinitionV1Instruction instruction) { + this.instruction = instruction; + } + + + public IrohaTransactionDefinitionV1 params(IrohaTransactionParametersV1 params) { + + this.params = params; + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nullable + public IrohaTransactionParametersV1 getParams() { + return params; + } + + + public void setParams(IrohaTransactionParametersV1 params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaTransactionDefinitionV1 irohaTransactionDefinitionV1 = (IrohaTransactionDefinitionV1) o; + return Objects.equals(this.instruction, irohaTransactionDefinitionV1.instruction) && + Objects.equals(this.params, irohaTransactionDefinitionV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(instruction, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaTransactionDefinitionV1 {\n"); + sb.append(" instruction: ").append(toIndentedString(instruction)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instruction"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instruction"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaTransactionDefinitionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaTransactionDefinitionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaTransactionDefinitionV1 is not found in the empty JSON string", IrohaTransactionDefinitionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaTransactionDefinitionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaTransactionDefinitionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaTransactionDefinitionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `instruction` + IrohaTransactionDefinitionV1Instruction.validateJsonObject(jsonObj.getAsJsonObject("instruction")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaTransactionDefinitionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaTransactionDefinitionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaTransactionDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaTransactionDefinitionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaTransactionDefinitionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaTransactionDefinitionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaTransactionDefinitionV1 + * @throws IOException if the JSON string is invalid with respect to IrohaTransactionDefinitionV1 + */ + public static IrohaTransactionDefinitionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaTransactionDefinitionV1.class); + } + + /** + * Convert an instance of IrohaTransactionDefinitionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java new file mode 100644 index 0000000000..852e7dacc9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java @@ -0,0 +1,286 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaInstruction; +import org.openapitools.client.model.IrohaInstructionRequestV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaTransactionDefinitionV1Instruction extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IrohaTransactionDefinitionV1Instruction.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaTransactionDefinitionV1Instruction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaTransactionDefinitionV1Instruction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIrohaInstructionRequestV1 = gson.getDelegateAdapter(this, TypeToken.get(IrohaInstructionRequestV1.class)); + final TypeAdapter adapterList<IrohaInstructionRequestV1> = gson.getDelegateAdapter(this, TypeToken.get(List<IrohaInstructionRequestV1>.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaTransactionDefinitionV1Instruction value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IrohaInstructionRequestV1` + if (value.getActualInstance() instanceof IrohaInstructionRequestV1) { + JsonObject obj = adapterIrohaInstructionRequestV1.toJsonTree((IrohaInstructionRequestV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `List<IrohaInstructionRequestV1>` + if (value.getActualInstance() instanceof List<IrohaInstructionRequestV1>) { + JsonObject obj = adapterList<IrohaInstructionRequestV1>.toJsonTree((List<IrohaInstructionRequestV1>)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IrohaInstructionRequestV1, List"); + } + + @Override + public IrohaTransactionDefinitionV1Instruction read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IrohaInstructionRequestV1 + try { + // validate the JSON object to see if any exception is thrown + IrohaInstructionRequestV1.validateJsonObject(jsonObject); + actualAdapter = adapterIrohaInstructionRequestV1; + match++; + log.log(Level.FINER, "Input data matches schema 'IrohaInstructionRequestV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IrohaInstructionRequestV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IrohaInstructionRequestV1'", e); + } + + // deserialize List + try { + // validate the JSON object to see if any exception is thrown + List<IrohaInstructionRequestV1>.validateJsonObject(jsonObject); + actualAdapter = adapterList<IrohaInstructionRequestV1>; + match++; + log.log(Level.FINER, "Input data matches schema 'List'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + if (match == 1) { + IrohaTransactionDefinitionV1Instruction ret = new IrohaTransactionDefinitionV1Instruction(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for IrohaTransactionDefinitionV1Instruction: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IrohaTransactionDefinitionV1Instruction() { + super("oneOf", Boolean.FALSE); + } + + public IrohaTransactionDefinitionV1Instruction(IrohaInstructionRequestV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IrohaTransactionDefinitionV1Instruction(List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IrohaInstructionRequestV1", new GenericType() { + }); + schemas.put("List", new GenericType>() { + }); + } + + @Override + public Map getSchemas() { + return IrohaTransactionDefinitionV1Instruction.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IrohaInstructionRequestV1, List + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IrohaInstructionRequestV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IrohaInstructionRequestV1, List"); + } + + /** + * Get the actual instance, which can be the following: + * IrohaInstructionRequestV1, List + * + * @return The actual instance (IrohaInstructionRequestV1, List) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IrohaInstructionRequestV1`. If the actual instance is not `IrohaInstructionRequestV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IrohaInstructionRequestV1` + * @throws ClassCastException if the instance is not `IrohaInstructionRequestV1` + */ + public IrohaInstructionRequestV1 getIrohaInstructionRequestV1() throws ClassCastException { + return (IrohaInstructionRequestV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `List`. If the actual instance is not `List`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List` + * @throws ClassCastException if the instance is not `List` + */ + public List getList() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaTransactionDefinitionV1Instruction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IrohaInstructionRequestV1 + try { + IrohaInstructionRequestV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IrohaInstructionRequestV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List + try { + List.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for IrohaTransactionDefinitionV1Instruction with oneOf schemas: IrohaInstructionRequestV1, List. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of IrohaTransactionDefinitionV1Instruction given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaTransactionDefinitionV1Instruction + * @throws IOException if the JSON string is invalid with respect to IrohaTransactionDefinitionV1Instruction + */ + public static IrohaTransactionDefinitionV1Instruction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaTransactionDefinitionV1Instruction.class); + } + + /** + * Convert an instance of IrohaTransactionDefinitionV1Instruction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java new file mode 100644 index 0000000000..a63e042833 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 transaction payload parameters + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaTransactionParametersV1 { + public static final String SERIALIZED_NAME_TTL = "ttl"; + @SerializedName(SERIALIZED_NAME_TTL) + private String ttl; + + public static final String SERIALIZED_NAME_CREATION_TIME = "creationTime"; + @SerializedName(SERIALIZED_NAME_CREATION_TIME) + private String creationTime; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public IrohaTransactionParametersV1() { + } + + public IrohaTransactionParametersV1 ttl(String ttl) { + + this.ttl = ttl; + return this; + } + + /** + * BigInt time to live. + * @return ttl + **/ + @javax.annotation.Nullable + public String getTtl() { + return ttl; + } + + + public void setTtl(String ttl) { + this.ttl = ttl; + } + + + public IrohaTransactionParametersV1 creationTime(String creationTime) { + + this.creationTime = creationTime; + return this; + } + + /** + * BigInt creation time + * @return creationTime + **/ + @javax.annotation.Nullable + public String getCreationTime() { + return creationTime; + } + + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + + public IrohaTransactionParametersV1 nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Transaction nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IrohaTransactionParametersV1 instance itself + */ + public IrohaTransactionParametersV1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaTransactionParametersV1 irohaTransactionParametersV1 = (IrohaTransactionParametersV1) o; + return Objects.equals(this.ttl, irohaTransactionParametersV1.ttl) && + Objects.equals(this.creationTime, irohaTransactionParametersV1.creationTime) && + Objects.equals(this.nonce, irohaTransactionParametersV1.nonce)&& + Objects.equals(this.additionalProperties, irohaTransactionParametersV1.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ttl, creationTime, nonce, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaTransactionParametersV1 {\n"); + sb.append(" ttl: ").append(toIndentedString(ttl)).append("\n"); + sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ttl"); + openapiFields.add("creationTime"); + openapiFields.add("nonce"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaTransactionParametersV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaTransactionParametersV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaTransactionParametersV1 is not found in the empty JSON string", IrohaTransactionParametersV1.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("ttl") != null && !jsonObj.get("ttl").isJsonNull()) && !jsonObj.get("ttl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ttl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ttl").toString())); + } + if ((jsonObj.get("creationTime") != null && !jsonObj.get("creationTime").isJsonNull()) && !jsonObj.get("creationTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creationTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creationTime").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaTransactionParametersV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaTransactionParametersV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaTransactionParametersV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaTransactionParametersV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IrohaTransactionParametersV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + IrohaTransactionParametersV1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaTransactionParametersV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaTransactionParametersV1 + * @throws IOException if the JSON string is invalid with respect to IrohaTransactionParametersV1 + */ + public static IrohaTransactionParametersV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaTransactionParametersV1.class); + } + + /** + * Convert an instance of IrohaTransactionParametersV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java new file mode 100644 index 0000000000..b6044bad1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Reference to entry stored in Cactus keychain plugin. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class KeychainReference { + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_KEYCHAIN_REF = "keychainRef"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_REF) + private String keychainRef; + + public KeychainReference() { + } + + public KeychainReference keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Keychain plugin ID. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public KeychainReference keychainRef(String keychainRef) { + + this.keychainRef = keychainRef; + return this; + } + + /** + * Key reference name. + * @return keychainRef + **/ + @javax.annotation.Nonnull + public String getKeychainRef() { + return keychainRef; + } + + + public void setKeychainRef(String keychainRef) { + this.keychainRef = keychainRef; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeychainReference keychainReference = (KeychainReference) o; + return Objects.equals(this.keychainId, keychainReference.keychainId) && + Objects.equals(this.keychainRef, keychainReference.keychainRef); + } + + @Override + public int hashCode() { + return Objects.hash(keychainId, keychainRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class KeychainReference {\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" keychainRef: ").append(toIndentedString(keychainRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychainId"); + openapiFields.add("keychainRef"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("keychainRef"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to KeychainReference + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!KeychainReference.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in KeychainReference is not found in the empty JSON string", KeychainReference.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!KeychainReference.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KeychainReference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : KeychainReference.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("keychainRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainRef").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!KeychainReference.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KeychainReference' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(KeychainReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, KeychainReference value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public KeychainReference read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of KeychainReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of KeychainReference + * @throws IOException if the JSON string is invalid with respect to KeychainReference + */ + public static KeychainReference fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KeychainReference.class); + } + + /** + * Convert an instance of KeychainReference to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java new file mode 100644 index 0000000000..0330faac38 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java @@ -0,0 +1,276 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaSignedQueryDefinitionV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request to query endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QueryRequestV1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private IrohaQueryDefinitionV1 query; + + public static final String SERIALIZED_NAME_SIGNED_QUERY = "signedQuery"; + @SerializedName(SERIALIZED_NAME_SIGNED_QUERY) + private IrohaSignedQueryDefinitionV1 signedQuery; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public QueryRequestV1() { + } + + public QueryRequestV1 query(IrohaQueryDefinitionV1 query) { + + this.query = query; + return this; + } + + /** + * Get query + * @return query + **/ + @javax.annotation.Nullable + public IrohaQueryDefinitionV1 getQuery() { + return query; + } + + + public void setQuery(IrohaQueryDefinitionV1 query) { + this.query = query; + } + + + public QueryRequestV1 signedQuery(IrohaSignedQueryDefinitionV1 signedQuery) { + + this.signedQuery = signedQuery; + return this; + } + + /** + * Get signedQuery + * @return signedQuery + **/ + @javax.annotation.Nullable + public IrohaSignedQueryDefinitionV1 getSignedQuery() { + return signedQuery; + } + + + public void setSignedQuery(IrohaSignedQueryDefinitionV1 signedQuery) { + this.signedQuery = signedQuery; + } + + + public QueryRequestV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryRequestV1 queryRequestV1 = (QueryRequestV1) o; + return Objects.equals(this.query, queryRequestV1.query) && + Objects.equals(this.signedQuery, queryRequestV1.signedQuery) && + Objects.equals(this.baseConfig, queryRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(query, signedQuery, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryRequestV1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" signedQuery: ").append(toIndentedString(signedQuery)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("signedQuery"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QueryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QueryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryRequestV1 is not found in the empty JSON string", QueryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QueryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `query` + if (jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) { + IrohaQueryDefinitionV1.validateJsonObject(jsonObj.getAsJsonObject("query")); + } + // validate the optional field `signedQuery` + if (jsonObj.get("signedQuery") != null && !jsonObj.get("signedQuery").isJsonNull()) { + IrohaSignedQueryDefinitionV1.validateJsonObject(jsonObj.getAsJsonObject("signedQuery")); + } + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryRequestV1 + * @throws IOException if the JSON string is invalid with respect to QueryRequestV1 + */ + public static QueryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryRequestV1.class); + } + + /** + * Convert an instance of QueryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java new file mode 100644 index 0000000000..898112d05f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response with the query results. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QueryResponseV1 { + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private Object response = null; + + public QueryResponseV1() { + } + + public QueryResponseV1 response(Object response) { + + this.response = response; + return this; + } + + /** + * Query response data that varies between different queries. + * @return response + **/ + @javax.annotation.Nullable + public Object getResponse() { + return response; + } + + + public void setResponse(Object response) { + this.response = response; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryResponseV1 queryResponseV1 = (QueryResponseV1) o; + return Objects.equals(this.response, queryResponseV1.response); + } + + @Override + public int hashCode() { + return Objects.hash(response); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryResponseV1 {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("response"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QueryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QueryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryResponseV1 is not found in the empty JSON string", QueryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QueryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QueryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryResponseV1 + * @throws IOException if the JSON string is invalid with respect to QueryResponseV1 + */ + public static QueryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryResponseV1.class); + } + + /** + * Convert an instance of QueryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java new file mode 100644 index 0000000000..719e1fd4a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java @@ -0,0 +1,302 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request to transact endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactRequestV1 { + public static final String SERIALIZED_NAME_SIGNED_TRANSACTION = "signedTransaction"; + @SerializedName(SERIALIZED_NAME_SIGNED_TRANSACTION) + private String signedTransaction; + + public static final String SERIALIZED_NAME_TRANSACTION = "transaction"; + @SerializedName(SERIALIZED_NAME_TRANSACTION) + private IrohaTransactionDefinitionV1 transaction; + + public static final String SERIALIZED_NAME_WAIT_FOR_COMMIT = "waitForCommit"; + @SerializedName(SERIALIZED_NAME_WAIT_FOR_COMMIT) + private Boolean waitForCommit = false; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public TransactRequestV1() { + } + + public TransactRequestV1 signedTransaction(String signedTransaction) { + + this.signedTransaction = signedTransaction; + return this; + } + + /** + * Signed transaction binary data received from generate-transaction endpoint. + * @return signedTransaction + **/ + @javax.annotation.Nullable + public String getSignedTransaction() { + return signedTransaction; + } + + + public void setSignedTransaction(String signedTransaction) { + this.signedTransaction = signedTransaction; + } + + + public TransactRequestV1 transaction(IrohaTransactionDefinitionV1 transaction) { + + this.transaction = transaction; + return this; + } + + /** + * Get transaction + * @return transaction + **/ + @javax.annotation.Nullable + public IrohaTransactionDefinitionV1 getTransaction() { + return transaction; + } + + + public void setTransaction(IrohaTransactionDefinitionV1 transaction) { + this.transaction = transaction; + } + + + public TransactRequestV1 waitForCommit(Boolean waitForCommit) { + + this.waitForCommit = waitForCommit; + return this; + } + + /** + * Wait unitl transaction is sent and return the final status (committed / rejected) + * @return waitForCommit + **/ + @javax.annotation.Nullable + public Boolean getWaitForCommit() { + return waitForCommit; + } + + + public void setWaitForCommit(Boolean waitForCommit) { + this.waitForCommit = waitForCommit; + } + + + public TransactRequestV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactRequestV1 transactRequestV1 = (TransactRequestV1) o; + return Objects.equals(this.signedTransaction, transactRequestV1.signedTransaction) && + Objects.equals(this.transaction, transactRequestV1.transaction) && + Objects.equals(this.waitForCommit, transactRequestV1.waitForCommit) && + Objects.equals(this.baseConfig, transactRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(signedTransaction, transaction, waitForCommit, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactRequestV1 {\n"); + sb.append(" signedTransaction: ").append(toIndentedString(signedTransaction)).append("\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append(" waitForCommit: ").append(toIndentedString(waitForCommit)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signedTransaction"); + openapiFields.add("transaction"); + openapiFields.add("waitForCommit"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactRequestV1 is not found in the empty JSON string", TransactRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("signedTransaction") != null && !jsonObj.get("signedTransaction").isJsonNull()) && !jsonObj.get("signedTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedTransaction").toString())); + } + // validate the optional field `transaction` + if (jsonObj.get("transaction") != null && !jsonObj.get("transaction").isJsonNull()) { + IrohaTransactionDefinitionV1.validateJsonObject(jsonObj.getAsJsonObject("transaction")); + } + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactRequestV1 + * @throws IOException if the JSON string is invalid with respect to TransactRequestV1 + */ + public static TransactRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactRequestV1.class); + } + + /** + * Convert an instance of TransactRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java new file mode 100644 index 0000000000..d65281c61a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.TransactionStatusV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response from transaction endpoint with operation status. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactResponseV1 { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private TransactionStatusV1 status; + + public static final String SERIALIZED_NAME_REJECT_REASON = "rejectReason"; + @SerializedName(SERIALIZED_NAME_REJECT_REASON) + private String rejectReason; + + public TransactResponseV1() { + } + + public TransactResponseV1 hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Hexadecimal hash of the transaction sent to the ledger. + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public TransactResponseV1 status(TransactionStatusV1 status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public TransactionStatusV1 getStatus() { + return status; + } + + + public void setStatus(TransactionStatusV1 status) { + this.status = status; + } + + + public TransactResponseV1 rejectReason(String rejectReason) { + + this.rejectReason = rejectReason; + return this; + } + + /** + * When waitForCommit was suplied and the transaction was rejected, contains the reason of the rejection. + * @return rejectReason + **/ + @javax.annotation.Nullable + public String getRejectReason() { + return rejectReason; + } + + + public void setRejectReason(String rejectReason) { + this.rejectReason = rejectReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactResponseV1 transactResponseV1 = (TransactResponseV1) o; + return Objects.equals(this.hash, transactResponseV1.hash) && + Objects.equals(this.status, transactResponseV1.status) && + Objects.equals(this.rejectReason, transactResponseV1.rejectReason); + } + + @Override + public int hashCode() { + return Objects.hash(hash, status, rejectReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactResponseV1 {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" rejectReason: ").append(toIndentedString(rejectReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("status"); + openapiFields.add("rejectReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactResponseV1 is not found in the empty JSON string", TransactResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransactResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if ((jsonObj.get("rejectReason") != null && !jsonObj.get("rejectReason").isJsonNull()) && !jsonObj.get("rejectReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rejectReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rejectReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactResponseV1 + * @throws IOException if the JSON string is invalid with respect to TransactResponseV1 + */ + public static TransactResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactResponseV1.class); + } + + /** + * Convert an instance of TransactResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java new file mode 100644 index 0000000000..3415544756 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Status of Iroha V2 transaction. + */ +@JsonAdapter(TransactionStatusV1.Adapter.class) +public enum TransactionStatusV1 { + + /** + * Transaction was submitted to the ledger - use other tools to check if it was accepted and committed. + */ + Submitted("submitted"), + + /** + * Transaction was committed to the ledger. + */ + Committed("committed"), + + /** + * Transaction was rejected. + */ + Rejected("rejected"); + + private String value; + + TransactionStatusV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TransactionStatusV1 fromValue(String value) { + for (TransactionStatusV1 b : TransactionStatusV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TransactionStatusV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TransactionStatusV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TransactionStatusV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java new file mode 100644 index 0000000000..680d8ee098 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Binary encoded response of block data. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksBinaryResponseV1 { + public static final String SERIALIZED_NAME_BINARY_BLOCK = "binaryBlock"; + @SerializedName(SERIALIZED_NAME_BINARY_BLOCK) + private String binaryBlock; + + public WatchBlocksBinaryResponseV1() { + } + + public WatchBlocksBinaryResponseV1 binaryBlock(String binaryBlock) { + + this.binaryBlock = binaryBlock; + return this; + } + + /** + * Get binaryBlock + * @return binaryBlock + **/ + @javax.annotation.Nonnull + public String getBinaryBlock() { + return binaryBlock; + } + + + public void setBinaryBlock(String binaryBlock) { + this.binaryBlock = binaryBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksBinaryResponseV1 watchBlocksBinaryResponseV1 = (WatchBlocksBinaryResponseV1) o; + return Objects.equals(this.binaryBlock, watchBlocksBinaryResponseV1.binaryBlock); + } + + @Override + public int hashCode() { + return Objects.hash(binaryBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksBinaryResponseV1 {\n"); + sb.append(" binaryBlock: ").append(toIndentedString(binaryBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("binaryBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("binaryBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksBinaryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksBinaryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksBinaryResponseV1 is not found in the empty JSON string", WatchBlocksBinaryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksBinaryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksBinaryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksBinaryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("binaryBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `binaryBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binaryBlock").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksBinaryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksBinaryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksBinaryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksBinaryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksBinaryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksBinaryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksBinaryResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksBinaryResponseV1 + */ + public static WatchBlocksBinaryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksBinaryResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksBinaryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java new file mode 100644 index 0000000000..114b2f8f94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.BlockTypeV1; +import org.openapitools.client.model.Iroha2BaseConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Options passed when subscribing to block monitoring. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksOptionsV1 { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private BlockTypeV1 type; + + public static final String SERIALIZED_NAME_START_BLOCK = "startBlock"; + @SerializedName(SERIALIZED_NAME_START_BLOCK) + private String startBlock; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public WatchBlocksOptionsV1() { + } + + public WatchBlocksOptionsV1 type(BlockTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + public BlockTypeV1 getType() { + return type; + } + + + public void setType(BlockTypeV1 type) { + this.type = type; + } + + + public WatchBlocksOptionsV1 startBlock(String startBlock) { + + this.startBlock = startBlock; + return this; + } + + /** + * Number of block to start monitoring from. + * @return startBlock + **/ + @javax.annotation.Nullable + public String getStartBlock() { + return startBlock; + } + + + public void setStartBlock(String startBlock) { + this.startBlock = startBlock; + } + + + public WatchBlocksOptionsV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksOptionsV1 watchBlocksOptionsV1 = (WatchBlocksOptionsV1) o; + return Objects.equals(this.type, watchBlocksOptionsV1.type) && + Objects.equals(this.startBlock, watchBlocksOptionsV1.startBlock) && + Objects.equals(this.baseConfig, watchBlocksOptionsV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(type, startBlock, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksOptionsV1 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" startBlock: ").append(toIndentedString(startBlock)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("startBlock"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksOptionsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksOptionsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksOptionsV1 is not found in the empty JSON string", WatchBlocksOptionsV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksOptionsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksOptionsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("startBlock") != null && !jsonObj.get("startBlock").isJsonNull()) && !jsonObj.get("startBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startBlock").toString())); + } + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksOptionsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksOptionsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksOptionsV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksOptionsV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksOptionsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksOptionsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksOptionsV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksOptionsV1 + */ + public static WatchBlocksOptionsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksOptionsV1.class); + } + + /** + * Convert an instance of WatchBlocksOptionsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java new file mode 100644 index 0000000000..3ed82a335f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Default JSON-encoded string full block data. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksRawResponseV1 { + public static final String SERIALIZED_NAME_BLOCK_DATA = "blockData"; + @SerializedName(SERIALIZED_NAME_BLOCK_DATA) + private String blockData; + + public WatchBlocksRawResponseV1() { + } + + public WatchBlocksRawResponseV1 blockData(String blockData) { + + this.blockData = blockData; + return this; + } + + /** + * Get blockData + * @return blockData + **/ + @javax.annotation.Nonnull + public String getBlockData() { + return blockData; + } + + + public void setBlockData(String blockData) { + this.blockData = blockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksRawResponseV1 watchBlocksRawResponseV1 = (WatchBlocksRawResponseV1) o; + return Objects.equals(this.blockData, watchBlocksRawResponseV1.blockData); + } + + @Override + public int hashCode() { + return Objects.hash(blockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksRawResponseV1 {\n"); + sb.append(" blockData: ").append(toIndentedString(blockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockData"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksRawResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksRawResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksRawResponseV1 is not found in the empty JSON string", WatchBlocksRawResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksRawResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksRawResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksRawResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("blockData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksRawResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksRawResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksRawResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksRawResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksRawResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksRawResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksRawResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksRawResponseV1 + */ + public static WatchBlocksRawResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksRawResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksRawResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java new file mode 100644 index 0000000000..f1cc0393e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java @@ -0,0 +1,337 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.WatchBlocksBinaryResponseV1; +import org.openapitools.client.model.WatchBlocksRawResponseV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksResponseV1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksResponseV1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterErrorExceptionResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + final TypeAdapter adapterWatchBlocksBinaryResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksBinaryResponseV1.class)); + final TypeAdapter adapterWatchBlocksRawResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksRawResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksResponseV1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ErrorExceptionResponseV1` + if (value.getActualInstance() instanceof ErrorExceptionResponseV1) { + JsonObject obj = adapterErrorExceptionResponseV1.toJsonTree((ErrorExceptionResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksBinaryResponseV1` + if (value.getActualInstance() instanceof WatchBlocksBinaryResponseV1) { + JsonObject obj = adapterWatchBlocksBinaryResponseV1.toJsonTree((WatchBlocksBinaryResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksRawResponseV1` + if (value.getActualInstance() instanceof WatchBlocksRawResponseV1) { + JsonObject obj = adapterWatchBlocksRawResponseV1.toJsonTree((WatchBlocksRawResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1"); + } + + @Override + public WatchBlocksResponseV1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ErrorExceptionResponseV1 + try { + // validate the JSON object to see if any exception is thrown + ErrorExceptionResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterErrorExceptionResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'ErrorExceptionResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ErrorExceptionResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ErrorExceptionResponseV1'", e); + } + + // deserialize WatchBlocksBinaryResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksBinaryResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksBinaryResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksBinaryResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksBinaryResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksBinaryResponseV1'", e); + } + + // deserialize WatchBlocksRawResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksRawResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksRawResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksRawResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksRawResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksRawResponseV1'", e); + } + + if (match == 1) { + WatchBlocksResponseV1 ret = new WatchBlocksResponseV1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksResponseV1: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksResponseV1() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksResponseV1(ErrorExceptionResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksBinaryResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksRawResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ErrorExceptionResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksBinaryResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksRawResponseV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksResponseV1.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ErrorExceptionResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksBinaryResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksRawResponseV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1"); + } + + /** + * Get the actual instance, which can be the following: + * ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1 + * + * @return The actual instance (ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ErrorExceptionResponseV1`. If the actual instance is not `ErrorExceptionResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ErrorExceptionResponseV1` + * @throws ClassCastException if the instance is not `ErrorExceptionResponseV1` + */ + public ErrorExceptionResponseV1 getErrorExceptionResponseV1() throws ClassCastException { + return (ErrorExceptionResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksBinaryResponseV1`. If the actual instance is not `WatchBlocksBinaryResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksBinaryResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksBinaryResponseV1` + */ + public WatchBlocksBinaryResponseV1 getWatchBlocksBinaryResponseV1() throws ClassCastException { + return (WatchBlocksBinaryResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksRawResponseV1`. If the actual instance is not `WatchBlocksRawResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksRawResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksRawResponseV1` + */ + public WatchBlocksRawResponseV1 getWatchBlocksRawResponseV1() throws ClassCastException { + return (WatchBlocksRawResponseV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ErrorExceptionResponseV1 + try { + ErrorExceptionResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ErrorExceptionResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksBinaryResponseV1 + try { + WatchBlocksBinaryResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksBinaryResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksRawResponseV1 + try { + WatchBlocksRawResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksRawResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksResponseV1 with oneOf schemas: ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksResponseV1 + */ + public static WatchBlocksResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 0000000000..dc24dab1e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Websocket requests for monitoring new blocks. + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..06f11ce693 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.QueryRequestV1; +import org.openapitools.client.model.QueryResponseV1; +import org.openapitools.client.model.TransactRequestV1; +import org.openapitools.client.model.TransactResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Generate transaction that can be signed locally. + * + * @throws ApiException if the Api call fails + */ + @Test + public void generateTransactionV1Test() throws ApiException { + GenerateTransactionRequestV1 generateTransactionRequestV1 = null; + String response = api.generateTransactionV1(generateTransactionRequestV1); + // TODO: test validations + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. + * + * @throws ApiException if the Api call fails + */ + @Test + public void queryV1Test() throws ApiException { + QueryRequestV1 queryRequestV1 = null; + QueryResponseV1 response = api.queryV1(queryRequestV1); + // TODO: test validations + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) + * + * @throws ApiException if the Api call fails + */ + @Test + public void transactV1Test() throws ApiException { + TransactRequestV1 transactRequestV1 = null; + TransactResponseV1 response = api.transactV1(transactRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java new file mode 100644 index 0000000000..6b982b8d28 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BlockTypeV1 + */ +public class BlockTypeV1Test { + /** + * Model tests for BlockTypeV1 + */ + @Test + public void testBlockTypeV1() { + // TODO: test BlockTypeV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 0000000000..ebf6fd6868 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java new file mode 100644 index 0000000000..a31194e30b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaQuery; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GenerateTransactionRequestV1Request + */ +public class GenerateTransactionRequestV1RequestTest { + private final GenerateTransactionRequestV1Request model = new GenerateTransactionRequestV1Request(); + + /** + * Model tests for GenerateTransactionRequestV1Request + */ + @Test + public void testGenerateTransactionRequestV1Request() { + // TODO: test GenerateTransactionRequestV1Request + } + + /** + * Test the property 'instruction' + */ + @Test + public void instructionTest() { + // TODO: test instruction + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java new file mode 100644 index 0000000000..b84e2c4fcd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GenerateTransactionRequestV1Request; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GenerateTransactionRequestV1 + */ +public class GenerateTransactionRequestV1Test { + private final GenerateTransactionRequestV1 model = new GenerateTransactionRequestV1(); + + /** + * Model tests for GenerateTransactionRequestV1 + */ + @Test + public void testGenerateTransactionRequestV1() { + // TODO: test GenerateTransactionRequestV1 + } + + /** + * Test the property 'request' + */ + @Test + public void requestTest() { + // TODO: test request + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java new file mode 100644 index 0000000000..d52770b5eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2AccountId + */ +public class Iroha2AccountIdTest { + private final Iroha2AccountId model = new Iroha2AccountId(); + + /** + * Model tests for Iroha2AccountId + */ + @Test + public void testIroha2AccountId() { + // TODO: test Iroha2AccountId + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java new file mode 100644 index 0000000000..028a395899 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2KeyJson; +import org.openapitools.client.model.Iroha2KeyPair; +import org.openapitools.client.model.KeychainReference; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2BaseConfigSigningCredential + */ +public class Iroha2BaseConfigSigningCredentialTest { + private final Iroha2BaseConfigSigningCredential model = new Iroha2BaseConfigSigningCredential(); + + /** + * Model tests for Iroha2BaseConfigSigningCredential + */ + @Test + public void testIroha2BaseConfigSigningCredential() { + // TODO: test Iroha2BaseConfigSigningCredential + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java new file mode 100644 index 0000000000..1e31b1cff8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2AccountId; +import org.openapitools.client.model.Iroha2BaseConfigSigningCredential; +import org.openapitools.client.model.Iroha2BaseConfigTorii; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2BaseConfig + */ +public class Iroha2BaseConfigTest { + private final Iroha2BaseConfig model = new Iroha2BaseConfig(); + + /** + * Model tests for Iroha2BaseConfig + */ + @Test + public void testIroha2BaseConfig() { + // TODO: test Iroha2BaseConfig + } + + /** + * Test the property 'torii' + */ + @Test + public void toriiTest() { + // TODO: test torii + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'signingCredential' + */ + @Test + public void signingCredentialTest() { + // TODO: test signingCredential + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java new file mode 100644 index 0000000000..571d72a92e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2BaseConfigTorii + */ +public class Iroha2BaseConfigToriiTest { + private final Iroha2BaseConfigTorii model = new Iroha2BaseConfigTorii(); + + /** + * Model tests for Iroha2BaseConfigTorii + */ + @Test + public void testIroha2BaseConfigTorii() { + // TODO: test Iroha2BaseConfigTorii + } + + /** + * Test the property 'apiURL' + */ + @Test + public void apiURLTest() { + // TODO: test apiURL + } + + /** + * Test the property 'telemetryURL' + */ + @Test + public void telemetryURLTest() { + // TODO: test telemetryURL + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java new file mode 100644 index 0000000000..046cff7935 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2KeyJson + */ +public class Iroha2KeyJsonTest { + private final Iroha2KeyJson model = new Iroha2KeyJson(); + + /** + * Model tests for Iroha2KeyJson + */ + @Test + public void testIroha2KeyJson() { + // TODO: test Iroha2KeyJson + } + + /** + * Test the property 'digestFunction' + */ + @Test + public void digestFunctionTest() { + // TODO: test digestFunction + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java new file mode 100644 index 0000000000..36d2bbeb00 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2KeyJson; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2KeyPair + */ +public class Iroha2KeyPairTest { + private final Iroha2KeyPair model = new Iroha2KeyPair(); + + /** + * Model tests for Iroha2KeyPair + */ + @Test + public void testIroha2KeyPair() { + // TODO: test Iroha2KeyPair + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java new file mode 100644 index 0000000000..6c4cafab3b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaInstruction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaInstructionRequestV1 + */ +public class IrohaInstructionRequestV1Test { + private final IrohaInstructionRequestV1 model = new IrohaInstructionRequestV1(); + + /** + * Model tests for IrohaInstructionRequestV1 + */ + @Test + public void testIrohaInstructionRequestV1() { + // TODO: test IrohaInstructionRequestV1 + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java new file mode 100644 index 0000000000..4e7b74e441 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaInstruction + */ +public class IrohaInstructionTest { + /** + * Model tests for IrohaInstruction + */ + @Test + public void testIrohaInstruction() { + // TODO: test IrohaInstruction + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java new file mode 100644 index 0000000000..c66724f6ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaQuery; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaQueryDefinitionV1 + */ +public class IrohaQueryDefinitionV1Test { + private final IrohaQueryDefinitionV1 model = new IrohaQueryDefinitionV1(); + + /** + * Model tests for IrohaQueryDefinitionV1 + */ + @Test + public void testIrohaQueryDefinitionV1() { + // TODO: test IrohaQueryDefinitionV1 + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java new file mode 100644 index 0000000000..7eec7b633c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaQuery + */ +public class IrohaQueryTest { + /** + * Model tests for IrohaQuery + */ + @Test + public void testIrohaQuery() { + // TODO: test IrohaQuery + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java new file mode 100644 index 0000000000..ae49745fb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaQuery; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaSignedQueryDefinitionV1 + */ +public class IrohaSignedQueryDefinitionV1Test { + private final IrohaSignedQueryDefinitionV1 model = new IrohaSignedQueryDefinitionV1(); + + /** + * Model tests for IrohaSignedQueryDefinitionV1 + */ + @Test + public void testIrohaSignedQueryDefinitionV1() { + // TODO: test IrohaSignedQueryDefinitionV1 + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java new file mode 100644 index 0000000000..ae9c781afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java @@ -0,0 +1,60 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.IrohaInstruction; +import org.openapitools.client.model.IrohaInstructionRequestV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaTransactionDefinitionV1Instruction + */ +public class IrohaTransactionDefinitionV1InstructionTest { + private final IrohaTransactionDefinitionV1Instruction model = new IrohaTransactionDefinitionV1Instruction(); + + /** + * Model tests for IrohaTransactionDefinitionV1Instruction + */ + @Test + public void testIrohaTransactionDefinitionV1Instruction() { + // TODO: test IrohaTransactionDefinitionV1Instruction + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java new file mode 100644 index 0000000000..03d5e4a10f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; +import org.openapitools.client.model.IrohaTransactionParametersV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaTransactionDefinitionV1 + */ +public class IrohaTransactionDefinitionV1Test { + private final IrohaTransactionDefinitionV1 model = new IrohaTransactionDefinitionV1(); + + /** + * Model tests for IrohaTransactionDefinitionV1 + */ + @Test + public void testIrohaTransactionDefinitionV1() { + // TODO: test IrohaTransactionDefinitionV1 + } + + /** + * Test the property 'instruction' + */ + @Test + public void instructionTest() { + // TODO: test instruction + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java new file mode 100644 index 0000000000..c1b2e1cbda --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaTransactionParametersV1 + */ +public class IrohaTransactionParametersV1Test { + private final IrohaTransactionParametersV1 model = new IrohaTransactionParametersV1(); + + /** + * Model tests for IrohaTransactionParametersV1 + */ + @Test + public void testIrohaTransactionParametersV1() { + // TODO: test IrohaTransactionParametersV1 + } + + /** + * Test the property 'ttl' + */ + @Test + public void ttlTest() { + // TODO: test ttl + } + + /** + * Test the property 'creationTime' + */ + @Test + public void creationTimeTest() { + // TODO: test creationTime + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java new file mode 100644 index 0000000000..a74887be32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for KeychainReference + */ +public class KeychainReferenceTest { + private final KeychainReference model = new KeychainReference(); + + /** + * Model tests for KeychainReference + */ + @Test + public void testKeychainReference() { + // TODO: test KeychainReference + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java new file mode 100644 index 0000000000..6c33798142 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaSignedQueryDefinitionV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QueryRequestV1 + */ +public class QueryRequestV1Test { + private final QueryRequestV1 model = new QueryRequestV1(); + + /** + * Model tests for QueryRequestV1 + */ + @Test + public void testQueryRequestV1() { + // TODO: test QueryRequestV1 + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'signedQuery' + */ + @Test + public void signedQueryTest() { + // TODO: test signedQuery + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java new file mode 100644 index 0000000000..c0b4d2d827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QueryResponseV1 + */ +public class QueryResponseV1Test { + private final QueryResponseV1 model = new QueryResponseV1(); + + /** + * Model tests for QueryResponseV1 + */ + @Test + public void testQueryResponseV1() { + // TODO: test QueryResponseV1 + } + + /** + * Test the property 'response' + */ + @Test + public void responseTest() { + // TODO: test response + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java new file mode 100644 index 0000000000..a111f20558 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactRequestV1 + */ +public class TransactRequestV1Test { + private final TransactRequestV1 model = new TransactRequestV1(); + + /** + * Model tests for TransactRequestV1 + */ + @Test + public void testTransactRequestV1() { + // TODO: test TransactRequestV1 + } + + /** + * Test the property 'signedTransaction' + */ + @Test + public void signedTransactionTest() { + // TODO: test signedTransaction + } + + /** + * Test the property 'transaction' + */ + @Test + public void transactionTest() { + // TODO: test transaction + } + + /** + * Test the property 'waitForCommit' + */ + @Test + public void waitForCommitTest() { + // TODO: test waitForCommit + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java new file mode 100644 index 0000000000..131740e2bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.TransactionStatusV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactResponseV1 + */ +public class TransactResponseV1Test { + private final TransactResponseV1 model = new TransactResponseV1(); + + /** + * Model tests for TransactResponseV1 + */ + @Test + public void testTransactResponseV1() { + // TODO: test TransactResponseV1 + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'rejectReason' + */ + @Test + public void rejectReasonTest() { + // TODO: test rejectReason + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java new file mode 100644 index 0000000000..60a8a70d65 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactionStatusV1 + */ +public class TransactionStatusV1Test { + /** + * Model tests for TransactionStatusV1 + */ + @Test + public void testTransactionStatusV1() { + // TODO: test TransactionStatusV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java new file mode 100644 index 0000000000..f6a5c504c6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksBinaryResponseV1 + */ +public class WatchBlocksBinaryResponseV1Test { + private final WatchBlocksBinaryResponseV1 model = new WatchBlocksBinaryResponseV1(); + + /** + * Model tests for WatchBlocksBinaryResponseV1 + */ + @Test + public void testWatchBlocksBinaryResponseV1() { + // TODO: test WatchBlocksBinaryResponseV1 + } + + /** + * Test the property 'binaryBlock' + */ + @Test + public void binaryBlockTest() { + // TODO: test binaryBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java new file mode 100644 index 0000000000..b28c1f037f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.BlockTypeV1; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksOptionsV1 + */ +public class WatchBlocksOptionsV1Test { + private final WatchBlocksOptionsV1 model = new WatchBlocksOptionsV1(); + + /** + * Model tests for WatchBlocksOptionsV1 + */ + @Test + public void testWatchBlocksOptionsV1() { + // TODO: test WatchBlocksOptionsV1 + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'startBlock' + */ + @Test + public void startBlockTest() { + // TODO: test startBlock + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java new file mode 100644 index 0000000000..b9e04fe49d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksRawResponseV1 + */ +public class WatchBlocksRawResponseV1Test { + private final WatchBlocksRawResponseV1 model = new WatchBlocksRawResponseV1(); + + /** + * Model tests for WatchBlocksRawResponseV1 + */ + @Test + public void testWatchBlocksRawResponseV1() { + // TODO: test WatchBlocksRawResponseV1 + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java new file mode 100644 index 0000000000..fda2071f00 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.WatchBlocksBinaryResponseV1; +import org.openapitools.client.model.WatchBlocksRawResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksResponseV1 + */ +public class WatchBlocksResponseV1Test { + private final WatchBlocksResponseV1 model = new WatchBlocksResponseV1(); + + /** + * Model tests for WatchBlocksResponseV1 + */ + @Test + public void testWatchBlocksResponseV1() { + // TODO: test WatchBlocksResponseV1 + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + + /** + * Test the property 'binaryBlock' + */ + @Test + public void binaryBlockTest() { + // TODO: test binaryBlock + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 0000000000..1ef002425e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/package.json b/packages/cactus-plugin-ledger-connector-quorum/package.json index add11121de..92411edea1 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/package.json +++ b/packages/cactus-plugin-ledger-connector-quorum/package.json @@ -49,7 +49,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 0000000000..9f5e6e66c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_contract_json.go +model_deploy_contract_solidity_bytecode_json_object_v1_request.go +model_deploy_contract_solidity_bytecode_v1_request.go +model_deploy_contract_solidity_bytecode_v1_response.go +model_eth_contract_invocation_type.go +model_eth_contract_invocation_web3_method.go +model_invoke_contract_json_object_v1_request.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_invoke_raw_web3_eth_contract_v1_request.go +model_invoke_raw_web3_eth_contract_v1_response.go +model_invoke_raw_web3_eth_method_v1_request.go +model_invoke_raw_web3_eth_method_v1_response.go +model_quorum_private_transaction_config.go +model_quorum_transaction_config.go +model_quorum_transaction_config_from.go +model_quorum_transaction_config_to.go +model_run_transaction_request.go +model_run_transaction_response.go +model_solidity_contract_json_artifact.go +model_solidity_contract_json_artifact_compiler.go +model_solidity_contract_json_artifact_gas_estimates.go +model_solidity_contract_json_artifact_gas_estimates_creation.go +model_watch_blocks_v1.go +model_watch_blocks_v1_block_data.go +model_watch_blocks_v1_options.go +model_watch_blocks_v1_progress.go +model_web3_block_header.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_geth_keychain_password.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction.go +model_web3_transaction_receipt.go +response.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 0000000000..33bfffb80a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,154 @@ +# Go API client for cactus-plugin-ledger-connector-quorum + +Can perform basic tasks on a Quorum ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-quorum "github.com/hyperledger/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractSolBytecodeJsonObjectV1**](docs/DefaultApi.md#deploycontractsolbytecodejsonobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**DeployContractSolBytecodeV1**](docs/DefaultApi.md#deploycontractsolbytecodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**InvokeContractV1NoKeychain**](docs/DefaultApi.md#invokecontractv1nokeychain) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**InvokeRawWeb3EthContractV1**](docs/DefaultApi.md#invokerawweb3ethcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract | Low-level endpoint to invoke a method on deployed contract. +*DefaultApi* | [**InvokeWeb3EthMethodV1**](docs/DefaultApi.md#invokeweb3ethmethodv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method | Invoke any method from web3.eth (low-level) +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction | Executes a transaction on a quorum ledger + + +## Documentation For Models + + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractSolidityBytecodeJsonObjectV1Request](docs/DeployContractSolidityBytecodeJsonObjectV1Request.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EthContractInvocationWeb3Method](docs/EthContractInvocationWeb3Method.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [QuorumPrivateTransactionConfig](docs/QuorumPrivateTransactionConfig.md) + - [QuorumTransactionConfig](docs/QuorumTransactionConfig.md) + - [QuorumTransactionConfigFrom](docs/QuorumTransactionConfigFrom.md) + - [QuorumTransactionConfigTo](docs/QuorumTransactionConfigTo.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..3f75f42d5e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1288 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Quorum ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Quorum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractSolBytecodeJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a quorum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object: + post: + operationId: invokeContractV1NoKeychain + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract: + post: + operationId: invokeRawWeb3EthContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Response' + description: OK + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + QuorumTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + to: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + type: object + QuorumPrivateTransactionConfig: + example: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + isPrivate: + default: false + nullable: false + type: boolean + gasPrice: + nullable: false + type: number + gasLimit: + nullable: false + type: number + privateKey: + nullable: false + type: string + privacyGroupId: + nullable: false + type: string + required: + - privateFor + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + logs: + default: [] + items: {} + nullable: false + type: array + logsBloom: + nullable: false + type: string + revertReason: + nullable: false + type: string + output: + nullable: false + type: string + commitmentHash: + nullable: false + type: string + cumulativeGasUSed: + nullable: false + type: number + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - bytecode + - contractName + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/QuorumTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with thehash of the transaction(which indicates successful execution) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + constructorArgs: + - "" + - "" + nonce: 1.4658129805029452 + keychainId: keychainId + timeoutMs: 0.5637376656633328 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + value: 5.962133916683182 + gasPrice: 6.027456183070403 + contractJSON: "{}" + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: number + nonce: + nullable: false + type: number + value: + nullable: false + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + description: "For use when not using keychain, pass the contract in as this\ + \ variable" + nullable: false + type: object + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + InvokeRawWeb3EthMethodV1Request: + additionalProperties: false + example: + methodName: methodName + params: + - "" + - "" + properties: + methodName: + description: The name of the web3.eth method to invoke + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass to web3.eth method specified + in methodName + items: {} + type: array + required: + - methodName + type: object + InvokeRawWeb3EthMethodV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + nullable: false + type: number + data: + description: Output of requested web3.eth method + errorDetail: + description: Error details + nullable: false + type: string + required: + - status + type: object + InvokeRawWeb3EthContractV1Request: + additionalProperties: false + example: + invocationType: null + address: address + abi: + - "" + - "" + contractMethodArgs: + - "" + - "" + contractMethod: contractMethod + invocationParams: "{}" + properties: + abi: + description: The application binary interface of the solidity contract + items: {} + type: array + address: + description: Deployed solidity contract address + type: string + invocationType: + $ref: '#/components/schemas/EthContractInvocationWeb3Method' + invocationParams: + default: {} + description: "The list of arguments for contract invocation method (send,\ + \ call, etc...)" + type: object + contractMethod: + description: Method of deployed solidity contract to execute + type: string + contractMethodArgs: + default: [] + description: The list of arguments for deployed solidity contract method + items: {} + type: array + required: + - abi + - address + - contractMethod + - invocationType + type: object + InvokeRawWeb3EthContractV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: number + blockHash: + nullable: true + type: string + blockNumber: + nullable: true + type: number + transactionIndex: + nullable: true + type: number + from: + type: string + to: + nullable: true + type: string + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + size: + type: number + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + QuorumTransactionConfig_from: + oneOf: + - type: string + - type: number + QuorumTransactionConfig_to: + oneOf: + - type: string diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..5a83ce23c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,855 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractSolBytecodeJsonObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeJsonObjectV1Request *DeployContractSolidityBytecodeJsonObjectV1Request +} + +func (r ApiDeployContractSolBytecodeJsonObjectV1Request) DeployContractSolidityBytecodeJsonObjectV1Request(deployContractSolidityBytecodeJsonObjectV1Request DeployContractSolidityBytecodeJsonObjectV1Request) ApiDeployContractSolBytecodeJsonObjectV1Request { + r.deployContractSolidityBytecodeJsonObjectV1Request = &deployContractSolidityBytecodeJsonObjectV1Request + return r +} + +func (r ApiDeployContractSolBytecodeJsonObjectV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeJsonObjectV1Execute(r) +} + +/* +DeployContractSolBytecodeJsonObjectV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeJsonObjectV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeJsonObjectV1(ctx context.Context) ApiDeployContractSolBytecodeJsonObjectV1Request { + return ApiDeployContractSolBytecodeJsonObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeJsonObjectV1Execute(r ApiDeployContractSolBytecodeJsonObjectV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeJsonObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractSolBytecodeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeV1Request *DeployContractSolidityBytecodeV1Request +} + +func (r ApiDeployContractSolBytecodeV1Request) DeployContractSolidityBytecodeV1Request(deployContractSolidityBytecodeV1Request DeployContractSolidityBytecodeV1Request) ApiDeployContractSolBytecodeV1Request { + r.deployContractSolidityBytecodeV1Request = &deployContractSolidityBytecodeV1Request + return r +} + +func (r ApiDeployContractSolBytecodeV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeV1Execute(r) +} + +/* +DeployContractSolBytecodeV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeV1(ctx context.Context) ApiDeployContractSolBytecodeV1Request { + return ApiDeployContractSolBytecodeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeV1Execute(r ApiDeployContractSolBytecodeV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1NoKeychainRequest struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractJsonObjectV1Request *InvokeContractJsonObjectV1Request +} + +func (r ApiInvokeContractV1NoKeychainRequest) InvokeContractJsonObjectV1Request(invokeContractJsonObjectV1Request InvokeContractJsonObjectV1Request) ApiInvokeContractV1NoKeychainRequest { + r.invokeContractJsonObjectV1Request = &invokeContractJsonObjectV1Request + return r +} + +func (r ApiInvokeContractV1NoKeychainRequest) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1NoKeychainExecute(r) +} + +/* +InvokeContractV1NoKeychain Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1NoKeychainRequest +*/ +func (a *DefaultApiService) InvokeContractV1NoKeychain(ctx context.Context) ApiInvokeContractV1NoKeychainRequest { + return ApiInvokeContractV1NoKeychainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1NoKeychainExecute(r ApiInvokeContractV1NoKeychainRequest) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1NoKeychain") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeRawWeb3EthContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeRawWeb3EthContractV1Request *InvokeRawWeb3EthContractV1Request +} + +func (r ApiInvokeRawWeb3EthContractV1Request) InvokeRawWeb3EthContractV1Request(invokeRawWeb3EthContractV1Request InvokeRawWeb3EthContractV1Request) ApiInvokeRawWeb3EthContractV1Request { + r.invokeRawWeb3EthContractV1Request = &invokeRawWeb3EthContractV1Request + return r +} + +func (r ApiInvokeRawWeb3EthContractV1Request) Execute() (*InvokeRawWeb3EthContractV1Response, *http.Response, error) { + return r.ApiService.InvokeRawWeb3EthContractV1Execute(r) +} + +/* +InvokeRawWeb3EthContractV1 Low-level endpoint to invoke a method on deployed contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeRawWeb3EthContractV1Request +*/ +func (a *DefaultApiService) InvokeRawWeb3EthContractV1(ctx context.Context) ApiInvokeRawWeb3EthContractV1Request { + return ApiInvokeRawWeb3EthContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeRawWeb3EthContractV1Response +func (a *DefaultApiService) InvokeRawWeb3EthContractV1Execute(r ApiInvokeRawWeb3EthContractV1Request) (*InvokeRawWeb3EthContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeRawWeb3EthContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeRawWeb3EthContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeWeb3EthMethodV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeRawWeb3EthMethodV1Request *InvokeRawWeb3EthMethodV1Request +} + +func (r ApiInvokeWeb3EthMethodV1Request) InvokeRawWeb3EthMethodV1Request(invokeRawWeb3EthMethodV1Request InvokeRawWeb3EthMethodV1Request) ApiInvokeWeb3EthMethodV1Request { + r.invokeRawWeb3EthMethodV1Request = &invokeRawWeb3EthMethodV1Request + return r +} + +func (r ApiInvokeWeb3EthMethodV1Request) Execute() (*InvokeRawWeb3EthMethodV1Response, *http.Response, error) { + return r.ApiService.InvokeWeb3EthMethodV1Execute(r) +} + +/* +InvokeWeb3EthMethodV1 Invoke any method from web3.eth (low-level) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeWeb3EthMethodV1Request +*/ +func (a *DefaultApiService) InvokeWeb3EthMethodV1(ctx context.Context) ApiInvokeWeb3EthMethodV1Request { + return ApiInvokeWeb3EthMethodV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeRawWeb3EthMethodV1Response +func (a *DefaultApiService) InvokeWeb3EthMethodV1Execute(r ApiInvokeWeb3EthMethodV1Request) (*InvokeRawWeb3EthMethodV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeRawWeb3EthMethodV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeWeb3EthMethodV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthMethodV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a quorum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..1a7130bda0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Quorum API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..d34a234caf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..60e83e331d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 0000000000..3ef9e31df2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 0000000000..c966c8ddfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go new file mode 100644 index 0000000000..6518e2fcc8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go @@ -0,0 +1,579 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the ContractJSON type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJSON{} + +// ContractJSON struct for ContractJSON +type ContractJSON struct { + ContractName string `json:"contractName"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The application binary interface of the solidity contract, optional parameter + Abi []interface{} `json:"abi,omitempty"` + Metadata *string `json:"metadata,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler map[string]interface{} `json:"compiler,omitempty"` + Networks map[string]interface{} `json:"networks,omitempty"` + Ast map[string]interface{} `json:"ast,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates map[string]interface{} `json:"gasEstimates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContractJSON ContractJSON + +// NewContractJSON instantiates a new ContractJSON object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractJSON(contractName string, bytecode string) *ContractJSON { + this := ContractJSON{} + this.ContractName = contractName + this.Bytecode = bytecode + return &this +} + +// NewContractJSONWithDefaults instantiates a new ContractJSON object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJSONWithDefaults() *ContractJSON { + this := ContractJSON{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractJSON) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractJSON) SetContractName(v string) { + o.ContractName = v +} + +// GetBytecode returns the Bytecode field value +func (o *ContractJSON) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *ContractJSON) SetBytecode(v string) { + o.Bytecode = v +} + +// GetAbi returns the Abi field value if set, zero value otherwise. +func (o *ContractJSON) GetAbi() []interface{} { + if o == nil || IsNil(o.Abi) { + var ret []interface{} + return ret + } + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAbiOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Abi) { + return nil, false + } + return o.Abi, true +} + +// HasAbi returns a boolean if a field has been set. +func (o *ContractJSON) HasAbi() bool { + if o != nil && !IsNil(o.Abi) { + return true + } + + return false +} + +// SetAbi gets a reference to the given []interface{} and assigns it to the Abi field. +func (o *ContractJSON) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ContractJSON) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ContractJSON) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *ContractJSON) SetMetadata(v string) { + o.Metadata = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *ContractJSON) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *ContractJSON) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *ContractJSON) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *ContractJSON) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *ContractJSON) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *ContractJSON) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *ContractJSON) GetCompiler() map[string]interface{} { + if o == nil || IsNil(o.Compiler) { + var ret map[string]interface{} + return ret + } + return o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetCompilerOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Compiler) { + return map[string]interface{}{}, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *ContractJSON) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given map[string]interface{} and assigns it to the Compiler field. +func (o *ContractJSON) SetCompiler(v map[string]interface{}) { + o.Compiler = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *ContractJSON) GetNetworks() map[string]interface{} { + if o == nil || IsNil(o.Networks) { + var ret map[string]interface{} + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetNetworksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Networks) { + return map[string]interface{}{}, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *ContractJSON) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given map[string]interface{} and assigns it to the Networks field. +func (o *ContractJSON) SetNetworks(v map[string]interface{}) { + o.Networks = v +} + +// GetAst returns the Ast field value if set, zero value otherwise. +func (o *ContractJSON) GetAst() map[string]interface{} { + if o == nil || IsNil(o.Ast) { + var ret map[string]interface{} + return ret + } + return o.Ast +} + +// GetAstOk returns a tuple with the Ast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAstOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Ast) { + return map[string]interface{}{}, false + } + return o.Ast, true +} + +// HasAst returns a boolean if a field has been set. +func (o *ContractJSON) HasAst() bool { + if o != nil && !IsNil(o.Ast) { + return true + } + + return false +} + +// SetAst gets a reference to the given map[string]interface{} and assigns it to the Ast field. +func (o *ContractJSON) SetAst(v map[string]interface{}) { + o.Ast = v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *ContractJSON) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *ContractJSON) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *ContractJSON) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *ContractJSON) GetGasEstimates() map[string]interface{} { + if o == nil || IsNil(o.GasEstimates) { + var ret map[string]interface{} + return ret + } + return o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetGasEstimatesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.GasEstimates) { + return map[string]interface{}{}, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *ContractJSON) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given map[string]interface{} and assigns it to the GasEstimates field. +func (o *ContractJSON) SetGasEstimates(v map[string]interface{}) { + o.GasEstimates = v +} + +func (o ContractJSON) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJSON) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["bytecode"] = o.Bytecode + if !IsNil(o.Abi) { + toSerialize["abi"] = o.Abi + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Ast) { + toSerialize["ast"] = o.Ast + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContractJSON) UnmarshalJSON(bytes []byte) (err error) { + varContractJSON := _ContractJSON{} + + if err = json.Unmarshal(bytes, &varContractJSON); err == nil { + *o = ContractJSON(varContractJSON) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contractName") + delete(additionalProperties, "bytecode") + delete(additionalProperties, "abi") + delete(additionalProperties, "metadata") + delete(additionalProperties, "deployedBytecode") + delete(additionalProperties, "sourceMap") + delete(additionalProperties, "deployedSourceMap") + delete(additionalProperties, "sourcePath") + delete(additionalProperties, "compiler") + delete(additionalProperties, "networks") + delete(additionalProperties, "ast") + delete(additionalProperties, "functionHashes") + delete(additionalProperties, "gasEstimates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContractJSON struct { + value *ContractJSON + isSet bool +} + +func (v NullableContractJSON) Get() *ContractJSON { + return v.value +} + +func (v *NullableContractJSON) Set(val *ContractJSON) { + v.value = val + v.isSet = true +} + +func (v NullableContractJSON) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJSON) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJSON(val *ContractJSON) *NullableContractJSON { + return &NullableContractJSON{value: val, isSet: true} +} + +func (v NullableContractJSON) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJSON) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go new file mode 100644 index 0000000000..283fa9981a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go @@ -0,0 +1,294 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeJsonObjectV1Request{} + +// DeployContractSolidityBytecodeJsonObjectV1Request struct for DeployContractSolidityBytecodeJsonObjectV1Request +type DeployContractSolidityBytecodeJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` +} + +// NewDeployContractSolidityBytecodeJsonObjectV1Request instantiates a new DeployContractSolidityBytecodeJsonObjectV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeJsonObjectV1Request(web3SigningCredential Web3SigningCredential, contractJSON ContractJSON) *DeployContractSolidityBytecodeJsonObjectV1Request { + this := DeployContractSolidityBytecodeJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewDeployContractSolidityBytecodeJsonObjectV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeJsonObjectV1RequestWithDefaults() *DeployContractSolidityBytecodeJsonObjectV1Request { + this := DeployContractSolidityBytecodeJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +func (o DeployContractSolidityBytecodeJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeJsonObjectV1Request struct { + value *DeployContractSolidityBytecodeJsonObjectV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) Get() *DeployContractSolidityBytecodeJsonObjectV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) Set(val *DeployContractSolidityBytecodeJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeJsonObjectV1Request(val *DeployContractSolidityBytecodeJsonObjectV1Request) *NullableDeployContractSolidityBytecodeJsonObjectV1Request { + return &NullableDeployContractSolidityBytecodeJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go new file mode 100644 index 0000000000..a0c5b1865c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go @@ -0,0 +1,542 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Request{} + +// DeployContractSolidityBytecodeV1Request struct for DeployContractSolidityBytecodeV1Request +type DeployContractSolidityBytecodeV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + // The application binary interface of the solidity contract + ContractAbi []interface{} `json:"contractAbi,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode *string `json:"bytecode,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *float32 `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Value *float32 `json:"value,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // For use when not using keychain, pass the contract in as this variable + ContractJSON map[string]interface{} `json:"contractJSON,omitempty"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + PrivateTransactionConfig *QuorumPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewDeployContractSolidityBytecodeV1Request instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Request(contractName string, web3SigningCredential Web3SigningCredential, keychainId string) *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractSolidityBytecodeV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1RequestWithDefaults() *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetContractAbi returns the ContractAbi field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbi() []interface{} { + if o == nil || IsNil(o.ContractAbi) { + var ret []interface{} + return ret + } + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ContractAbi) { + return nil, false + } + return o.ContractAbi, true +} + +// HasContractAbi returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasContractAbi() bool { + if o != nil && !IsNil(o.ContractAbi) { + return true + } + + return false +} + +// SetContractAbi gets a reference to the given []interface{} and assigns it to the ContractAbi field. +func (o *DeployContractSolidityBytecodeV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *DeployContractSolidityBytecodeV1Request) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractSolidityBytecodeV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPrice() float32 { + if o == nil || IsNil(o.GasPrice) { + var ret float32 + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPriceOk() (*float32, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given float32 and assigns it to the GasPrice field. +func (o *DeployContractSolidityBytecodeV1Request) SetGasPrice(v float32) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *DeployContractSolidityBytecodeV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetValue() float32 { + if o == nil || IsNil(o.Value) { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetValueOk() (*float32, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *DeployContractSolidityBytecodeV1Request) SetValue(v float32) { + o.Value = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetContractJSON() map[string]interface{} { + if o == nil || IsNil(o.ContractJSON) { + var ret map[string]interface{} + return ret + } + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractJSONOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ContractJSON) { + return map[string]interface{}{}, false + } + return o.ContractJSON, true +} + +// HasContractJSON returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasContractJSON() bool { + if o != nil && !IsNil(o.ContractJSON) { + return true + } + + return false +} + +// SetContractJSON gets a reference to the given map[string]interface{} and assigns it to the ContractJSON field. +func (o *DeployContractSolidityBytecodeV1Request) SetContractJSON(v map[string]interface{}) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractSolidityBytecodeV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfig() QuorumPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret QuorumPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfigOk() (*QuorumPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given QuorumPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *DeployContractSolidityBytecodeV1Request) SetPrivateTransactionConfig(v QuorumPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o DeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.ContractAbi) { + toSerialize["contractAbi"] = o.ContractAbi + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.ContractJSON) { + toSerialize["contractJSON"] = o.ContractJSON + } + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Request struct { + value *DeployContractSolidityBytecodeV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Request) Get() *DeployContractSolidityBytecodeV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Set(val *DeployContractSolidityBytecodeV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Request(val *DeployContractSolidityBytecodeV1Request) *NullableDeployContractSolidityBytecodeV1Request { + return &NullableDeployContractSolidityBytecodeV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go new file mode 100644 index 0000000000..ca5a15d9a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Response{} + +// DeployContractSolidityBytecodeV1Response struct for DeployContractSolidityBytecodeV1Response +type DeployContractSolidityBytecodeV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewDeployContractSolidityBytecodeV1Response instantiates a new DeployContractSolidityBytecodeV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Response(transactionReceipt Web3TransactionReceipt) *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewDeployContractSolidityBytecodeV1ResponseWithDefaults instantiates a new DeployContractSolidityBytecodeV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1ResponseWithDefaults() *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *DeployContractSolidityBytecodeV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o DeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Response struct { + value *DeployContractSolidityBytecodeV1Response + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Response) Get() *DeployContractSolidityBytecodeV1Response { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Set(val *DeployContractSolidityBytecodeV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Response(val *DeployContractSolidityBytecodeV1Response) *NullableDeployContractSolidityBytecodeV1Response { + return &NullableDeployContractSolidityBytecodeV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 0000000000..d32f2f3630 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go new file mode 100644 index 0000000000..a981452e94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationWeb3Method the model 'EthContractInvocationWeb3Method' +type EthContractInvocationWeb3Method string + +// List of EthContractInvocationWeb3Method +const ( + SEND EthContractInvocationWeb3Method = "send" + CALL EthContractInvocationWeb3Method = "call" + ENCODE_ABI EthContractInvocationWeb3Method = "encodeABI" + ESTIMATE_GAS EthContractInvocationWeb3Method = "estimateGas" +) + +// All allowed values of EthContractInvocationWeb3Method enum +var AllowedEthContractInvocationWeb3MethodEnumValues = []EthContractInvocationWeb3Method{ + "send", + "call", + "encodeABI", + "estimateGas", +} + +func (v *EthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationWeb3Method(value) + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationWeb3Method", value) +} + +// NewEthContractInvocationWeb3MethodFromValue returns a pointer to a valid EthContractInvocationWeb3Method +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationWeb3MethodFromValue(v string) (*EthContractInvocationWeb3Method, error) { + ev := EthContractInvocationWeb3Method(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationWeb3Method: valid values are %v", v, AllowedEthContractInvocationWeb3MethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationWeb3Method) IsValid() bool { + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationWeb3Method value +func (v EthContractInvocationWeb3Method) Ptr() *EthContractInvocationWeb3Method { + return &v +} + +type NullableEthContractInvocationWeb3Method struct { + value *EthContractInvocationWeb3Method + isSet bool +} + +func (v NullableEthContractInvocationWeb3Method) Get() *EthContractInvocationWeb3Method { + return v.value +} + +func (v *NullableEthContractInvocationWeb3Method) Set(val *EthContractInvocationWeb3Method) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationWeb3Method) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationWeb3Method) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationWeb3Method(val *EthContractInvocationWeb3Method) *NullableEthContractInvocationWeb3Method { + return &NullableEthContractInvocationWeb3Method{value: val, isSet: true} +} + +func (v NullableEthContractInvocationWeb3Method) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go new file mode 100644 index 0000000000..dafe15c7a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go @@ -0,0 +1,476 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeContractJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractJsonObjectV1Request{} + +// InvokeContractJsonObjectV1Request struct for InvokeContractJsonObjectV1Request +type InvokeContractJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + // Address of the solidity contract + ContractAddress string `json:"contractAddress"` + Value *QuorumTransactionConfigFrom `json:"value,omitempty"` + Gas *QuorumTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *QuorumTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + PrivateTransactionConfig *QuorumPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewInvokeContractJsonObjectV1Request instantiates a new InvokeContractJsonObjectV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractJsonObjectV1Request(web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, contractAddress string, contractJSON ContractJSON) *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + this.ContractAddress = contractAddress + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewInvokeContractJsonObjectV1RequestWithDefaults instantiates a new InvokeContractJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractJsonObjectV1RequestWithDefaults() *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractJsonObjectV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractJsonObjectV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractJsonObjectV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractJsonObjectV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractJsonObjectV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractJsonObjectV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeContractJsonObjectV1Request) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetValue() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetValueOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractJsonObjectV1Request) SetValue(v QuorumTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGas() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractJsonObjectV1Request) SetGas(v QuorumTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGasPrice() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasPriceOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given QuorumTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractJsonObjectV1Request) SetGasPrice(v QuorumTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractJsonObjectV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *InvokeContractJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetPrivateTransactionConfig() QuorumPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret QuorumPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetPrivateTransactionConfigOk() (*QuorumPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given QuorumPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *InvokeContractJsonObjectV1Request) SetPrivateTransactionConfig(v QuorumPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o InvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + toSerialize["contractAddress"] = o.ContractAddress + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableInvokeContractJsonObjectV1Request struct { + value *InvokeContractJsonObjectV1Request + isSet bool +} + +func (v NullableInvokeContractJsonObjectV1Request) Get() *InvokeContractJsonObjectV1Request { + return v.value +} + +func (v *NullableInvokeContractJsonObjectV1Request) Set(val *InvokeContractJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractJsonObjectV1Request(val *InvokeContractJsonObjectV1Request) *NullableInvokeContractJsonObjectV1Request { + return &NullableInvokeContractJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 0000000000..c9fcfb6aea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // The contract name to find it in the keychain plugin + ContractName string `json:"contractName"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + Value *QuorumTransactionConfigFrom `json:"value,omitempty"` + Gas *QuorumTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *QuorumTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contractName string, web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, keychainId string) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.KeychainId = keychainId + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *InvokeContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *InvokeContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v QuorumTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGas() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractV1Request) SetGas(v QuorumTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasPrice() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasPriceOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given QuorumTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractV1Request) SetGasPrice(v QuorumTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *InvokeContractV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InvokeContractV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 0000000000..1306faa0b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go new file mode 100644 index 0000000000..9593bfda04 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go @@ -0,0 +1,275 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Request{} + +// InvokeRawWeb3EthContractV1Request struct for InvokeRawWeb3EthContractV1Request +type InvokeRawWeb3EthContractV1Request struct { + // The application binary interface of the solidity contract + Abi []interface{} `json:"abi"` + // Deployed solidity contract address + Address string `json:"address"` + InvocationType EthContractInvocationWeb3Method `json:"invocationType"` + // The list of arguments for contract invocation method (send, call, etc...) + InvocationParams map[string]interface{} `json:"invocationParams,omitempty"` + // Method of deployed solidity contract to execute + ContractMethod string `json:"contractMethod"` + // The list of arguments for deployed solidity contract method + ContractMethodArgs []interface{} `json:"contractMethodArgs,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Request instantiates a new InvokeRawWeb3EthContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Request(abi []interface{}, address string, invocationType EthContractInvocationWeb3Method, contractMethod string) *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + this.Abi = abi + this.Address = address + this.InvocationType = invocationType + this.ContractMethod = contractMethod + return &this +} + +// NewInvokeRawWeb3EthContractV1RequestWithDefaults instantiates a new InvokeRawWeb3EthContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1RequestWithDefaults() *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + return &this +} + +// GetAbi returns the Abi field value +func (o *InvokeRawWeb3EthContractV1Request) GetAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Abi, true +} + +// SetAbi sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetAddress returns the Address field value +func (o *InvokeRawWeb3EthContractV1Request) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAddress(v string) { + o.Address = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationType() EthContractInvocationWeb3Method { + if o == nil { + var ret EthContractInvocationWeb3Method + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationTypeOk() (*EthContractInvocationWeb3Method, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationType(v EthContractInvocationWeb3Method) { + o.InvocationType = v +} + +// GetInvocationParams returns the InvocationParams field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParams() map[string]interface{} { + if o == nil || IsNil(o.InvocationParams) { + var ret map[string]interface{} + return ret + } + return o.InvocationParams +} + +// GetInvocationParamsOk returns a tuple with the InvocationParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.InvocationParams) { + return map[string]interface{}{}, false + } + return o.InvocationParams, true +} + +// HasInvocationParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasInvocationParams() bool { + if o != nil && !IsNil(o.InvocationParams) { + return true + } + + return false +} + +// SetInvocationParams gets a reference to the given map[string]interface{} and assigns it to the InvocationParams field. +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationParams(v map[string]interface{}) { + o.InvocationParams = v +} + +// GetContractMethod returns the ContractMethod field value +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethod() string { + if o == nil { + var ret string + return ret + } + + return o.ContractMethod +} + +// GetContractMethodOk returns a tuple with the ContractMethod field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractMethod, true +} + +// SetContractMethod sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethod(v string) { + o.ContractMethod = v +} + +// GetContractMethodArgs returns the ContractMethodArgs field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgs() []interface{} { + if o == nil || IsNil(o.ContractMethodArgs) { + var ret []interface{} + return ret + } + return o.ContractMethodArgs +} + +// GetContractMethodArgsOk returns a tuple with the ContractMethodArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ContractMethodArgs) { + return nil, false + } + return o.ContractMethodArgs, true +} + +// HasContractMethodArgs returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasContractMethodArgs() bool { + if o != nil && !IsNil(o.ContractMethodArgs) { + return true + } + + return false +} + +// SetContractMethodArgs gets a reference to the given []interface{} and assigns it to the ContractMethodArgs field. +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethodArgs(v []interface{}) { + o.ContractMethodArgs = v +} + +func (o InvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["abi"] = o.Abi + toSerialize["address"] = o.Address + toSerialize["invocationType"] = o.InvocationType + if !IsNil(o.InvocationParams) { + toSerialize["invocationParams"] = o.InvocationParams + } + toSerialize["contractMethod"] = o.ContractMethod + if !IsNil(o.ContractMethodArgs) { + toSerialize["contractMethodArgs"] = o.ContractMethodArgs + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Request struct { + value *InvokeRawWeb3EthContractV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Request) Get() *InvokeRawWeb3EthContractV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Set(val *InvokeRawWeb3EthContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Request(val *InvokeRawWeb3EthContractV1Request) *NullableInvokeRawWeb3EthContractV1Request { + return &NullableInvokeRawWeb3EthContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go new file mode 100644 index 0000000000..e2d1dfc54d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go @@ -0,0 +1,193 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Response{} + +// InvokeRawWeb3EthContractV1Response struct for InvokeRawWeb3EthContractV1Response +type InvokeRawWeb3EthContractV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of contract invocation method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Response instantiates a new InvokeRawWeb3EthContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Response(status float32) *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthContractV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1ResponseWithDefaults() *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthContractV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthContractV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthContractV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthContractV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasData() bool { + if o != nil && IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthContractV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetail() string { + if o == nil || IsNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || IsNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasErrorDetail() bool { + if o != nil && !IsNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthContractV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !IsNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Response struct { + value *InvokeRawWeb3EthContractV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Response) Get() *InvokeRawWeb3EthContractV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Set(val *InvokeRawWeb3EthContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Response(val *InvokeRawWeb3EthContractV1Response) *NullableInvokeRawWeb3EthContractV1Response { + return &NullableInvokeRawWeb3EthContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go new file mode 100644 index 0000000000..9d9aaebfcb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Request{} + +// InvokeRawWeb3EthMethodV1Request struct for InvokeRawWeb3EthMethodV1Request +type InvokeRawWeb3EthMethodV1Request struct { + // The name of the web3.eth method to invoke + MethodName string `json:"methodName"` + // The list of arguments to pass to web3.eth method specified in methodName + Params []interface{} `json:"params,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Request instantiates a new InvokeRawWeb3EthMethodV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Request(methodName string) *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + this.MethodName = methodName + return &this +} + +// NewInvokeRawWeb3EthMethodV1RequestWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1RequestWithDefaults() *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + return &this +} + +// GetMethodName returns the MethodName field value +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeRawWeb3EthMethodV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Request) GetParams() []interface{} { + if o == nil || IsNil(o.Params) { + var ret []interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Request) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []interface{} and assigns it to the Params field. +func (o *InvokeRawWeb3EthMethodV1Request) SetParams(v []interface{}) { + o.Params = v +} + +func (o InvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["methodName"] = o.MethodName + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Request struct { + value *InvokeRawWeb3EthMethodV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) Get() *InvokeRawWeb3EthMethodV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Set(val *InvokeRawWeb3EthMethodV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Request(val *InvokeRawWeb3EthMethodV1Request) *NullableInvokeRawWeb3EthMethodV1Request { + return &NullableInvokeRawWeb3EthMethodV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go new file mode 100644 index 0000000000..2376afaef4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go @@ -0,0 +1,193 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Response{} + +// InvokeRawWeb3EthMethodV1Response struct for InvokeRawWeb3EthMethodV1Response +type InvokeRawWeb3EthMethodV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of requested web3.eth method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Response instantiates a new InvokeRawWeb3EthMethodV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Response(status float32) *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthMethodV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1ResponseWithDefaults() *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthMethodV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthMethodV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthMethodV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthMethodV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasData() bool { + if o != nil && IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthMethodV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetail() string { + if o == nil || IsNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || IsNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasErrorDetail() bool { + if o != nil && !IsNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthMethodV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !IsNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Response struct { + value *InvokeRawWeb3EthMethodV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) Get() *InvokeRawWeb3EthMethodV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Set(val *InvokeRawWeb3EthMethodV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Response(val *InvokeRawWeb3EthMethodV1Response) *NullableInvokeRawWeb3EthMethodV1Response { + return &NullableInvokeRawWeb3EthMethodV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go new file mode 100644 index 0000000000..193542cc2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go @@ -0,0 +1,337 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the QuorumPrivateTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuorumPrivateTransactionConfig{} + +// QuorumPrivateTransactionConfig struct for QuorumPrivateTransactionConfig +type QuorumPrivateTransactionConfig struct { + PrivateFrom *string `json:"privateFrom,omitempty"` + PrivateFor []interface{} `json:"privateFor"` + IsPrivate *bool `json:"isPrivate,omitempty"` + GasPrice *float32 `json:"gasPrice,omitempty"` + GasLimit *float32 `json:"gasLimit,omitempty"` + PrivateKey *string `json:"privateKey,omitempty"` + PrivacyGroupId *string `json:"privacyGroupId,omitempty"` +} + +// NewQuorumPrivateTransactionConfig instantiates a new QuorumPrivateTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuorumPrivateTransactionConfig(privateFor []interface{}) *QuorumPrivateTransactionConfig { + this := QuorumPrivateTransactionConfig{} + this.PrivateFor = privateFor + var isPrivate bool = false + this.IsPrivate = &isPrivate + return &this +} + +// NewQuorumPrivateTransactionConfigWithDefaults instantiates a new QuorumPrivateTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuorumPrivateTransactionConfigWithDefaults() *QuorumPrivateTransactionConfig { + this := QuorumPrivateTransactionConfig{} + var isPrivate bool = false + this.IsPrivate = &isPrivate + return &this +} + +// GetPrivateFrom returns the PrivateFrom field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetPrivateFrom() string { + if o == nil || IsNil(o.PrivateFrom) { + var ret string + return ret + } + return *o.PrivateFrom +} + +// GetPrivateFromOk returns a tuple with the PrivateFrom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivateFromOk() (*string, bool) { + if o == nil || IsNil(o.PrivateFrom) { + return nil, false + } + return o.PrivateFrom, true +} + +// HasPrivateFrom returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasPrivateFrom() bool { + if o != nil && !IsNil(o.PrivateFrom) { + return true + } + + return false +} + +// SetPrivateFrom gets a reference to the given string and assigns it to the PrivateFrom field. +func (o *QuorumPrivateTransactionConfig) SetPrivateFrom(v string) { + o.PrivateFrom = &v +} + +// GetPrivateFor returns the PrivateFor field value +func (o *QuorumPrivateTransactionConfig) GetPrivateFor() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.PrivateFor +} + +// GetPrivateForOk returns a tuple with the PrivateFor field value +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivateForOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.PrivateFor, true +} + +// SetPrivateFor sets field value +func (o *QuorumPrivateTransactionConfig) SetPrivateFor(v []interface{}) { + o.PrivateFor = v +} + +// GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetIsPrivate() bool { + if o == nil || IsNil(o.IsPrivate) { + var ret bool + return ret + } + return *o.IsPrivate +} + +// GetIsPrivateOk returns a tuple with the IsPrivate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetIsPrivateOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrivate) { + return nil, false + } + return o.IsPrivate, true +} + +// HasIsPrivate returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasIsPrivate() bool { + if o != nil && !IsNil(o.IsPrivate) { + return true + } + + return false +} + +// SetIsPrivate gets a reference to the given bool and assigns it to the IsPrivate field. +func (o *QuorumPrivateTransactionConfig) SetIsPrivate(v bool) { + o.IsPrivate = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetGasPrice() float32 { + if o == nil || IsNil(o.GasPrice) { + var ret float32 + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetGasPriceOk() (*float32, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given float32 and assigns it to the GasPrice field. +func (o *QuorumPrivateTransactionConfig) SetGasPrice(v float32) { + o.GasPrice = &v +} + +// GetGasLimit returns the GasLimit field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetGasLimit() float32 { + if o == nil || IsNil(o.GasLimit) { + var ret float32 + return ret + } + return *o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetGasLimitOk() (*float32, bool) { + if o == nil || IsNil(o.GasLimit) { + return nil, false + } + return o.GasLimit, true +} + +// HasGasLimit returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasGasLimit() bool { + if o != nil && !IsNil(o.GasLimit) { + return true + } + + return false +} + +// SetGasLimit gets a reference to the given float32 and assigns it to the GasLimit field. +func (o *QuorumPrivateTransactionConfig) SetGasLimit(v float32) { + o.GasLimit = &v +} + +// GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetPrivateKey() string { + if o == nil || IsNil(o.PrivateKey) { + var ret string + return ret + } + return *o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivateKeyOk() (*string, bool) { + if o == nil || IsNil(o.PrivateKey) { + return nil, false + } + return o.PrivateKey, true +} + +// HasPrivateKey returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasPrivateKey() bool { + if o != nil && !IsNil(o.PrivateKey) { + return true + } + + return false +} + +// SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field. +func (o *QuorumPrivateTransactionConfig) SetPrivateKey(v string) { + o.PrivateKey = &v +} + +// GetPrivacyGroupId returns the PrivacyGroupId field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetPrivacyGroupId() string { + if o == nil || IsNil(o.PrivacyGroupId) { + var ret string + return ret + } + return *o.PrivacyGroupId +} + +// GetPrivacyGroupIdOk returns a tuple with the PrivacyGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivacyGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.PrivacyGroupId) { + return nil, false + } + return o.PrivacyGroupId, true +} + +// HasPrivacyGroupId returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasPrivacyGroupId() bool { + if o != nil && !IsNil(o.PrivacyGroupId) { + return true + } + + return false +} + +// SetPrivacyGroupId gets a reference to the given string and assigns it to the PrivacyGroupId field. +func (o *QuorumPrivateTransactionConfig) SetPrivacyGroupId(v string) { + o.PrivacyGroupId = &v +} + +func (o QuorumPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuorumPrivateTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PrivateFrom) { + toSerialize["privateFrom"] = o.PrivateFrom + } + toSerialize["privateFor"] = o.PrivateFor + if !IsNil(o.IsPrivate) { + toSerialize["isPrivate"] = o.IsPrivate + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.GasLimit) { + toSerialize["gasLimit"] = o.GasLimit + } + if !IsNil(o.PrivateKey) { + toSerialize["privateKey"] = o.PrivateKey + } + if !IsNil(o.PrivacyGroupId) { + toSerialize["privacyGroupId"] = o.PrivacyGroupId + } + return toSerialize, nil +} + +type NullableQuorumPrivateTransactionConfig struct { + value *QuorumPrivateTransactionConfig + isSet bool +} + +func (v NullableQuorumPrivateTransactionConfig) Get() *QuorumPrivateTransactionConfig { + return v.value +} + +func (v *NullableQuorumPrivateTransactionConfig) Set(val *QuorumPrivateTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumPrivateTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumPrivateTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumPrivateTransactionConfig(val *QuorumPrivateTransactionConfig) *NullableQuorumPrivateTransactionConfig { + return &NullableQuorumPrivateTransactionConfig{value: val, isSet: true} +} + +func (v NullableQuorumPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumPrivateTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go new file mode 100644 index 0000000000..e9da61904e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go @@ -0,0 +1,410 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the QuorumTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuorumTransactionConfig{} + +// QuorumTransactionConfig struct for QuorumTransactionConfig +type QuorumTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *QuorumTransactionConfigFrom `json:"from,omitempty"` + To *QuorumTransactionConfigTo `json:"to,omitempty"` + Value *QuorumTransactionConfigFrom `json:"value,omitempty"` + Gas *QuorumTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *QuorumTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Data *QuorumTransactionConfigTo `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _QuorumTransactionConfig QuorumTransactionConfig + +// NewQuorumTransactionConfig instantiates a new QuorumTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuorumTransactionConfig() *QuorumTransactionConfig { + this := QuorumTransactionConfig{} + return &this +} + +// NewQuorumTransactionConfigWithDefaults instantiates a new QuorumTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuorumTransactionConfigWithDefaults() *QuorumTransactionConfig { + this := QuorumTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetRawTransaction() string { + if o == nil || IsNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || IsNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasRawTransaction() bool { + if o != nil && !IsNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *QuorumTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetFrom() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.From) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetFromOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given QuorumTransactionConfigFrom and assigns it to the From field. +func (o *QuorumTransactionConfig) SetFrom(v QuorumTransactionConfigFrom) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetTo() QuorumTransactionConfigTo { + if o == nil || IsNil(o.To) { + var ret QuorumTransactionConfigTo + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetToOk() (*QuorumTransactionConfigTo, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given QuorumTransactionConfigTo and assigns it to the To field. +func (o *QuorumTransactionConfig) SetTo(v QuorumTransactionConfigTo) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetValue() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetValueOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Value field. +func (o *QuorumTransactionConfig) SetValue(v QuorumTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetGas() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetGasOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Gas field. +func (o *QuorumTransactionConfig) SetGas(v QuorumTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetGasPrice() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetGasPriceOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given QuorumTransactionConfigFrom and assigns it to the GasPrice field. +func (o *QuorumTransactionConfig) SetGasPrice(v QuorumTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *QuorumTransactionConfig) SetNonce(v float32) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetData() QuorumTransactionConfigTo { + if o == nil || IsNil(o.Data) { + var ret QuorumTransactionConfigTo + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetDataOk() (*QuorumTransactionConfigTo, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given QuorumTransactionConfigTo and assigns it to the Data field. +func (o *QuorumTransactionConfig) SetData(v QuorumTransactionConfigTo) { + o.Data = &v +} + +func (o QuorumTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuorumTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *QuorumTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varQuorumTransactionConfig := _QuorumTransactionConfig{} + + if err = json.Unmarshal(bytes, &varQuorumTransactionConfig); err == nil { + *o = QuorumTransactionConfig(varQuorumTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rawTransaction") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + delete(additionalProperties, "gas") + delete(additionalProperties, "gasPrice") + delete(additionalProperties, "nonce") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableQuorumTransactionConfig struct { + value *QuorumTransactionConfig + isSet bool +} + +func (v NullableQuorumTransactionConfig) Get() *QuorumTransactionConfig { + return v.value +} + +func (v *NullableQuorumTransactionConfig) Set(val *QuorumTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumTransactionConfig(val *QuorumTransactionConfig) *NullableQuorumTransactionConfig { + return &NullableQuorumTransactionConfig{value: val, isSet: true} +} + +func (v NullableQuorumTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go new file mode 100644 index 0000000000..0686486946 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// QuorumTransactionConfigFrom - struct for QuorumTransactionConfigFrom +type QuorumTransactionConfigFrom struct { + Float32 *float32 + String *string +} + +// float32AsQuorumTransactionConfigFrom is a convenience function that returns float32 wrapped in QuorumTransactionConfigFrom +func Float32AsQuorumTransactionConfigFrom(v *float32) QuorumTransactionConfigFrom { + return QuorumTransactionConfigFrom{ + Float32: v, + } +} + +// stringAsQuorumTransactionConfigFrom is a convenience function that returns string wrapped in QuorumTransactionConfigFrom +func StringAsQuorumTransactionConfigFrom(v *string) QuorumTransactionConfigFrom { + return QuorumTransactionConfigFrom{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *QuorumTransactionConfigFrom) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(QuorumTransactionConfigFrom)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(QuorumTransactionConfigFrom)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src QuorumTransactionConfigFrom) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *QuorumTransactionConfigFrom) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableQuorumTransactionConfigFrom struct { + value *QuorumTransactionConfigFrom + isSet bool +} + +func (v NullableQuorumTransactionConfigFrom) Get() *QuorumTransactionConfigFrom { + return v.value +} + +func (v *NullableQuorumTransactionConfigFrom) Set(val *QuorumTransactionConfigFrom) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumTransactionConfigFrom) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumTransactionConfigFrom) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumTransactionConfigFrom(val *QuorumTransactionConfigFrom) *NullableQuorumTransactionConfigFrom { + return &NullableQuorumTransactionConfigFrom{value: val, isSet: true} +} + +func (v NullableQuorumTransactionConfigFrom) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumTransactionConfigFrom) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go new file mode 100644 index 0000000000..aae309d712 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// QuorumTransactionConfigTo - struct for QuorumTransactionConfigTo +type QuorumTransactionConfigTo struct { + String *string +} + +// stringAsQuorumTransactionConfigTo is a convenience function that returns string wrapped in QuorumTransactionConfigTo +func StringAsQuorumTransactionConfigTo(v *string) QuorumTransactionConfigTo { + return QuorumTransactionConfigTo{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *QuorumTransactionConfigTo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(QuorumTransactionConfigTo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(QuorumTransactionConfigTo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src QuorumTransactionConfigTo) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *QuorumTransactionConfigTo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableQuorumTransactionConfigTo struct { + value *QuorumTransactionConfigTo + isSet bool +} + +func (v NullableQuorumTransactionConfigTo) Get() *QuorumTransactionConfigTo { + return v.value +} + +func (v *NullableQuorumTransactionConfigTo) Set(val *QuorumTransactionConfigTo) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumTransactionConfigTo) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumTransactionConfigTo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumTransactionConfigTo(val *QuorumTransactionConfigTo) *NullableQuorumTransactionConfigTo { + return &NullableQuorumTransactionConfigTo{value: val, isSet: true} +} + +func (v NullableQuorumTransactionConfigTo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumTransactionConfigTo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 0000000000..b5e22355db --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,221 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig QuorumTransactionConfig `json:"transactionConfig"` + // The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + PrivateTransactionConfig *QuorumPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig QuorumTransactionConfig) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionRequest) GetTransactionConfig() QuorumTransactionConfig { + if o == nil { + var ret QuorumTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTransactionConfigOk() (*QuorumTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v QuorumTransactionConfig) { + o.TransactionConfig = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *RunTransactionRequest) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetPrivateTransactionConfig() QuorumPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret QuorumPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetPrivateTransactionConfigOk() (*QuorumPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given QuorumPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *RunTransactionRequest) SetPrivateTransactionConfig(v QuorumPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 0000000000..7739575a26 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 0000000000..4a5490d819 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifact{} + +// SolidityContractJsonArtifact struct for SolidityContractJsonArtifact +type SolidityContractJsonArtifact struct { + ContractName string `json:"contractName"` + Metadata *string `json:"metadata,omitempty"` + Bytecode *string `json:"bytecode,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler *SolidityContractJsonArtifactCompiler `json:"compiler,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates *SolidityContractJsonArtifactGasEstimates `json:"gasEstimates,omitempty"` +} + +// NewSolidityContractJsonArtifact instantiates a new SolidityContractJsonArtifact object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifact(contractName string) *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + this.ContractName = contractName + return &this +} + +// NewSolidityContractJsonArtifactWithDefaults instantiates a new SolidityContractJsonArtifact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *SolidityContractJsonArtifact) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *SolidityContractJsonArtifact) SetContractName(v string) { + o.ContractName = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *SolidityContractJsonArtifact) SetMetadata(v string) { + o.Metadata = &v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *SolidityContractJsonArtifact) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *SolidityContractJsonArtifact) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *SolidityContractJsonArtifact) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler { + if o == nil || IsNil(o.Compiler) { + var ret SolidityContractJsonArtifactCompiler + return ret + } + return *o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool) { + if o == nil || IsNil(o.Compiler) { + return nil, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given SolidityContractJsonArtifactCompiler and assigns it to the Compiler field. +func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler) { + o.Compiler = &v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates { + if o == nil || IsNil(o.GasEstimates) { + var ret SolidityContractJsonArtifactGasEstimates + return ret + } + return *o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool) { + if o == nil || IsNil(o.GasEstimates) { + return nil, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given SolidityContractJsonArtifactGasEstimates and assigns it to the GasEstimates field. +func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates) { + o.GasEstimates = &v +} + +func (o SolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifact struct { + value *SolidityContractJsonArtifact + isSet bool +} + +func (v NullableSolidityContractJsonArtifact) Get() *SolidityContractJsonArtifact { + return v.value +} + +func (v *NullableSolidityContractJsonArtifact) Set(val *SolidityContractJsonArtifact) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifact) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifact(val *SolidityContractJsonArtifact) *NullableSolidityContractJsonArtifact { + return &NullableSolidityContractJsonArtifact{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 0000000000..9797c8b82e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactCompiler type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactCompiler{} + +// SolidityContractJsonArtifactCompiler struct for SolidityContractJsonArtifactCompiler +type SolidityContractJsonArtifactCompiler struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SolidityContractJsonArtifactCompiler SolidityContractJsonArtifactCompiler + +// NewSolidityContractJsonArtifactCompiler instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactCompiler() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// NewSolidityContractJsonArtifactCompilerWithDefaults instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SolidityContractJsonArtifactCompiler) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string) { + o.Version = &v +} + +func (o SolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactCompiler) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SolidityContractJsonArtifactCompiler) UnmarshalJSON(bytes []byte) (err error) { + varSolidityContractJsonArtifactCompiler := _SolidityContractJsonArtifactCompiler{} + + if err = json.Unmarshal(bytes, &varSolidityContractJsonArtifactCompiler); err == nil { + *o = SolidityContractJsonArtifactCompiler(varSolidityContractJsonArtifactCompiler) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSolidityContractJsonArtifactCompiler struct { + value *SolidityContractJsonArtifactCompiler + isSet bool +} + +func (v NullableSolidityContractJsonArtifactCompiler) Get() *SolidityContractJsonArtifactCompiler { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Set(val *SolidityContractJsonArtifactCompiler) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactCompiler) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactCompiler(val *SolidityContractJsonArtifactCompiler) *NullableSolidityContractJsonArtifactCompiler { + return &NullableSolidityContractJsonArtifactCompiler{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactCompiler) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 0000000000..d532930148 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimates{} + +// SolidityContractJsonArtifactGasEstimates struct for SolidityContractJsonArtifactGasEstimates +type SolidityContractJsonArtifactGasEstimates struct { + Creation *SolidityContractJsonArtifactGasEstimatesCreation `json:"creation,omitempty"` + External map[string]interface{} `json:"external,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimates instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// GetCreation returns the Creation field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation { + if o == nil || IsNil(o.Creation) { + var ret SolidityContractJsonArtifactGasEstimatesCreation + return ret + } + return *o.Creation +} + +// GetCreationOk returns a tuple with the Creation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool) { + if o == nil || IsNil(o.Creation) { + return nil, false + } + return o.Creation, true +} + +// HasCreation returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool { + if o != nil && !IsNil(o.Creation) { + return true + } + + return false +} + +// SetCreation gets a reference to the given SolidityContractJsonArtifactGasEstimatesCreation and assigns it to the Creation field. +func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation) { + o.Creation = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{} { + if o == nil || IsNil(o.External) { + var ret map[string]interface{} + return ret + } + return o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.External) { + return map[string]interface{}{}, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given map[string]interface{} and assigns it to the External field. +func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{}) { + o.External = v +} + +func (o SolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Creation) { + toSerialize["creation"] = o.Creation + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimates struct { + value *SolidityContractJsonArtifactGasEstimates + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) Get() *SolidityContractJsonArtifactGasEstimates { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Set(val *SolidityContractJsonArtifactGasEstimates) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimates(val *SolidityContractJsonArtifactGasEstimates) *NullableSolidityContractJsonArtifactGasEstimates { + return &NullableSolidityContractJsonArtifactGasEstimates{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 0000000000..548c46bfaa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimatesCreation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimatesCreation{} + +// SolidityContractJsonArtifactGasEstimatesCreation struct for SolidityContractJsonArtifactGasEstimatesCreation +type SolidityContractJsonArtifactGasEstimatesCreation struct { + CodeDepositCost *string `json:"codeDepositCost,omitempty"` + ExecutionCost *string `json:"executionCost,omitempty"` + TotalCost *string `json:"totalCost,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimatesCreation instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// GetCodeDepositCost returns the CodeDepositCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string { + if o == nil || IsNil(o.CodeDepositCost) { + var ret string + return ret + } + return *o.CodeDepositCost +} + +// GetCodeDepositCostOk returns a tuple with the CodeDepositCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool) { + if o == nil || IsNil(o.CodeDepositCost) { + return nil, false + } + return o.CodeDepositCost, true +} + +// HasCodeDepositCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool { + if o != nil && !IsNil(o.CodeDepositCost) { + return true + } + + return false +} + +// SetCodeDepositCost gets a reference to the given string and assigns it to the CodeDepositCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string) { + o.CodeDepositCost = &v +} + +// GetExecutionCost returns the ExecutionCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string { + if o == nil || IsNil(o.ExecutionCost) { + var ret string + return ret + } + return *o.ExecutionCost +} + +// GetExecutionCostOk returns a tuple with the ExecutionCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionCost) { + return nil, false + } + return o.ExecutionCost, true +} + +// HasExecutionCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool { + if o != nil && !IsNil(o.ExecutionCost) { + return true + } + + return false +} + +// SetExecutionCost gets a reference to the given string and assigns it to the ExecutionCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string) { + o.ExecutionCost = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string { + if o == nil || IsNil(o.TotalCost) { + var ret string + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given string and assigns it to the TotalCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string) { + o.TotalCost = &v +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CodeDepositCost) { + toSerialize["codeDepositCost"] = o.CodeDepositCost + } + if !IsNil(o.ExecutionCost) { + toSerialize["executionCost"] = o.ExecutionCost + } + if !IsNil(o.TotalCost) { + toSerialize["totalCost"] = o.TotalCost + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimatesCreation struct { + value *SolidityContractJsonArtifactGasEstimatesCreation + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) Get() *SolidityContractJsonArtifactGasEstimatesCreation { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Set(val *SolidityContractJsonArtifactGasEstimatesCreation) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimatesCreation(val *SolidityContractJsonArtifactGasEstimatesCreation) *NullableSolidityContractJsonArtifactGasEstimatesCreation { + return &NullableSolidityContractJsonArtifactGasEstimatesCreation{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 0000000000..77d8b220f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go new file mode 100644 index 0000000000..cb55086dc0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go @@ -0,0 +1,666 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1BlockData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1BlockData{} + +// WatchBlocksV1BlockData struct for WatchBlocksV1BlockData +type WatchBlocksV1BlockData struct { + Number float32 `json:"number"` + Hash string `json:"hash"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom string `json:"logsBloom"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot string `json:"stateRoot"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit int32 `json:"gasLimit"` + GasUsed int32 `json:"gasUsed"` + Timestamp QuorumTransactionConfigFrom `json:"timestamp"` + Size float32 `json:"size"` + TotalDifficulty string `json:"totalDifficulty"` + Uncles []string `json:"uncles"` + Transactions []Web3Transaction `json:"transactions"` +} + +// NewWatchBlocksV1BlockData instantiates a new WatchBlocksV1BlockData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1BlockData(number float32, hash string, parentHash string, nonce string, sha3Uncles string, logsBloom string, stateRoot string, miner string, extraData string, gasLimit int32, gasUsed int32, timestamp QuorumTransactionConfigFrom, size float32, totalDifficulty string, uncles []string, transactions []Web3Transaction) *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + this.Number = number + this.Hash = hash + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.LogsBloom = logsBloom + this.StateRoot = stateRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + this.Size = size + this.TotalDifficulty = totalDifficulty + this.Uncles = uncles + this.Transactions = transactions + return &this +} + +// NewWatchBlocksV1BlockDataWithDefaults instantiates a new WatchBlocksV1BlockData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1BlockDataWithDefaults() *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + return &this +} + +// GetNumber returns the Number field value +func (o *WatchBlocksV1BlockData) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *WatchBlocksV1BlockData) SetNumber(v float32) { + o.Number = v +} + +// GetHash returns the Hash field value +func (o *WatchBlocksV1BlockData) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *WatchBlocksV1BlockData) SetHash(v string) { + o.Hash = v +} + +// GetParentHash returns the ParentHash field value +func (o *WatchBlocksV1BlockData) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *WatchBlocksV1BlockData) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *WatchBlocksV1BlockData) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *WatchBlocksV1BlockData) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *WatchBlocksV1BlockData) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *WatchBlocksV1BlockData) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value +func (o *WatchBlocksV1BlockData) GetLogsBloom() string { + if o == nil { + var ret string + return ret + } + + return o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetLogsBloomOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LogsBloom, true +} + +// SetLogsBloom sets field value +func (o *WatchBlocksV1BlockData) SetLogsBloom(v string) { + o.LogsBloom = v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetTransactionsRoot() string { + if o == nil || IsNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsRootOk() (*string, bool) { + if o == nil || IsNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasTransactionsRoot() bool { + if o != nil && !IsNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *WatchBlocksV1BlockData) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value +func (o *WatchBlocksV1BlockData) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *WatchBlocksV1BlockData) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetReceiptsRoot() string { + if o == nil || IsNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetReceiptsRootOk() (*string, bool) { + if o == nil || IsNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasReceiptsRoot() bool { + if o != nil && !IsNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *WatchBlocksV1BlockData) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetDifficulty() string { + if o == nil || IsNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetDifficultyOk() (*string, bool) { + if o == nil || IsNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasDifficulty() bool { + if o != nil && !IsNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *WatchBlocksV1BlockData) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetMixHash() string { + if o == nil || IsNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMixHashOk() (*string, bool) { + if o == nil || IsNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasMixHash() bool { + if o != nil && !IsNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *WatchBlocksV1BlockData) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value +func (o *WatchBlocksV1BlockData) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *WatchBlocksV1BlockData) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *WatchBlocksV1BlockData) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *WatchBlocksV1BlockData) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *WatchBlocksV1BlockData) GetGasLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *WatchBlocksV1BlockData) SetGasLimit(v int32) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *WatchBlocksV1BlockData) GetGasUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *WatchBlocksV1BlockData) SetGasUsed(v int32) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *WatchBlocksV1BlockData) GetTimestamp() QuorumTransactionConfigFrom { + if o == nil { + var ret QuorumTransactionConfigFrom + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTimestampOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *WatchBlocksV1BlockData) SetTimestamp(v QuorumTransactionConfigFrom) { + o.Timestamp = v +} + +// GetSize returns the Size field value +func (o *WatchBlocksV1BlockData) GetSize() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSizeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *WatchBlocksV1BlockData) SetSize(v float32) { + o.Size = v +} + +// GetTotalDifficulty returns the TotalDifficulty field value +func (o *WatchBlocksV1BlockData) GetTotalDifficulty() string { + if o == nil { + var ret string + return ret + } + + return o.TotalDifficulty +} + +// GetTotalDifficultyOk returns a tuple with the TotalDifficulty field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTotalDifficultyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TotalDifficulty, true +} + +// SetTotalDifficulty sets field value +func (o *WatchBlocksV1BlockData) SetTotalDifficulty(v string) { + o.TotalDifficulty = v +} + +// GetUncles returns the Uncles field value +func (o *WatchBlocksV1BlockData) GetUncles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Uncles +} + +// GetUnclesOk returns a tuple with the Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetUnclesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Uncles, true +} + +// SetUncles sets field value +func (o *WatchBlocksV1BlockData) SetUncles(v []string) { + o.Uncles = v +} + +// GetTransactions returns the Transactions field value +func (o *WatchBlocksV1BlockData) GetTransactions() []Web3Transaction { + if o == nil { + var ret []Web3Transaction + return ret + } + + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsOk() ([]Web3Transaction, bool) { + if o == nil { + return nil, false + } + return o.Transactions, true +} + +// SetTransactions sets field value +func (o *WatchBlocksV1BlockData) SetTransactions(v []Web3Transaction) { + o.Transactions = v +} + +func (o WatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1BlockData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["hash"] = o.Hash + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + toSerialize["logsBloom"] = o.LogsBloom + if !IsNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + toSerialize["stateRoot"] = o.StateRoot + if !IsNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !IsNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !IsNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + toSerialize["size"] = o.Size + toSerialize["totalDifficulty"] = o.TotalDifficulty + toSerialize["uncles"] = o.Uncles + toSerialize["transactions"] = o.Transactions + return toSerialize, nil +} + +type NullableWatchBlocksV1BlockData struct { + value *WatchBlocksV1BlockData + isSet bool +} + +func (v NullableWatchBlocksV1BlockData) Get() *WatchBlocksV1BlockData { + return v.value +} + +func (v *NullableWatchBlocksV1BlockData) Set(val *WatchBlocksV1BlockData) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1BlockData) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1BlockData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1BlockData(val *WatchBlocksV1BlockData) *NullableWatchBlocksV1BlockData { + return &NullableWatchBlocksV1BlockData{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1BlockData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go new file mode 100644 index 0000000000..97ea6a597f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Options type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Options{} + +// WatchBlocksV1Options struct for WatchBlocksV1Options +type WatchBlocksV1Options struct { + GetBlockData *bool `json:"getBlockData,omitempty"` +} + +// NewWatchBlocksV1Options instantiates a new WatchBlocksV1Options object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1Options() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// NewWatchBlocksV1OptionsWithDefaults instantiates a new WatchBlocksV1Options object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1OptionsWithDefaults() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// GetGetBlockData returns the GetBlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetGetBlockData() bool { + if o == nil || IsNil(o.GetBlockData) { + var ret bool + return ret + } + return *o.GetBlockData +} + +// GetGetBlockDataOk returns a tuple with the GetBlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetGetBlockDataOk() (*bool, bool) { + if o == nil || IsNil(o.GetBlockData) { + return nil, false + } + return o.GetBlockData, true +} + +// HasGetBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasGetBlockData() bool { + if o != nil && !IsNil(o.GetBlockData) { + return true + } + + return false +} + +// SetGetBlockData gets a reference to the given bool and assigns it to the GetBlockData field. +func (o *WatchBlocksV1Options) SetGetBlockData(v bool) { + o.GetBlockData = &v +} + +func (o WatchBlocksV1Options) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Options) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.GetBlockData) { + toSerialize["getBlockData"] = o.GetBlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Options struct { + value *WatchBlocksV1Options + isSet bool +} + +func (v NullableWatchBlocksV1Options) Get() *WatchBlocksV1Options { + return v.value +} + +func (v *NullableWatchBlocksV1Options) Set(val *WatchBlocksV1Options) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Options) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Options) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Options(val *WatchBlocksV1Options) *NullableWatchBlocksV1Options { + return &NullableWatchBlocksV1Options{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Options) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Options) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 0000000000..ed90467fbc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Progress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Progress{} + +// WatchBlocksV1Progress struct for WatchBlocksV1Progress +type WatchBlocksV1Progress struct { + BlockHeader *Web3BlockHeader `json:"blockHeader,omitempty"` + BlockData *WatchBlocksV1BlockData `json:"blockData,omitempty"` +} + +// NewWatchBlocksV1Progress instantiates a new WatchBlocksV1Progress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1Progress() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// NewWatchBlocksV1ProgressWithDefaults instantiates a new WatchBlocksV1Progress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// GetBlockHeader returns the BlockHeader field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader { + if o == nil || IsNil(o.BlockHeader) { + var ret Web3BlockHeader + return ret + } + return *o.BlockHeader +} + +// GetBlockHeaderOk returns a tuple with the BlockHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool) { + if o == nil || IsNil(o.BlockHeader) { + return nil, false + } + return o.BlockHeader, true +} + +// HasBlockHeader returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockHeader() bool { + if o != nil && !IsNil(o.BlockHeader) { + return true + } + + return false +} + +// SetBlockHeader gets a reference to the given Web3BlockHeader and assigns it to the BlockHeader field. +func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader) { + o.BlockHeader = &v +} + +// GetBlockData returns the BlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockData() WatchBlocksV1BlockData { + if o == nil || IsNil(o.BlockData) { + var ret WatchBlocksV1BlockData + return ret + } + return *o.BlockData +} + +// GetBlockDataOk returns a tuple with the BlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockDataOk() (*WatchBlocksV1BlockData, bool) { + if o == nil || IsNil(o.BlockData) { + return nil, false + } + return o.BlockData, true +} + +// HasBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockData() bool { + if o != nil && !IsNil(o.BlockData) { + return true + } + + return false +} + +// SetBlockData gets a reference to the given WatchBlocksV1BlockData and assigns it to the BlockData field. +func (o *WatchBlocksV1Progress) SetBlockData(v WatchBlocksV1BlockData) { + o.BlockData = &v +} + +func (o WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Progress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockHeader) { + toSerialize["blockHeader"] = o.BlockHeader + } + if !IsNil(o.BlockData) { + toSerialize["blockData"] = o.BlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go new file mode 100644 index 0000000000..afd2ad8280 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go @@ -0,0 +1,558 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3BlockHeader type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3BlockHeader{} + +// Web3BlockHeader struct for Web3BlockHeader +type Web3BlockHeader struct { + Number float32 `json:"number"` + Hash string `json:"hash"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom string `json:"logsBloom"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot string `json:"stateRoot"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit int32 `json:"gasLimit"` + GasUsed int32 `json:"gasUsed"` + Timestamp QuorumTransactionConfigFrom `json:"timestamp"` +} + +// NewWeb3BlockHeader instantiates a new Web3BlockHeader object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3BlockHeader(number float32, hash string, parentHash string, nonce string, sha3Uncles string, logsBloom string, stateRoot string, miner string, extraData string, gasLimit int32, gasUsed int32, timestamp QuorumTransactionConfigFrom) *Web3BlockHeader { + this := Web3BlockHeader{} + this.Number = number + this.Hash = hash + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.LogsBloom = logsBloom + this.StateRoot = stateRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + return &this +} + +// NewWeb3BlockHeaderWithDefaults instantiates a new Web3BlockHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader { + this := Web3BlockHeader{} + return &this +} + +// GetNumber returns the Number field value +func (o *Web3BlockHeader) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *Web3BlockHeader) SetNumber(v float32) { + o.Number = v +} + +// GetHash returns the Hash field value +func (o *Web3BlockHeader) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3BlockHeader) SetHash(v string) { + o.Hash = v +} + +// GetParentHash returns the ParentHash field value +func (o *Web3BlockHeader) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *Web3BlockHeader) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3BlockHeader) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3BlockHeader) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *Web3BlockHeader) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *Web3BlockHeader) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value +func (o *Web3BlockHeader) GetLogsBloom() string { + if o == nil { + var ret string + return ret + } + + return o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LogsBloom, true +} + +// SetLogsBloom sets field value +func (o *Web3BlockHeader) SetLogsBloom(v string) { + o.LogsBloom = v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetTransactionsRoot() string { + if o == nil || IsNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTransactionsRootOk() (*string, bool) { + if o == nil || IsNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasTransactionsRoot() bool { + if o != nil && !IsNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *Web3BlockHeader) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value +func (o *Web3BlockHeader) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *Web3BlockHeader) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetReceiptsRoot() string { + if o == nil || IsNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetReceiptsRootOk() (*string, bool) { + if o == nil || IsNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasReceiptsRoot() bool { + if o != nil && !IsNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *Web3BlockHeader) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetDifficulty() string { + if o == nil || IsNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetDifficultyOk() (*string, bool) { + if o == nil || IsNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasDifficulty() bool { + if o != nil && !IsNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *Web3BlockHeader) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetMixHash() string { + if o == nil || IsNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMixHashOk() (*string, bool) { + if o == nil || IsNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasMixHash() bool { + if o != nil && !IsNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *Web3BlockHeader) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value +func (o *Web3BlockHeader) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *Web3BlockHeader) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *Web3BlockHeader) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *Web3BlockHeader) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *Web3BlockHeader) GetGasLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *Web3BlockHeader) SetGasLimit(v int32) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3BlockHeader) GetGasUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3BlockHeader) SetGasUsed(v int32) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *Web3BlockHeader) GetTimestamp() QuorumTransactionConfigFrom { + if o == nil { + var ret QuorumTransactionConfigFrom + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTimestampOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *Web3BlockHeader) SetTimestamp(v QuorumTransactionConfigFrom) { + o.Timestamp = v +} + +func (o Web3BlockHeader) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3BlockHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["hash"] = o.Hash + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + toSerialize["logsBloom"] = o.LogsBloom + if !IsNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + toSerialize["stateRoot"] = o.StateRoot + if !IsNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !IsNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !IsNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullableWeb3BlockHeader struct { + value *Web3BlockHeader + isSet bool +} + +func (v NullableWeb3BlockHeader) Get() *Web3BlockHeader { + return v.value +} + +func (v *NullableWeb3BlockHeader) Set(val *Web3BlockHeader) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeader(val *Web3BlockHeader) *NullableWeb3BlockHeader { + return &NullableWeb3BlockHeader{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..79b838d037 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,208 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialGethKeychainPassword *Web3SigningCredentialGethKeychainPassword + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialGethKeychainPassword wrapped in Web3SigningCredential +func Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential(v *Web3SigningCredentialGethKeychainPassword) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialGethKeychainPassword: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialGethKeychainPassword + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialGethKeychainPassword) + if err == nil { + jsonWeb3SigningCredentialGethKeychainPassword, _ := json.Marshal(dst.Web3SigningCredentialGethKeychainPassword) + if string(jsonWeb3SigningCredentialGethKeychainPassword) == "{}" { // empty struct + dst.Web3SigningCredentialGethKeychainPassword = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialGethKeychainPassword = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialGethKeychainPassword = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialGethKeychainPassword != nil { + return json.Marshal(&src.Web3SigningCredentialGethKeychainPassword) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialGethKeychainPassword != nil { + return obj.Web3SigningCredentialGethKeychainPassword + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..32a3b4bd19 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,210 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId *string `json:"keychainId,omitempty"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value if set, zero value otherwise. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil || IsNil(o.KeychainId) { + var ret string + return ret + } + return *o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil || IsNil(o.KeychainId) { + return nil, false + } + return o.KeychainId, true +} + +// HasKeychainId returns a boolean if a field has been set. +func (o *Web3SigningCredentialCactusKeychainRef) HasKeychainId() bool { + if o != nil && !IsNil(o.KeychainId) { + return true + } + + return false +} + +// SetKeychainId gets a reference to the given string and assigns it to the KeychainId field. +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = &v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + if !IsNil(o.KeychainId) { + toSerialize["keychainId"] = o.KeychainId + } + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go new file mode 100644 index 0000000000..2f05b637a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialGethKeychainPassword type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialGethKeychainPassword{} + +// Web3SigningCredentialGethKeychainPassword struct for Web3SigningCredentialGethKeychainPassword +type Web3SigningCredentialGethKeychainPassword struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // A geth keychain unlock password. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialGethKeychainPassword instantiates a new Web3SigningCredentialGethKeychainPassword object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialGethKeychainPassword(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialGethKeychainPasswordWithDefaults instantiates a new Web3SigningCredentialGethKeychainPassword object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialGethKeychainPasswordWithDefaults() *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialGethKeychainPassword) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialGethKeychainPassword) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialGethKeychainPassword) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialGethKeychainPassword struct { + value *Web3SigningCredentialGethKeychainPassword + isSet bool +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) Get() *Web3SigningCredentialGethKeychainPassword { + return v.value +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Set(val *Web3SigningCredentialGethKeychainPassword) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialGethKeychainPassword(val *Web3SigningCredentialGethKeychainPassword) *NullableWeb3SigningCredentialGethKeychainPassword { + return &NullableWeb3SigningCredentialGethKeychainPassword{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..d2ac450835 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..e5aa433dcd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..26814bc9c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go new file mode 100644 index 0000000000..5366ab0622 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go @@ -0,0 +1,503 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3Transaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3Transaction{} + +// Web3Transaction struct for Web3Transaction +type Web3Transaction struct { + Hash string `json:"hash"` + Nonce float32 `json:"nonce"` + BlockHash NullableString `json:"blockHash"` + BlockNumber NullableFloat32 `json:"blockNumber"` + TransactionIndex NullableFloat32 `json:"transactionIndex"` + From string `json:"from"` + To NullableString `json:"to"` + Value string `json:"value"` + GasPrice string `json:"gasPrice"` + Gas float32 `json:"gas"` + Input string `json:"input"` + V *string `json:"v,omitempty"` + R *string `json:"r,omitempty"` + S *string `json:"s,omitempty"` +} + +// NewWeb3Transaction instantiates a new Web3Transaction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3Transaction(hash string, nonce float32, blockHash NullableString, blockNumber NullableFloat32, transactionIndex NullableFloat32, from string, to NullableString, value string, gasPrice string, gas float32, input string) *Web3Transaction { + this := Web3Transaction{} + this.Hash = hash + this.Nonce = nonce + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.TransactionIndex = transactionIndex + this.From = from + this.To = to + this.Value = value + this.GasPrice = gasPrice + this.Gas = gas + this.Input = input + return &this +} + +// NewWeb3TransactionWithDefaults instantiates a new Web3Transaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionWithDefaults() *Web3Transaction { + this := Web3Transaction{} + return &this +} + +// GetHash returns the Hash field value +func (o *Web3Transaction) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3Transaction) SetHash(v string) { + o.Hash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3Transaction) GetNonce() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetNonceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3Transaction) SetNonce(v float32) { + o.Nonce = v +} + +// GetBlockHash returns the BlockHash field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Web3Transaction) GetBlockHash() string { + if o == nil || o.BlockHash.Get() == nil { + var ret string + return ret + } + + return *o.BlockHash.Get() +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.BlockHash.Get(), o.BlockHash.IsSet() +} + +// SetBlockHash sets field value +func (o *Web3Transaction) SetBlockHash(v string) { + o.BlockHash.Set(&v) +} + +// GetBlockNumber returns the BlockNumber field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Web3Transaction) GetBlockNumber() float32 { + if o == nil || o.BlockNumber.Get() == nil { + var ret float32 + return ret + } + + return *o.BlockNumber.Get() +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.BlockNumber.Get(), o.BlockNumber.IsSet() +} + +// SetBlockNumber sets field value +func (o *Web3Transaction) SetBlockNumber(v float32) { + o.BlockNumber.Set(&v) +} + +// GetTransactionIndex returns the TransactionIndex field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Web3Transaction) GetTransactionIndex() float32 { + if o == nil || o.TransactionIndex.Get() == nil { + var ret float32 + return ret + } + + return *o.TransactionIndex.Get() +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.TransactionIndex.Get(), o.TransactionIndex.IsSet() +} + +// SetTransactionIndex sets field value +func (o *Web3Transaction) SetTransactionIndex(v float32) { + o.TransactionIndex.Set(&v) +} + +// GetFrom returns the From field value +func (o *Web3Transaction) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3Transaction) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Web3Transaction) GetTo() string { + if o == nil || o.To.Get() == nil { + var ret string + return ret + } + + return *o.To.Get() +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.To.Get(), o.To.IsSet() +} + +// SetTo sets field value +func (o *Web3Transaction) SetTo(v string) { + o.To.Set(&v) +} + +// GetValue returns the Value field value +func (o *Web3Transaction) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Web3Transaction) SetValue(v string) { + o.Value = v +} + +// GetGasPrice returns the GasPrice field value +func (o *Web3Transaction) GetGasPrice() string { + if o == nil { + var ret string + return ret + } + + return o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasPriceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasPrice, true +} + +// SetGasPrice sets field value +func (o *Web3Transaction) SetGasPrice(v string) { + o.GasPrice = v +} + +// GetGas returns the Gas field value +func (o *Web3Transaction) GetGas() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Gas +} + +// GetGasOk returns a tuple with the Gas field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Gas, true +} + +// SetGas sets field value +func (o *Web3Transaction) SetGas(v float32) { + o.Gas = v +} + +// GetInput returns the Input field value +func (o *Web3Transaction) GetInput() string { + if o == nil { + var ret string + return ret + } + + return o.Input +} + +// GetInputOk returns a tuple with the Input field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetInputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *Web3Transaction) SetInput(v string) { + o.Input = v +} + +// GetV returns the V field value if set, zero value otherwise. +func (o *Web3Transaction) GetV() string { + if o == nil || IsNil(o.V) { + var ret string + return ret + } + return *o.V +} + +// GetVOk returns a tuple with the V field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetVOk() (*string, bool) { + if o == nil || IsNil(o.V) { + return nil, false + } + return o.V, true +} + +// HasV returns a boolean if a field has been set. +func (o *Web3Transaction) HasV() bool { + if o != nil && !IsNil(o.V) { + return true + } + + return false +} + +// SetV gets a reference to the given string and assigns it to the V field. +func (o *Web3Transaction) SetV(v string) { + o.V = &v +} + +// GetR returns the R field value if set, zero value otherwise. +func (o *Web3Transaction) GetR() string { + if o == nil || IsNil(o.R) { + var ret string + return ret + } + return *o.R +} + +// GetROk returns a tuple with the R field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetROk() (*string, bool) { + if o == nil || IsNil(o.R) { + return nil, false + } + return o.R, true +} + +// HasR returns a boolean if a field has been set. +func (o *Web3Transaction) HasR() bool { + if o != nil && !IsNil(o.R) { + return true + } + + return false +} + +// SetR gets a reference to the given string and assigns it to the R field. +func (o *Web3Transaction) SetR(v string) { + o.R = &v +} + +// GetS returns the S field value if set, zero value otherwise. +func (o *Web3Transaction) GetS() string { + if o == nil || IsNil(o.S) { + var ret string + return ret + } + return *o.S +} + +// GetSOk returns a tuple with the S field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetSOk() (*string, bool) { + if o == nil || IsNil(o.S) { + return nil, false + } + return o.S, true +} + +// HasS returns a boolean if a field has been set. +func (o *Web3Transaction) HasS() bool { + if o != nil && !IsNil(o.S) { + return true + } + + return false +} + +// SetS gets a reference to the given string and assigns it to the S field. +func (o *Web3Transaction) SetS(v string) { + o.S = &v +} + +func (o Web3Transaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["nonce"] = o.Nonce + toSerialize["blockHash"] = o.BlockHash.Get() + toSerialize["blockNumber"] = o.BlockNumber.Get() + toSerialize["transactionIndex"] = o.TransactionIndex.Get() + toSerialize["from"] = o.From + toSerialize["to"] = o.To.Get() + toSerialize["value"] = o.Value + toSerialize["gasPrice"] = o.GasPrice + toSerialize["gas"] = o.Gas + toSerialize["input"] = o.Input + if !IsNil(o.V) { + toSerialize["v"] = o.V + } + if !IsNil(o.R) { + toSerialize["r"] = o.R + } + if !IsNil(o.S) { + toSerialize["s"] = o.S + } + return toSerialize, nil +} + +type NullableWeb3Transaction struct { + value *Web3Transaction + isSet bool +} + +func (v NullableWeb3Transaction) Get() *Web3Transaction { + return v.value +} + +func (v *NullableWeb3Transaction) Set(val *Web3Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3Transaction) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3Transaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3Transaction(val *Web3Transaction) *NullableWeb3Transaction { + return &NullableWeb3Transaction{value: val, isSet: true} +} + +func (v NullableWeb3Transaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3Transaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 0000000000..5a18ae675e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,607 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + Logs []interface{} `json:"logs,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + RevertReason *string `json:"revertReason,omitempty"` + Output *string `json:"output,omitempty"` + CommitmentHash *string `json:"commitmentHash,omitempty"` + CumulativeGasUSed *float32 `json:"cumulativeGasUSed,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogs() []interface{} { + if o == nil || IsNil(o.Logs) { + var ret []interface{} + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogs() bool { + if o != nil && !IsNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given []interface{} and assigns it to the Logs field. +func (o *Web3TransactionReceipt) SetLogs(v []interface{}) { + o.Logs = v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogsBloom() string { + if o == nil || IsNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsBloomOk() (*string, bool) { + if o == nil || IsNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogsBloom() bool { + if o != nil && !IsNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *Web3TransactionReceipt) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetRevertReason returns the RevertReason field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetRevertReason() string { + if o == nil || IsNil(o.RevertReason) { + var ret string + return ret + } + return *o.RevertReason +} + +// GetRevertReasonOk returns a tuple with the RevertReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetRevertReasonOk() (*string, bool) { + if o == nil || IsNil(o.RevertReason) { + return nil, false + } + return o.RevertReason, true +} + +// HasRevertReason returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasRevertReason() bool { + if o != nil && !IsNil(o.RevertReason) { + return true + } + + return false +} + +// SetRevertReason gets a reference to the given string and assigns it to the RevertReason field. +func (o *Web3TransactionReceipt) SetRevertReason(v string) { + o.RevertReason = &v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetOutput() string { + if o == nil || IsNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetOutputOk() (*string, bool) { + if o == nil || IsNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasOutput() bool { + if o != nil && !IsNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *Web3TransactionReceipt) SetOutput(v string) { + o.Output = &v +} + +// GetCommitmentHash returns the CommitmentHash field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCommitmentHash() string { + if o == nil || IsNil(o.CommitmentHash) { + var ret string + return ret + } + return *o.CommitmentHash +} + +// GetCommitmentHashOk returns a tuple with the CommitmentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCommitmentHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitmentHash) { + return nil, false + } + return o.CommitmentHash, true +} + +// HasCommitmentHash returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCommitmentHash() bool { + if o != nil && !IsNil(o.CommitmentHash) { + return true + } + + return false +} + +// SetCommitmentHash gets a reference to the given string and assigns it to the CommitmentHash field. +func (o *Web3TransactionReceipt) SetCommitmentHash(v string) { + o.CommitmentHash = &v +} + +// GetCumulativeGasUSed returns the CumulativeGasUSed field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCumulativeGasUSed() float32 { + if o == nil || IsNil(o.CumulativeGasUSed) { + var ret float32 + return ret + } + return *o.CumulativeGasUSed +} + +// GetCumulativeGasUSedOk returns a tuple with the CumulativeGasUSed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCumulativeGasUSedOk() (*float32, bool) { + if o == nil || IsNil(o.CumulativeGasUSed) { + return nil, false + } + return o.CumulativeGasUSed, true +} + +// HasCumulativeGasUSed returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCumulativeGasUSed() bool { + if o != nil && !IsNil(o.CumulativeGasUSed) { + return true + } + + return false +} + +// SetCumulativeGasUSed gets a reference to the given float32 and assigns it to the CumulativeGasUSed field. +func (o *Web3TransactionReceipt) SetCumulativeGasUSed(v float32) { + o.CumulativeGasUSed = &v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + if !IsNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + if !IsNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !IsNil(o.RevertReason) { + toSerialize["revertReason"] = o.RevertReason + } + if !IsNil(o.Output) { + toSerialize["output"] = o.Output + } + if !IsNil(o.CommitmentHash) { + toSerialize["commitmentHash"] = o.CommitmentHash + } + if !IsNil(o.CumulativeGasUSed) { + toSerialize["cumulativeGasUSed"] = o.CumulativeGasUSed + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "logs") + delete(additionalProperties, "logsBloom") + delete(additionalProperties, "revertReason") + delete(additionalProperties, "output") + delete(additionalProperties, "commitmentHash") + delete(additionalProperties, "cumulativeGasUSed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..e96a29d796 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..9d17e9739f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-quorum + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-quorum_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContractSolBytecodeJsonObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeJsonObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DeployContractSolBytecodeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1NoKeychain", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1NoKeychain(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeRawWeb3EthContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeRawWeb3EthContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeWeb3EthMethodV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeWeb3EthMethodV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 0000000000..277f3183f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..f67a3cab33 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Quorum + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..3f3ee6d6e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,69 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ContractJSON.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java +src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java +src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java +src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java +src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java +src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/Web3BlockHeader.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3Transaction.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..4fca79b01d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,179 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Quorum +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Quorum ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = new DeployContractSolidityBytecodeJsonObjectV1Request(); // DeployContractSolidityBytecodeJsonObjectV1Request | + try { + DeployContractSolidityBytecodeV1Response result = apiInstance.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractSolBytecodeJsonObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractSolBytecodeJsonObjectV1**](docs/DefaultApi.md#deployContractSolBytecodeJsonObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**deployContractSolBytecodeV1**](docs/DefaultApi.md#deployContractSolBytecodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**invokeContractV1NoKeychain**](docs/DefaultApi.md#invokeContractV1NoKeychain) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**invokeRawWeb3EthContractV1**](docs/DefaultApi.md#invokeRawWeb3EthContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract | Low-level endpoint to invoke a method on deployed contract. +*DefaultApi* | [**invokeWeb3EthMethodV1**](docs/DefaultApi.md#invokeWeb3EthMethodV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method | Invoke any method from web3.eth (low-level) +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction | Executes a transaction on a quorum ledger + + +## Documentation for Models + + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractSolidityBytecodeJsonObjectV1Request](docs/DeployContractSolidityBytecodeJsonObjectV1Request.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EthContractInvocationWeb3Method](docs/EthContractInvocationWeb3Method.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [QuorumPrivateTransactionConfig](docs/QuorumPrivateTransactionConfig.md) + - [QuorumTransactionConfig](docs/QuorumTransactionConfig.md) + - [QuorumTransactionConfigFrom](docs/QuorumTransactionConfigFrom.md) + - [QuorumTransactionConfigTo](docs/QuorumTransactionConfigTo.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..fa89826350 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1304 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Quorum ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Quorum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractSolBytecodeJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a quorum ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object: + post: + operationId: invokeContractV1NoKeychain + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method + x-content-type: application/json + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract: + post: + operationId: invokeRawWeb3EthContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Response' + description: OK + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract + x-content-type: application/json + x-accepts: text/plain +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + QuorumTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + to: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + type: object + QuorumPrivateTransactionConfig: + example: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + isPrivate: + default: false + nullable: false + type: boolean + gasPrice: + nullable: false + type: number + gasLimit: + nullable: false + type: number + privateKey: + nullable: false + type: string + privacyGroupId: + nullable: false + type: string + required: + - privateFor + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + logs: + default: [] + items: {} + nullable: false + type: array + logsBloom: + nullable: false + type: string + revertReason: + nullable: false + type: string + output: + nullable: false + type: string + commitmentHash: + nullable: false + type: string + cumulativeGasUSed: + nullable: false + type: number + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - bytecode + - contractName + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/QuorumTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with thehash of the transaction(which indicates successful execution) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + constructorArgs: + - "" + - "" + nonce: 1.4658129805029452 + keychainId: keychainId + timeoutMs: 0.5637376656633328 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + value: 5.962133916683182 + gasPrice: 6.027456183070403 + contractJSON: "{}" + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: number + nonce: + nullable: false + type: number + value: + nullable: false + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + description: "For use when not using keychain, pass the contract in as this\ + \ variable" + nullable: false + type: object + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + InvokeRawWeb3EthMethodV1Request: + additionalProperties: false + example: + methodName: methodName + params: + - "" + - "" + properties: + methodName: + description: The name of the web3.eth method to invoke + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass to web3.eth method specified + in methodName + items: {} + type: array + required: + - methodName + type: object + InvokeRawWeb3EthMethodV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + nullable: false + type: number + data: + description: Output of requested web3.eth method + errorDetail: + description: Error details + nullable: false + type: string + required: + - status + type: object + InvokeRawWeb3EthContractV1Request: + additionalProperties: false + example: + invocationType: null + address: address + abi: + - "" + - "" + contractMethodArgs: + - "" + - "" + contractMethod: contractMethod + invocationParams: "{}" + properties: + abi: + description: The application binary interface of the solidity contract + items: {} + type: array + address: + description: Deployed solidity contract address + type: string + invocationType: + $ref: '#/components/schemas/EthContractInvocationWeb3Method' + invocationParams: + default: {} + description: "The list of arguments for contract invocation method (send,\ + \ call, etc...)" + type: object + contractMethod: + description: Method of deployed solidity contract to execute + type: string + contractMethodArgs: + default: [] + description: The list of arguments for deployed solidity contract method + items: {} + type: array + required: + - abi + - address + - contractMethod + - invocationType + type: object + InvokeRawWeb3EthContractV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: number + blockHash: + nullable: true + type: string + blockNumber: + nullable: true + type: number + transactionIndex: + nullable: true + type: number + from: + type: string + to: + nullable: true + type: string + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + size: + type: number + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + QuorumTransactionConfig_from: + oneOf: + - type: string + - type: number + QuorumTransactionConfig_to: + oneOf: + - type: string + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..f2dfad4800 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..bd3e523d94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..918f0cd5f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..e41eab4f23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..6bce8e2976 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..21c8b47f18 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,445 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialGethKeychainPassword", org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ContractJSON.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumPrivateTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumTransactionConfigFrom.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumTransactionConfigTo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1BlockData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Options.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3Transaction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..f7d877ad2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..9b9f84d540 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..24314903bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..64d87d20ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..2c8909609a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1026 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deployContractSolBytecodeJsonObjectV1 + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeJsonObjectV1Call(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeJsonObjectV1Call(deployContractSolidityBytecodeJsonObjectV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeJsonObjectV1(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeJsonObjectV1WithHttpInfo(deployContractSolidityBytecodeJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeJsonObjectV1WithHttpInfo(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(deployContractSolidityBytecodeJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeJsonObjectV1Async(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(deployContractSolidityBytecodeJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractSolBytecodeV1 + * @param deployContractSolidityBytecodeV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Call(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractSolBytecodeV1ValidateBeforeCall(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeV1Call(deployContractSolidityBytecodeV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeV1(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeV1WithHttpInfo(deployContractSolidityBytecodeV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeV1WithHttpInfo(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Async(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1NoKeychain + * @param invokeContractJsonObjectV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1NoKeychainCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1NoKeychainValidateBeforeCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1NoKeychainCall(invokeContractJsonObjectV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1NoKeychain(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1NoKeychainWithHttpInfo(invokeContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1NoKeychainWithHttpInfo(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1NoKeychainValidateBeforeCall(invokeContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractJsonObjectV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1NoKeychainAsync(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1NoKeychainValidateBeforeCall(invokeContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeRawWeb3EthContractV1 + * @param invokeRawWeb3EthContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Call(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeRawWeb3EthContractV1ValidateBeforeCall(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeRawWeb3EthContractV1Call(invokeRawWeb3EthContractV1Request, _callback); + + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return InvokeRawWeb3EthContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeRawWeb3EthContractV1WithHttpInfo(invokeRawWeb3EthContractV1Request); + return localVarResp.getData(); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeRawWeb3EthContractV1WithHttpInfo(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. (asynchronously) + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Async(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeWeb3EthMethodV1 + * @param invokeRawWeb3EthMethodV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Call(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthMethodV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeWeb3EthMethodV1ValidateBeforeCall(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + return invokeWeb3EthMethodV1Call(invokeRawWeb3EthMethodV1Request, _callback); + + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return InvokeRawWeb3EthMethodV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeRawWeb3EthMethodV1Response invokeWeb3EthMethodV1(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + ApiResponse localVarResp = invokeWeb3EthMethodV1WithHttpInfo(invokeRawWeb3EthMethodV1Request); + return localVarResp.getData(); + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthMethodV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeWeb3EthMethodV1WithHttpInfo(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invoke any method from web3.eth (low-level) (asynchronously) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Async(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Executes a transaction on a quorum ledger + * + * @param runTransactionRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a quorum ledger + * + * @param runTransactionRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a quorum ledger (asynchronously) + * + * @param runTransactionRequest (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..f47f36f5f7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..542e354777 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..82590a49ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..b95239fa54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..53df15cd6a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java new file mode 100644 index 0000000000..a34177acf4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java @@ -0,0 +1,660 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJSON + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJSON { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private Object compiler; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + @SerializedName(SERIALIZED_NAME_NETWORKS) + private Object networks; + + public static final String SERIALIZED_NAME_AST = "ast"; + @SerializedName(SERIALIZED_NAME_AST) + private Object ast; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Object functionHashes; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private Object gasEstimates; + + public ContractJSON() { + } + + public ContractJSON contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractJSON bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public ContractJSON abi(List abi) { + + this.abi = abi; + return this; + } + + public ContractJSON addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return abi + **/ + @javax.annotation.Nullable + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public ContractJSON metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public ContractJSON deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public ContractJSON sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public ContractJSON deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public ContractJSON sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public ContractJSON compiler(Object compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public Object getCompiler() { + return compiler; + } + + + public void setCompiler(Object compiler) { + this.compiler = compiler; + } + + + public ContractJSON networks(Object networks) { + + this.networks = networks; + return this; + } + + /** + * Get networks + * @return networks + **/ + @javax.annotation.Nullable + public Object getNetworks() { + return networks; + } + + + public void setNetworks(Object networks) { + this.networks = networks; + } + + + public ContractJSON ast(Object ast) { + + this.ast = ast; + return this; + } + + /** + * Get ast + * @return ast + **/ + @javax.annotation.Nullable + public Object getAst() { + return ast; + } + + + public void setAst(Object ast) { + this.ast = ast; + } + + + public ContractJSON functionHashes(Object functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Object getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Object functionHashes) { + this.functionHashes = functionHashes; + } + + + public ContractJSON gasEstimates(Object gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public Object getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(Object gasEstimates) { + this.gasEstimates = gasEstimates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ContractJSON instance itself + */ + public ContractJSON putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJSON contractJSON = (ContractJSON) o; + return Objects.equals(this.contractName, contractJSON.contractName) && + Objects.equals(this.bytecode, contractJSON.bytecode) && + Objects.equals(this.abi, contractJSON.abi) && + Objects.equals(this.metadata, contractJSON.metadata) && + Objects.equals(this.deployedBytecode, contractJSON.deployedBytecode) && + Objects.equals(this.sourceMap, contractJSON.sourceMap) && + Objects.equals(this.deployedSourceMap, contractJSON.deployedSourceMap) && + Objects.equals(this.sourcePath, contractJSON.sourcePath) && + Objects.equals(this.compiler, contractJSON.compiler) && + Objects.equals(this.networks, contractJSON.networks) && + Objects.equals(this.ast, contractJSON.ast) && + Objects.equals(this.functionHashes, contractJSON.functionHashes) && + Objects.equals(this.gasEstimates, contractJSON.gasEstimates)&& + Objects.equals(this.additionalProperties, contractJSON.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, bytecode, abi, metadata, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, networks, ast, functionHashes, gasEstimates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJSON {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ast: ").append(toIndentedString(ast)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("bytecode"); + openapiFields.add("abi"); + openapiFields.add("metadata"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("networks"); + openapiFields.add("ast"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("bytecode"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJSON + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJSON.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJSON is not found in the empty JSON string", ContractJSON.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJSON.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("abi") != null && !jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJSON.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJSON' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJSON.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJSON value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ContractJSON read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ContractJSON instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJSON given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJSON + * @throws IOException if the JSON string is invalid with respect to ContractJSON + */ + public static ContractJSON fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJSON.class); + } + + /** + * Convert an instance of ContractJSON to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java new file mode 100644 index 0000000000..54be6fc5d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public DeployContractSolidityBytecodeJsonObjectV1Request() { + } + + public DeployContractSolidityBytecodeJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeJsonObjectV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = (DeployContractSolidityBytecodeJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.gas, deployContractSolidityBytecodeJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, deployContractSolidityBytecodeJsonObjectV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractSolidityBytecodeJsonObjectV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeJsonObjectV1Request.constructorArgs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, gas, gasPrice, timeoutMs, contractJSON, constructorArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeJsonObjectV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeJsonObjectV1Request + */ + public static DeployContractSolidityBytecodeJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeJsonObjectV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java new file mode 100644 index 0000000000..31acb0e5e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java @@ -0,0 +1,596 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private BigDecimal gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private BigDecimal value; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private Object contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private QuorumPrivateTransactionConfig privateTransactionConfig; + + public DeployContractSolidityBytecodeV1Request() { + } + + public DeployContractSolidityBytecodeV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractSolidityBytecodeV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public DeployContractSolidityBytecodeV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return contractAbi + **/ + @javax.annotation.Nullable + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public DeployContractSolidityBytecodeV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeV1Request bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public DeployContractSolidityBytecodeV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractSolidityBytecodeV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractSolidityBytecodeV1Request gasPrice(BigDecimal gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public BigDecimal getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(BigDecimal gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractSolidityBytecodeV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public DeployContractSolidityBytecodeV1Request value(BigDecimal value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public BigDecimal getValue() { + return value; + } + + + public void setValue(BigDecimal value) { + this.value = value; + } + + + public DeployContractSolidityBytecodeV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeV1Request contractJSON(Object contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * For use when not using keychain, pass the contract in as this variable + * @return contractJSON + **/ + @javax.annotation.Nullable + public Object getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(Object contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractSolidityBytecodeV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractSolidityBytecodeV1Request privateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public QuorumPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = (DeployContractSolidityBytecodeV1Request) o; + return Objects.equals(this.contractName, deployContractSolidityBytecodeV1Request.contractName) && + Objects.equals(this.contractAbi, deployContractSolidityBytecodeV1Request.contractAbi) && + Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeV1Request.web3SigningCredential) && + Objects.equals(this.bytecode, deployContractSolidityBytecodeV1Request.bytecode) && + Objects.equals(this.keychainId, deployContractSolidityBytecodeV1Request.keychainId) && + Objects.equals(this.gas, deployContractSolidityBytecodeV1Request.gas) && + Objects.equals(this.gasPrice, deployContractSolidityBytecodeV1Request.gasPrice) && + Objects.equals(this.nonce, deployContractSolidityBytecodeV1Request.nonce) && + Objects.equals(this.value, deployContractSolidityBytecodeV1Request.value) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractSolidityBytecodeV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeV1Request.constructorArgs) && + Objects.equals(this.privateTransactionConfig, deployContractSolidityBytecodeV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, contractAbi, web3SigningCredential, bytecode, keychainId, gas, gasPrice, nonce, value, timeoutMs, contractJSON, constructorArgs, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("contractAbi"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("bytecode"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("value"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractAbi") != null && !jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + QuorumPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static DeployContractSolidityBytecodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java new file mode 100644 index 0000000000..038789d442 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractSolidityBytecodeV1Response() { + } + + public DeployContractSolidityBytecodeV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Response deployContractSolidityBytecodeV1Response = (DeployContractSolidityBytecodeV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractSolidityBytecodeV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Response is not found in the empty JSON string", DeployContractSolidityBytecodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static DeployContractSolidityBytecodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Response.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 0000000000..de41b53dd2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java new file mode 100644 index 0000000000..46b63aebd5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationWeb3Method + */ +@JsonAdapter(EthContractInvocationWeb3Method.Adapter.class) +public enum EthContractInvocationWeb3Method { + + SEND("send"), + + CALL("call"), + + ENCODEABI("encodeABI"), + + ESTIMATEGAS("estimateGas"); + + private String value; + + EthContractInvocationWeb3Method(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationWeb3Method fromValue(String value) { + for (EthContractInvocationWeb3Method b : EthContractInvocationWeb3Method.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationWeb3Method enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationWeb3Method read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationWeb3Method.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java new file mode 100644 index 0000000000..a398999043 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java @@ -0,0 +1,573 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private QuorumTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private QuorumTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private QuorumTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private QuorumPrivateTransactionConfig privateTransactionConfig; + + public InvokeContractJsonObjectV1Request() { + } + + public InvokeContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractJsonObjectV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractJsonObjectV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractJsonObjectV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractJsonObjectV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractJsonObjectV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractJsonObjectV1Request value(QuorumTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(QuorumTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractJsonObjectV1Request gas(QuorumTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(QuorumTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractJsonObjectV1Request gasPrice(QuorumTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(QuorumTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractJsonObjectV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public InvokeContractJsonObjectV1Request privateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public QuorumPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = (InvokeContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, invokeContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractJsonObjectV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractJsonObjectV1Request.methodName) && + Objects.equals(this.params, invokeContractJsonObjectV1Request.params) && + Objects.equals(this.contractAddress, invokeContractJsonObjectV1Request.contractAddress) && + Objects.equals(this.value, invokeContractJsonObjectV1Request.value) && + Objects.equals(this.gas, invokeContractJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractJsonObjectV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractJsonObjectV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, invokeContractJsonObjectV1Request.contractJSON) && + Objects.equals(this.privateTransactionConfig, invokeContractJsonObjectV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, invocationType, methodName, params, contractAddress, value, gas, gasPrice, nonce, timeoutMs, contractJSON, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractJsonObjectV1Request is not found in the empty JSON string", InvokeContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + QuorumPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static InvokeContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of InvokeContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 0000000000..76fe3ae1e4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,542 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private QuorumTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private QuorumTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private QuorumTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name to find it in the keychain plugin + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request value(QuorumTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(QuorumTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractV1Request gas(QuorumTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(QuorumTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractV1Request gasPrice(QuorumTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(QuorumTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.web3SigningCredential, invokeContractV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gas, invokeContractV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, web3SigningCredential, invocationType, methodName, params, value, gas, gasPrice, nonce, timeoutMs, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..ba0b6d9b12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java new file mode 100644 index 0000000000..022ab644b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java @@ -0,0 +1,391 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Request { + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationWeb3Method invocationType; + + public static final String SERIALIZED_NAME_INVOCATION_PARAMS = "invocationParams"; + @SerializedName(SERIALIZED_NAME_INVOCATION_PARAMS) + private Object invocationParams = {}; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD = "contractMethod"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD) + private String contractMethod; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD_ARGS = "contractMethodArgs"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD_ARGS) + private List contractMethodArgs = null; + + public InvokeRawWeb3EthContractV1Request() { + } + + public InvokeRawWeb3EthContractV1Request abi(List abi) { + + this.abi = abi; + return this; + } + + public InvokeRawWeb3EthContractV1Request addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return abi + **/ + @javax.annotation.Nonnull + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public InvokeRawWeb3EthContractV1Request address(String address) { + + this.address = address; + return this; + } + + /** + * Deployed solidity contract address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public InvokeRawWeb3EthContractV1Request invocationType(EthContractInvocationWeb3Method invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationWeb3Method getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationWeb3Method invocationType) { + this.invocationType = invocationType; + } + + + public InvokeRawWeb3EthContractV1Request invocationParams(Object invocationParams) { + + this.invocationParams = invocationParams; + return this; + } + + /** + * The list of arguments for contract invocation method (send, call, etc...) + * @return invocationParams + **/ + @javax.annotation.Nullable + public Object getInvocationParams() { + return invocationParams; + } + + + public void setInvocationParams(Object invocationParams) { + this.invocationParams = invocationParams; + } + + + public InvokeRawWeb3EthContractV1Request contractMethod(String contractMethod) { + + this.contractMethod = contractMethod; + return this; + } + + /** + * Method of deployed solidity contract to execute + * @return contractMethod + **/ + @javax.annotation.Nonnull + public String getContractMethod() { + return contractMethod; + } + + + public void setContractMethod(String contractMethod) { + this.contractMethod = contractMethod; + } + + + public InvokeRawWeb3EthContractV1Request contractMethodArgs(List contractMethodArgs) { + + this.contractMethodArgs = contractMethodArgs; + return this; + } + + public InvokeRawWeb3EthContractV1Request addContractMethodArgsItem(Object contractMethodArgsItem) { + if (this.contractMethodArgs == null) { + this.contractMethodArgs = null; + } + this.contractMethodArgs.add(contractMethodArgsItem); + return this; + } + + /** + * The list of arguments for deployed solidity contract method + * @return contractMethodArgs + **/ + @javax.annotation.Nullable + public List getContractMethodArgs() { + return contractMethodArgs; + } + + + public void setContractMethodArgs(List contractMethodArgs) { + this.contractMethodArgs = contractMethodArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = (InvokeRawWeb3EthContractV1Request) o; + return Objects.equals(this.abi, invokeRawWeb3EthContractV1Request.abi) && + Objects.equals(this.address, invokeRawWeb3EthContractV1Request.address) && + Objects.equals(this.invocationType, invokeRawWeb3EthContractV1Request.invocationType) && + Objects.equals(this.invocationParams, invokeRawWeb3EthContractV1Request.invocationParams) && + Objects.equals(this.contractMethod, invokeRawWeb3EthContractV1Request.contractMethod) && + Objects.equals(this.contractMethodArgs, invokeRawWeb3EthContractV1Request.contractMethodArgs); + } + + @Override + public int hashCode() { + return Objects.hash(abi, address, invocationType, invocationParams, contractMethod, contractMethodArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Request {\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" invocationParams: ").append(toIndentedString(invocationParams)).append("\n"); + sb.append(" contractMethod: ").append(toIndentedString(contractMethod)).append("\n"); + sb.append(" contractMethodArgs: ").append(toIndentedString(contractMethodArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("abi"); + openapiFields.add("address"); + openapiFields.add("invocationType"); + openapiFields.add("invocationParams"); + openapiFields.add("contractMethod"); + openapiFields.add("contractMethodArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("abi"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("contractMethod"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Request is not found in the empty JSON string", InvokeRawWeb3EthContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("abi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("contractMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractMethod").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractMethodArgs") != null && !jsonObj.get("contractMethodArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethodArgs` to be an array in the JSON string but got `%s`", jsonObj.get("contractMethodArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static InvokeRawWeb3EthContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java new file mode 100644 index 0000000000..25e32182b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthContractV1Response() { + } + + public InvokeRawWeb3EthContractV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthContractV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of contract invocation method + * @return data + **/ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthContractV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1Response = (InvokeRawWeb3EthContractV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthContractV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthContractV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthContractV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Response is not found in the empty JSON string", InvokeRawWeb3EthContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static InvokeRawWeb3EthContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java new file mode 100644 index 0000000000..17c9f20bce --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java @@ -0,0 +1,258 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Request { + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public InvokeRawWeb3EthMethodV1Request() { + } + + public InvokeRawWeb3EthMethodV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the web3.eth method to invoke + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeRawWeb3EthMethodV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeRawWeb3EthMethodV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass to web3.eth method specified in methodName + * @return params + **/ + @javax.annotation.Nullable + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = (InvokeRawWeb3EthMethodV1Request) o; + return Objects.equals(this.methodName, invokeRawWeb3EthMethodV1Request.methodName) && + Objects.equals(this.params, invokeRawWeb3EthMethodV1Request.params); + } + + @Override + public int hashCode() { + return Objects.hash(methodName, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Request {\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("methodName"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("methodName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Request is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("params") != null && !jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static InvokeRawWeb3EthMethodV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java new file mode 100644 index 0000000000..f41027c07d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthMethodV1Response() { + } + + public InvokeRawWeb3EthMethodV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthMethodV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of requested web3.eth method + * @return data + **/ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthMethodV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Response invokeRawWeb3EthMethodV1Response = (InvokeRawWeb3EthMethodV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthMethodV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthMethodV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthMethodV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Response is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static InvokeRawWeb3EthMethodV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java new file mode 100644 index 0000000000..f7d402f971 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java @@ -0,0 +1,407 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * QuorumPrivateTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumPrivateTransactionConfig { + public static final String SERIALIZED_NAME_PRIVATE_FROM = "privateFrom"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FROM) + private String privateFrom; + + public static final String SERIALIZED_NAME_PRIVATE_FOR = "privateFor"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FOR) + private List privateFor = null; + + public static final String SERIALIZED_NAME_IS_PRIVATE = "isPrivate"; + @SerializedName(SERIALIZED_NAME_IS_PRIVATE) + private Boolean isPrivate = false; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private BigDecimal gasPrice; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private BigDecimal gasLimit; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private String privateKey; + + public static final String SERIALIZED_NAME_PRIVACY_GROUP_ID = "privacyGroupId"; + @SerializedName(SERIALIZED_NAME_PRIVACY_GROUP_ID) + private String privacyGroupId; + + public QuorumPrivateTransactionConfig() { + } + + public QuorumPrivateTransactionConfig privateFrom(String privateFrom) { + + this.privateFrom = privateFrom; + return this; + } + + /** + * Get privateFrom + * @return privateFrom + **/ + @javax.annotation.Nullable + public String getPrivateFrom() { + return privateFrom; + } + + + public void setPrivateFrom(String privateFrom) { + this.privateFrom = privateFrom; + } + + + public QuorumPrivateTransactionConfig privateFor(List privateFor) { + + this.privateFor = privateFor; + return this; + } + + public QuorumPrivateTransactionConfig addPrivateForItem(Object privateForItem) { + if (this.privateFor == null) { + this.privateFor = null; + } + this.privateFor.add(privateForItem); + return this; + } + + /** + * Get privateFor + * @return privateFor + **/ + @javax.annotation.Nonnull + public List getPrivateFor() { + return privateFor; + } + + + public void setPrivateFor(List privateFor) { + this.privateFor = privateFor; + } + + + public QuorumPrivateTransactionConfig isPrivate(Boolean isPrivate) { + + this.isPrivate = isPrivate; + return this; + } + + /** + * Get isPrivate + * @return isPrivate + **/ + @javax.annotation.Nullable + public Boolean getIsPrivate() { + return isPrivate; + } + + + public void setIsPrivate(Boolean isPrivate) { + this.isPrivate = isPrivate; + } + + + public QuorumPrivateTransactionConfig gasPrice(BigDecimal gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public BigDecimal getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(BigDecimal gasPrice) { + this.gasPrice = gasPrice; + } + + + public QuorumPrivateTransactionConfig gasLimit(BigDecimal gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nullable + public BigDecimal getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(BigDecimal gasLimit) { + this.gasLimit = gasLimit; + } + + + public QuorumPrivateTransactionConfig privateKey(String privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + **/ + @javax.annotation.Nullable + public String getPrivateKey() { + return privateKey; + } + + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey; + } + + + public QuorumPrivateTransactionConfig privacyGroupId(String privacyGroupId) { + + this.privacyGroupId = privacyGroupId; + return this; + } + + /** + * Get privacyGroupId + * @return privacyGroupId + **/ + @javax.annotation.Nullable + public String getPrivacyGroupId() { + return privacyGroupId; + } + + + public void setPrivacyGroupId(String privacyGroupId) { + this.privacyGroupId = privacyGroupId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuorumPrivateTransactionConfig quorumPrivateTransactionConfig = (QuorumPrivateTransactionConfig) o; + return Objects.equals(this.privateFrom, quorumPrivateTransactionConfig.privateFrom) && + Objects.equals(this.privateFor, quorumPrivateTransactionConfig.privateFor) && + Objects.equals(this.isPrivate, quorumPrivateTransactionConfig.isPrivate) && + Objects.equals(this.gasPrice, quorumPrivateTransactionConfig.gasPrice) && + Objects.equals(this.gasLimit, quorumPrivateTransactionConfig.gasLimit) && + Objects.equals(this.privateKey, quorumPrivateTransactionConfig.privateKey) && + Objects.equals(this.privacyGroupId, quorumPrivateTransactionConfig.privacyGroupId); + } + + @Override + public int hashCode() { + return Objects.hash(privateFrom, privateFor, isPrivate, gasPrice, gasLimit, privateKey, privacyGroupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuorumPrivateTransactionConfig {\n"); + sb.append(" privateFrom: ").append(toIndentedString(privateFrom)).append("\n"); + sb.append(" privateFor: ").append(toIndentedString(privateFor)).append("\n"); + sb.append(" isPrivate: ").append(toIndentedString(isPrivate)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" privacyGroupId: ").append(toIndentedString(privacyGroupId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateFrom"); + openapiFields.add("privateFor"); + openapiFields.add("isPrivate"); + openapiFields.add("gasPrice"); + openapiFields.add("gasLimit"); + openapiFields.add("privateKey"); + openapiFields.add("privacyGroupId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateFor"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumPrivateTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QuorumPrivateTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QuorumPrivateTransactionConfig is not found in the empty JSON string", QuorumPrivateTransactionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QuorumPrivateTransactionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QuorumPrivateTransactionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QuorumPrivateTransactionConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("privateFrom") != null && !jsonObj.get("privateFrom").isJsonNull()) && !jsonObj.get("privateFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateFrom").toString())); + } + // ensure the required json array is present + if (jsonObj.get("privateFor") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("privateFor").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFor` to be an array in the JSON string but got `%s`", jsonObj.get("privateFor").toString())); + } + if ((jsonObj.get("privateKey") != null && !jsonObj.get("privateKey").isJsonNull()) && !jsonObj.get("privateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateKey").toString())); + } + if ((jsonObj.get("privacyGroupId") != null && !jsonObj.get("privacyGroupId").isJsonNull()) && !jsonObj.get("privacyGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privacyGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privacyGroupId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumPrivateTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumPrivateTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuorumPrivateTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumPrivateTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuorumPrivateTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QuorumPrivateTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumPrivateTransactionConfig + * @throws IOException if the JSON string is invalid with respect to QuorumPrivateTransactionConfig + */ + public static QuorumPrivateTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumPrivateTransactionConfig.class); + } + + /** + * Convert an instance of QuorumPrivateTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java new file mode 100644 index 0000000000..927d10acbe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.QuorumTransactionConfigTo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * QuorumTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private QuorumTransactionConfigFrom from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private QuorumTransactionConfigTo to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private QuorumTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private QuorumTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private QuorumTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private QuorumTransactionConfigTo data; + + public QuorumTransactionConfig() { + } + + public QuorumTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public QuorumTransactionConfig from(QuorumTransactionConfigFrom from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getFrom() { + return from; + } + + + public void setFrom(QuorumTransactionConfigFrom from) { + this.from = from; + } + + + public QuorumTransactionConfig to(QuorumTransactionConfigTo to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigTo getTo() { + return to; + } + + + public void setTo(QuorumTransactionConfigTo to) { + this.to = to; + } + + + public QuorumTransactionConfig value(QuorumTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(QuorumTransactionConfigFrom value) { + this.value = value; + } + + + public QuorumTransactionConfig gas(QuorumTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(QuorumTransactionConfigFrom gas) { + this.gas = gas; + } + + + public QuorumTransactionConfig gasPrice(QuorumTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(QuorumTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public QuorumTransactionConfig nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public QuorumTransactionConfig data(QuorumTransactionConfigTo data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigTo getData() { + return data; + } + + + public void setData(QuorumTransactionConfigTo data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QuorumTransactionConfig instance itself + */ + public QuorumTransactionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuorumTransactionConfig quorumTransactionConfig = (QuorumTransactionConfig) o; + return Objects.equals(this.rawTransaction, quorumTransactionConfig.rawTransaction) && + Objects.equals(this.from, quorumTransactionConfig.from) && + Objects.equals(this.to, quorumTransactionConfig.to) && + Objects.equals(this.value, quorumTransactionConfig.value) && + Objects.equals(this.gas, quorumTransactionConfig.gas) && + Objects.equals(this.gasPrice, quorumTransactionConfig.gasPrice) && + Objects.equals(this.nonce, quorumTransactionConfig.nonce) && + Objects.equals(this.data, quorumTransactionConfig.data)&& + Objects.equals(this.additionalProperties, quorumTransactionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, gas, gasPrice, nonce, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuorumTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QuorumTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QuorumTransactionConfig is not found in the empty JSON string", QuorumTransactionConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("from")); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + QuorumTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("to")); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + QuorumTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuorumTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QuorumTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + QuorumTransactionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QuorumTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumTransactionConfig + * @throws IOException if the JSON string is invalid with respect to QuorumTransactionConfig + */ + public static QuorumTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumTransactionConfig.class); + } + + /** + * Convert an instance of QuorumTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java new file mode 100644 index 0000000000..f6539d9159 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumTransactionConfigFrom extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QuorumTransactionConfigFrom.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumTransactionConfigFrom.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumTransactionConfigFrom' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumTransactionConfigFrom value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public QuorumTransactionConfigFrom read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + QuorumTransactionConfigFrom ret = new QuorumTransactionConfigFrom(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for QuorumTransactionConfigFrom: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public QuorumTransactionConfigFrom() { + super("oneOf", Boolean.FALSE); + } + + public QuorumTransactionConfigFrom(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public QuorumTransactionConfigFrom(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return QuorumTransactionConfigFrom.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumTransactionConfigFrom + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for QuorumTransactionConfigFrom with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of QuorumTransactionConfigFrom given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumTransactionConfigFrom + * @throws IOException if the JSON string is invalid with respect to QuorumTransactionConfigFrom + */ + public static QuorumTransactionConfigFrom fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumTransactionConfigFrom.class); + } + + /** + * Convert an instance of QuorumTransactionConfigFrom to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java new file mode 100644 index 0000000000..a60c21d665 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QuorumTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public QuorumTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + QuorumTransactionConfigTo ret = new QuorumTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for QuorumTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public QuorumTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public QuorumTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return QuorumTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for QuorumTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of QuorumTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to QuorumTransactionConfigTo + */ + public static QuorumTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumTransactionConfigTo.class); + } + + /** + * Convert an instance of QuorumTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 0000000000..f730d9f89a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private QuorumTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private QuorumPrivateTransactionConfig privateTransactionConfig; + + public RunTransactionRequest() { + } + + public RunTransactionRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionRequest transactionConfig(QuorumTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + public QuorumTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(QuorumTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionRequest timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public RunTransactionRequest privateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public QuorumPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.web3SigningCredential, runTransactionRequest.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionRequest.transactionConfig) && + Objects.equals(this.timeoutMs, runTransactionRequest.timeoutMs) && + Objects.equals(this.privateTransactionConfig, runTransactionRequest.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, timeoutMs, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("timeoutMs"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + QuorumPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 0000000000..a3e14223cc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 0000000000..d73b3676f2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,502 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = new HashMap<>(); + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 0000000000..6948dd6557 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,314 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 0000000000..634757e1f1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = new HashMap<>(); + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 0000000000..6fd80df1cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 0000000000..89264fe9be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java new file mode 100644 index 0000000000..8b57ce386b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java @@ -0,0 +1,838 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3Transaction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1BlockData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1BlockData { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private Integer gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private Integer gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private QuorumTransactionConfigFrom timestamp; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private BigDecimal size; + + public static final String SERIALIZED_NAME_TOTAL_DIFFICULTY = "totalDifficulty"; + @SerializedName(SERIALIZED_NAME_TOTAL_DIFFICULTY) + private String totalDifficulty; + + public static final String SERIALIZED_NAME_UNCLES = "uncles"; + @SerializedName(SERIALIZED_NAME_UNCLES) + private List uncles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions = new ArrayList<>(); + + public WatchBlocksV1BlockData() { + } + + public WatchBlocksV1BlockData number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public WatchBlocksV1BlockData hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public WatchBlocksV1BlockData parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public WatchBlocksV1BlockData nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public WatchBlocksV1BlockData sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public WatchBlocksV1BlockData logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nonnull + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public WatchBlocksV1BlockData transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public WatchBlocksV1BlockData stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public WatchBlocksV1BlockData receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public WatchBlocksV1BlockData difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public WatchBlocksV1BlockData mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public WatchBlocksV1BlockData miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public WatchBlocksV1BlockData extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public WatchBlocksV1BlockData gasLimit(Integer gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + public Integer getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(Integer gasLimit) { + this.gasLimit = gasLimit; + } + + + public WatchBlocksV1BlockData gasUsed(Integer gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public Integer getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(Integer gasUsed) { + this.gasUsed = gasUsed; + } + + + public WatchBlocksV1BlockData timestamp(QuorumTransactionConfigFrom timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public QuorumTransactionConfigFrom getTimestamp() { + return timestamp; + } + + + public void setTimestamp(QuorumTransactionConfigFrom timestamp) { + this.timestamp = timestamp; + } + + + public WatchBlocksV1BlockData size(BigDecimal size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nonnull + public BigDecimal getSize() { + return size; + } + + + public void setSize(BigDecimal size) { + this.size = size; + } + + + public WatchBlocksV1BlockData totalDifficulty(String totalDifficulty) { + + this.totalDifficulty = totalDifficulty; + return this; + } + + /** + * Get totalDifficulty + * @return totalDifficulty + **/ + @javax.annotation.Nonnull + public String getTotalDifficulty() { + return totalDifficulty; + } + + + public void setTotalDifficulty(String totalDifficulty) { + this.totalDifficulty = totalDifficulty; + } + + + public WatchBlocksV1BlockData uncles(List uncles) { + + this.uncles = uncles; + return this; + } + + public WatchBlocksV1BlockData addUnclesItem(String unclesItem) { + if (this.uncles == null) { + this.uncles = new ArrayList<>(); + } + this.uncles.add(unclesItem); + return this; + } + + /** + * Get uncles + * @return uncles + **/ + @javax.annotation.Nonnull + public List getUncles() { + return uncles; + } + + + public void setUncles(List uncles) { + this.uncles = uncles; + } + + + public WatchBlocksV1BlockData transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public WatchBlocksV1BlockData addTransactionsItem(Web3Transaction transactionsItem) { + if (this.transactions == null) { + this.transactions = new ArrayList<>(); + } + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nonnull + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1BlockData watchBlocksV1BlockData = (WatchBlocksV1BlockData) o; + return Objects.equals(this.number, watchBlocksV1BlockData.number) && + Objects.equals(this.hash, watchBlocksV1BlockData.hash) && + Objects.equals(this.parentHash, watchBlocksV1BlockData.parentHash) && + Objects.equals(this.nonce, watchBlocksV1BlockData.nonce) && + Objects.equals(this.sha3Uncles, watchBlocksV1BlockData.sha3Uncles) && + Objects.equals(this.logsBloom, watchBlocksV1BlockData.logsBloom) && + Objects.equals(this.transactionsRoot, watchBlocksV1BlockData.transactionsRoot) && + Objects.equals(this.stateRoot, watchBlocksV1BlockData.stateRoot) && + Objects.equals(this.receiptsRoot, watchBlocksV1BlockData.receiptsRoot) && + Objects.equals(this.difficulty, watchBlocksV1BlockData.difficulty) && + Objects.equals(this.mixHash, watchBlocksV1BlockData.mixHash) && + Objects.equals(this.miner, watchBlocksV1BlockData.miner) && + Objects.equals(this.extraData, watchBlocksV1BlockData.extraData) && + Objects.equals(this.gasLimit, watchBlocksV1BlockData.gasLimit) && + Objects.equals(this.gasUsed, watchBlocksV1BlockData.gasUsed) && + Objects.equals(this.timestamp, watchBlocksV1BlockData.timestamp) && + Objects.equals(this.size, watchBlocksV1BlockData.size) && + Objects.equals(this.totalDifficulty, watchBlocksV1BlockData.totalDifficulty) && + Objects.equals(this.uncles, watchBlocksV1BlockData.uncles) && + Objects.equals(this.transactions, watchBlocksV1BlockData.transactions); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, receiptsRoot, difficulty, mixHash, miner, extraData, gasLimit, gasUsed, timestamp, size, totalDifficulty, uncles, transactions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1BlockData {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" totalDifficulty: ").append(toIndentedString(totalDifficulty)).append("\n"); + sb.append(" uncles: ").append(toIndentedString(uncles)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + openapiFields.add("size"); + openapiFields.add("totalDifficulty"); + openapiFields.add("uncles"); + openapiFields.add("transactions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("logsBloom"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + openapiRequiredFields.add("size"); + openapiRequiredFields.add("totalDifficulty"); + openapiRequiredFields.add("uncles"); + openapiRequiredFields.add("transactions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1BlockData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1BlockData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1BlockData is not found in the empty JSON string", WatchBlocksV1BlockData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1BlockData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1BlockData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1BlockData.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if (!jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // validate the required field `timestamp` + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + if (!jsonObj.get("totalDifficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalDifficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalDifficulty").toString())); + } + // ensure the required json array is present + if (jsonObj.get("uncles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("uncles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uncles` to be an array in the JSON string but got `%s`", jsonObj.get("uncles").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + + JsonArray jsonArraytransactions = jsonObj.getAsJsonArray("transactions"); + // validate the required field `transactions` (array) + for (int i = 0; i < jsonArraytransactions.size(); i++) { + Web3Transaction.validateJsonObject(jsonArraytransactions.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1BlockData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1BlockData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1BlockData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1BlockData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1BlockData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1BlockData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1BlockData + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1BlockData + */ + public static WatchBlocksV1BlockData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1BlockData.class); + } + + /** + * Convert an instance of WatchBlocksV1BlockData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java new file mode 100644 index 0000000000..4a62551e44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java @@ -0,0 +1,205 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Options + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Options { + public static final String SERIALIZED_NAME_GET_BLOCK_DATA = "getBlockData"; + @SerializedName(SERIALIZED_NAME_GET_BLOCK_DATA) + private Boolean getBlockData; + + public WatchBlocksV1Options() { + } + + public WatchBlocksV1Options getBlockData(Boolean getBlockData) { + + this.getBlockData = getBlockData; + return this; + } + + /** + * Get getBlockData + * @return getBlockData + **/ + @javax.annotation.Nullable + public Boolean getGetBlockData() { + return getBlockData; + } + + + public void setGetBlockData(Boolean getBlockData) { + this.getBlockData = getBlockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Options watchBlocksV1Options = (WatchBlocksV1Options) o; + return Objects.equals(this.getBlockData, watchBlocksV1Options.getBlockData); + } + + @Override + public int hashCode() { + return Objects.hash(getBlockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Options {\n"); + sb.append(" getBlockData: ").append(toIndentedString(getBlockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("getBlockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Options + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Options.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Options is not found in the empty JSON string", WatchBlocksV1Options.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Options.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Options` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Options.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Options' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Options.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Options value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Options read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Options given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Options + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Options + */ + public static WatchBlocksV1Options fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Options.class); + } + + /** + * Convert an instance of WatchBlocksV1Options to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 0000000000..889f1e0a91 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,243 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Progress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress { + public static final String SERIALIZED_NAME_BLOCK_HEADER = "blockHeader"; + @SerializedName(SERIALIZED_NAME_BLOCK_HEADER) + private Web3BlockHeader blockHeader; + + public static final String SERIALIZED_NAME_BLOCK_DATA = "blockData"; + @SerializedName(SERIALIZED_NAME_BLOCK_DATA) + private WatchBlocksV1BlockData blockData; + + public WatchBlocksV1Progress() { + } + + public WatchBlocksV1Progress blockHeader(Web3BlockHeader blockHeader) { + + this.blockHeader = blockHeader; + return this; + } + + /** + * Get blockHeader + * @return blockHeader + **/ + @javax.annotation.Nullable + public Web3BlockHeader getBlockHeader() { + return blockHeader; + } + + + public void setBlockHeader(Web3BlockHeader blockHeader) { + this.blockHeader = blockHeader; + } + + + public WatchBlocksV1Progress blockData(WatchBlocksV1BlockData blockData) { + + this.blockData = blockData; + return this; + } + + /** + * Get blockData + * @return blockData + **/ + @javax.annotation.Nullable + public WatchBlocksV1BlockData getBlockData() { + return blockData; + } + + + public void setBlockData(WatchBlocksV1BlockData blockData) { + this.blockData = blockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Progress watchBlocksV1Progress = (WatchBlocksV1Progress) o; + return Objects.equals(this.blockHeader, watchBlocksV1Progress.blockHeader) && + Objects.equals(this.blockData, watchBlocksV1Progress.blockData); + } + + @Override + public int hashCode() { + return Objects.hash(blockHeader, blockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Progress {\n"); + sb.append(" blockHeader: ").append(toIndentedString(blockHeader)).append("\n"); + sb.append(" blockData: ").append(toIndentedString(blockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHeader"); + openapiFields.add("blockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Progress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Progress is not found in the empty JSON string", WatchBlocksV1Progress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Progress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Progress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `blockHeader` + if (jsonObj.get("blockHeader") != null && !jsonObj.get("blockHeader").isJsonNull()) { + Web3BlockHeader.validateJsonObject(jsonObj.getAsJsonObject("blockHeader")); + } + // validate the optional field `blockData` + if (jsonObj.get("blockData") != null && !jsonObj.get("blockData").isJsonNull()) { + WatchBlocksV1BlockData.validateJsonObject(jsonObj.getAsJsonObject("blockData")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Progress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java new file mode 100644 index 0000000000..7fe69e3692 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java @@ -0,0 +1,684 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3BlockHeader + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeader { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private Integer gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private Integer gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private QuorumTransactionConfigFrom timestamp; + + public Web3BlockHeader() { + } + + public Web3BlockHeader number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public Web3BlockHeader hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3BlockHeader parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public Web3BlockHeader nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3BlockHeader sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public Web3BlockHeader logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nonnull + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3BlockHeader transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public Web3BlockHeader stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public Web3BlockHeader receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public Web3BlockHeader difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public Web3BlockHeader mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public Web3BlockHeader miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public Web3BlockHeader extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public Web3BlockHeader gasLimit(Integer gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + public Integer getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(Integer gasLimit) { + this.gasLimit = gasLimit; + } + + + public Web3BlockHeader gasUsed(Integer gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public Integer getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(Integer gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3BlockHeader timestamp(QuorumTransactionConfigFrom timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public QuorumTransactionConfigFrom getTimestamp() { + return timestamp; + } + + + public void setTimestamp(QuorumTransactionConfigFrom timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3BlockHeader web3BlockHeader = (Web3BlockHeader) o; + return Objects.equals(this.number, web3BlockHeader.number) && + Objects.equals(this.hash, web3BlockHeader.hash) && + Objects.equals(this.parentHash, web3BlockHeader.parentHash) && + Objects.equals(this.nonce, web3BlockHeader.nonce) && + Objects.equals(this.sha3Uncles, web3BlockHeader.sha3Uncles) && + Objects.equals(this.logsBloom, web3BlockHeader.logsBloom) && + Objects.equals(this.transactionsRoot, web3BlockHeader.transactionsRoot) && + Objects.equals(this.stateRoot, web3BlockHeader.stateRoot) && + Objects.equals(this.receiptsRoot, web3BlockHeader.receiptsRoot) && + Objects.equals(this.difficulty, web3BlockHeader.difficulty) && + Objects.equals(this.mixHash, web3BlockHeader.mixHash) && + Objects.equals(this.miner, web3BlockHeader.miner) && + Objects.equals(this.extraData, web3BlockHeader.extraData) && + Objects.equals(this.gasLimit, web3BlockHeader.gasLimit) && + Objects.equals(this.gasUsed, web3BlockHeader.gasUsed) && + Objects.equals(this.timestamp, web3BlockHeader.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, receiptsRoot, difficulty, mixHash, miner, extraData, gasLimit, gasUsed, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3BlockHeader {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("logsBloom"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3BlockHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3BlockHeader is not found in the empty JSON string", Web3BlockHeader.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3BlockHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3BlockHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3BlockHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if (!jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // validate the required field `timestamp` + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3BlockHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3BlockHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3BlockHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeader + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeader + */ + public static Web3BlockHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeader.class); + } + + /** + * Convert an instance of Web3BlockHeader to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..a4ea964d85 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,391 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialGethKeychainPassword = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialGethKeychainPassword` + if (value.getActualInstance() instanceof Web3SigningCredentialGethKeychainPassword) { + JsonObject obj = adapterWeb3SigningCredentialGethKeychainPassword.toJsonTree((Web3SigningCredentialGethKeychainPassword)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialGethKeychainPassword + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialGethKeychainPassword; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialGethKeychainPassword'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialGethKeychainPassword'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialGethKeychainPassword o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialGethKeychainPassword", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialGethKeychainPassword) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialGethKeychainPassword`. If the actual instance is not `Web3SigningCredentialGethKeychainPassword`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialGethKeychainPassword` + * @throws ClassCastException if the instance is not `Web3SigningCredentialGethKeychainPassword` + */ + public Web3SigningCredentialGethKeychainPassword getWeb3SigningCredentialGethKeychainPassword() throws ClassCastException { + return (Web3SigningCredentialGethKeychainPassword)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialGethKeychainPassword + try { + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..72aa31645a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nullable + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if ((jsonObj.get("keychainId") != null && !jsonObj.get("keychainId").isJsonNull()) && !jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java new file mode 100644 index 0000000000..396fba6a57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialGethKeychainPassword + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialGethKeychainPassword { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialGethKeychainPassword() { + } + + public Web3SigningCredentialGethKeychainPassword type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialGethKeychainPassword ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialGethKeychainPassword secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * A geth keychain unlock password. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialGethKeychainPassword web3SigningCredentialGethKeychainPassword = (Web3SigningCredentialGethKeychainPassword) o; + return Objects.equals(this.type, web3SigningCredentialGethKeychainPassword.type) && + Objects.equals(this.ethAccount, web3SigningCredentialGethKeychainPassword.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialGethKeychainPassword.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialGethKeychainPassword {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialGethKeychainPassword is not found in the empty JSON string", Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialGethKeychainPassword.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialGethKeychainPassword` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialGethKeychainPassword.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialGethKeychainPassword.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialGethKeychainPassword' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialGethKeychainPassword value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialGethKeychainPassword read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialGethKeychainPassword given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialGethKeychainPassword + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static Web3SigningCredentialGethKeychainPassword fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialGethKeychainPassword.class); + } + + /** + * Convert an instance of Web3SigningCredentialGethKeychainPassword to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..0f3468a530 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..c42e5e0e0e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..eaa857ab73 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java new file mode 100644 index 0000000000..cca2a7f01e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java @@ -0,0 +1,618 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3Transaction + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3Transaction { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public static final String SERIALIZED_NAME_V = "v"; + @SerializedName(SERIALIZED_NAME_V) + private String v; + + public static final String SERIALIZED_NAME_R = "r"; + @SerializedName(SERIALIZED_NAME_R) + private String r; + + public static final String SERIALIZED_NAME_S = "s"; + @SerializedName(SERIALIZED_NAME_S) + private String s; + + public Web3Transaction() { + } + + public Web3Transaction hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3Transaction nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public Web3Transaction blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nullable + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3Transaction blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nullable + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3Transaction transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nullable + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3Transaction from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3Transaction to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3Transaction value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public Web3Transaction gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nonnull + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public Web3Transaction gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nonnull + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public Web3Transaction input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nonnull + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + public Web3Transaction v(String v) { + + this.v = v; + return this; + } + + /** + * Get v + * @return v + **/ + @javax.annotation.Nullable + public String getV() { + return v; + } + + + public void setV(String v) { + this.v = v; + } + + + public Web3Transaction r(String r) { + + this.r = r; + return this; + } + + /** + * Get r + * @return r + **/ + @javax.annotation.Nullable + public String getR() { + return r; + } + + + public void setR(String r) { + this.r = r; + } + + + public Web3Transaction s(String s) { + + this.s = s; + return this; + } + + /** + * Get s + * @return s + **/ + @javax.annotation.Nullable + public String getS() { + return s; + } + + + public void setS(String s) { + this.s = s; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3Transaction web3Transaction = (Web3Transaction) o; + return Objects.equals(this.hash, web3Transaction.hash) && + Objects.equals(this.nonce, web3Transaction.nonce) && + Objects.equals(this.blockHash, web3Transaction.blockHash) && + Objects.equals(this.blockNumber, web3Transaction.blockNumber) && + Objects.equals(this.transactionIndex, web3Transaction.transactionIndex) && + Objects.equals(this.from, web3Transaction.from) && + Objects.equals(this.to, web3Transaction.to) && + Objects.equals(this.value, web3Transaction.value) && + Objects.equals(this.gasPrice, web3Transaction.gasPrice) && + Objects.equals(this.gas, web3Transaction.gas) && + Objects.equals(this.input, web3Transaction.input) && + Objects.equals(this.v, web3Transaction.v) && + Objects.equals(this.r, web3Transaction.r) && + Objects.equals(this.s, web3Transaction.s); + } + + @Override + public int hashCode() { + return Objects.hash(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gasPrice, gas, input, v, r, s); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3Transaction {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" v: ").append(toIndentedString(v)).append("\n"); + sb.append(" r: ").append(toIndentedString(r)).append("\n"); + sb.append(" s: ").append(toIndentedString(s)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("nonce"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("transactionIndex"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gasPrice"); + openapiFields.add("gas"); + openapiFields.add("input"); + openapiFields.add("v"); + openapiFields.add("r"); + openapiFields.add("s"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("gasPrice"); + openapiRequiredFields.add("gas"); + openapiRequiredFields.add("input"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3Transaction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3Transaction.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3Transaction is not found in the empty JSON string", Web3Transaction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3Transaction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3Transaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3Transaction.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if (!jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + if (!jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) && !jsonObj.get("v").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `v` to be a primitive type in the JSON string but got `%s`", jsonObj.get("v").toString())); + } + if ((jsonObj.get("r") != null && !jsonObj.get("r").isJsonNull()) && !jsonObj.get("r").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `r` to be a primitive type in the JSON string but got `%s`", jsonObj.get("r").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `s` to be a primitive type in the JSON string but got `%s`", jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3Transaction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3Transaction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3Transaction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3Transaction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3Transaction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3Transaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3Transaction + * @throws IOException if the JSON string is invalid with respect to Web3Transaction + */ + public static Web3Transaction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3Transaction.class); + } + + /** + * Convert an instance of Web3Transaction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 0000000000..6e4d29d711 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,741 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = null; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_REVERT_REASON = "revertReason"; + @SerializedName(SERIALIZED_NAME_REVERT_REASON) + private String revertReason; + + public static final String SERIALIZED_NAME_OUTPUT = "output"; + @SerializedName(SERIALIZED_NAME_OUTPUT) + private String output; + + public static final String SERIALIZED_NAME_COMMITMENT_HASH = "commitmentHash"; + @SerializedName(SERIALIZED_NAME_COMMITMENT_HASH) + private String commitmentHash; + + public static final String SERIALIZED_NAME_CUMULATIVE_GAS_U_SED = "cumulativeGasUSed"; + @SerializedName(SERIALIZED_NAME_CUMULATIVE_GAS_U_SED) + private BigDecimal cumulativeGasUSed; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3TransactionReceipt logs(List logs) { + + this.logs = logs; + return this; + } + + public Web3TransactionReceipt addLogsItem(Object logsItem) { + if (this.logs == null) { + this.logs = null; + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nullable + public List getLogs() { + return logs; + } + + + public void setLogs(List logs) { + this.logs = logs; + } + + + public Web3TransactionReceipt logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3TransactionReceipt revertReason(String revertReason) { + + this.revertReason = revertReason; + return this; + } + + /** + * Get revertReason + * @return revertReason + **/ + @javax.annotation.Nullable + public String getRevertReason() { + return revertReason; + } + + + public void setRevertReason(String revertReason) { + this.revertReason = revertReason; + } + + + public Web3TransactionReceipt output(String output) { + + this.output = output; + return this; + } + + /** + * Get output + * @return output + **/ + @javax.annotation.Nullable + public String getOutput() { + return output; + } + + + public void setOutput(String output) { + this.output = output; + } + + + public Web3TransactionReceipt commitmentHash(String commitmentHash) { + + this.commitmentHash = commitmentHash; + return this; + } + + /** + * Get commitmentHash + * @return commitmentHash + **/ + @javax.annotation.Nullable + public String getCommitmentHash() { + return commitmentHash; + } + + + public void setCommitmentHash(String commitmentHash) { + this.commitmentHash = commitmentHash; + } + + + public Web3TransactionReceipt cumulativeGasUSed(BigDecimal cumulativeGasUSed) { + + this.cumulativeGasUSed = cumulativeGasUSed; + return this; + } + + /** + * Get cumulativeGasUSed + * @return cumulativeGasUSed + **/ + @javax.annotation.Nullable + public BigDecimal getCumulativeGasUSed() { + return cumulativeGasUSed; + } + + + public void setCumulativeGasUSed(BigDecimal cumulativeGasUSed) { + this.cumulativeGasUSed = cumulativeGasUSed; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to) && + Objects.equals(this.logs, web3TransactionReceipt.logs) && + Objects.equals(this.logsBloom, web3TransactionReceipt.logsBloom) && + Objects.equals(this.revertReason, web3TransactionReceipt.revertReason) && + Objects.equals(this.output, web3TransactionReceipt.output) && + Objects.equals(this.commitmentHash, web3TransactionReceipt.commitmentHash) && + Objects.equals(this.cumulativeGasUSed, web3TransactionReceipt.cumulativeGasUSed)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, logs, logsBloom, revertReason, output, commitmentHash, cumulativeGasUSed, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" revertReason: ").append(toIndentedString(revertReason)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" commitmentHash: ").append(toIndentedString(commitmentHash)).append("\n"); + sb.append(" cumulativeGasUSed: ").append(toIndentedString(cumulativeGasUSed)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("logs"); + openapiFields.add("logsBloom"); + openapiFields.add("revertReason"); + openapiFields.add("output"); + openapiFields.add("commitmentHash"); + openapiFields.add("cumulativeGasUSed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("revertReason") != null && !jsonObj.get("revertReason").isJsonNull()) && !jsonObj.get("revertReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revertReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revertReason").toString())); + } + if ((jsonObj.get("output") != null && !jsonObj.get("output").isJsonNull()) && !jsonObj.get("output").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); + } + if ((jsonObj.get("commitmentHash") != null && !jsonObj.get("commitmentHash").isJsonNull()) && !jsonObj.get("commitmentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitmentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitmentHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..361d348faf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,140 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeJsonObjectV1Test() throws ApiException { + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request); + // TODO: test validations + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeV1Test() throws ApiException { + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1NoKeychainTest() throws ApiException { + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = null; + InvokeContractV1Response response = api.invokeContractV1NoKeychain(invokeContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeRawWeb3EthContractV1Test() throws ApiException { + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = null; + InvokeRawWeb3EthContractV1Response response = api.invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request); + // TODO: test validations + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeWeb3EthMethodV1Test() throws ApiException { + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = null; + InvokeRawWeb3EthMethodV1Response response = api.invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a quorum ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java new file mode 100644 index 0000000000..6e7d3cb365 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java @@ -0,0 +1,146 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJSON + */ +public class ContractJSONTest { + private final ContractJSON model = new ContractJSON(); + + /** + * Model tests for ContractJSON + */ + @Test + public void testContractJSON() { + // TODO: test ContractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'networks' + */ + @Test + public void networksTest() { + // TODO: test networks + } + + /** + * Test the property 'ast' + */ + @Test + public void astTest() { + // TODO: test ast + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java new file mode 100644 index 0000000000..854987b330 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java @@ -0,0 +1,93 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeJsonObjectV1Request + */ +public class DeployContractSolidityBytecodeJsonObjectV1RequestTest { + private final DeployContractSolidityBytecodeJsonObjectV1Request model = new DeployContractSolidityBytecodeJsonObjectV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeJsonObjectV1Request + */ + @Test + public void testDeployContractSolidityBytecodeJsonObjectV1Request() { + // TODO: test DeployContractSolidityBytecodeJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java new file mode 100644 index 0000000000..ad9fa6afae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Request + */ +public class DeployContractSolidityBytecodeV1RequestTest { + private final DeployContractSolidityBytecodeV1Request model = new DeployContractSolidityBytecodeV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Request + */ + @Test + public void testDeployContractSolidityBytecodeV1Request() { + // TODO: test DeployContractSolidityBytecodeV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java new file mode 100644 index 0000000000..0bef146086 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Response + */ +public class DeployContractSolidityBytecodeV1ResponseTest { + private final DeployContractSolidityBytecodeV1Response model = new DeployContractSolidityBytecodeV1Response(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Response + */ + @Test + public void testDeployContractSolidityBytecodeV1Response() { + // TODO: test DeployContractSolidityBytecodeV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 0000000000..39b72555e4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java new file mode 100644 index 0000000000..904d71eb9a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationWeb3Method + */ +public class EthContractInvocationWeb3MethodTest { + /** + * Model tests for EthContractInvocationWeb3Method + */ + @Test + public void testEthContractInvocationWeb3Method() { + // TODO: test EthContractInvocationWeb3Method + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java new file mode 100644 index 0000000000..0990421184 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java @@ -0,0 +1,144 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractJsonObjectV1Request + */ +public class InvokeContractJsonObjectV1RequestTest { + private final InvokeContractJsonObjectV1Request model = new InvokeContractJsonObjectV1Request(); + + /** + * Model tests for InvokeContractJsonObjectV1Request + */ + @Test + public void testInvokeContractJsonObjectV1Request() { + // TODO: test InvokeContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 0000000000..5a129e7959 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..76c4e8d8a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java new file mode 100644 index 0000000000..9ef3dc57e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Request + */ +public class InvokeRawWeb3EthContractV1RequestTest { + private final InvokeRawWeb3EthContractV1Request model = new InvokeRawWeb3EthContractV1Request(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Request + */ + @Test + public void testInvokeRawWeb3EthContractV1Request() { + // TODO: test InvokeRawWeb3EthContractV1Request + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'invocationParams' + */ + @Test + public void invocationParamsTest() { + // TODO: test invocationParams + } + + /** + * Test the property 'contractMethod' + */ + @Test + public void contractMethodTest() { + // TODO: test contractMethod + } + + /** + * Test the property 'contractMethodArgs' + */ + @Test + public void contractMethodArgsTest() { + // TODO: test contractMethodArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java new file mode 100644 index 0000000000..6ee6a60d49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Response + */ +public class InvokeRawWeb3EthContractV1ResponseTest { + private final InvokeRawWeb3EthContractV1Response model = new InvokeRawWeb3EthContractV1Response(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Response + */ + @Test + public void testInvokeRawWeb3EthContractV1Response() { + // TODO: test InvokeRawWeb3EthContractV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java new file mode 100644 index 0000000000..8ff63c6a80 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ +public class InvokeRawWeb3EthMethodV1RequestTest { + private final InvokeRawWeb3EthMethodV1Request model = new InvokeRawWeb3EthMethodV1Request(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ + @Test + public void testInvokeRawWeb3EthMethodV1Request() { + // TODO: test InvokeRawWeb3EthMethodV1Request + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java new file mode 100644 index 0000000000..c928292764 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ +public class InvokeRawWeb3EthMethodV1ResponseTest { + private final InvokeRawWeb3EthMethodV1Response model = new InvokeRawWeb3EthMethodV1Response(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ + @Test + public void testInvokeRawWeb3EthMethodV1Response() { + // TODO: test InvokeRawWeb3EthMethodV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java new file mode 100644 index 0000000000..cd0a7eb8fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java @@ -0,0 +1,99 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumPrivateTransactionConfig + */ +public class QuorumPrivateTransactionConfigTest { + private final QuorumPrivateTransactionConfig model = new QuorumPrivateTransactionConfig(); + + /** + * Model tests for QuorumPrivateTransactionConfig + */ + @Test + public void testQuorumPrivateTransactionConfig() { + // TODO: test QuorumPrivateTransactionConfig + } + + /** + * Test the property 'privateFrom' + */ + @Test + public void privateFromTest() { + // TODO: test privateFrom + } + + /** + * Test the property 'privateFor' + */ + @Test + public void privateForTest() { + // TODO: test privateFor + } + + /** + * Test the property 'isPrivate' + */ + @Test + public void isPrivateTest() { + // TODO: test isPrivate + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + + /** + * Test the property 'privacyGroupId' + */ + @Test + public void privacyGroupIdTest() { + // TODO: test privacyGroupId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java new file mode 100644 index 0000000000..6e43893871 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumTransactionConfigFrom + */ +public class QuorumTransactionConfigFromTest { + private final QuorumTransactionConfigFrom model = new QuorumTransactionConfigFrom(); + + /** + * Model tests for QuorumTransactionConfigFrom + */ + @Test + public void testQuorumTransactionConfigFrom() { + // TODO: test QuorumTransactionConfigFrom + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java new file mode 100644 index 0000000000..614cff43e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.QuorumTransactionConfigTo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumTransactionConfig + */ +public class QuorumTransactionConfigTest { + private final QuorumTransactionConfig model = new QuorumTransactionConfig(); + + /** + * Model tests for QuorumTransactionConfig + */ + @Test + public void testQuorumTransactionConfig() { + // TODO: test QuorumTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java new file mode 100644 index 0000000000..ee726a03b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumTransactionConfigTo + */ +public class QuorumTransactionConfigToTest { + private final QuorumTransactionConfigTo model = new QuorumTransactionConfigTo(); + + /** + * Model tests for QuorumTransactionConfigTo + */ + @Test + public void testQuorumTransactionConfigTo() { + // TODO: test QuorumTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 0000000000..8e8b1d0183 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 0000000000..47b49369c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 0000000000..cef7a0fee9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 0000000000..eeec00c7ac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 0000000000..18a50fa8b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 0000000000..1695f7a464 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java new file mode 100644 index 0000000000..3427893020 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java @@ -0,0 +1,205 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3Transaction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1BlockData + */ +public class WatchBlocksV1BlockDataTest { + private final WatchBlocksV1BlockData model = new WatchBlocksV1BlockData(); + + /** + * Model tests for WatchBlocksV1BlockData + */ + @Test + public void testWatchBlocksV1BlockData() { + // TODO: test WatchBlocksV1BlockData + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'totalDifficulty' + */ + @Test + public void totalDifficultyTest() { + // TODO: test totalDifficulty + } + + /** + * Test the property 'uncles' + */ + @Test + public void unclesTest() { + // TODO: test uncles + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java new file mode 100644 index 0000000000..312074ff0a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Options + */ +public class WatchBlocksV1OptionsTest { + private final WatchBlocksV1Options model = new WatchBlocksV1Options(); + + /** + * Model tests for WatchBlocksV1Options + */ + @Test + public void testWatchBlocksV1Options() { + // TODO: test WatchBlocksV1Options + } + + /** + * Test the property 'getBlockData' + */ + @Test + public void getBlockDataTest() { + // TODO: test getBlockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 0000000000..e76fd7dd8a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'blockHeader' + */ + @Test + public void blockHeaderTest() { + // TODO: test blockHeader + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 0000000000..e91ce9348b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java new file mode 100644 index 0000000000..79750b248f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java @@ -0,0 +1,170 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeader + */ +public class Web3BlockHeaderTest { + private final Web3BlockHeader model = new Web3BlockHeader(); + + /** + * Model tests for Web3BlockHeader + */ + @Test + public void testWeb3BlockHeader() { + // TODO: test Web3BlockHeader + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..42acd03e4f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java new file mode 100644 index 0000000000..6e5c3d51f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ +public class Web3SigningCredentialGethKeychainPasswordTest { + private final Web3SigningCredentialGethKeychainPassword model = new Web3SigningCredentialGethKeychainPassword(); + + /** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ + @Test + public void testWeb3SigningCredentialGethKeychainPassword() { + // TODO: test Web3SigningCredentialGethKeychainPassword + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..eeda72ef5d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..222d65cdf4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..b6375a48f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..cfec6ceb01 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 0000000000..4869f44ad2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,164 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'revertReason' + */ + @Test + public void revertReasonTest() { + // TODO: test revertReason + } + + /** + * Test the property 'output' + */ + @Test + public void outputTest() { + // TODO: test output + } + + /** + * Test the property 'commitmentHash' + */ + @Test + public void commitmentHashTest() { + // TODO: test commitmentHash + } + + /** + * Test the property 'cumulativeGasUSed' + */ + @Test + public void cumulativeGasUSedTest() { + // TODO: test cumulativeGasUSed + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java new file mode 100644 index 0000000000..e2c341a12b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java @@ -0,0 +1,153 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3Transaction + */ +public class Web3TransactionTest { + private final Web3Transaction model = new Web3Transaction(); + + /** + * Model tests for Web3Transaction + */ + @Test + public void testWeb3Transaction() { + // TODO: test Web3Transaction + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + + /** + * Test the property 'v' + */ + @Test + public void vTest() { + // TODO: test v + } + + /** + * Test the property 'r' + */ + @Test + public void rTest() { + // TODO: test r + } + + /** + * Test the property 's' + */ + @Test + public void sTest() { + // TODO: test s + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/package.json b/packages/cactus-plugin-ledger-connector-sawtooth/package.json index 30abacea90..96734d916d 100644 --- a/packages/cactus-plugin-ledger-connector-sawtooth/package.json +++ b/packages/cactus-plugin-ledger-connector-sawtooth/package.json @@ -47,8 +47,8 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk: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", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", "webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js", diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/package.json b/packages/cactus-plugin-ledger-connector-ubiquity/package.json index 4b03d54464..01caa77ae0 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/package.json +++ b/packages/cactus-plugin-ledger-connector-ubiquity/package.json @@ -46,7 +46,10 @@ "scripts": { "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", - "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk": "run-p 'generate-sdk:*'", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 0000000000..e459a4b997 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,13 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_get_transactions_by_address_endpoint.go +response.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 0000000000..ec9e76dfd4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,112 @@ +# Go API client for cactus-plugin-ledger-connector-ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-ubiquity "github.com/hyperledger/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetTransactionByAddressV1**](docs/DefaultApi.md#gettransactionbyaddressv1) | **Post** /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress | + + +## Documentation For Models + + - [GetTransactionsByAddressEndpoint](docs/GetTransactionsByAddressEndpoint.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..cefa8f664c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.3 +info: + description: Ubiquity wrapper for Hyperledger Cactus + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Ubiquity + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress: + post: + description: "" + operationId: GetTransactionByAddressV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionsByAddressEndpoint' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress +components: + schemas: + GetTransactionsByAddressEndpoint: + description: "Gets transactions that an address was involved with, from newest\ + \ to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress" + example: + protocol: protocol + address: address + network: network + properties: + protocol: + type: string + network: + type: string + address: + type: string + required: + - address + - network + - protocol + type: object diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..120bd7e054 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,119 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetTransactionByAddressV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getTransactionsByAddressEndpoint *GetTransactionsByAddressEndpoint +} + +func (r ApiGetTransactionByAddressV1Request) GetTransactionsByAddressEndpoint(getTransactionsByAddressEndpoint GetTransactionsByAddressEndpoint) ApiGetTransactionByAddressV1Request { + r.getTransactionsByAddressEndpoint = &getTransactionsByAddressEndpoint + return r +} + +func (r ApiGetTransactionByAddressV1Request) Execute() (*http.Response, error) { + return r.ApiService.GetTransactionByAddressV1Execute(r) +} + +/* +GetTransactionByAddressV1 Method for GetTransactionByAddressV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionByAddressV1Request +*/ +func (a *DefaultApiService) GetTransactionByAddressV1(ctx context.Context) ApiGetTransactionByAddressV1Request { + return ApiGetTransactionByAddressV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) GetTransactionByAddressV1Execute(r ApiGetTransactionByAddressV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionByAddressV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getTransactionsByAddressEndpoint + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..3c07feb82f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Ubiquity API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..71e65046b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..3d3f26627a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 0000000000..b59b77ef50 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 0000000000..c966c8ddfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go new file mode 100644 index 0000000000..e5fc713a7f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "encoding/json" +) + +// checks if the GetTransactionsByAddressEndpoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionsByAddressEndpoint{} + +// GetTransactionsByAddressEndpoint Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress +type GetTransactionsByAddressEndpoint struct { + Protocol string `json:"protocol"` + Network string `json:"network"` + Address string `json:"address"` +} + +// NewGetTransactionsByAddressEndpoint instantiates a new GetTransactionsByAddressEndpoint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetTransactionsByAddressEndpoint(protocol string, network string, address string) *GetTransactionsByAddressEndpoint { + this := GetTransactionsByAddressEndpoint{} + this.Protocol = protocol + this.Network = network + this.Address = address + return &this +} + +// NewGetTransactionsByAddressEndpointWithDefaults instantiates a new GetTransactionsByAddressEndpoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionsByAddressEndpointWithDefaults() *GetTransactionsByAddressEndpoint { + this := GetTransactionsByAddressEndpoint{} + return &this +} + +// GetProtocol returns the Protocol field value +func (o *GetTransactionsByAddressEndpoint) GetProtocol() string { + if o == nil { + var ret string + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsByAddressEndpoint) GetProtocolOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *GetTransactionsByAddressEndpoint) SetProtocol(v string) { + o.Protocol = v +} + +// GetNetwork returns the Network field value +func (o *GetTransactionsByAddressEndpoint) GetNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsByAddressEndpoint) GetNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *GetTransactionsByAddressEndpoint) SetNetwork(v string) { + o.Network = v +} + +// GetAddress returns the Address field value +func (o *GetTransactionsByAddressEndpoint) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsByAddressEndpoint) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *GetTransactionsByAddressEndpoint) SetAddress(v string) { + o.Address = v +} + +func (o GetTransactionsByAddressEndpoint) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionsByAddressEndpoint) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["protocol"] = o.Protocol + toSerialize["network"] = o.Network + toSerialize["address"] = o.Address + return toSerialize, nil +} + +type NullableGetTransactionsByAddressEndpoint struct { + value *GetTransactionsByAddressEndpoint + isSet bool +} + +func (v NullableGetTransactionsByAddressEndpoint) Get() *GetTransactionsByAddressEndpoint { + return v.value +} + +func (v *NullableGetTransactionsByAddressEndpoint) Set(val *GetTransactionsByAddressEndpoint) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionsByAddressEndpoint) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionsByAddressEndpoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionsByAddressEndpoint(val *GetTransactionsByAddressEndpoint) *NullableGetTransactionsByAddressEndpoint { + return &NullableGetTransactionsByAddressEndpoint{value: val, isSet: true} +} + +func (v NullableGetTransactionsByAddressEndpoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionsByAddressEndpoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..1c26821383 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..cb73f3f03b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,36 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-ubiquity_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetTransactionByAddressV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.GetTransactionByAddressV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 0000000000..6ff536fe58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..9e1c21e1ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Ubiquity + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..d17d45061e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,34 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..c996c15bbb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,136 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Ubiquity +- API version: v2.0.0-alpha.2 + +Ubiquity wrapper for Hyperledger Cactus + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint = new GetTransactionsByAddressEndpoint(); // GetTransactionsByAddressEndpoint | + try { + apiInstance.getTransactionByAddressV1(getTransactionsByAddressEndpoint); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getTransactionByAddressV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getTransactionByAddressV1**](docs/DefaultApi.md#getTransactionByAddressV1) | **POST** /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress | + + +## Documentation for Models + + - [GetTransactionsByAddressEndpoint](docs/GetTransactionsByAddressEndpoint.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..23f565fb05 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.3 +info: + description: Ubiquity wrapper for Hyperledger Cactus + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Ubiquity + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress: + post: + description: "" + operationId: GetTransactionByAddressV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionsByAddressEndpoint' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress + x-content-type: application/json + x-accepts: application/json +components: + schemas: + GetTransactionsByAddressEndpoint: + description: "Gets transactions that an address was involved with, from newest\ + \ to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress" + example: + protocol: protocol + address: address + network: network + properties: + protocol: + type: string + network: + type: string + address: + type: string + required: + - address + - network + - protocol + type: object + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..89a0bc0fbd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..23571ff72b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..39810a14f8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..294099a4ac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..3c1ed35d4f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..5e592c2e1d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,401 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionsByAddressEndpoint.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..08ad0e993a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..caac3c535f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..da801263b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..7ae95deaa9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..bc6a83f604 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,189 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.GetTransactionsByAddressEndpoint; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getTransactionByAddressV1 + * @param getTransactionsByAddressEndpoint (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionByAddressV1Call(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getTransactionsByAddressEndpoint; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTransactionByAddressV1ValidateBeforeCall(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint, final ApiCallback _callback) throws ApiException { + return getTransactionByAddressV1Call(getTransactionsByAddressEndpoint, _callback); + + } + + /** + * + * + * @param getTransactionsByAddressEndpoint (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void getTransactionByAddressV1(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint) throws ApiException { + getTransactionByAddressV1WithHttpInfo(getTransactionsByAddressEndpoint); + } + + /** + * + * + * @param getTransactionsByAddressEndpoint (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getTransactionByAddressV1WithHttpInfo(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint) throws ApiException { + okhttp3.Call localVarCall = getTransactionByAddressV1ValidateBeforeCall(getTransactionsByAddressEndpoint, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param getTransactionsByAddressEndpoint (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionByAddressV1Async(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTransactionByAddressV1ValidateBeforeCall(getTransactionsByAddressEndpoint, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..9d32c27258 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..e1bdb3ed69 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..d6116bf835 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..23daf1046c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..247ba73296 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java new file mode 100644 index 0000000000..ac17114eec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionsByAddressEndpoint { + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + @SerializedName(SERIALIZED_NAME_PROTOCOL) + private String protocol; + + public static final String SERIALIZED_NAME_NETWORK = "network"; + @SerializedName(SERIALIZED_NAME_NETWORK) + private String network; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public GetTransactionsByAddressEndpoint() { + } + + public GetTransactionsByAddressEndpoint protocol(String protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * @return protocol + **/ + @javax.annotation.Nonnull + public String getProtocol() { + return protocol; + } + + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + + public GetTransactionsByAddressEndpoint network(String network) { + + this.network = network; + return this; + } + + /** + * Get network + * @return network + **/ + @javax.annotation.Nonnull + public String getNetwork() { + return network; + } + + + public void setNetwork(String network) { + this.network = network; + } + + + public GetTransactionsByAddressEndpoint address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint = (GetTransactionsByAddressEndpoint) o; + return Objects.equals(this.protocol, getTransactionsByAddressEndpoint.protocol) && + Objects.equals(this.network, getTransactionsByAddressEndpoint.network) && + Objects.equals(this.address, getTransactionsByAddressEndpoint.address); + } + + @Override + public int hashCode() { + return Objects.hash(protocol, network, address); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionsByAddressEndpoint {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("protocol"); + openapiFields.add("network"); + openapiFields.add("address"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("protocol"); + openapiRequiredFields.add("network"); + openapiRequiredFields.add("address"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionsByAddressEndpoint + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionsByAddressEndpoint.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionsByAddressEndpoint is not found in the empty JSON string", GetTransactionsByAddressEndpoint.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionsByAddressEndpoint.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionsByAddressEndpoint` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionsByAddressEndpoint.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("protocol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `protocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protocol").toString())); + } + if (!jsonObj.get("network").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `network` to be a primitive type in the JSON string but got `%s`", jsonObj.get("network").toString())); + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionsByAddressEndpoint.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionsByAddressEndpoint' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionsByAddressEndpoint.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionsByAddressEndpoint value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionsByAddressEndpoint read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionsByAddressEndpoint given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionsByAddressEndpoint + * @throws IOException if the JSON string is invalid with respect to GetTransactionsByAddressEndpoint + */ + public static GetTransactionsByAddressEndpoint fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionsByAddressEndpoint.class); + } + + /** + * Convert an instance of GetTransactionsByAddressEndpoint to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..6d01fbf88a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,46 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.GetTransactionsByAddressEndpoint; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTransactionByAddressV1Test() throws ApiException { + GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint = null; + api.getTransactionByAddressV1(getTransactionsByAddressEndpoint); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java new file mode 100644 index 0000000000..7fa783f271 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionsByAddressEndpoint + */ +public class GetTransactionsByAddressEndpointTest { + private final GetTransactionsByAddressEndpoint model = new GetTransactionsByAddressEndpoint(); + + /** + * Model tests for GetTransactionsByAddressEndpoint + */ + @Test + public void testGetTransactionsByAddressEndpoint() { + // TODO: test GetTransactionsByAddressEndpoint + } + + /** + * Test the property 'protocol' + */ + @Test + public void protocolTest() { + // TODO: test protocol + } + + /** + * Test the property 'network' + */ + @Test + public void networkTest() { + // TODO: test network + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/package.json b/packages/cactus-plugin-ledger-connector-xdai/package.json index b0ae848812..3225e05ea8 100644 --- a/packages/cactus-plugin-ledger-connector-xdai/package.json +++ b/packages/cactus-plugin-ledger-connector-xdai/package.json @@ -46,7 +46,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..d75ca32fc5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,39 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..0aae7fe264 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,143 @@ +# Go API client for cactus-plugin-ledger-connector-xdai + +Can perform basic tasks on a Xdai ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-xdai "github.com/hyperledger/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractJsonObjectV1**](docs/DefaultApi.md#deploycontractjsonobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**DeployContractV1**](docs/DefaultApi.md#deploycontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractJsonObject**](docs/DefaultApi.md#invokecontractjsonobject) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract | Invokes a contract on a xdai ledger +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction | Executes a transaction on a xdai ledger + + +## Documentation For Models + + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractJsonObjectV1Request](docs/DeployContractJsonObjectV1Request.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeployRequestBaseV1](docs/DeployRequestBaseV1.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRequestBaseV1](docs/InvokeRequestBaseV1.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionV1Request](docs/RunTransactionV1Request.md) + - [RunTransactionV1Response](docs/RunTransactionV1Response.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [XdaiTransactionConfig](docs/XdaiTransactionConfig.md) + - [XdaiTransactionConfigFrom](docs/XdaiTransactionConfigFrom.md) + - [XdaiTransactionConfigTo](docs/XdaiTransactionConfigTo.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..a01c98b4af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,896 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Xdai ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Xdai + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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-cactus: + 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 0000000000..fd949d82eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,645 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractJsonObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractJsonObjectV1Request *DeployContractJsonObjectV1Request +} + +func (r ApiDeployContractJsonObjectV1Request) DeployContractJsonObjectV1Request(deployContractJsonObjectV1Request DeployContractJsonObjectV1Request) ApiDeployContractJsonObjectV1Request { + r.deployContractJsonObjectV1Request = &deployContractJsonObjectV1Request + return r +} + +func (r ApiDeployContractJsonObjectV1Request) Execute() (*DeployContractV1Response, *http.Response, error) { + return r.ApiService.DeployContractJsonObjectV1Execute(r) +} + +/* +DeployContractJsonObjectV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractJsonObjectV1Request +*/ +func (a *DefaultApiService) DeployContractJsonObjectV1(ctx context.Context) ApiDeployContractJsonObjectV1Request { + return ApiDeployContractJsonObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractV1Response +func (a *DefaultApiService) DeployContractJsonObjectV1Execute(r ApiDeployContractJsonObjectV1Request) (*DeployContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractJsonObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractV1Request *DeployContractV1Request +} + +func (r ApiDeployContractV1Request) DeployContractV1Request(deployContractV1Request DeployContractV1Request) ApiDeployContractV1Request { + r.deployContractV1Request = &deployContractV1Request + return r +} + +func (r ApiDeployContractV1Request) Execute() (*DeployContractV1Response, *http.Response, error) { + return r.ApiService.DeployContractV1Execute(r) +} + +/* +DeployContractV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractV1Request +*/ +func (a *DefaultApiService) DeployContractV1(ctx context.Context) ApiDeployContractV1Request { + return ApiDeployContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractV1Response +func (a *DefaultApiService) DeployContractV1Execute(r ApiDeployContractV1Request) (*DeployContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractJsonObjectRequest struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractJsonObjectV1Request *InvokeContractJsonObjectV1Request +} + +func (r ApiInvokeContractJsonObjectRequest) InvokeContractJsonObjectV1Request(invokeContractJsonObjectV1Request InvokeContractJsonObjectV1Request) ApiInvokeContractJsonObjectRequest { + r.invokeContractJsonObjectV1Request = &invokeContractJsonObjectV1Request + return r +} + +func (r ApiInvokeContractJsonObjectRequest) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractJsonObjectExecute(r) +} + +/* +InvokeContractJsonObject Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractJsonObjectRequest +*/ +func (a *DefaultApiService) InvokeContractJsonObject(ctx context.Context) ApiInvokeContractJsonObjectRequest { + return ApiInvokeContractJsonObjectRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractJsonObjectExecute(r ApiInvokeContractJsonObjectRequest) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractJsonObject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a xdai ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionV1Request *RunTransactionV1Request +} + +func (r ApiRunTransactionV1Request) RunTransactionV1Request(runTransactionV1Request RunTransactionV1Request) ApiRunTransactionV1Request { + r.runTransactionV1Request = &runTransactionV1Request + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionV1Response, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a xdai ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionV1Response +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..a6319859e6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Xdai API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..d39adb2628 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..dfe1502f56 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..9110fb7b31 --- /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 0000000000..c966c8ddfd --- /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 0000000000..1b45891d4b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_consistency_strategy.go @@ -0,0 +1,219 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the ConsistencyStrategy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsistencyStrategy{} + +// ConsistencyStrategy struct for ConsistencyStrategy +type ConsistencyStrategy struct { + ReceiptType ReceiptType `json:"receiptType"` + // The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + TimeoutMs *int32 `json:"timeoutMs,omitempty"` + // The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + BlockConfirmations int32 `json:"blockConfirmations"` + // The amount of time (in milliseconds) connector will wait before making another confiramtion request to the network in case of previous confiramtion request fails + PollIntervalMs *int32 `json:"pollIntervalMs,omitempty"` +} + +// NewConsistencyStrategy instantiates a new ConsistencyStrategy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsistencyStrategy(receiptType ReceiptType, blockConfirmations int32) *ConsistencyStrategy { + this := ConsistencyStrategy{} + this.ReceiptType = receiptType + this.BlockConfirmations = blockConfirmations + return &this +} + +// NewConsistencyStrategyWithDefaults instantiates a new ConsistencyStrategy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsistencyStrategyWithDefaults() *ConsistencyStrategy { + this := ConsistencyStrategy{} + return &this +} + +// GetReceiptType returns the ReceiptType field value +func (o *ConsistencyStrategy) GetReceiptType() ReceiptType { + if o == nil { + var ret ReceiptType + return ret + } + + return o.ReceiptType +} + +// GetReceiptTypeOk returns a tuple with the ReceiptType field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetReceiptTypeOk() (*ReceiptType, bool) { + if o == nil { + return nil, false + } + return &o.ReceiptType, true +} + +// SetReceiptType sets field value +func (o *ConsistencyStrategy) SetReceiptType(v ReceiptType) { + o.ReceiptType = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *ConsistencyStrategy) GetTimeoutMs() int32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret int32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetTimeoutMsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *ConsistencyStrategy) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given int32 and assigns it to the TimeoutMs field. +func (o *ConsistencyStrategy) SetTimeoutMs(v int32) { + o.TimeoutMs = &v +} + +// GetBlockConfirmations returns the BlockConfirmations field value +func (o *ConsistencyStrategy) GetBlockConfirmations() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BlockConfirmations +} + +// GetBlockConfirmationsOk returns a tuple with the BlockConfirmations field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetBlockConfirmationsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BlockConfirmations, true +} + +// SetBlockConfirmations sets field value +func (o *ConsistencyStrategy) SetBlockConfirmations(v int32) { + o.BlockConfirmations = v +} + +// GetPollIntervalMs returns the PollIntervalMs field value if set, zero value otherwise. +func (o *ConsistencyStrategy) GetPollIntervalMs() int32 { + if o == nil || IsNil(o.PollIntervalMs) { + var ret int32 + return ret + } + return *o.PollIntervalMs +} + +// GetPollIntervalMsOk returns a tuple with the PollIntervalMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetPollIntervalMsOk() (*int32, bool) { + if o == nil || IsNil(o.PollIntervalMs) { + return nil, false + } + return o.PollIntervalMs, true +} + +// HasPollIntervalMs returns a boolean if a field has been set. +func (o *ConsistencyStrategy) HasPollIntervalMs() bool { + if o != nil && !IsNil(o.PollIntervalMs) { + return true + } + + return false +} + +// SetPollIntervalMs gets a reference to the given int32 and assigns it to the PollIntervalMs field. +func (o *ConsistencyStrategy) SetPollIntervalMs(v int32) { + o.PollIntervalMs = &v +} + +func (o ConsistencyStrategy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsistencyStrategy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["receiptType"] = o.ReceiptType + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["blockConfirmations"] = o.BlockConfirmations + if !IsNil(o.PollIntervalMs) { + toSerialize["pollIntervalMs"] = o.PollIntervalMs + } + return toSerialize, nil +} + +type NullableConsistencyStrategy struct { + value *ConsistencyStrategy + isSet bool +} + +func (v NullableConsistencyStrategy) Get() *ConsistencyStrategy { + return v.value +} + +func (v *NullableConsistencyStrategy) Set(val *ConsistencyStrategy) { + v.value = val + v.isSet = true +} + +func (v NullableConsistencyStrategy) IsSet() bool { + return v.isSet +} + +func (v *NullableConsistencyStrategy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsistencyStrategy(val *ConsistencyStrategy) *NullableConsistencyStrategy { + return &NullableConsistencyStrategy{value: val, isSet: true} +} + +func (v NullableConsistencyStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsistencyStrategy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go new file mode 100644 index 0000000000..f37c11e2da --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go @@ -0,0 +1,570 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the ContractJSON type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJSON{} + +// ContractJSON struct for ContractJSON +type ContractJSON struct { + ContractName string `json:"contractName"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The application binary interface of the solidity contract, optional parameter + Abi []interface{} `json:"abi"` + Metadata *string `json:"metadata,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler map[string]interface{} `json:"compiler,omitempty"` + Networks map[string]interface{} `json:"networks,omitempty"` + Ast map[string]interface{} `json:"ast,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates map[string]interface{} `json:"gasEstimates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContractJSON ContractJSON + +// NewContractJSON instantiates a new ContractJSON object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractJSON(contractName string, bytecode string, abi []interface{}) *ContractJSON { + this := ContractJSON{} + this.ContractName = contractName + this.Bytecode = bytecode + this.Abi = abi + return &this +} + +// NewContractJSONWithDefaults instantiates a new ContractJSON object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJSONWithDefaults() *ContractJSON { + this := ContractJSON{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractJSON) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractJSON) SetContractName(v string) { + o.ContractName = v +} + +// GetBytecode returns the Bytecode field value +func (o *ContractJSON) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *ContractJSON) SetBytecode(v string) { + o.Bytecode = v +} + +// GetAbi returns the Abi field value +func (o *ContractJSON) GetAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Abi, true +} + +// SetAbi sets field value +func (o *ContractJSON) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ContractJSON) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ContractJSON) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *ContractJSON) SetMetadata(v string) { + o.Metadata = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *ContractJSON) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *ContractJSON) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *ContractJSON) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *ContractJSON) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *ContractJSON) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *ContractJSON) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *ContractJSON) GetCompiler() map[string]interface{} { + if o == nil || IsNil(o.Compiler) { + var ret map[string]interface{} + return ret + } + return o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetCompilerOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Compiler) { + return map[string]interface{}{}, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *ContractJSON) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given map[string]interface{} and assigns it to the Compiler field. +func (o *ContractJSON) SetCompiler(v map[string]interface{}) { + o.Compiler = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *ContractJSON) GetNetworks() map[string]interface{} { + if o == nil || IsNil(o.Networks) { + var ret map[string]interface{} + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetNetworksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Networks) { + return map[string]interface{}{}, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *ContractJSON) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given map[string]interface{} and assigns it to the Networks field. +func (o *ContractJSON) SetNetworks(v map[string]interface{}) { + o.Networks = v +} + +// GetAst returns the Ast field value if set, zero value otherwise. +func (o *ContractJSON) GetAst() map[string]interface{} { + if o == nil || IsNil(o.Ast) { + var ret map[string]interface{} + return ret + } + return o.Ast +} + +// GetAstOk returns a tuple with the Ast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAstOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Ast) { + return map[string]interface{}{}, false + } + return o.Ast, true +} + +// HasAst returns a boolean if a field has been set. +func (o *ContractJSON) HasAst() bool { + if o != nil && !IsNil(o.Ast) { + return true + } + + return false +} + +// SetAst gets a reference to the given map[string]interface{} and assigns it to the Ast field. +func (o *ContractJSON) SetAst(v map[string]interface{}) { + o.Ast = v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *ContractJSON) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *ContractJSON) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *ContractJSON) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *ContractJSON) GetGasEstimates() map[string]interface{} { + if o == nil || IsNil(o.GasEstimates) { + var ret map[string]interface{} + return ret + } + return o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetGasEstimatesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.GasEstimates) { + return map[string]interface{}{}, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *ContractJSON) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given map[string]interface{} and assigns it to the GasEstimates field. +func (o *ContractJSON) SetGasEstimates(v map[string]interface{}) { + o.GasEstimates = v +} + +func (o ContractJSON) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJSON) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["bytecode"] = o.Bytecode + toSerialize["abi"] = o.Abi + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Ast) { + toSerialize["ast"] = o.Ast + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContractJSON) UnmarshalJSON(bytes []byte) (err error) { + varContractJSON := _ContractJSON{} + + if err = json.Unmarshal(bytes, &varContractJSON); err == nil { + *o = ContractJSON(varContractJSON) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contractName") + delete(additionalProperties, "bytecode") + delete(additionalProperties, "abi") + delete(additionalProperties, "metadata") + delete(additionalProperties, "deployedBytecode") + delete(additionalProperties, "sourceMap") + delete(additionalProperties, "deployedSourceMap") + delete(additionalProperties, "sourcePath") + delete(additionalProperties, "compiler") + delete(additionalProperties, "networks") + delete(additionalProperties, "ast") + delete(additionalProperties, "functionHashes") + delete(additionalProperties, "gasEstimates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContractJSON struct { + value *ContractJSON + isSet bool +} + +func (v NullableContractJSON) Get() *ContractJSON { + return v.value +} + +func (v *NullableContractJSON) Set(val *ContractJSON) { + v.value = val + v.isSet = true +} + +func (v NullableContractJSON) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJSON) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJSON(val *ContractJSON) *NullableContractJSON { + return &NullableContractJSON{value: val, isSet: true} +} + +func (v NullableContractJSON) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJSON) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go new file mode 100644 index 0000000000..30cbcd1f48 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go @@ -0,0 +1,294 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployContractJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJsonObjectV1Request{} + +// DeployContractJsonObjectV1Request struct for DeployContractJsonObjectV1Request +type DeployContractJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` +} + +// NewDeployContractJsonObjectV1Request instantiates a new DeployContractJsonObjectV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractJsonObjectV1Request(web3SigningCredential Web3SigningCredential, contractJSON ContractJSON) *DeployContractJsonObjectV1Request { + this := DeployContractJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewDeployContractJsonObjectV1RequestWithDefaults instantiates a new DeployContractJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJsonObjectV1RequestWithDefaults() *DeployContractJsonObjectV1Request { + this := DeployContractJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractJsonObjectV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractJsonObjectV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployContractJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployContractJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractJsonObjectV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +func (o DeployContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + return toSerialize, nil +} + +type NullableDeployContractJsonObjectV1Request struct { + value *DeployContractJsonObjectV1Request + isSet bool +} + +func (v NullableDeployContractJsonObjectV1Request) Get() *DeployContractJsonObjectV1Request { + return v.value +} + +func (v *NullableDeployContractJsonObjectV1Request) Set(val *DeployContractJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJsonObjectV1Request(val *DeployContractJsonObjectV1Request) *NullableDeployContractJsonObjectV1Request { + return &NullableDeployContractJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go new file mode 100644 index 0000000000..be0eb922f8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go @@ -0,0 +1,322 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Request{} + +// DeployContractV1Request struct for DeployContractV1Request +type DeployContractV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewDeployContractV1Request instantiates a new DeployContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractV1Request(contractName string, web3SigningCredential Web3SigningCredential, keychainId string) *DeployContractV1Request { + this := DeployContractV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractV1RequestWithDefaults instantiates a new DeployContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1RequestWithDefaults() *DeployContractV1Request { + this := DeployContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o DeployContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableDeployContractV1Request struct { + value *DeployContractV1Request + isSet bool +} + +func (v NullableDeployContractV1Request) Get() *DeployContractV1Request { + return v.value +} + +func (v *NullableDeployContractV1Request) Set(val *DeployContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Request(val *DeployContractV1Request) *NullableDeployContractV1Request { + return &NullableDeployContractV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go new file mode 100644 index 0000000000..70362cf250 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Response{} + +// DeployContractV1Response struct for DeployContractV1Response +type DeployContractV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewDeployContractV1Response instantiates a new DeployContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractV1Response(transactionReceipt Web3TransactionReceipt) *DeployContractV1Response { + this := DeployContractV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewDeployContractV1ResponseWithDefaults instantiates a new DeployContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1ResponseWithDefaults() *DeployContractV1Response { + this := DeployContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *DeployContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *DeployContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o DeployContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableDeployContractV1Response struct { + value *DeployContractV1Response + isSet bool +} + +func (v NullableDeployContractV1Response) Get() *DeployContractV1Response { + return v.value +} + +func (v *NullableDeployContractV1Response) Set(val *DeployContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Response(val *DeployContractV1Response) *NullableDeployContractV1Response { + return &NullableDeployContractV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go new file mode 100644 index 0000000000..34ab5467c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go @@ -0,0 +1,293 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployRequestBaseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployRequestBaseV1{} + +// DeployRequestBaseV1 struct for DeployRequestBaseV1 +type DeployRequestBaseV1 struct { + ContractJSON ContractJSON `json:"contractJSON"` + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewDeployRequestBaseV1 instantiates a new DeployRequestBaseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployRequestBaseV1(contractJSON ContractJSON, web3SigningCredential Web3SigningCredential) *DeployRequestBaseV1 { + this := DeployRequestBaseV1{} + this.ContractJSON = contractJSON + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployRequestBaseV1WithDefaults instantiates a new DeployRequestBaseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployRequestBaseV1WithDefaults() *DeployRequestBaseV1 { + this := DeployRequestBaseV1{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployRequestBaseV1) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployRequestBaseV1) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployRequestBaseV1) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployRequestBaseV1) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployRequestBaseV1) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *DeployRequestBaseV1) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *DeployRequestBaseV1) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployRequestBaseV1) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o DeployRequestBaseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployRequestBaseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableDeployRequestBaseV1 struct { + value *DeployRequestBaseV1 + isSet bool +} + +func (v NullableDeployRequestBaseV1) Get() *DeployRequestBaseV1 { + return v.value +} + +func (v *NullableDeployRequestBaseV1) Set(val *DeployRequestBaseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeployRequestBaseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployRequestBaseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployRequestBaseV1(val *DeployRequestBaseV1) *NullableDeployRequestBaseV1 { + return &NullableDeployRequestBaseV1{value: val, isSet: true} +} + +func (v NullableDeployRequestBaseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployRequestBaseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 0000000000..d5474c0a25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go new file mode 100644 index 0000000000..8073b34015 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go @@ -0,0 +1,440 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeContractJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractJsonObjectV1Request{} + +// InvokeContractJsonObjectV1Request struct for InvokeContractJsonObjectV1Request +type InvokeContractJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + // Address of the solidity contract + ContractAddress string `json:"contractAddress"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` +} + +// NewInvokeContractJsonObjectV1Request instantiates a new InvokeContractJsonObjectV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractJsonObjectV1Request(web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, contractAddress string, contractJSON ContractJSON) *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + this.ContractAddress = contractAddress + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewInvokeContractJsonObjectV1RequestWithDefaults instantiates a new InvokeContractJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractJsonObjectV1RequestWithDefaults() *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractJsonObjectV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractJsonObjectV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractJsonObjectV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractJsonObjectV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractJsonObjectV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractJsonObjectV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeContractJsonObjectV1Request) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractJsonObjectV1Request) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractJsonObjectV1Request) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractJsonObjectV1Request) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractJsonObjectV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *InvokeContractJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +func (o InvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + toSerialize["contractAddress"] = o.ContractAddress + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + return toSerialize, nil +} + +type NullableInvokeContractJsonObjectV1Request struct { + value *InvokeContractJsonObjectV1Request + isSet bool +} + +func (v NullableInvokeContractJsonObjectV1Request) Get() *InvokeContractJsonObjectV1Request { + return v.value +} + +func (v *NullableInvokeContractJsonObjectV1Request) Set(val *InvokeContractJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractJsonObjectV1Request(val *InvokeContractJsonObjectV1Request) *NullableInvokeContractJsonObjectV1Request { + return &NullableInvokeContractJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 0000000000..818fc0df7b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // The contract name to find it in the keychain plugin + ContractName string `json:"contractName"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contractName string, web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, keychainId string) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.KeychainId = keychainId + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *InvokeContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *InvokeContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractV1Request) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractV1Request) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *InvokeContractV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InvokeContractV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 0000000000..73590f436b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go new file mode 100644 index 0000000000..cd14765c8a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go @@ -0,0 +1,440 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeRequestBaseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRequestBaseV1{} + +// InvokeRequestBaseV1 struct for InvokeRequestBaseV1 +type InvokeRequestBaseV1 struct { + // Address of the solidity contract + ContractAddress string `json:"contractAddress"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` +} + +// NewInvokeRequestBaseV1 instantiates a new InvokeRequestBaseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeRequestBaseV1(contractAddress string, web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, contractJSON ContractJSON) *InvokeRequestBaseV1 { + this := InvokeRequestBaseV1{} + this.ContractAddress = contractAddress + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewInvokeRequestBaseV1WithDefaults instantiates a new InvokeRequestBaseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRequestBaseV1WithDefaults() *InvokeRequestBaseV1 { + this := InvokeRequestBaseV1{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeRequestBaseV1) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeRequestBaseV1) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeRequestBaseV1) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeRequestBaseV1) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeRequestBaseV1) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeRequestBaseV1) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeRequestBaseV1) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeRequestBaseV1) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeRequestBaseV1) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeRequestBaseV1) SetParams(v []interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeRequestBaseV1) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeRequestBaseV1) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeRequestBaseV1) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeRequestBaseV1) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeRequestBaseV1) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *InvokeRequestBaseV1) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *InvokeRequestBaseV1) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +func (o InvokeRequestBaseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRequestBaseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractAddress"] = o.ContractAddress + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + return toSerialize, nil +} + +type NullableInvokeRequestBaseV1 struct { + value *InvokeRequestBaseV1 + isSet bool +} + +func (v NullableInvokeRequestBaseV1) Get() *InvokeRequestBaseV1 { + return v.value +} + +func (v *NullableInvokeRequestBaseV1) Set(val *InvokeRequestBaseV1) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRequestBaseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRequestBaseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRequestBaseV1(val *InvokeRequestBaseV1) *NullableInvokeRequestBaseV1 { + return &NullableInvokeRequestBaseV1{value: val, isSet: true} +} + +func (v NullableInvokeRequestBaseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRequestBaseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go new file mode 100644 index 0000000000..40936813b7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// ReceiptType Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. +type ReceiptType string + +// List of ReceiptType +const ( + NODE_TX_POOL_ACK ReceiptType = "NODE_TX_POOL_ACK" + LEDGER_BLOCK_ACK ReceiptType = "LEDGER_BLOCK_ACK" +) + +// All allowed values of ReceiptType enum +var AllowedReceiptTypeEnumValues = []ReceiptType{ + "NODE_TX_POOL_ACK", + "LEDGER_BLOCK_ACK", +} + +func (v *ReceiptType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ReceiptType(value) + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ReceiptType", value) +} + +// NewReceiptTypeFromValue returns a pointer to a valid ReceiptType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewReceiptTypeFromValue(v string) (*ReceiptType, error) { + ev := ReceiptType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ReceiptType: valid values are %v", v, AllowedReceiptTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ReceiptType) IsValid() bool { + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ReceiptType value +func (v ReceiptType) Ptr() *ReceiptType { + return &v +} + +type NullableReceiptType struct { + value *ReceiptType + isSet bool +} + +func (v NullableReceiptType) Get() *ReceiptType { + return v.value +} + +func (v *NullableReceiptType) Set(val *ReceiptType) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptType) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptType(val *ReceiptType) *NullableReceiptType { + return &NullableReceiptType{value: val, isSet: true} +} + +func (v NullableReceiptType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go new file mode 100644 index 0000000000..01e13ddaec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the RunTransactionV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionV1Request{} + +// RunTransactionV1Request struct for RunTransactionV1Request +type RunTransactionV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig XdaiTransactionConfig `json:"transactionConfig"` + ConsistencyStrategy ConsistencyStrategy `json:"consistencyStrategy"` +} + +// NewRunTransactionV1Request instantiates a new RunTransactionV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionV1Request(web3SigningCredential Web3SigningCredential, transactionConfig XdaiTransactionConfig, consistencyStrategy ConsistencyStrategy) *RunTransactionV1Request { + this := RunTransactionV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + this.ConsistencyStrategy = consistencyStrategy + return &this +} + +// NewRunTransactionV1RequestWithDefaults instantiates a new RunTransactionV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionV1RequestWithDefaults() *RunTransactionV1Request { + this := RunTransactionV1Request{} + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionV1Request) GetTransactionConfig() XdaiTransactionConfig { + if o == nil { + var ret XdaiTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Request) GetTransactionConfigOk() (*XdaiTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionV1Request) SetTransactionConfig(v XdaiTransactionConfig) { + o.TransactionConfig = v +} + +// GetConsistencyStrategy returns the ConsistencyStrategy field value +func (o *RunTransactionV1Request) GetConsistencyStrategy() ConsistencyStrategy { + if o == nil { + var ret ConsistencyStrategy + return ret + } + + return o.ConsistencyStrategy +} + +// GetConsistencyStrategyOk returns a tuple with the ConsistencyStrategy field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Request) GetConsistencyStrategyOk() (*ConsistencyStrategy, bool) { + if o == nil { + return nil, false + } + return &o.ConsistencyStrategy, true +} + +// SetConsistencyStrategy sets field value +func (o *RunTransactionV1Request) SetConsistencyStrategy(v ConsistencyStrategy) { + o.ConsistencyStrategy = v +} + +func (o RunTransactionV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + toSerialize["consistencyStrategy"] = o.ConsistencyStrategy + return toSerialize, nil +} + +type NullableRunTransactionV1Request struct { + value *RunTransactionV1Request + isSet bool +} + +func (v NullableRunTransactionV1Request) Get() *RunTransactionV1Request { + return v.value +} + +func (v *NullableRunTransactionV1Request) Set(val *RunTransactionV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionV1Request(val *RunTransactionV1Request) *NullableRunTransactionV1Request { + return &NullableRunTransactionV1Request{value: val, isSet: true} +} + +func (v NullableRunTransactionV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go new file mode 100644 index 0000000000..e16edabda1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the RunTransactionV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionV1Response{} + +// RunTransactionV1Response struct for RunTransactionV1Response +type RunTransactionV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionV1Response instantiates a new RunTransactionV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunTransactionV1Response(transactionReceipt Web3TransactionReceipt) *RunTransactionV1Response { + this := RunTransactionV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionV1ResponseWithDefaults instantiates a new RunTransactionV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionV1ResponseWithDefaults() *RunTransactionV1Response { + this := RunTransactionV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionV1Response struct { + value *RunTransactionV1Response + isSet bool +} + +func (v NullableRunTransactionV1Response) Get() *RunTransactionV1Response { + return v.value +} + +func (v *NullableRunTransactionV1Response) Set(val *RunTransactionV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionV1Response(val *RunTransactionV1Response) *NullableRunTransactionV1Response { + return &NullableRunTransactionV1Response{value: val, isSet: true} +} + +func (v NullableRunTransactionV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 0000000000..89c4e0c4be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifact{} + +// SolidityContractJsonArtifact struct for SolidityContractJsonArtifact +type SolidityContractJsonArtifact struct { + ContractName string `json:"contractName"` + Metadata *string `json:"metadata,omitempty"` + Bytecode *string `json:"bytecode,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler *SolidityContractJsonArtifactCompiler `json:"compiler,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates *SolidityContractJsonArtifactGasEstimates `json:"gasEstimates,omitempty"` +} + +// NewSolidityContractJsonArtifact instantiates a new SolidityContractJsonArtifact object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifact(contractName string) *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + this.ContractName = contractName + return &this +} + +// NewSolidityContractJsonArtifactWithDefaults instantiates a new SolidityContractJsonArtifact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *SolidityContractJsonArtifact) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *SolidityContractJsonArtifact) SetContractName(v string) { + o.ContractName = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *SolidityContractJsonArtifact) SetMetadata(v string) { + o.Metadata = &v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *SolidityContractJsonArtifact) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *SolidityContractJsonArtifact) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *SolidityContractJsonArtifact) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler { + if o == nil || IsNil(o.Compiler) { + var ret SolidityContractJsonArtifactCompiler + return ret + } + return *o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool) { + if o == nil || IsNil(o.Compiler) { + return nil, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given SolidityContractJsonArtifactCompiler and assigns it to the Compiler field. +func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler) { + o.Compiler = &v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates { + if o == nil || IsNil(o.GasEstimates) { + var ret SolidityContractJsonArtifactGasEstimates + return ret + } + return *o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool) { + if o == nil || IsNil(o.GasEstimates) { + return nil, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given SolidityContractJsonArtifactGasEstimates and assigns it to the GasEstimates field. +func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates) { + o.GasEstimates = &v +} + +func (o SolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifact struct { + value *SolidityContractJsonArtifact + isSet bool +} + +func (v NullableSolidityContractJsonArtifact) Get() *SolidityContractJsonArtifact { + return v.value +} + +func (v *NullableSolidityContractJsonArtifact) Set(val *SolidityContractJsonArtifact) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifact) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifact(val *SolidityContractJsonArtifact) *NullableSolidityContractJsonArtifact { + return &NullableSolidityContractJsonArtifact{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 0000000000..faad0b2c0d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactCompiler type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactCompiler{} + +// SolidityContractJsonArtifactCompiler struct for SolidityContractJsonArtifactCompiler +type SolidityContractJsonArtifactCompiler struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SolidityContractJsonArtifactCompiler SolidityContractJsonArtifactCompiler + +// NewSolidityContractJsonArtifactCompiler instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactCompiler() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// NewSolidityContractJsonArtifactCompilerWithDefaults instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SolidityContractJsonArtifactCompiler) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string) { + o.Version = &v +} + +func (o SolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactCompiler) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SolidityContractJsonArtifactCompiler) UnmarshalJSON(bytes []byte) (err error) { + varSolidityContractJsonArtifactCompiler := _SolidityContractJsonArtifactCompiler{} + + if err = json.Unmarshal(bytes, &varSolidityContractJsonArtifactCompiler); err == nil { + *o = SolidityContractJsonArtifactCompiler(varSolidityContractJsonArtifactCompiler) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSolidityContractJsonArtifactCompiler struct { + value *SolidityContractJsonArtifactCompiler + isSet bool +} + +func (v NullableSolidityContractJsonArtifactCompiler) Get() *SolidityContractJsonArtifactCompiler { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Set(val *SolidityContractJsonArtifactCompiler) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactCompiler) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactCompiler(val *SolidityContractJsonArtifactCompiler) *NullableSolidityContractJsonArtifactCompiler { + return &NullableSolidityContractJsonArtifactCompiler{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactCompiler) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 0000000000..1c9aecc2a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimates{} + +// SolidityContractJsonArtifactGasEstimates struct for SolidityContractJsonArtifactGasEstimates +type SolidityContractJsonArtifactGasEstimates struct { + Creation *SolidityContractJsonArtifactGasEstimatesCreation `json:"creation,omitempty"` + External map[string]interface{} `json:"external,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimates instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// GetCreation returns the Creation field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation { + if o == nil || IsNil(o.Creation) { + var ret SolidityContractJsonArtifactGasEstimatesCreation + return ret + } + return *o.Creation +} + +// GetCreationOk returns a tuple with the Creation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool) { + if o == nil || IsNil(o.Creation) { + return nil, false + } + return o.Creation, true +} + +// HasCreation returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool { + if o != nil && !IsNil(o.Creation) { + return true + } + + return false +} + +// SetCreation gets a reference to the given SolidityContractJsonArtifactGasEstimatesCreation and assigns it to the Creation field. +func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation) { + o.Creation = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{} { + if o == nil || IsNil(o.External) { + var ret map[string]interface{} + return ret + } + return o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.External) { + return map[string]interface{}{}, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given map[string]interface{} and assigns it to the External field. +func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{}) { + o.External = v +} + +func (o SolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Creation) { + toSerialize["creation"] = o.Creation + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimates struct { + value *SolidityContractJsonArtifactGasEstimates + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) Get() *SolidityContractJsonArtifactGasEstimates { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Set(val *SolidityContractJsonArtifactGasEstimates) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimates(val *SolidityContractJsonArtifactGasEstimates) *NullableSolidityContractJsonArtifactGasEstimates { + return &NullableSolidityContractJsonArtifactGasEstimates{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 0000000000..8066fd4de1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimatesCreation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimatesCreation{} + +// SolidityContractJsonArtifactGasEstimatesCreation struct for SolidityContractJsonArtifactGasEstimatesCreation +type SolidityContractJsonArtifactGasEstimatesCreation struct { + CodeDepositCost *string `json:"codeDepositCost,omitempty"` + ExecutionCost *string `json:"executionCost,omitempty"` + TotalCost *string `json:"totalCost,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimatesCreation instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// GetCodeDepositCost returns the CodeDepositCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string { + if o == nil || IsNil(o.CodeDepositCost) { + var ret string + return ret + } + return *o.CodeDepositCost +} + +// GetCodeDepositCostOk returns a tuple with the CodeDepositCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool) { + if o == nil || IsNil(o.CodeDepositCost) { + return nil, false + } + return o.CodeDepositCost, true +} + +// HasCodeDepositCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool { + if o != nil && !IsNil(o.CodeDepositCost) { + return true + } + + return false +} + +// SetCodeDepositCost gets a reference to the given string and assigns it to the CodeDepositCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string) { + o.CodeDepositCost = &v +} + +// GetExecutionCost returns the ExecutionCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string { + if o == nil || IsNil(o.ExecutionCost) { + var ret string + return ret + } + return *o.ExecutionCost +} + +// GetExecutionCostOk returns a tuple with the ExecutionCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionCost) { + return nil, false + } + return o.ExecutionCost, true +} + +// HasExecutionCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool { + if o != nil && !IsNil(o.ExecutionCost) { + return true + } + + return false +} + +// SetExecutionCost gets a reference to the given string and assigns it to the ExecutionCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string) { + o.ExecutionCost = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string { + if o == nil || IsNil(o.TotalCost) { + var ret string + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given string and assigns it to the TotalCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string) { + o.TotalCost = &v +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CodeDepositCost) { + toSerialize["codeDepositCost"] = o.CodeDepositCost + } + if !IsNil(o.ExecutionCost) { + toSerialize["executionCost"] = o.ExecutionCost + } + if !IsNil(o.TotalCost) { + toSerialize["totalCost"] = o.TotalCost + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimatesCreation struct { + value *SolidityContractJsonArtifactGasEstimatesCreation + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) Get() *SolidityContractJsonArtifactGasEstimatesCreation { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Set(val *SolidityContractJsonArtifactGasEstimatesCreation) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimatesCreation(val *SolidityContractJsonArtifactGasEstimatesCreation) *NullableSolidityContractJsonArtifactGasEstimatesCreation { + return &NullableSolidityContractJsonArtifactGasEstimatesCreation{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 0000000000..4293ae58b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 0000000000..a6a7a4db74 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 0000000000..a19ea342bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 0000000000..c78818447a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 0000000000..9177a91dcd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 0000000000..4dbbb956cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go new file mode 100644 index 0000000000..6ef2d2925d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go @@ -0,0 +1,410 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the XdaiTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &XdaiTransactionConfig{} + +// XdaiTransactionConfig struct for XdaiTransactionConfig +type XdaiTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *XdaiTransactionConfigFrom `json:"from,omitempty"` + To *XdaiTransactionConfigTo `json:"to,omitempty"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Data *XdaiTransactionConfigTo `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _XdaiTransactionConfig XdaiTransactionConfig + +// NewXdaiTransactionConfig instantiates a new XdaiTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewXdaiTransactionConfig() *XdaiTransactionConfig { + this := XdaiTransactionConfig{} + return &this +} + +// NewXdaiTransactionConfigWithDefaults instantiates a new XdaiTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewXdaiTransactionConfigWithDefaults() *XdaiTransactionConfig { + this := XdaiTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetRawTransaction() string { + if o == nil || IsNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || IsNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasRawTransaction() bool { + if o != nil && !IsNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *XdaiTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetFrom() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.From) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetFromOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given XdaiTransactionConfigFrom and assigns it to the From field. +func (o *XdaiTransactionConfig) SetFrom(v XdaiTransactionConfigFrom) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetTo() XdaiTransactionConfigTo { + if o == nil || IsNil(o.To) { + var ret XdaiTransactionConfigTo + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetToOk() (*XdaiTransactionConfigTo, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given XdaiTransactionConfigTo and assigns it to the To field. +func (o *XdaiTransactionConfig) SetTo(v XdaiTransactionConfigTo) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *XdaiTransactionConfig) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *XdaiTransactionConfig) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *XdaiTransactionConfig) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *XdaiTransactionConfig) SetNonce(v float32) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetData() XdaiTransactionConfigTo { + if o == nil || IsNil(o.Data) { + var ret XdaiTransactionConfigTo + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetDataOk() (*XdaiTransactionConfigTo, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given XdaiTransactionConfigTo and assigns it to the Data field. +func (o *XdaiTransactionConfig) SetData(v XdaiTransactionConfigTo) { + o.Data = &v +} + +func (o XdaiTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o XdaiTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *XdaiTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varXdaiTransactionConfig := _XdaiTransactionConfig{} + + if err = json.Unmarshal(bytes, &varXdaiTransactionConfig); err == nil { + *o = XdaiTransactionConfig(varXdaiTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rawTransaction") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + delete(additionalProperties, "gas") + delete(additionalProperties, "gasPrice") + delete(additionalProperties, "nonce") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableXdaiTransactionConfig struct { + value *XdaiTransactionConfig + isSet bool +} + +func (v NullableXdaiTransactionConfig) Get() *XdaiTransactionConfig { + return v.value +} + +func (v *NullableXdaiTransactionConfig) Set(val *XdaiTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableXdaiTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableXdaiTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXdaiTransactionConfig(val *XdaiTransactionConfig) *NullableXdaiTransactionConfig { + return &NullableXdaiTransactionConfig{value: val, isSet: true} +} + +func (v NullableXdaiTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXdaiTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go new file mode 100644 index 0000000000..29ea6955b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// XdaiTransactionConfigFrom - struct for XdaiTransactionConfigFrom +type XdaiTransactionConfigFrom struct { + Float32 *float32 + String *string +} + +// float32AsXdaiTransactionConfigFrom is a convenience function that returns float32 wrapped in XdaiTransactionConfigFrom +func Float32AsXdaiTransactionConfigFrom(v *float32) XdaiTransactionConfigFrom { + return XdaiTransactionConfigFrom{ + Float32: v, + } +} + +// stringAsXdaiTransactionConfigFrom is a convenience function that returns string wrapped in XdaiTransactionConfigFrom +func StringAsXdaiTransactionConfigFrom(v *string) XdaiTransactionConfigFrom { + return XdaiTransactionConfigFrom{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *XdaiTransactionConfigFrom) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(XdaiTransactionConfigFrom)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(XdaiTransactionConfigFrom)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src XdaiTransactionConfigFrom) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *XdaiTransactionConfigFrom) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableXdaiTransactionConfigFrom struct { + value *XdaiTransactionConfigFrom + isSet bool +} + +func (v NullableXdaiTransactionConfigFrom) Get() *XdaiTransactionConfigFrom { + return v.value +} + +func (v *NullableXdaiTransactionConfigFrom) Set(val *XdaiTransactionConfigFrom) { + v.value = val + v.isSet = true +} + +func (v NullableXdaiTransactionConfigFrom) IsSet() bool { + return v.isSet +} + +func (v *NullableXdaiTransactionConfigFrom) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXdaiTransactionConfigFrom(val *XdaiTransactionConfigFrom) *NullableXdaiTransactionConfigFrom { + return &NullableXdaiTransactionConfigFrom{value: val, isSet: true} +} + +func (v NullableXdaiTransactionConfigFrom) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXdaiTransactionConfigFrom) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go new file mode 100644 index 0000000000..9aecfd62d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// XdaiTransactionConfigTo - struct for XdaiTransactionConfigTo +type XdaiTransactionConfigTo struct { + String *string +} + +// stringAsXdaiTransactionConfigTo is a convenience function that returns string wrapped in XdaiTransactionConfigTo +func StringAsXdaiTransactionConfigTo(v *string) XdaiTransactionConfigTo { + return XdaiTransactionConfigTo{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *XdaiTransactionConfigTo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(XdaiTransactionConfigTo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(XdaiTransactionConfigTo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src XdaiTransactionConfigTo) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *XdaiTransactionConfigTo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableXdaiTransactionConfigTo struct { + value *XdaiTransactionConfigTo + isSet bool +} + +func (v NullableXdaiTransactionConfigTo) Get() *XdaiTransactionConfigTo { + return v.value +} + +func (v *NullableXdaiTransactionConfigTo) Set(val *XdaiTransactionConfigTo) { + v.value = val + v.isSet = true +} + +func (v NullableXdaiTransactionConfigTo) IsSet() bool { + return v.isSet +} + +func (v *NullableXdaiTransactionConfigTo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXdaiTransactionConfigTo(val *XdaiTransactionConfigTo) *NullableXdaiTransactionConfigTo { + return &NullableXdaiTransactionConfigTo{value: val, isSet: true} +} + +func (v NullableXdaiTransactionConfigTo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXdaiTransactionConfigTo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..fc501d8d6a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..866443a7e4 --- /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 0000000000..09f0729ee7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..f61de6e006 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Connector Xdai + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..3e25eaea99 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ConsistencyStrategy.java +src/main/java/org/openapitools/client/model/ContractJSON.java +src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1Response.java +src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java +src/main/java/org/openapitools/client/model/ReceiptType.java +src/main/java/org/openapitools/client/model/RunTransactionV1Request.java +src/main/java/org/openapitools/client/model/RunTransactionV1Response.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java +src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java +src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..69ea211ce4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,168 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Xdai +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Xdai ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractJsonObjectV1Request deployContractJsonObjectV1Request = new DeployContractJsonObjectV1Request(); // DeployContractJsonObjectV1Request | + try { + DeployContractV1Response result = apiInstance.deployContractJsonObjectV1(deployContractJsonObjectV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractJsonObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractJsonObjectV1**](docs/DefaultApi.md#deployContractJsonObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**deployContractV1**](docs/DefaultApi.md#deployContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractJsonObject**](docs/DefaultApi.md#invokeContractJsonObject) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract | Invokes a contract on a xdai ledger +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction | Executes a transaction on a xdai ledger + + +## Documentation for Models + + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractJsonObjectV1Request](docs/DeployContractJsonObjectV1Request.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeployRequestBaseV1](docs/DeployRequestBaseV1.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRequestBaseV1](docs/InvokeRequestBaseV1.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionV1Request](docs/RunTransactionV1Request.md) + - [RunTransactionV1Response](docs/RunTransactionV1Response.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [XdaiTransactionConfig](docs/XdaiTransactionConfig.md) + - [XdaiTransactionConfigFrom](docs/XdaiTransactionConfigFrom.md) + - [XdaiTransactionConfigTo](docs/XdaiTransactionConfigTo.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..e9589a3800 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,908 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Xdai ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Xdai + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionV1Response' + description: OK + summary: Executes a transaction on a xdai ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a xdai ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object: + post: + operationId: invokeContractJsonObject + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + pollIntervalMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + pollIntervalMs: + description: The amount of time (in milliseconds) connector will wait before + making another confiramtion request to the network in case of previous + confiramtion request fails + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + XdaiTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + to: + $ref: '#/components/schemas/XdaiTransactionConfig_to' + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/XdaiTransactionConfig_to' + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - abi + - bytecode + - contractName + type: object + RunTransactionV1Request: + additionalProperties: false + example: + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + pollIntervalMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/XdaiTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractV1Request: + additionalProperties: false + example: + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + DeployContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + DeployRequestBaseV1: + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - contractJSON + - web3SigningCredential + type: object + InvokeRequestBaseV1: + additionalProperties: false + properties: + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + XdaiTransactionConfig_from: + oneOf: + - type: string + - type: number + XdaiTransactionConfig_to: + oneOf: + - type: string + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..c2ec97f011 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..cd1cb6bf3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..663f82b3fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..1a533c5045 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..679fc21aa0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..a607730a83 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,436 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsistencyStrategy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ContractJSON.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployRequestBaseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRequestBaseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.XdaiTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.XdaiTransactionConfigFrom.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.XdaiTransactionConfigTo.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..da11f45df3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..7f33c6d43e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..25d5d3e50a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..ad3fd746e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..6af7f61630 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,786 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.DeployContractJsonObjectV1Request; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionV1Request; +import org.openapitools.client.model.RunTransactionV1Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deployContractJsonObjectV1 + * @param deployContractJsonObjectV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractJsonObjectV1Call(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractJsonObjectV1ValidateBeforeCall(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return deployContractJsonObjectV1Call(deployContractJsonObjectV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractJsonObjectV1Request (optional) + * @return DeployContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractV1Response deployContractJsonObjectV1(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = deployContractJsonObjectV1WithHttpInfo(deployContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractJsonObjectV1Request (optional) + * @return ApiResponse<DeployContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractJsonObjectV1WithHttpInfo(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractJsonObjectV1ValidateBeforeCall(deployContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractJsonObjectV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractJsonObjectV1Async(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractJsonObjectV1ValidateBeforeCall(deployContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractV1 + * @param deployContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractV1Call(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deployContractV1ValidateBeforeCall(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + return deployContractV1Call(deployContractV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractV1Request (optional) + * @return DeployContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractV1Response deployContractV1(DeployContractV1Request deployContractV1Request) throws ApiException { + ApiResponse localVarResp = deployContractV1WithHttpInfo(deployContractV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractV1Request (optional) + * @return ApiResponse<DeployContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractV1WithHttpInfo(DeployContractV1Request deployContractV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractV1Async(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractJsonObject + * @param invokeContractJsonObjectV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractJsonObjectCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractJsonObjectValidateBeforeCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractJsonObjectCall(invokeContractJsonObjectV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractJsonObject(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractJsonObjectWithHttpInfo(invokeContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractJsonObjectWithHttpInfo(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractJsonObjectValidateBeforeCall(invokeContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractJsonObjectV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractJsonObjectAsync(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractJsonObjectValidateBeforeCall(invokeContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a xdai ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a xdai ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a xdai ledger (asynchronously) + * + * @param invokeContractV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionV1Request runTransactionV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call runTransactionV1ValidateBeforeCall(RunTransactionV1Request runTransactionV1Request, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionV1Request, _callback); + + } + + /** + * Executes a transaction on a xdai ledger + * + * @param runTransactionV1Request (optional) + * @return RunTransactionV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionV1Response runTransactionV1(RunTransactionV1Request runTransactionV1Request) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionV1Request); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a xdai ledger + * + * @param runTransactionV1Request (optional) + * @return ApiResponse<RunTransactionV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionV1Request runTransactionV1Request) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a xdai ledger (asynchronously) + * + * @param runTransactionV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionV1Request runTransactionV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..f8752c145f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..b916aaedab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..47d16fe309 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..add22a2645 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..a0013ac38d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java new file mode 100644 index 0000000000..dcade87586 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java @@ -0,0 +1,303 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ReceiptType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsistencyStrategy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsistencyStrategy { + public static final String SERIALIZED_NAME_RECEIPT_TYPE = "receiptType"; + @SerializedName(SERIALIZED_NAME_RECEIPT_TYPE) + private ReceiptType receiptType; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private Integer timeoutMs; + + public static final String SERIALIZED_NAME_BLOCK_CONFIRMATIONS = "blockConfirmations"; + @SerializedName(SERIALIZED_NAME_BLOCK_CONFIRMATIONS) + private Integer blockConfirmations; + + public static final String SERIALIZED_NAME_POLL_INTERVAL_MS = "pollIntervalMs"; + @SerializedName(SERIALIZED_NAME_POLL_INTERVAL_MS) + private Integer pollIntervalMs; + + public ConsistencyStrategy() { + } + + public ConsistencyStrategy receiptType(ReceiptType receiptType) { + + this.receiptType = receiptType; + return this; + } + + /** + * Get receiptType + * @return receiptType + **/ + @javax.annotation.Nonnull + public ReceiptType getReceiptType() { + return receiptType; + } + + + public void setReceiptType(ReceiptType receiptType) { + this.receiptType = receiptType; + } + + + public ConsistencyStrategy timeoutMs(Integer timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public Integer getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public ConsistencyStrategy blockConfirmations(Integer blockConfirmations) { + + this.blockConfirmations = blockConfirmations; + return this; + } + + /** + * The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + * minimum: 0 + * maximum: 20000 + * @return blockConfirmations + **/ + @javax.annotation.Nonnull + public Integer getBlockConfirmations() { + return blockConfirmations; + } + + + public void setBlockConfirmations(Integer blockConfirmations) { + this.blockConfirmations = blockConfirmations; + } + + + public ConsistencyStrategy pollIntervalMs(Integer pollIntervalMs) { + + this.pollIntervalMs = pollIntervalMs; + return this; + } + + /** + * The amount of time (in milliseconds) connector will wait before making another confiramtion request to the network in case of previous confiramtion request fails + * minimum: 0 + * @return pollIntervalMs + **/ + @javax.annotation.Nullable + public Integer getPollIntervalMs() { + return pollIntervalMs; + } + + + public void setPollIntervalMs(Integer pollIntervalMs) { + this.pollIntervalMs = pollIntervalMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsistencyStrategy consistencyStrategy = (ConsistencyStrategy) o; + return Objects.equals(this.receiptType, consistencyStrategy.receiptType) && + Objects.equals(this.timeoutMs, consistencyStrategy.timeoutMs) && + Objects.equals(this.blockConfirmations, consistencyStrategy.blockConfirmations) && + Objects.equals(this.pollIntervalMs, consistencyStrategy.pollIntervalMs); + } + + @Override + public int hashCode() { + return Objects.hash(receiptType, timeoutMs, blockConfirmations, pollIntervalMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsistencyStrategy {\n"); + sb.append(" receiptType: ").append(toIndentedString(receiptType)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" blockConfirmations: ").append(toIndentedString(blockConfirmations)).append("\n"); + sb.append(" pollIntervalMs: ").append(toIndentedString(pollIntervalMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("receiptType"); + openapiFields.add("timeoutMs"); + openapiFields.add("blockConfirmations"); + openapiFields.add("pollIntervalMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("receiptType"); + openapiRequiredFields.add("blockConfirmations"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsistencyStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsistencyStrategy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsistencyStrategy is not found in the empty JSON string", ConsistencyStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsistencyStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsistencyStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsistencyStrategy.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsistencyStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsistencyStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsistencyStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsistencyStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsistencyStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsistencyStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsistencyStrategy + * @throws IOException if the JSON string is invalid with respect to ConsistencyStrategy + */ + public static ConsistencyStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsistencyStrategy.class); + } + + /** + * Convert an instance of ConsistencyStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java new file mode 100644 index 0000000000..f476487e80 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java @@ -0,0 +1,663 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJSON + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJSON { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private Object compiler; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + @SerializedName(SERIALIZED_NAME_NETWORKS) + private Object networks; + + public static final String SERIALIZED_NAME_AST = "ast"; + @SerializedName(SERIALIZED_NAME_AST) + private Object ast; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Object functionHashes; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private Object gasEstimates; + + public ContractJSON() { + } + + public ContractJSON contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractJSON bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public ContractJSON abi(List abi) { + + this.abi = abi; + return this; + } + + public ContractJSON addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return abi + **/ + @javax.annotation.Nonnull + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public ContractJSON metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public ContractJSON deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public ContractJSON sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public ContractJSON deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public ContractJSON sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public ContractJSON compiler(Object compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public Object getCompiler() { + return compiler; + } + + + public void setCompiler(Object compiler) { + this.compiler = compiler; + } + + + public ContractJSON networks(Object networks) { + + this.networks = networks; + return this; + } + + /** + * Get networks + * @return networks + **/ + @javax.annotation.Nullable + public Object getNetworks() { + return networks; + } + + + public void setNetworks(Object networks) { + this.networks = networks; + } + + + public ContractJSON ast(Object ast) { + + this.ast = ast; + return this; + } + + /** + * Get ast + * @return ast + **/ + @javax.annotation.Nullable + public Object getAst() { + return ast; + } + + + public void setAst(Object ast) { + this.ast = ast; + } + + + public ContractJSON functionHashes(Object functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Object getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Object functionHashes) { + this.functionHashes = functionHashes; + } + + + public ContractJSON gasEstimates(Object gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public Object getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(Object gasEstimates) { + this.gasEstimates = gasEstimates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ContractJSON instance itself + */ + public ContractJSON putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJSON contractJSON = (ContractJSON) o; + return Objects.equals(this.contractName, contractJSON.contractName) && + Objects.equals(this.bytecode, contractJSON.bytecode) && + Objects.equals(this.abi, contractJSON.abi) && + Objects.equals(this.metadata, contractJSON.metadata) && + Objects.equals(this.deployedBytecode, contractJSON.deployedBytecode) && + Objects.equals(this.sourceMap, contractJSON.sourceMap) && + Objects.equals(this.deployedSourceMap, contractJSON.deployedSourceMap) && + Objects.equals(this.sourcePath, contractJSON.sourcePath) && + Objects.equals(this.compiler, contractJSON.compiler) && + Objects.equals(this.networks, contractJSON.networks) && + Objects.equals(this.ast, contractJSON.ast) && + Objects.equals(this.functionHashes, contractJSON.functionHashes) && + Objects.equals(this.gasEstimates, contractJSON.gasEstimates)&& + Objects.equals(this.additionalProperties, contractJSON.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, bytecode, abi, metadata, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, networks, ast, functionHashes, gasEstimates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJSON {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ast: ").append(toIndentedString(ast)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("bytecode"); + openapiFields.add("abi"); + openapiFields.add("metadata"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("networks"); + openapiFields.add("ast"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("bytecode"); + openapiRequiredFields.add("abi"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJSON + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJSON.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJSON is not found in the empty JSON string", ContractJSON.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJSON.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + // ensure the required json array is present + if (jsonObj.get("abi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJSON.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJSON' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJSON.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJSON value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ContractJSON read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ContractJSON instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJSON given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJSON + * @throws IOException if the JSON string is invalid with respect to ContractJSON + */ + public static ContractJSON fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJSON.class); + } + + /** + * Convert an instance of ContractJSON to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java new file mode 100644 index 0000000000..170199c876 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public DeployContractJsonObjectV1Request() { + } + + public DeployContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractJsonObjectV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractJsonObjectV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractJsonObjectV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractJsonObjectV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJsonObjectV1Request deployContractJsonObjectV1Request = (DeployContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, deployContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.gas, deployContractJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, deployContractJsonObjectV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractJsonObjectV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractJsonObjectV1Request.constructorArgs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, gas, gasPrice, timeoutMs, contractJSON, constructorArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJsonObjectV1Request is not found in the empty JSON string", DeployContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractJsonObjectV1Request + */ + public static DeployContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of DeployContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java new file mode 100644 index 0000000000..835e127b32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java @@ -0,0 +1,411 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public DeployContractV1Request() { + } + + public DeployContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Request deployContractV1Request = (DeployContractV1Request) o; + return Objects.equals(this.contractName, deployContractV1Request.contractName) && + Objects.equals(this.constructorArgs, deployContractV1Request.constructorArgs) && + Objects.equals(this.web3SigningCredential, deployContractV1Request.web3SigningCredential) && + Objects.equals(this.keychainId, deployContractV1Request.keychainId) && + Objects.equals(this.gas, deployContractV1Request.gas) && + Objects.equals(this.gasPrice, deployContractV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractV1Request.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, constructorArgs, web3SigningCredential, keychainId, gas, gasPrice, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Request is not found in the empty JSON string", DeployContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Request + */ + public static DeployContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Request.class); + } + + /** + * Convert an instance of DeployContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java new file mode 100644 index 0000000000..7a3e9693d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractV1Response() { + } + + public DeployContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Response deployContractV1Response = (DeployContractV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Response is not found in the empty JSON string", DeployContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Response + */ + public static DeployContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Response.class); + } + + /** + * Convert an instance of DeployContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java new file mode 100644 index 0000000000..39f20b2148 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java @@ -0,0 +1,383 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployRequestBaseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployRequestBaseV1 { + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public DeployRequestBaseV1() { + } + + public DeployRequestBaseV1 contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployRequestBaseV1 constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployRequestBaseV1 addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployRequestBaseV1 web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployRequestBaseV1 gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public DeployRequestBaseV1 gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployRequestBaseV1 timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployRequestBaseV1 deployRequestBaseV1 = (DeployRequestBaseV1) o; + return Objects.equals(this.contractJSON, deployRequestBaseV1.contractJSON) && + Objects.equals(this.constructorArgs, deployRequestBaseV1.constructorArgs) && + Objects.equals(this.web3SigningCredential, deployRequestBaseV1.web3SigningCredential) && + Objects.equals(this.gas, deployRequestBaseV1.gas) && + Objects.equals(this.gasPrice, deployRequestBaseV1.gasPrice) && + Objects.equals(this.timeoutMs, deployRequestBaseV1.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(contractJSON, constructorArgs, web3SigningCredential, gas, gasPrice, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployRequestBaseV1 {\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractJSON"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployRequestBaseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployRequestBaseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployRequestBaseV1 is not found in the empty JSON string", DeployRequestBaseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployRequestBaseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployRequestBaseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployRequestBaseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployRequestBaseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployRequestBaseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployRequestBaseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployRequestBaseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployRequestBaseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployRequestBaseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployRequestBaseV1 + * @throws IOException if the JSON string is invalid with respect to DeployRequestBaseV1 + */ + public static DeployRequestBaseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployRequestBaseV1.class); + } + + /** + * Convert an instance of DeployRequestBaseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 0000000000..7cca84fc50 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java new file mode 100644 index 0000000000..868de4dba0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java @@ -0,0 +1,540 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public InvokeContractJsonObjectV1Request() { + } + + public InvokeContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractJsonObjectV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractJsonObjectV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractJsonObjectV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractJsonObjectV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractJsonObjectV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractJsonObjectV1Request value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractJsonObjectV1Request gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractJsonObjectV1Request gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractJsonObjectV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = (InvokeContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, invokeContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractJsonObjectV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractJsonObjectV1Request.methodName) && + Objects.equals(this.params, invokeContractJsonObjectV1Request.params) && + Objects.equals(this.contractAddress, invokeContractJsonObjectV1Request.contractAddress) && + Objects.equals(this.value, invokeContractJsonObjectV1Request.value) && + Objects.equals(this.gas, invokeContractJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractJsonObjectV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractJsonObjectV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, invokeContractJsonObjectV1Request.contractJSON); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, invocationType, methodName, params, contractAddress, value, gas, gasPrice, nonce, timeoutMs, contractJSON); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractJsonObjectV1Request is not found in the empty JSON string", InvokeContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static InvokeContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of InvokeContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 0000000000..8b7017b1ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,542 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name to find it in the keychain plugin + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractV1Request gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractV1Request gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.web3SigningCredential, invokeContractV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gas, invokeContractV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, web3SigningCredential, invocationType, methodName, params, value, gas, gasPrice, nonce, timeoutMs, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 0000000000..294d800920 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java new file mode 100644 index 0000000000..9fc86a2ac7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java @@ -0,0 +1,540 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRequestBaseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRequestBaseV1 { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public InvokeRequestBaseV1() { + } + + public InvokeRequestBaseV1 contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeRequestBaseV1 web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeRequestBaseV1 invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeRequestBaseV1 methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeRequestBaseV1 params(List params) { + + this.params = params; + return this; + } + + public InvokeRequestBaseV1 addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeRequestBaseV1 value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeRequestBaseV1 gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeRequestBaseV1 gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeRequestBaseV1 nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeRequestBaseV1 timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeRequestBaseV1 contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRequestBaseV1 invokeRequestBaseV1 = (InvokeRequestBaseV1) o; + return Objects.equals(this.contractAddress, invokeRequestBaseV1.contractAddress) && + Objects.equals(this.web3SigningCredential, invokeRequestBaseV1.web3SigningCredential) && + Objects.equals(this.invocationType, invokeRequestBaseV1.invocationType) && + Objects.equals(this.methodName, invokeRequestBaseV1.methodName) && + Objects.equals(this.params, invokeRequestBaseV1.params) && + Objects.equals(this.value, invokeRequestBaseV1.value) && + Objects.equals(this.gas, invokeRequestBaseV1.gas) && + Objects.equals(this.gasPrice, invokeRequestBaseV1.gasPrice) && + Objects.equals(this.nonce, invokeRequestBaseV1.nonce) && + Objects.equals(this.timeoutMs, invokeRequestBaseV1.timeoutMs) && + Objects.equals(this.contractJSON, invokeRequestBaseV1.contractJSON); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, web3SigningCredential, invocationType, methodName, params, value, gas, gasPrice, nonce, timeoutMs, contractJSON); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRequestBaseV1 {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractAddress"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRequestBaseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRequestBaseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRequestBaseV1 is not found in the empty JSON string", InvokeRequestBaseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRequestBaseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRequestBaseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRequestBaseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRequestBaseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRequestBaseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRequestBaseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRequestBaseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRequestBaseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRequestBaseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRequestBaseV1 + * @throws IOException if the JSON string is invalid with respect to InvokeRequestBaseV1 + */ + public static InvokeRequestBaseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRequestBaseV1.class); + } + + /** + * Convert an instance of InvokeRequestBaseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java new file mode 100644 index 0000000000..28c3865e9c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. + */ +@JsonAdapter(ReceiptType.Adapter.class) +public enum ReceiptType { + + NODE_TX_POOL_ACK("NODE_TX_POOL_ACK"), + + LEDGER_BLOCK_ACK("LEDGER_BLOCK_ACK"); + + private String value; + + ReceiptType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ReceiptType fromValue(String value) { + for (ReceiptType b : ReceiptType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ReceiptType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ReceiptType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ReceiptType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java new file mode 100644 index 0000000000..afaea7de46 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private XdaiTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_CONSISTENCY_STRATEGY = "consistencyStrategy"; + @SerializedName(SERIALIZED_NAME_CONSISTENCY_STRATEGY) + private ConsistencyStrategy consistencyStrategy; + + public RunTransactionV1Request() { + } + + public RunTransactionV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionV1Request transactionConfig(XdaiTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + public XdaiTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(XdaiTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionV1Request consistencyStrategy(ConsistencyStrategy consistencyStrategy) { + + this.consistencyStrategy = consistencyStrategy; + return this; + } + + /** + * Get consistencyStrategy + * @return consistencyStrategy + **/ + @javax.annotation.Nonnull + public ConsistencyStrategy getConsistencyStrategy() { + return consistencyStrategy; + } + + + public void setConsistencyStrategy(ConsistencyStrategy consistencyStrategy) { + this.consistencyStrategy = consistencyStrategy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionV1Request runTransactionV1Request = (RunTransactionV1Request) o; + return Objects.equals(this.web3SigningCredential, runTransactionV1Request.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionV1Request.transactionConfig) && + Objects.equals(this.consistencyStrategy, runTransactionV1Request.consistencyStrategy); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, consistencyStrategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" consistencyStrategy: ").append(toIndentedString(consistencyStrategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("consistencyStrategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + openapiRequiredFields.add("consistencyStrategy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionV1Request is not found in the empty JSON string", RunTransactionV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `consistencyStrategy` + ConsistencyStrategy.validateJsonObject(jsonObj.getAsJsonObject("consistencyStrategy")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionV1Request + * @throws IOException if the JSON string is invalid with respect to RunTransactionV1Request + */ + public static RunTransactionV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionV1Request.class); + } + + /** + * Convert an instance of RunTransactionV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java new file mode 100644 index 0000000000..a342eddeed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionV1Response() { + } + + public RunTransactionV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionV1Response runTransactionV1Response = (RunTransactionV1Response) o; + return Objects.equals(this.transactionReceipt, runTransactionV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionV1Response is not found in the empty JSON string", RunTransactionV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionV1Response + * @throws IOException if the JSON string is invalid with respect to RunTransactionV1Response + */ + public static RunTransactionV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionV1Response.class); + } + + /** + * Convert an instance of RunTransactionV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 0000000000..7b47452a23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,502 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = new HashMap<>(); + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 0000000000..0d629e2f88 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,314 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 0000000000..a217bbaabb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = new HashMap<>(); + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 0000000000..fa2678daba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 0000000000..7ee4c5804d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 0000000000..fec704f3fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 0000000000..331f9e11c1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 0000000000..22b6e9a878 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 0000000000..6dfb13b733 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 0000000000..6e8ed4dce7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java new file mode 100644 index 0000000000..ca3a982b07 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.openapitools.client.model.XdaiTransactionConfigTo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * XdaiTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class XdaiTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private XdaiTransactionConfigFrom from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private XdaiTransactionConfigTo to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private XdaiTransactionConfigTo data; + + public XdaiTransactionConfig() { + } + + public XdaiTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public XdaiTransactionConfig from(XdaiTransactionConfigFrom from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getFrom() { + return from; + } + + + public void setFrom(XdaiTransactionConfigFrom from) { + this.from = from; + } + + + public XdaiTransactionConfig to(XdaiTransactionConfigTo to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigTo getTo() { + return to; + } + + + public void setTo(XdaiTransactionConfigTo to) { + this.to = to; + } + + + public XdaiTransactionConfig value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public XdaiTransactionConfig gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public XdaiTransactionConfig gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public XdaiTransactionConfig nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public XdaiTransactionConfig data(XdaiTransactionConfigTo data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigTo getData() { + return data; + } + + + public void setData(XdaiTransactionConfigTo data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the XdaiTransactionConfig instance itself + */ + public XdaiTransactionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XdaiTransactionConfig xdaiTransactionConfig = (XdaiTransactionConfig) o; + return Objects.equals(this.rawTransaction, xdaiTransactionConfig.rawTransaction) && + Objects.equals(this.from, xdaiTransactionConfig.from) && + Objects.equals(this.to, xdaiTransactionConfig.to) && + Objects.equals(this.value, xdaiTransactionConfig.value) && + Objects.equals(this.gas, xdaiTransactionConfig.gas) && + Objects.equals(this.gasPrice, xdaiTransactionConfig.gasPrice) && + Objects.equals(this.nonce, xdaiTransactionConfig.nonce) && + Objects.equals(this.data, xdaiTransactionConfig.data)&& + Objects.equals(this.additionalProperties, xdaiTransactionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, gas, gasPrice, nonce, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XdaiTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XdaiTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!XdaiTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in XdaiTransactionConfig is not found in the empty JSON string", XdaiTransactionConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("from")); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + XdaiTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("to")); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + XdaiTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XdaiTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XdaiTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(XdaiTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XdaiTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public XdaiTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + XdaiTransactionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of XdaiTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of XdaiTransactionConfig + * @throws IOException if the JSON string is invalid with respect to XdaiTransactionConfig + */ + public static XdaiTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XdaiTransactionConfig.class); + } + + /** + * Convert an instance of XdaiTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java new file mode 100644 index 0000000000..14f4e3c0eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class XdaiTransactionConfigFrom extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(XdaiTransactionConfigFrom.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XdaiTransactionConfigFrom.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XdaiTransactionConfigFrom' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XdaiTransactionConfigFrom value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public XdaiTransactionConfigFrom read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + XdaiTransactionConfigFrom ret = new XdaiTransactionConfigFrom(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for XdaiTransactionConfigFrom: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public XdaiTransactionConfigFrom() { + super("oneOf", Boolean.FALSE); + } + + public XdaiTransactionConfigFrom(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public XdaiTransactionConfigFrom(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return XdaiTransactionConfigFrom.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XdaiTransactionConfigFrom + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for XdaiTransactionConfigFrom with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of XdaiTransactionConfigFrom given an JSON string + * + * @param jsonString JSON string + * @return An instance of XdaiTransactionConfigFrom + * @throws IOException if the JSON string is invalid with respect to XdaiTransactionConfigFrom + */ + public static XdaiTransactionConfigFrom fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XdaiTransactionConfigFrom.class); + } + + /** + * Convert an instance of XdaiTransactionConfigFrom to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java new file mode 100644 index 0000000000..df421c1cb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class XdaiTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(XdaiTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XdaiTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XdaiTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XdaiTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public XdaiTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + XdaiTransactionConfigTo ret = new XdaiTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for XdaiTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public XdaiTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public XdaiTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return XdaiTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XdaiTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for XdaiTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of XdaiTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of XdaiTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to XdaiTransactionConfigTo + */ + public static XdaiTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XdaiTransactionConfigTo.class); + } + + /** + * Convert an instance of XdaiTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..b049d3d278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,112 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.DeployContractJsonObjectV1Request; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionV1Request; +import org.openapitools.client.model.RunTransactionV1Response; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractJsonObjectV1Test() throws ApiException { + DeployContractJsonObjectV1Request deployContractJsonObjectV1Request = null; + DeployContractV1Response response = api.deployContractJsonObjectV1(deployContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractV1Test() throws ApiException { + DeployContractV1Request deployContractV1Request = null; + DeployContractV1Response response = api.deployContractV1(deployContractV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractJsonObjectTest() throws ApiException { + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = null; + InvokeContractV1Response response = api.invokeContractJsonObject(invokeContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a xdai ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a xdai ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionV1Request runTransactionV1Request = null; + RunTransactionV1Response response = api.runTransactionV1(runTransactionV1Request); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java new file mode 100644 index 0000000000..6c44fd6f62 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ReceiptType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsistencyStrategy + */ +public class ConsistencyStrategyTest { + private final ConsistencyStrategy model = new ConsistencyStrategy(); + + /** + * Model tests for ConsistencyStrategy + */ + @Test + public void testConsistencyStrategy() { + // TODO: test ConsistencyStrategy + } + + /** + * Test the property 'receiptType' + */ + @Test + public void receiptTypeTest() { + // TODO: test receiptType + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'blockConfirmations' + */ + @Test + public void blockConfirmationsTest() { + // TODO: test blockConfirmations + } + + /** + * Test the property 'pollIntervalMs' + */ + @Test + public void pollIntervalMsTest() { + // TODO: test pollIntervalMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java new file mode 100644 index 0000000000..3c7d69b8ff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java @@ -0,0 +1,146 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJSON + */ +public class ContractJSONTest { + private final ContractJSON model = new ContractJSON(); + + /** + * Model tests for ContractJSON + */ + @Test + public void testContractJSON() { + // TODO: test ContractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'networks' + */ + @Test + public void networksTest() { + // TODO: test networks + } + + /** + * Test the property 'ast' + */ + @Test + public void astTest() { + // TODO: test ast + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java new file mode 100644 index 0000000000..2f971b035f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java @@ -0,0 +1,93 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJsonObjectV1Request + */ +public class DeployContractJsonObjectV1RequestTest { + private final DeployContractJsonObjectV1Request model = new DeployContractJsonObjectV1Request(); + + /** + * Model tests for DeployContractJsonObjectV1Request + */ + @Test + public void testDeployContractJsonObjectV1Request() { + // TODO: test DeployContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java new file mode 100644 index 0000000000..2fa530b3d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Request + */ +public class DeployContractV1RequestTest { + private final DeployContractV1Request model = new DeployContractV1Request(); + + /** + * Model tests for DeployContractV1Request + */ + @Test + public void testDeployContractV1Request() { + // TODO: test DeployContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java new file mode 100644 index 0000000000..2d511d2455 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Response + */ +public class DeployContractV1ResponseTest { + private final DeployContractV1Response model = new DeployContractV1Response(); + + /** + * Model tests for DeployContractV1Response + */ + @Test + public void testDeployContractV1Response() { + // TODO: test DeployContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java new file mode 100644 index 0000000000..7707c89733 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java @@ -0,0 +1,94 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployRequestBaseV1 + */ +public class DeployRequestBaseV1Test { + private final DeployRequestBaseV1 model = new DeployRequestBaseV1(); + + /** + * Model tests for DeployRequestBaseV1 + */ + @Test + public void testDeployRequestBaseV1() { + // TODO: test DeployRequestBaseV1 + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 0000000000..a2e09b557f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java new file mode 100644 index 0000000000..b8083d846a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java @@ -0,0 +1,135 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractJsonObjectV1Request + */ +public class InvokeContractJsonObjectV1RequestTest { + private final InvokeContractJsonObjectV1Request model = new InvokeContractJsonObjectV1Request(); + + /** + * Model tests for InvokeContractJsonObjectV1Request + */ + @Test + public void testInvokeContractJsonObjectV1Request() { + // TODO: test InvokeContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 0000000000..c53709f968 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 0000000000..59d843b126 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java new file mode 100644 index 0000000000..9d79fd585a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java @@ -0,0 +1,135 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRequestBaseV1 + */ +public class InvokeRequestBaseV1Test { + private final InvokeRequestBaseV1 model = new InvokeRequestBaseV1(); + + /** + * Model tests for InvokeRequestBaseV1 + */ + @Test + public void testInvokeRequestBaseV1() { + // TODO: test InvokeRequestBaseV1 + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java new file mode 100644 index 0000000000..092c86024b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReceiptType + */ +public class ReceiptTypeTest { + /** + * Model tests for ReceiptType + */ + @Test + public void testReceiptType() { + // TODO: test ReceiptType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java new file mode 100644 index 0000000000..32dc330e73 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionV1Request + */ +public class RunTransactionV1RequestTest { + private final RunTransactionV1Request model = new RunTransactionV1Request(); + + /** + * Model tests for RunTransactionV1Request + */ + @Test + public void testRunTransactionV1Request() { + // TODO: test RunTransactionV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'consistencyStrategy' + */ + @Test + public void consistencyStrategyTest() { + // TODO: test consistencyStrategy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java new file mode 100644 index 0000000000..429aa0146d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionV1Response + */ +public class RunTransactionV1ResponseTest { + private final RunTransactionV1Response model = new RunTransactionV1Response(); + + /** + * Model tests for RunTransactionV1Response + */ + @Test + public void testRunTransactionV1Response() { + // TODO: test RunTransactionV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 0000000000..7234d5b4e6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 0000000000..0154136807 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 0000000000..bc8d271047 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 0000000000..f4792c0bd4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 0000000000..0be44933ff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 0000000000..05c665248a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 0000000000..5eaf1d74dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 0000000000..3e671b9906 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 0000000000..5e04f5f4e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 0000000000..76e43da2a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java new file mode 100644 index 0000000000..488f2b13f7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for XdaiTransactionConfigFrom + */ +public class XdaiTransactionConfigFromTest { + private final XdaiTransactionConfigFrom model = new XdaiTransactionConfigFrom(); + + /** + * Model tests for XdaiTransactionConfigFrom + */ + @Test + public void testXdaiTransactionConfigFrom() { + // TODO: test XdaiTransactionConfigFrom + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java new file mode 100644 index 0000000000..55cdbd5751 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.openapitools.client.model.XdaiTransactionConfigTo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for XdaiTransactionConfig + */ +public class XdaiTransactionConfigTest { + private final XdaiTransactionConfig model = new XdaiTransactionConfig(); + + /** + * Model tests for XdaiTransactionConfig + */ + @Test + public void testXdaiTransactionConfig() { + // TODO: test XdaiTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java new file mode 100644 index 0000000000..bbe64d00c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for XdaiTransactionConfigTo + */ +public class XdaiTransactionConfigToTest { + private final XdaiTransactionConfigTo model = new XdaiTransactionConfigTo(); + + /** + * Model tests for XdaiTransactionConfigTo + */ + @Test + public void testXdaiTransactionConfigTo() { + // TODO: test XdaiTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-odap-hermes/package.json b/packages/cactus-plugin-odap-hermes/package.json index 2fced88463..a5fa7550a7 100644 --- a/packages/cactus-plugin-odap-hermes/package.json +++ b/packages/cactus-plugin-odap-hermes/package.json @@ -41,8 +41,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", + "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", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch" diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 0000000000..8813cc0b5f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,39 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +git_push.sh +go.mod +go.sum +model_asset_profile.go +model_client_v1_request.go +model_client_v1_request_client_gateway_configuration.go +model_commit_final_v1_request.go +model_commit_final_v1_response.go +model_commit_preparation_v1_request.go +model_commit_preparation_v1_response.go +model_credential_profile.go +model_history.go +model_lock_evidence_v1_request.go +model_lock_evidence_v1_response.go +model_odap_local_log.go +model_odap_message.go +model_odap_message_action_response.go +model_payload_profile.go +model_recover_success_v1_message.go +model_recover_update_ack_v1_message.go +model_recover_update_v1_message.go +model_recover_v1_message.go +model_rollback_ack_v1_message.go +model_rollback_v1_message.go +model_session_data.go +model_transfer_commence_v1_request.go +model_transfer_commence_v1_response.go +model_transfer_complete_v1_request.go +model_transfer_initialization_v1_request.go +model_transfer_initialization_v1_response.go +response.go +utils.go diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 0000000000..df0352d74b --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,155 @@ +# Go API client for cactus-plugin-odap-hermes + +Implementation for Odap and Hermes + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-odap-hermes "github.com/hyperledger/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**ClientRequestV1**](docs/DefaultApi.md#clientrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest | +*DefaultApi* | [**Phase1TransferInitiationRequestV1**](docs/DefaultApi.md#phase1transferinitiationrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest | +*DefaultApi* | [**Phase1TransferInitiationResponseV1**](docs/DefaultApi.md#phase1transferinitiationresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse | +*DefaultApi* | [**Phase2LockEvidenceRequestV1**](docs/DefaultApi.md#phase2lockevidencerequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest | +*DefaultApi* | [**Phase2LockEvidenceResponseV1**](docs/DefaultApi.md#phase2lockevidenceresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse | +*DefaultApi* | [**Phase2TransferCommenceRequestV1**](docs/DefaultApi.md#phase2transfercommencerequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest | +*DefaultApi* | [**Phase2TransferCommenceResponseV1**](docs/DefaultApi.md#phase2transfercommenceresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse | +*DefaultApi* | [**Phase3CommitFinalRequestV1**](docs/DefaultApi.md#phase3commitfinalrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest | +*DefaultApi* | [**Phase3CommitFinalResponseV1**](docs/DefaultApi.md#phase3commitfinalresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse | +*DefaultApi* | [**Phase3CommitPreparationRequestV1**](docs/DefaultApi.md#phase3commitpreparationrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest | +*DefaultApi* | [**Phase3CommitPreparationResponseV1**](docs/DefaultApi.md#phase3commitpreparationresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse | +*DefaultApi* | [**Phase3TransferCompleteRequestV1**](docs/DefaultApi.md#phase3transfercompleterequestv1) | **Get** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest | +*DefaultApi* | [**RecoverUpdateAckV1Message**](docs/DefaultApi.md#recoverupdateackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage | +*DefaultApi* | [**RecoverUpdateV1Message**](docs/DefaultApi.md#recoverupdatev1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage | +*DefaultApi* | [**RecoverV1Message**](docs/DefaultApi.md#recoverv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage | +*DefaultApi* | [**RecoverV1Success**](docs/DefaultApi.md#recoverv1success) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage | +*DefaultApi* | [**RollbackAckV1Message**](docs/DefaultApi.md#rollbackackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage | +*DefaultApi* | [**RollbackV1Message**](docs/DefaultApi.md#rollbackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage | + + +## Documentation For Models + + - [AssetProfile](docs/AssetProfile.md) + - [ClientV1Request](docs/ClientV1Request.md) + - [ClientV1RequestClientGatewayConfiguration](docs/ClientV1RequestClientGatewayConfiguration.md) + - [CommitFinalV1Request](docs/CommitFinalV1Request.md) + - [CommitFinalV1Response](docs/CommitFinalV1Response.md) + - [CommitPreparationV1Request](docs/CommitPreparationV1Request.md) + - [CommitPreparationV1Response](docs/CommitPreparationV1Response.md) + - [CredentialProfile](docs/CredentialProfile.md) + - [History](docs/History.md) + - [LockEvidenceV1Request](docs/LockEvidenceV1Request.md) + - [LockEvidenceV1Response](docs/LockEvidenceV1Response.md) + - [OdapLocalLog](docs/OdapLocalLog.md) + - [OdapMessage](docs/OdapMessage.md) + - [OdapMessageActionResponse](docs/OdapMessageActionResponse.md) + - [PayloadProfile](docs/PayloadProfile.md) + - [RecoverSuccessV1Message](docs/RecoverSuccessV1Message.md) + - [RecoverUpdateAckV1Message](docs/RecoverUpdateAckV1Message.md) + - [RecoverUpdateV1Message](docs/RecoverUpdateV1Message.md) + - [RecoverV1Message](docs/RecoverV1Message.md) + - [RollbackAckV1Message](docs/RollbackAckV1Message.md) + - [RollbackV1Message](docs/RollbackV1Message.md) + - [SessionData](docs/SessionData.md) + - [TransferCommenceV1Request](docs/TransferCommenceV1Request.md) + - [TransferCommenceV1Response](docs/TransferCommenceV1Response.md) + - [TransferCompleteV1Request](docs/TransferCompleteV1Request.md) + - [TransferInitializationV1Request](docs/TransferInitializationV1Request.md) + - [TransferInitializationV1Response](docs/TransferInitializationV1Response.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..a38d05ffcb --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1600 @@ +openapi: 3.0.3 +info: + description: Implementation for Odap and Hermes + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Odap Hermes + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest: + post: + description: "" + operationId: phase1TransferInitiationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest: + post: + description: "" + operationId: phase2TransferCommenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest: + post: + description: "" + operationId: phase2LockEvidenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest: + post: + description: "" + operationId: phase3CommitPreparationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest: + post: + description: "" + operationId: phase3CommitFinalRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest: + get: + description: "" + operationId: phase3TransferCompleteRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCompleteV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest: + post: + description: "" + operationId: clientRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientV1Request' + responses: + "200": + content: + application/json: + schema: {} + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse: + post: + description: "" + operationId: phase1TransferInitiationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse: + post: + description: "" + operationId: phase2TransferCommenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse: + post: + description: "" + operationId: phase2LockEvidenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse: + post: + description: "" + operationId: phase3CommitPreparationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse: + post: + description: "" + operationId: phase3CommitFinalResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage: + post: + description: "" + operationId: RecoverV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage: + post: + description: "" + operationId: RecoverUpdateV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage: + post: + description: "" + operationId: RecoverUpdateAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage: + post: + description: "" + operationId: RecoverV1Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuccessV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage: + post: + description: "" + operationId: RollbackV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage: + post: + description: "" + operationId: RollbackAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage +components: + schemas: + CredentialProfile: + enum: + - SAML + - OAUTH + - X509 + type: string + PayloadProfile: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + properties: + assetProfile: + $ref: '#/components/schemas/AssetProfile' + capabilities: + type: string + required: + - assetProfile + type: object + ApplicationProfile: + type: object + Payload: + type: object + AssetProfile: + example: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + properties: + issuer: + type: string + assetCode: + type: string + assetCodeType: + type: string + issuanceDate: + type: string + expirationDate: + type: string + verificationEndPoint: + type: string + digitalSignature: + type: string + prospectusLink: + type: string + keyInformationLink: + items: {} + type: array + keyWord: + items: {} + type: array + transferRestriction: + items: {} + type: array + ledgerRequirements: + items: {} + type: array + required: + - expirationDate + type: object + LoggingProfile: + items: + type: string + type: array + AccessControlProfile: + items: + type: string + type: array + Permissions: + type: object + Transaction: + type: object + ActionCategory: + type: object + History: + example: + Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + properties: + Transactions: + items: + $ref: '#/components/schemas/Transaction' + type: array + Actions: + items: + $ref: '#/components/schemas/ActionCategory' + type: array + Origin: + type: string + Destination: + type: string + Balance: + type: string + CurrentStatus: + type: object + ApplicationSpecificParameters: + type: object + type: object + SenderDltSystem: + type: object + RecipientDltSystem: + type: object + LockEvidenceClaim: + type: object + LockClaimFormat: + type: object + CommitFinalClaim: + type: object + CommitFinalClaimFormat: + type: object + CommitAcknowledgementClaim: + type: object + CommitAcknowledgementClaimFormat: + type: object + SessionData: + properties: + id: + type: string + step: + type: number + version: + type: string + lastSequenceNumber: + type: number + loggingProfile: + type: string + accessControlProfile: + type: string + applicationProfile: + type: string + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + assetProfile: + $ref: '#/components/schemas/AssetProfile' + allowedSourceBackupGateways: + items: + type: string + type: array + allowedRecipientBackupGateways: + items: + type: string + type: array + sourceBasePath: + type: string + recipientBasePath: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + initializationRequestMessageHash: + type: string + initializationResponseMessageHash: + type: string + initializationRequestMessageRcvTimeStamp: + type: string + initializationRequestMessageProcessedTimeStamp: + type: string + clientSignatureInitializationRequestMessage: + type: string + serverSignatureInitializationResponseMessage: + type: string + transferCommenceMessageRequestHash: + type: string + transferCommenceMessageResponseHash: + type: string + clientSignatureTransferCommenceRequestMessage: + type: string + serverSignatureTransferCommenceResponseMessage: + type: string + lockEvidenceRequestMessageHash: + type: string + lockEvidenceResponseMessageHash: + type: string + clientSignatureLockEvidenceRequestMessage: + type: string + serverSignatureLockEvidenceResponseMessage: + type: string + lockEvidenceClaim: + type: string + commitPrepareRequestMessageHash: + type: string + commitPrepareResponseMessageHash: + type: string + clientSignatureCommitPreparationRequestMessage: + type: string + serverSignatureCommitPreparationResponseMessage: + type: string + commitFinalRequestMessageHash: + type: string + commitFinalResponseMessageHash: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: string + clientSignatureCommitFinalRequestMessage: + type: string + serverSignatureCommitFinalResponseMessage: + type: string + transferCompleteMessageHash: + type: string + clientSignatureTransferCompleteMessage: + type: string + maxRetries: + type: number + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + maxTimeout: + type: number + lastLogEntryTimestamp: + type: string + unlockAssetClaim: + type: string + recreateAssetClaim: + type: string + deleteAssetClaim: + type: string + lastMessageReceivedTimestamp: + type: string + rollback: + type: boolean + rollbackMessageHash: + type: string + rollbackProofs: + items: + type: string + type: array + rollbackActionsPerformed: + items: + enum: + - CREATE + - DELETE + - LOCK + - UNLOCK + type: string + type: array + type: object + TransferInitializationV1Request: + example: + recipientLedgerAssetID: recipientLedgerAssetID + subsequentCalls: "{}" + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + signature: signature + credentialProfile: null + origin: origin + destination: destination + recipientGatewayPubkey: recipientGatewayPubkey + sessionID: sessionID + sourceBasePath: sourceBasePath + loggingProfile: loggingProfile + sourceLedgerAssetID: sourceLedgerAssetID + messageType: messageType + permissions: "{}" + multipleClaimsAllowed: true + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + applicationProfile: applicationProfile + sourceGatewayPubkey: sourceGatewayPubkey + recipientGatewayDltSystem: recipientGatewayDltSystem + sequenceNumber: 0 + accessControlProfile: accessControlProfile + developerURN: developerURN + histories: + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + version: version + multipleCancelsAllowed: true + escrowType: FAUCET + maxRetries: 6.027456183070403 + sourceGatewayDltSystem: sourceGatewayDltSystem + recipientBasePath: recipientBasePath + maxTimeout: 1.4658129805029452 + expiryTime: expiryTime + properties: + messageType: + type: string + sessionID: + type: string + version: + type: string + developerURN: + type: string + credentialProfile: + $ref: '#/components/schemas/CredentialProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + applicationProfile: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + signature: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + escrowType: + enum: + - FAUCET + - TIMELOCK + - HASHLOCK + - HASHTIMELOCK + - MULTICLAIMPC + - DESTROY + - BURN + type: string + expiryTime: + type: string + multipleClaimsAllowed: + type: boolean + multipleCancelsAllowed: + type: boolean + permissions: + type: object + origin: + type: string + destination: + type: string + subsequentCalls: + type: object + histories: + items: + $ref: '#/components/schemas/History' + type: array + sequenceNumber: + type: integer + sourceBasePath: + type: string + recipientBasePath: + type: string + maxRetries: + type: number + maxTimeout: + type: number + backupGatewaysAllowed: + items: + type: string + type: array + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - backupGatewaysAllowed + - loggingProfile + - maxRetries + - maxTimeout + - messageType + - payloadProfile + - recipientBasePath + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - sequenceNumber + - sessionID + - signature + - sourceBasePath + - sourceGatewayDltSystem + - sourceGatewayPubkey + - sourceLedgerAssetID + type: object + TransferInitializationV1Response: + example: + timeStamp: timeStamp + sequenceNumber: 0.8008281904610115 + odapPhase: TransferInitialization + initialRequestMessageHash: initialRequestMessageHash + messageType: messageType + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + processedTimeStamp: processedTimeStamp + signature: signature + destination: destination + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + messageType: + type: string + sessionID: + type: string + sequenceNumber: + type: number + odapPhase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + initialRequestMessageHash: + type: string + destination: + type: string + timeStamp: + type: string + processedTimeStamp: + type: string + serverIdentityPubkey: + type: string + signature: + type: string + backupGatewaysAllowed: + items: + type: string + type: array + required: + - backupGatewaysAllowed + - initialRequestMessageHash + - messageType + - processedTimeStamp + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + - timeStamp + type: object + TransferCommenceV1Request: + example: + beneficiaryPubkey: beneficiaryPubkey + sequenceNumber: 1 + hashAssetProfile: hashAssetProfile + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 6 + signature: signature + recipientDltSystem: recipientDltSystem + sessionID: sessionID + hashPrevMessage: hashPrevMessage + serverIdentityPubkey: serverIdentityPubkey + assetUnit: 0 + messageType: messageType + senderDltSystem: senderDltSystem + originatorPubkey: originatorPubkey + properties: + sessionID: + type: string + messageType: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + senderDltSystem: + type: string + recipientDltSystem: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashAssetProfile: + type: string + assetUnit: + type: integer + hashPrevMessage: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: integer + required: + - beneficiaryPubkey + - clientIdentityPubkey + - hashAssetProfile + - hashPrevMessage + - messageType + - originatorPubkey + - recipientDltSystem + - senderDltSystem + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCommenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + messageHash: messageHash + sessionID: sessionID + hashCommenceRequest: hashCommenceRequest + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Request: + example: + sequenceNumber: 6.027456183070403 + lockEvidenceExpiration: lockEvidenceExpiration + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 0 + messageType: messageType + signature: signature + lockEvidenceClaim: lockEvidenceClaim + lockEvidenceFormat: "{}" + hashCommenceAckRequest: hashCommenceAckRequest + messageHash: messageHash + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + lockEvidenceClaim: + type: string + lockEvidenceFormat: + type: object + lockEvidenceExpiration: + type: string + hashCommenceAckRequest: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceAckRequest + - lockEvidenceClaim + - lockEvidenceExpiration + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + hashLockEvidenceRequest: hashLockEvidenceRequest + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + hashLockEvidenceAck: hashLockEvidenceAck + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceAck: + type: string + clientTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Response: + example: + sequenceNumber: 0.8008281904610115 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + hashCommitPrep: hashCommitPrep + signature: signature + serverTransferNumber: serverTransferNumber + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitPrep: + type: string + serverTransferNumber: + type: string + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitPrep + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + clientTransferNumber: 0 + signature: signature + commitFinalClaim: commitFinalClaim + commitFinalClaimFormat: "{}" + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + hashCommitPrepareAck: hashCommitPrepareAck + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: object + hashCommitPrepareAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitFinalClaim + - hashCommitPrepareAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + commitAcknowledgementClaimFormat: "{}" + signature: signature + serverTransferNumber: 0 + commitAcknowledgementClaim: commitAcknowledgementClaim + hashCommitFinal: hashCommitFinal + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: object + hashCommitFinal: + type: string + serverTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitAcknowledgementClaim + - hashCommitFinal + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCompleteV1Request: + example: + sequenceNumber: 6.027456183070403 + hashCommitFinalAck: hashCommitFinalAck + clientIdentityPubkey: clientIdentityPubkey + hashTransferCommence: hashTransferCommence + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitFinalAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + hashTransferCommence: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitFinalAck + - hashTransferCommence + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + ClientV1Request: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + beneficiaryPubkey: beneficiaryPubkey + recipientLedgerAssetID: recipientLedgerAssetID + clientIdentityPubkey: clientIdentityPubkey + serverDltSystem: serverDltSystem + accessControlProfile: accessControlProfile + recipientGatewayPubkey: recipientGatewayPubkey + assetControlProfile: assetControlProfile + version: version + serverIdentityPubkey: serverIdentityPubkey + loggingProfile: loggingProfile + serverGatewayConfiguration: + apiHost: apiHost + sourceLedgerAssetID: sourceLedgerAssetID + clientGatewayConfiguration: + apiHost: apiHost + maxRetries: 0.8008281904610115 + sourceGatewayDltSystem: sourceGatewayDltSystem + maxTimeout: 6.027456183070403 + applicationProfile: applicationProfile + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + originatorPubkey: originatorPubkey + clientDltSystem: clientDltSystem + recipientGatewayDltSystem: recipientGatewayDltSystem + properties: + version: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + assetControlProfile: + type: string + applicationProfile: + type: string + assetProfile: + $ref: '#/components/schemas/AssetProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + sourceGatewayDltSystem: + type: string + recipientGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + clientDltSystem: + type: string + serverDltSystem: + type: string + clientGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + serverGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + maxRetries: + type: number + maxTimeout: + type: number + sourceLedgerAssetID: + type: string + recipientLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - assetControlProfile + - assetProfile + - beneficiaryPubkey + - clientDltSystem + - clientGatewayConfiguration + - clientIdentityPubkey + - loggingProfile + - maxRetries + - maxTimeout + - originatorPubkey + - payloadProfile + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - serverDltSystem + - serverGatewayConfiguration + - serverIdentityPubkey + - sourceGatewayDltSystem + - sourceLedgerAssetID + - version + type: object + RecoverV1Message: + example: + sequenceNumber: 0.8008281904610115 + isBackup: true + odapPhase: odapPhase + signature: signature + sessionID: sessionID + newGatewayPubKey: newGatewayPubKey + newBasePath: newBasePath + lastLogEntryTimestamp: lastLogEntryTimestamp + properties: + sessionID: + type: string + odapPhase: + type: string + sequenceNumber: + type: number + lastLogEntryTimestamp: + type: string + isBackup: + type: boolean + newBasePath: + type: string + newGatewayPubKey: + type: string + signature: + type: string + required: + - isBackup + - lastLogEntryTimestamp + - newBasePath + - odapPhase + - sequenceNumber + - sessionID + - signature + type: object + RecoverUpdateV1Message: + example: + signature: signature + sessionID: sessionID + recoveredLogs: + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + sessionID: + type: string + recoveredLogs: + items: + $ref: '#/components/schemas/OdapLocalLog' + type: array + signature: + type: string + required: + - recoveredLogs + - sessionID + - signature + type: object + RecoverUpdateAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + changedEntriesHash: + - changedEntriesHash + - changedEntriesHash + properties: + sessionID: + type: string + success: + type: boolean + changedEntriesHash: + items: + type: string + type: array + signature: + type: string + required: + - changedEntriesHash + - sessionID + - signature + - success + type: object + RecoverSuccessV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + RollbackV1Message: + example: + actionPerformed: + - actionPerformed + - actionPerformed + signature: signature + success: true + proofs: + - proofs + - proofs + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + actionPerformed: + items: + type: string + type: array + proofs: + items: + type: string + type: array + signature: + type: string + required: + - actionPerformed + - proofs + - sessionID + - signature + - success + type: object + RollbackAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + OdapLocalLog: + example: + data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + key: + type: string + sessionID: + type: string + data: + type: string + type: + type: string + operation: + type: string + timestamp: + type: string + required: + - operation + - sessionID + - type + type: object + OdapMessage: + properties: + SequenceNumber: + type: number + Phase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + ResourceURL: + type: string + DeveloperURN: + type: string + ActionResponse: + $ref: '#/components/schemas/OdapMessage_ActionResponse' + CredentialProfile: + enum: + - SAML + - OAuth + - X509 + type: string + CredentialBlock: + items: {} + type: array + CredentialsProfile: + $ref: '#/components/schemas/PayloadProfile' + ApplicationProfile: + type: object + Payload: + type: object + PayloadHash: + type: string + MessageSignature: + type: string + type: object + ClientV1Request_clientGatewayConfiguration: + example: + apiHost: apiHost + properties: + apiHost: + type: string + required: + - apiHost + type: object + OdapMessage_ActionResponse: + properties: + ResponseCode: + enum: + - "200" + - "404" + type: string + x-enum-varnames: + - OK + - RESOURCE_NOT_FOUND + Arguments: + items: {} + type: array + type: object diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 0000000000..3667cb6177 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1762 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiClientRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + clientV1Request *ClientV1Request +} + +func (r ApiClientRequestV1Request) ClientV1Request(clientV1Request ClientV1Request) ApiClientRequestV1Request { + r.clientV1Request = &clientV1Request + return r +} + +func (r ApiClientRequestV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.ClientRequestV1Execute(r) +} + +/* +ClientRequestV1 Method for ClientRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClientRequestV1Request +*/ +func (a *DefaultApiService) ClientRequestV1(ctx context.Context) ApiClientRequestV1Request { + return ApiClientRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) ClientRequestV1Execute(r ApiClientRequestV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ClientRequestV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clientV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPhase1TransferInitiationRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferInitializationV1Request *TransferInitializationV1Request +} + +func (r ApiPhase1TransferInitiationRequestV1Request) TransferInitializationV1Request(transferInitializationV1Request TransferInitializationV1Request) ApiPhase1TransferInitiationRequestV1Request { + r.transferInitializationV1Request = &transferInitializationV1Request + return r +} + +func (r ApiPhase1TransferInitiationRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase1TransferInitiationRequestV1Execute(r) +} + +/* +Phase1TransferInitiationRequestV1 Method for Phase1TransferInitiationRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase1TransferInitiationRequestV1Request +*/ +func (a *DefaultApiService) Phase1TransferInitiationRequestV1(ctx context.Context) ApiPhase1TransferInitiationRequestV1Request { + return ApiPhase1TransferInitiationRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase1TransferInitiationRequestV1Execute(r ApiPhase1TransferInitiationRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase1TransferInitiationRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferInitializationV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase1TransferInitiationResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferInitializationV1Response *TransferInitializationV1Response +} + +func (r ApiPhase1TransferInitiationResponseV1Request) TransferInitializationV1Response(transferInitializationV1Response TransferInitializationV1Response) ApiPhase1TransferInitiationResponseV1Request { + r.transferInitializationV1Response = &transferInitializationV1Response + return r +} + +func (r ApiPhase1TransferInitiationResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase1TransferInitiationResponseV1Execute(r) +} + +/* +Phase1TransferInitiationResponseV1 Method for Phase1TransferInitiationResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase1TransferInitiationResponseV1Request +*/ +func (a *DefaultApiService) Phase1TransferInitiationResponseV1(ctx context.Context) ApiPhase1TransferInitiationResponseV1Request { + return ApiPhase1TransferInitiationResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase1TransferInitiationResponseV1Execute(r ApiPhase1TransferInitiationResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase1TransferInitiationResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferInitializationV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2LockEvidenceRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + lockEvidenceV1Request *LockEvidenceV1Request +} + +func (r ApiPhase2LockEvidenceRequestV1Request) LockEvidenceV1Request(lockEvidenceV1Request LockEvidenceV1Request) ApiPhase2LockEvidenceRequestV1Request { + r.lockEvidenceV1Request = &lockEvidenceV1Request + return r +} + +func (r ApiPhase2LockEvidenceRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2LockEvidenceRequestV1Execute(r) +} + +/* +Phase2LockEvidenceRequestV1 Method for Phase2LockEvidenceRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2LockEvidenceRequestV1Request +*/ +func (a *DefaultApiService) Phase2LockEvidenceRequestV1(ctx context.Context) ApiPhase2LockEvidenceRequestV1Request { + return ApiPhase2LockEvidenceRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2LockEvidenceRequestV1Execute(r ApiPhase2LockEvidenceRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2LockEvidenceRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lockEvidenceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2LockEvidenceResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + lockEvidenceV1Response *LockEvidenceV1Response +} + +func (r ApiPhase2LockEvidenceResponseV1Request) LockEvidenceV1Response(lockEvidenceV1Response LockEvidenceV1Response) ApiPhase2LockEvidenceResponseV1Request { + r.lockEvidenceV1Response = &lockEvidenceV1Response + return r +} + +func (r ApiPhase2LockEvidenceResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2LockEvidenceResponseV1Execute(r) +} + +/* +Phase2LockEvidenceResponseV1 Method for Phase2LockEvidenceResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2LockEvidenceResponseV1Request +*/ +func (a *DefaultApiService) Phase2LockEvidenceResponseV1(ctx context.Context) ApiPhase2LockEvidenceResponseV1Request { + return ApiPhase2LockEvidenceResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2LockEvidenceResponseV1Execute(r ApiPhase2LockEvidenceResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2LockEvidenceResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lockEvidenceV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2TransferCommenceRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferCommenceV1Request *TransferCommenceV1Request +} + +func (r ApiPhase2TransferCommenceRequestV1Request) TransferCommenceV1Request(transferCommenceV1Request TransferCommenceV1Request) ApiPhase2TransferCommenceRequestV1Request { + r.transferCommenceV1Request = &transferCommenceV1Request + return r +} + +func (r ApiPhase2TransferCommenceRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2TransferCommenceRequestV1Execute(r) +} + +/* +Phase2TransferCommenceRequestV1 Method for Phase2TransferCommenceRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2TransferCommenceRequestV1Request +*/ +func (a *DefaultApiService) Phase2TransferCommenceRequestV1(ctx context.Context) ApiPhase2TransferCommenceRequestV1Request { + return ApiPhase2TransferCommenceRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2TransferCommenceRequestV1Execute(r ApiPhase2TransferCommenceRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2TransferCommenceRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferCommenceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2TransferCommenceResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferCommenceV1Response *TransferCommenceV1Response +} + +func (r ApiPhase2TransferCommenceResponseV1Request) TransferCommenceV1Response(transferCommenceV1Response TransferCommenceV1Response) ApiPhase2TransferCommenceResponseV1Request { + r.transferCommenceV1Response = &transferCommenceV1Response + return r +} + +func (r ApiPhase2TransferCommenceResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2TransferCommenceResponseV1Execute(r) +} + +/* +Phase2TransferCommenceResponseV1 Method for Phase2TransferCommenceResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2TransferCommenceResponseV1Request +*/ +func (a *DefaultApiService) Phase2TransferCommenceResponseV1(ctx context.Context) ApiPhase2TransferCommenceResponseV1Request { + return ApiPhase2TransferCommenceResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2TransferCommenceResponseV1Execute(r ApiPhase2TransferCommenceResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2TransferCommenceResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferCommenceV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitFinalRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitFinalV1Request *CommitFinalV1Request +} + +func (r ApiPhase3CommitFinalRequestV1Request) CommitFinalV1Request(commitFinalV1Request CommitFinalV1Request) ApiPhase3CommitFinalRequestV1Request { + r.commitFinalV1Request = &commitFinalV1Request + return r +} + +func (r ApiPhase3CommitFinalRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitFinalRequestV1Execute(r) +} + +/* +Phase3CommitFinalRequestV1 Method for Phase3CommitFinalRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitFinalRequestV1Request +*/ +func (a *DefaultApiService) Phase3CommitFinalRequestV1(ctx context.Context) ApiPhase3CommitFinalRequestV1Request { + return ApiPhase3CommitFinalRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitFinalRequestV1Execute(r ApiPhase3CommitFinalRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitFinalRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitFinalV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitFinalResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitFinalV1Response *CommitFinalV1Response +} + +func (r ApiPhase3CommitFinalResponseV1Request) CommitFinalV1Response(commitFinalV1Response CommitFinalV1Response) ApiPhase3CommitFinalResponseV1Request { + r.commitFinalV1Response = &commitFinalV1Response + return r +} + +func (r ApiPhase3CommitFinalResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitFinalResponseV1Execute(r) +} + +/* +Phase3CommitFinalResponseV1 Method for Phase3CommitFinalResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitFinalResponseV1Request +*/ +func (a *DefaultApiService) Phase3CommitFinalResponseV1(ctx context.Context) ApiPhase3CommitFinalResponseV1Request { + return ApiPhase3CommitFinalResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitFinalResponseV1Execute(r ApiPhase3CommitFinalResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitFinalResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitFinalV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitPreparationRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitPreparationV1Request *CommitPreparationV1Request +} + +func (r ApiPhase3CommitPreparationRequestV1Request) CommitPreparationV1Request(commitPreparationV1Request CommitPreparationV1Request) ApiPhase3CommitPreparationRequestV1Request { + r.commitPreparationV1Request = &commitPreparationV1Request + return r +} + +func (r ApiPhase3CommitPreparationRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitPreparationRequestV1Execute(r) +} + +/* +Phase3CommitPreparationRequestV1 Method for Phase3CommitPreparationRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitPreparationRequestV1Request +*/ +func (a *DefaultApiService) Phase3CommitPreparationRequestV1(ctx context.Context) ApiPhase3CommitPreparationRequestV1Request { + return ApiPhase3CommitPreparationRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitPreparationRequestV1Execute(r ApiPhase3CommitPreparationRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitPreparationRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitPreparationV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitPreparationResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitPreparationV1Response *CommitPreparationV1Response +} + +func (r ApiPhase3CommitPreparationResponseV1Request) CommitPreparationV1Response(commitPreparationV1Response CommitPreparationV1Response) ApiPhase3CommitPreparationResponseV1Request { + r.commitPreparationV1Response = &commitPreparationV1Response + return r +} + +func (r ApiPhase3CommitPreparationResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitPreparationResponseV1Execute(r) +} + +/* +Phase3CommitPreparationResponseV1 Method for Phase3CommitPreparationResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitPreparationResponseV1Request +*/ +func (a *DefaultApiService) Phase3CommitPreparationResponseV1(ctx context.Context) ApiPhase3CommitPreparationResponseV1Request { + return ApiPhase3CommitPreparationResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitPreparationResponseV1Execute(r ApiPhase3CommitPreparationResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitPreparationResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitPreparationV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3TransferCompleteRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferCompleteV1Request *TransferCompleteV1Request +} + +func (r ApiPhase3TransferCompleteRequestV1Request) TransferCompleteV1Request(transferCompleteV1Request TransferCompleteV1Request) ApiPhase3TransferCompleteRequestV1Request { + r.transferCompleteV1Request = &transferCompleteV1Request + return r +} + +func (r ApiPhase3TransferCompleteRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3TransferCompleteRequestV1Execute(r) +} + +/* +Phase3TransferCompleteRequestV1 Method for Phase3TransferCompleteRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3TransferCompleteRequestV1Request +*/ +func (a *DefaultApiService) Phase3TransferCompleteRequestV1(ctx context.Context) ApiPhase3TransferCompleteRequestV1Request { + return ApiPhase3TransferCompleteRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3TransferCompleteRequestV1Execute(r ApiPhase3TransferCompleteRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3TransferCompleteRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferCompleteV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverUpdateAckV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverUpdateAckV1Message *RecoverUpdateAckV1Message +} + +func (r ApiRecoverUpdateAckV1MessageRequest) RecoverUpdateAckV1Message(recoverUpdateAckV1Message RecoverUpdateAckV1Message) ApiRecoverUpdateAckV1MessageRequest { + r.recoverUpdateAckV1Message = &recoverUpdateAckV1Message + return r +} + +func (r ApiRecoverUpdateAckV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverUpdateAckV1MessageExecute(r) +} + +/* +RecoverUpdateAckV1Message Method for RecoverUpdateAckV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverUpdateAckV1MessageRequest +*/ +func (a *DefaultApiService) RecoverUpdateAckV1Message(ctx context.Context) ApiRecoverUpdateAckV1MessageRequest { + return ApiRecoverUpdateAckV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverUpdateAckV1MessageExecute(r ApiRecoverUpdateAckV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverUpdateAckV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverUpdateAckV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverUpdateV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverUpdateV1Message *RecoverUpdateV1Message +} + +func (r ApiRecoverUpdateV1MessageRequest) RecoverUpdateV1Message(recoverUpdateV1Message RecoverUpdateV1Message) ApiRecoverUpdateV1MessageRequest { + r.recoverUpdateV1Message = &recoverUpdateV1Message + return r +} + +func (r ApiRecoverUpdateV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverUpdateV1MessageExecute(r) +} + +/* +RecoverUpdateV1Message Method for RecoverUpdateV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverUpdateV1MessageRequest +*/ +func (a *DefaultApiService) RecoverUpdateV1Message(ctx context.Context) ApiRecoverUpdateV1MessageRequest { + return ApiRecoverUpdateV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverUpdateV1MessageExecute(r ApiRecoverUpdateV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverUpdateV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverUpdateV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverV1Message *RecoverV1Message +} + +func (r ApiRecoverV1MessageRequest) RecoverV1Message(recoverV1Message RecoverV1Message) ApiRecoverV1MessageRequest { + r.recoverV1Message = &recoverV1Message + return r +} + +func (r ApiRecoverV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverV1MessageExecute(r) +} + +/* +RecoverV1Message Method for RecoverV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverV1MessageRequest +*/ +func (a *DefaultApiService) RecoverV1Message(ctx context.Context) ApiRecoverV1MessageRequest { + return ApiRecoverV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverV1MessageExecute(r ApiRecoverV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverV1SuccessRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverSuccessV1Message *RecoverSuccessV1Message +} + +func (r ApiRecoverV1SuccessRequest) RecoverSuccessV1Message(recoverSuccessV1Message RecoverSuccessV1Message) ApiRecoverV1SuccessRequest { + r.recoverSuccessV1Message = &recoverSuccessV1Message + return r +} + +func (r ApiRecoverV1SuccessRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverV1SuccessExecute(r) +} + +/* +RecoverV1Success Method for RecoverV1Success + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverV1SuccessRequest +*/ +func (a *DefaultApiService) RecoverV1Success(ctx context.Context) ApiRecoverV1SuccessRequest { + return ApiRecoverV1SuccessRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverV1SuccessExecute(r ApiRecoverV1SuccessRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverV1Success") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverSuccessV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRollbackAckV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + rollbackAckV1Message *RollbackAckV1Message +} + +func (r ApiRollbackAckV1MessageRequest) RollbackAckV1Message(rollbackAckV1Message RollbackAckV1Message) ApiRollbackAckV1MessageRequest { + r.rollbackAckV1Message = &rollbackAckV1Message + return r +} + +func (r ApiRollbackAckV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RollbackAckV1MessageExecute(r) +} + +/* +RollbackAckV1Message Method for RollbackAckV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRollbackAckV1MessageRequest +*/ +func (a *DefaultApiService) RollbackAckV1Message(ctx context.Context) ApiRollbackAckV1MessageRequest { + return ApiRollbackAckV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RollbackAckV1MessageExecute(r ApiRollbackAckV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RollbackAckV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rollbackAckV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRollbackV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + rollbackV1Message *RollbackV1Message +} + +func (r ApiRollbackV1MessageRequest) RollbackV1Message(rollbackV1Message RollbackV1Message) ApiRollbackV1MessageRequest { + r.rollbackV1Message = &rollbackV1Message + return r +} + +func (r ApiRollbackV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RollbackV1MessageExecute(r) +} + +/* +RollbackV1Message Method for RollbackV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRollbackV1MessageRequest +*/ +func (a *DefaultApiService) RollbackV1Message(ctx context.Context) ApiRollbackV1MessageRequest { + return ApiRollbackV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RollbackV1MessageExecute(r ApiRollbackV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RollbackV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rollbackV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..8e1c966952 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Odap Hermes API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..59a3e94a0a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..d75832f646 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 0000000000..9079b11f62 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 0000000000..c966c8ddfd --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go new file mode 100644 index 0000000000..20dfc53bd8 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go @@ -0,0 +1,513 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the AssetProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AssetProfile{} + +// AssetProfile struct for AssetProfile +type AssetProfile struct { + Issuer *string `json:"issuer,omitempty"` + AssetCode *string `json:"assetCode,omitempty"` + AssetCodeType *string `json:"assetCodeType,omitempty"` + IssuanceDate *string `json:"issuanceDate,omitempty"` + ExpirationDate string `json:"expirationDate"` + VerificationEndPoint *string `json:"verificationEndPoint,omitempty"` + DigitalSignature *string `json:"digitalSignature,omitempty"` + ProspectusLink *string `json:"prospectusLink,omitempty"` + KeyInformationLink []interface{} `json:"keyInformationLink,omitempty"` + KeyWord []interface{} `json:"keyWord,omitempty"` + TransferRestriction []interface{} `json:"transferRestriction,omitempty"` + LedgerRequirements []interface{} `json:"ledgerRequirements,omitempty"` +} + +// NewAssetProfile instantiates a new AssetProfile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAssetProfile(expirationDate string) *AssetProfile { + this := AssetProfile{} + this.ExpirationDate = expirationDate + return &this +} + +// NewAssetProfileWithDefaults instantiates a new AssetProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAssetProfileWithDefaults() *AssetProfile { + this := AssetProfile{} + return &this +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *AssetProfile) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *AssetProfile) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *AssetProfile) SetIssuer(v string) { + o.Issuer = &v +} + +// GetAssetCode returns the AssetCode field value if set, zero value otherwise. +func (o *AssetProfile) GetAssetCode() string { + if o == nil || IsNil(o.AssetCode) { + var ret string + return ret + } + return *o.AssetCode +} + +// GetAssetCodeOk returns a tuple with the AssetCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetAssetCodeOk() (*string, bool) { + if o == nil || IsNil(o.AssetCode) { + return nil, false + } + return o.AssetCode, true +} + +// HasAssetCode returns a boolean if a field has been set. +func (o *AssetProfile) HasAssetCode() bool { + if o != nil && !IsNil(o.AssetCode) { + return true + } + + return false +} + +// SetAssetCode gets a reference to the given string and assigns it to the AssetCode field. +func (o *AssetProfile) SetAssetCode(v string) { + o.AssetCode = &v +} + +// GetAssetCodeType returns the AssetCodeType field value if set, zero value otherwise. +func (o *AssetProfile) GetAssetCodeType() string { + if o == nil || IsNil(o.AssetCodeType) { + var ret string + return ret + } + return *o.AssetCodeType +} + +// GetAssetCodeTypeOk returns a tuple with the AssetCodeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetAssetCodeTypeOk() (*string, bool) { + if o == nil || IsNil(o.AssetCodeType) { + return nil, false + } + return o.AssetCodeType, true +} + +// HasAssetCodeType returns a boolean if a field has been set. +func (o *AssetProfile) HasAssetCodeType() bool { + if o != nil && !IsNil(o.AssetCodeType) { + return true + } + + return false +} + +// SetAssetCodeType gets a reference to the given string and assigns it to the AssetCodeType field. +func (o *AssetProfile) SetAssetCodeType(v string) { + o.AssetCodeType = &v +} + +// GetIssuanceDate returns the IssuanceDate field value if set, zero value otherwise. +func (o *AssetProfile) GetIssuanceDate() string { + if o == nil || IsNil(o.IssuanceDate) { + var ret string + return ret + } + return *o.IssuanceDate +} + +// GetIssuanceDateOk returns a tuple with the IssuanceDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetIssuanceDateOk() (*string, bool) { + if o == nil || IsNil(o.IssuanceDate) { + return nil, false + } + return o.IssuanceDate, true +} + +// HasIssuanceDate returns a boolean if a field has been set. +func (o *AssetProfile) HasIssuanceDate() bool { + if o != nil && !IsNil(o.IssuanceDate) { + return true + } + + return false +} + +// SetIssuanceDate gets a reference to the given string and assigns it to the IssuanceDate field. +func (o *AssetProfile) SetIssuanceDate(v string) { + o.IssuanceDate = &v +} + +// GetExpirationDate returns the ExpirationDate field value +func (o *AssetProfile) GetExpirationDate() string { + if o == nil { + var ret string + return ret + } + + return o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetExpirationDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpirationDate, true +} + +// SetExpirationDate sets field value +func (o *AssetProfile) SetExpirationDate(v string) { + o.ExpirationDate = v +} + +// GetVerificationEndPoint returns the VerificationEndPoint field value if set, zero value otherwise. +func (o *AssetProfile) GetVerificationEndPoint() string { + if o == nil || IsNil(o.VerificationEndPoint) { + var ret string + return ret + } + return *o.VerificationEndPoint +} + +// GetVerificationEndPointOk returns a tuple with the VerificationEndPoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetVerificationEndPointOk() (*string, bool) { + if o == nil || IsNil(o.VerificationEndPoint) { + return nil, false + } + return o.VerificationEndPoint, true +} + +// HasVerificationEndPoint returns a boolean if a field has been set. +func (o *AssetProfile) HasVerificationEndPoint() bool { + if o != nil && !IsNil(o.VerificationEndPoint) { + return true + } + + return false +} + +// SetVerificationEndPoint gets a reference to the given string and assigns it to the VerificationEndPoint field. +func (o *AssetProfile) SetVerificationEndPoint(v string) { + o.VerificationEndPoint = &v +} + +// GetDigitalSignature returns the DigitalSignature field value if set, zero value otherwise. +func (o *AssetProfile) GetDigitalSignature() string { + if o == nil || IsNil(o.DigitalSignature) { + var ret string + return ret + } + return *o.DigitalSignature +} + +// GetDigitalSignatureOk returns a tuple with the DigitalSignature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetDigitalSignatureOk() (*string, bool) { + if o == nil || IsNil(o.DigitalSignature) { + return nil, false + } + return o.DigitalSignature, true +} + +// HasDigitalSignature returns a boolean if a field has been set. +func (o *AssetProfile) HasDigitalSignature() bool { + if o != nil && !IsNil(o.DigitalSignature) { + return true + } + + return false +} + +// SetDigitalSignature gets a reference to the given string and assigns it to the DigitalSignature field. +func (o *AssetProfile) SetDigitalSignature(v string) { + o.DigitalSignature = &v +} + +// GetProspectusLink returns the ProspectusLink field value if set, zero value otherwise. +func (o *AssetProfile) GetProspectusLink() string { + if o == nil || IsNil(o.ProspectusLink) { + var ret string + return ret + } + return *o.ProspectusLink +} + +// GetProspectusLinkOk returns a tuple with the ProspectusLink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetProspectusLinkOk() (*string, bool) { + if o == nil || IsNil(o.ProspectusLink) { + return nil, false + } + return o.ProspectusLink, true +} + +// HasProspectusLink returns a boolean if a field has been set. +func (o *AssetProfile) HasProspectusLink() bool { + if o != nil && !IsNil(o.ProspectusLink) { + return true + } + + return false +} + +// SetProspectusLink gets a reference to the given string and assigns it to the ProspectusLink field. +func (o *AssetProfile) SetProspectusLink(v string) { + o.ProspectusLink = &v +} + +// GetKeyInformationLink returns the KeyInformationLink field value if set, zero value otherwise. +func (o *AssetProfile) GetKeyInformationLink() []interface{} { + if o == nil || IsNil(o.KeyInformationLink) { + var ret []interface{} + return ret + } + return o.KeyInformationLink +} + +// GetKeyInformationLinkOk returns a tuple with the KeyInformationLink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetKeyInformationLinkOk() ([]interface{}, bool) { + if o == nil || IsNil(o.KeyInformationLink) { + return nil, false + } + return o.KeyInformationLink, true +} + +// HasKeyInformationLink returns a boolean if a field has been set. +func (o *AssetProfile) HasKeyInformationLink() bool { + if o != nil && !IsNil(o.KeyInformationLink) { + return true + } + + return false +} + +// SetKeyInformationLink gets a reference to the given []interface{} and assigns it to the KeyInformationLink field. +func (o *AssetProfile) SetKeyInformationLink(v []interface{}) { + o.KeyInformationLink = v +} + +// GetKeyWord returns the KeyWord field value if set, zero value otherwise. +func (o *AssetProfile) GetKeyWord() []interface{} { + if o == nil || IsNil(o.KeyWord) { + var ret []interface{} + return ret + } + return o.KeyWord +} + +// GetKeyWordOk returns a tuple with the KeyWord field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetKeyWordOk() ([]interface{}, bool) { + if o == nil || IsNil(o.KeyWord) { + return nil, false + } + return o.KeyWord, true +} + +// HasKeyWord returns a boolean if a field has been set. +func (o *AssetProfile) HasKeyWord() bool { + if o != nil && !IsNil(o.KeyWord) { + return true + } + + return false +} + +// SetKeyWord gets a reference to the given []interface{} and assigns it to the KeyWord field. +func (o *AssetProfile) SetKeyWord(v []interface{}) { + o.KeyWord = v +} + +// GetTransferRestriction returns the TransferRestriction field value if set, zero value otherwise. +func (o *AssetProfile) GetTransferRestriction() []interface{} { + if o == nil || IsNil(o.TransferRestriction) { + var ret []interface{} + return ret + } + return o.TransferRestriction +} + +// GetTransferRestrictionOk returns a tuple with the TransferRestriction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetTransferRestrictionOk() ([]interface{}, bool) { + if o == nil || IsNil(o.TransferRestriction) { + return nil, false + } + return o.TransferRestriction, true +} + +// HasTransferRestriction returns a boolean if a field has been set. +func (o *AssetProfile) HasTransferRestriction() bool { + if o != nil && !IsNil(o.TransferRestriction) { + return true + } + + return false +} + +// SetTransferRestriction gets a reference to the given []interface{} and assigns it to the TransferRestriction field. +func (o *AssetProfile) SetTransferRestriction(v []interface{}) { + o.TransferRestriction = v +} + +// GetLedgerRequirements returns the LedgerRequirements field value if set, zero value otherwise. +func (o *AssetProfile) GetLedgerRequirements() []interface{} { + if o == nil || IsNil(o.LedgerRequirements) { + var ret []interface{} + return ret + } + return o.LedgerRequirements +} + +// GetLedgerRequirementsOk returns a tuple with the LedgerRequirements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetLedgerRequirementsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.LedgerRequirements) { + return nil, false + } + return o.LedgerRequirements, true +} + +// HasLedgerRequirements returns a boolean if a field has been set. +func (o *AssetProfile) HasLedgerRequirements() bool { + if o != nil && !IsNil(o.LedgerRequirements) { + return true + } + + return false +} + +// SetLedgerRequirements gets a reference to the given []interface{} and assigns it to the LedgerRequirements field. +func (o *AssetProfile) SetLedgerRequirements(v []interface{}) { + o.LedgerRequirements = v +} + +func (o AssetProfile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AssetProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !IsNil(o.AssetCode) { + toSerialize["assetCode"] = o.AssetCode + } + if !IsNil(o.AssetCodeType) { + toSerialize["assetCodeType"] = o.AssetCodeType + } + if !IsNil(o.IssuanceDate) { + toSerialize["issuanceDate"] = o.IssuanceDate + } + toSerialize["expirationDate"] = o.ExpirationDate + if !IsNil(o.VerificationEndPoint) { + toSerialize["verificationEndPoint"] = o.VerificationEndPoint + } + if !IsNil(o.DigitalSignature) { + toSerialize["digitalSignature"] = o.DigitalSignature + } + if !IsNil(o.ProspectusLink) { + toSerialize["prospectusLink"] = o.ProspectusLink + } + if !IsNil(o.KeyInformationLink) { + toSerialize["keyInformationLink"] = o.KeyInformationLink + } + if !IsNil(o.KeyWord) { + toSerialize["keyWord"] = o.KeyWord + } + if !IsNil(o.TransferRestriction) { + toSerialize["transferRestriction"] = o.TransferRestriction + } + if !IsNil(o.LedgerRequirements) { + toSerialize["ledgerRequirements"] = o.LedgerRequirements + } + return toSerialize, nil +} + +type NullableAssetProfile struct { + value *AssetProfile + isSet bool +} + +func (v NullableAssetProfile) Get() *AssetProfile { + return v.value +} + +func (v *NullableAssetProfile) Set(val *AssetProfile) { + v.value = val + v.isSet = true +} + +func (v NullableAssetProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableAssetProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAssetProfile(val *AssetProfile) *NullableAssetProfile { + return &NullableAssetProfile{value: val, isSet: true} +} + +func (v NullableAssetProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAssetProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go new file mode 100644 index 0000000000..b16a18eadb --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go @@ -0,0 +1,684 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the ClientV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientV1Request{} + +// ClientV1Request struct for ClientV1Request +type ClientV1Request struct { + Version string `json:"version"` + LoggingProfile string `json:"loggingProfile"` + AccessControlProfile string `json:"accessControlProfile"` + AssetControlProfile string `json:"assetControlProfile"` + ApplicationProfile string `json:"applicationProfile"` + AssetProfile AssetProfile `json:"assetProfile"` + PayloadProfile PayloadProfile `json:"payloadProfile"` + SourceGatewayDltSystem string `json:"sourceGatewayDltSystem"` + RecipientGatewayDltSystem string `json:"recipientGatewayDltSystem"` + RecipientGatewayPubkey string `json:"recipientGatewayPubkey"` + OriginatorPubkey string `json:"originatorPubkey"` + BeneficiaryPubkey string `json:"beneficiaryPubkey"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + ClientDltSystem string `json:"clientDltSystem"` + ServerDltSystem string `json:"serverDltSystem"` + ClientGatewayConfiguration ClientV1RequestClientGatewayConfiguration `json:"clientGatewayConfiguration"` + ServerGatewayConfiguration ClientV1RequestClientGatewayConfiguration `json:"serverGatewayConfiguration"` + MaxRetries float32 `json:"maxRetries"` + MaxTimeout float32 `json:"maxTimeout"` + SourceLedgerAssetID string `json:"sourceLedgerAssetID"` + RecipientLedgerAssetID string `json:"recipientLedgerAssetID"` +} + +// NewClientV1Request instantiates a new ClientV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClientV1Request(version string, loggingProfile string, accessControlProfile string, assetControlProfile string, applicationProfile string, assetProfile AssetProfile, payloadProfile PayloadProfile, sourceGatewayDltSystem string, recipientGatewayDltSystem string, recipientGatewayPubkey string, originatorPubkey string, beneficiaryPubkey string, clientIdentityPubkey string, serverIdentityPubkey string, clientDltSystem string, serverDltSystem string, clientGatewayConfiguration ClientV1RequestClientGatewayConfiguration, serverGatewayConfiguration ClientV1RequestClientGatewayConfiguration, maxRetries float32, maxTimeout float32, sourceLedgerAssetID string, recipientLedgerAssetID string) *ClientV1Request { + this := ClientV1Request{} + this.Version = version + this.LoggingProfile = loggingProfile + this.AccessControlProfile = accessControlProfile + this.AssetControlProfile = assetControlProfile + this.ApplicationProfile = applicationProfile + this.AssetProfile = assetProfile + this.PayloadProfile = payloadProfile + this.SourceGatewayDltSystem = sourceGatewayDltSystem + this.RecipientGatewayDltSystem = recipientGatewayDltSystem + this.RecipientGatewayPubkey = recipientGatewayPubkey + this.OriginatorPubkey = originatorPubkey + this.BeneficiaryPubkey = beneficiaryPubkey + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.ClientDltSystem = clientDltSystem + this.ServerDltSystem = serverDltSystem + this.ClientGatewayConfiguration = clientGatewayConfiguration + this.ServerGatewayConfiguration = serverGatewayConfiguration + this.MaxRetries = maxRetries + this.MaxTimeout = maxTimeout + this.SourceLedgerAssetID = sourceLedgerAssetID + this.RecipientLedgerAssetID = recipientLedgerAssetID + return &this +} + +// NewClientV1RequestWithDefaults instantiates a new ClientV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientV1RequestWithDefaults() *ClientV1Request { + this := ClientV1Request{} + return &this +} + +// GetVersion returns the Version field value +func (o *ClientV1Request) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ClientV1Request) SetVersion(v string) { + o.Version = v +} + +// GetLoggingProfile returns the LoggingProfile field value +func (o *ClientV1Request) GetLoggingProfile() string { + if o == nil { + var ret string + return ret + } + + return o.LoggingProfile +} + +// GetLoggingProfileOk returns a tuple with the LoggingProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetLoggingProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LoggingProfile, true +} + +// SetLoggingProfile sets field value +func (o *ClientV1Request) SetLoggingProfile(v string) { + o.LoggingProfile = v +} + +// GetAccessControlProfile returns the AccessControlProfile field value +func (o *ClientV1Request) GetAccessControlProfile() string { + if o == nil { + var ret string + return ret + } + + return o.AccessControlProfile +} + +// GetAccessControlProfileOk returns a tuple with the AccessControlProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetAccessControlProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessControlProfile, true +} + +// SetAccessControlProfile sets field value +func (o *ClientV1Request) SetAccessControlProfile(v string) { + o.AccessControlProfile = v +} + +// GetAssetControlProfile returns the AssetControlProfile field value +func (o *ClientV1Request) GetAssetControlProfile() string { + if o == nil { + var ret string + return ret + } + + return o.AssetControlProfile +} + +// GetAssetControlProfileOk returns a tuple with the AssetControlProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetAssetControlProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetControlProfile, true +} + +// SetAssetControlProfile sets field value +func (o *ClientV1Request) SetAssetControlProfile(v string) { + o.AssetControlProfile = v +} + +// GetApplicationProfile returns the ApplicationProfile field value +func (o *ClientV1Request) GetApplicationProfile() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetApplicationProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationProfile, true +} + +// SetApplicationProfile sets field value +func (o *ClientV1Request) SetApplicationProfile(v string) { + o.ApplicationProfile = v +} + +// GetAssetProfile returns the AssetProfile field value +func (o *ClientV1Request) GetAssetProfile() AssetProfile { + if o == nil { + var ret AssetProfile + return ret + } + + return o.AssetProfile +} + +// GetAssetProfileOk returns a tuple with the AssetProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetAssetProfileOk() (*AssetProfile, bool) { + if o == nil { + return nil, false + } + return &o.AssetProfile, true +} + +// SetAssetProfile sets field value +func (o *ClientV1Request) SetAssetProfile(v AssetProfile) { + o.AssetProfile = v +} + +// GetPayloadProfile returns the PayloadProfile field value +func (o *ClientV1Request) GetPayloadProfile() PayloadProfile { + if o == nil { + var ret PayloadProfile + return ret + } + + return o.PayloadProfile +} + +// GetPayloadProfileOk returns a tuple with the PayloadProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetPayloadProfileOk() (*PayloadProfile, bool) { + if o == nil { + return nil, false + } + return &o.PayloadProfile, true +} + +// SetPayloadProfile sets field value +func (o *ClientV1Request) SetPayloadProfile(v PayloadProfile) { + o.PayloadProfile = v +} + +// GetSourceGatewayDltSystem returns the SourceGatewayDltSystem field value +func (o *ClientV1Request) GetSourceGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.SourceGatewayDltSystem +} + +// GetSourceGatewayDltSystemOk returns a tuple with the SourceGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetSourceGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceGatewayDltSystem, true +} + +// SetSourceGatewayDltSystem sets field value +func (o *ClientV1Request) SetSourceGatewayDltSystem(v string) { + o.SourceGatewayDltSystem = v +} + +// GetRecipientGatewayDltSystem returns the RecipientGatewayDltSystem field value +func (o *ClientV1Request) GetRecipientGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayDltSystem +} + +// GetRecipientGatewayDltSystemOk returns a tuple with the RecipientGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetRecipientGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayDltSystem, true +} + +// SetRecipientGatewayDltSystem sets field value +func (o *ClientV1Request) SetRecipientGatewayDltSystem(v string) { + o.RecipientGatewayDltSystem = v +} + +// GetRecipientGatewayPubkey returns the RecipientGatewayPubkey field value +func (o *ClientV1Request) GetRecipientGatewayPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayPubkey +} + +// GetRecipientGatewayPubkeyOk returns a tuple with the RecipientGatewayPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetRecipientGatewayPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayPubkey, true +} + +// SetRecipientGatewayPubkey sets field value +func (o *ClientV1Request) SetRecipientGatewayPubkey(v string) { + o.RecipientGatewayPubkey = v +} + +// GetOriginatorPubkey returns the OriginatorPubkey field value +func (o *ClientV1Request) GetOriginatorPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.OriginatorPubkey +} + +// GetOriginatorPubkeyOk returns a tuple with the OriginatorPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetOriginatorPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginatorPubkey, true +} + +// SetOriginatorPubkey sets field value +func (o *ClientV1Request) SetOriginatorPubkey(v string) { + o.OriginatorPubkey = v +} + +// GetBeneficiaryPubkey returns the BeneficiaryPubkey field value +func (o *ClientV1Request) GetBeneficiaryPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.BeneficiaryPubkey +} + +// GetBeneficiaryPubkeyOk returns a tuple with the BeneficiaryPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetBeneficiaryPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BeneficiaryPubkey, true +} + +// SetBeneficiaryPubkey sets field value +func (o *ClientV1Request) SetBeneficiaryPubkey(v string) { + o.BeneficiaryPubkey = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *ClientV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *ClientV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *ClientV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *ClientV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetClientDltSystem returns the ClientDltSystem field value +func (o *ClientV1Request) GetClientDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.ClientDltSystem +} + +// GetClientDltSystemOk returns a tuple with the ClientDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetClientDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientDltSystem, true +} + +// SetClientDltSystem sets field value +func (o *ClientV1Request) SetClientDltSystem(v string) { + o.ClientDltSystem = v +} + +// GetServerDltSystem returns the ServerDltSystem field value +func (o *ClientV1Request) GetServerDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.ServerDltSystem +} + +// GetServerDltSystemOk returns a tuple with the ServerDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetServerDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerDltSystem, true +} + +// SetServerDltSystem sets field value +func (o *ClientV1Request) SetServerDltSystem(v string) { + o.ServerDltSystem = v +} + +// GetClientGatewayConfiguration returns the ClientGatewayConfiguration field value +func (o *ClientV1Request) GetClientGatewayConfiguration() ClientV1RequestClientGatewayConfiguration { + if o == nil { + var ret ClientV1RequestClientGatewayConfiguration + return ret + } + + return o.ClientGatewayConfiguration +} + +// GetClientGatewayConfigurationOk returns a tuple with the ClientGatewayConfiguration field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetClientGatewayConfigurationOk() (*ClientV1RequestClientGatewayConfiguration, bool) { + if o == nil { + return nil, false + } + return &o.ClientGatewayConfiguration, true +} + +// SetClientGatewayConfiguration sets field value +func (o *ClientV1Request) SetClientGatewayConfiguration(v ClientV1RequestClientGatewayConfiguration) { + o.ClientGatewayConfiguration = v +} + +// GetServerGatewayConfiguration returns the ServerGatewayConfiguration field value +func (o *ClientV1Request) GetServerGatewayConfiguration() ClientV1RequestClientGatewayConfiguration { + if o == nil { + var ret ClientV1RequestClientGatewayConfiguration + return ret + } + + return o.ServerGatewayConfiguration +} + +// GetServerGatewayConfigurationOk returns a tuple with the ServerGatewayConfiguration field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetServerGatewayConfigurationOk() (*ClientV1RequestClientGatewayConfiguration, bool) { + if o == nil { + return nil, false + } + return &o.ServerGatewayConfiguration, true +} + +// SetServerGatewayConfiguration sets field value +func (o *ClientV1Request) SetServerGatewayConfiguration(v ClientV1RequestClientGatewayConfiguration) { + o.ServerGatewayConfiguration = v +} + +// GetMaxRetries returns the MaxRetries field value +func (o *ClientV1Request) GetMaxRetries() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxRetries +} + +// GetMaxRetriesOk returns a tuple with the MaxRetries field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetMaxRetriesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxRetries, true +} + +// SetMaxRetries sets field value +func (o *ClientV1Request) SetMaxRetries(v float32) { + o.MaxRetries = v +} + +// GetMaxTimeout returns the MaxTimeout field value +func (o *ClientV1Request) GetMaxTimeout() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxTimeout +} + +// GetMaxTimeoutOk returns a tuple with the MaxTimeout field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetMaxTimeoutOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxTimeout, true +} + +// SetMaxTimeout sets field value +func (o *ClientV1Request) SetMaxTimeout(v float32) { + o.MaxTimeout = v +} + +// GetSourceLedgerAssetID returns the SourceLedgerAssetID field value +func (o *ClientV1Request) GetSourceLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.SourceLedgerAssetID +} + +// GetSourceLedgerAssetIDOk returns a tuple with the SourceLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetSourceLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceLedgerAssetID, true +} + +// SetSourceLedgerAssetID sets field value +func (o *ClientV1Request) SetSourceLedgerAssetID(v string) { + o.SourceLedgerAssetID = v +} + +// GetRecipientLedgerAssetID returns the RecipientLedgerAssetID field value +func (o *ClientV1Request) GetRecipientLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientLedgerAssetID +} + +// GetRecipientLedgerAssetIDOk returns a tuple with the RecipientLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetRecipientLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientLedgerAssetID, true +} + +// SetRecipientLedgerAssetID sets field value +func (o *ClientV1Request) SetRecipientLedgerAssetID(v string) { + o.RecipientLedgerAssetID = v +} + +func (o ClientV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["version"] = o.Version + toSerialize["loggingProfile"] = o.LoggingProfile + toSerialize["accessControlProfile"] = o.AccessControlProfile + toSerialize["assetControlProfile"] = o.AssetControlProfile + toSerialize["applicationProfile"] = o.ApplicationProfile + toSerialize["assetProfile"] = o.AssetProfile + toSerialize["payloadProfile"] = o.PayloadProfile + toSerialize["sourceGatewayDltSystem"] = o.SourceGatewayDltSystem + toSerialize["recipientGatewayDltSystem"] = o.RecipientGatewayDltSystem + toSerialize["recipientGatewayPubkey"] = o.RecipientGatewayPubkey + toSerialize["originatorPubkey"] = o.OriginatorPubkey + toSerialize["beneficiaryPubkey"] = o.BeneficiaryPubkey + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["clientDltSystem"] = o.ClientDltSystem + toSerialize["serverDltSystem"] = o.ServerDltSystem + toSerialize["clientGatewayConfiguration"] = o.ClientGatewayConfiguration + toSerialize["serverGatewayConfiguration"] = o.ServerGatewayConfiguration + toSerialize["maxRetries"] = o.MaxRetries + toSerialize["maxTimeout"] = o.MaxTimeout + toSerialize["sourceLedgerAssetID"] = o.SourceLedgerAssetID + toSerialize["recipientLedgerAssetID"] = o.RecipientLedgerAssetID + return toSerialize, nil +} + +type NullableClientV1Request struct { + value *ClientV1Request + isSet bool +} + +func (v NullableClientV1Request) Get() *ClientV1Request { + return v.value +} + +func (v *NullableClientV1Request) Set(val *ClientV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableClientV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableClientV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientV1Request(val *ClientV1Request) *NullableClientV1Request { + return &NullableClientV1Request{value: val, isSet: true} +} + +func (v NullableClientV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go new file mode 100644 index 0000000000..1a1e737714 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the ClientV1RequestClientGatewayConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientV1RequestClientGatewayConfiguration{} + +// ClientV1RequestClientGatewayConfiguration struct for ClientV1RequestClientGatewayConfiguration +type ClientV1RequestClientGatewayConfiguration struct { + ApiHost string `json:"apiHost"` +} + +// NewClientV1RequestClientGatewayConfiguration instantiates a new ClientV1RequestClientGatewayConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClientV1RequestClientGatewayConfiguration(apiHost string) *ClientV1RequestClientGatewayConfiguration { + this := ClientV1RequestClientGatewayConfiguration{} + this.ApiHost = apiHost + return &this +} + +// NewClientV1RequestClientGatewayConfigurationWithDefaults instantiates a new ClientV1RequestClientGatewayConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientV1RequestClientGatewayConfigurationWithDefaults() *ClientV1RequestClientGatewayConfiguration { + this := ClientV1RequestClientGatewayConfiguration{} + return &this +} + +// GetApiHost returns the ApiHost field value +func (o *ClientV1RequestClientGatewayConfiguration) GetApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.ApiHost +} + +// GetApiHostOk returns a tuple with the ApiHost field value +// and a boolean to check if the value has been set. +func (o *ClientV1RequestClientGatewayConfiguration) GetApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApiHost, true +} + +// SetApiHost sets field value +func (o *ClientV1RequestClientGatewayConfiguration) SetApiHost(v string) { + o.ApiHost = v +} + +func (o ClientV1RequestClientGatewayConfiguration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientV1RequestClientGatewayConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apiHost"] = o.ApiHost + return toSerialize, nil +} + +type NullableClientV1RequestClientGatewayConfiguration struct { + value *ClientV1RequestClientGatewayConfiguration + isSet bool +} + +func (v NullableClientV1RequestClientGatewayConfiguration) Get() *ClientV1RequestClientGatewayConfiguration { + return v.value +} + +func (v *NullableClientV1RequestClientGatewayConfiguration) Set(val *ClientV1RequestClientGatewayConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableClientV1RequestClientGatewayConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableClientV1RequestClientGatewayConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientV1RequestClientGatewayConfiguration(val *ClientV1RequestClientGatewayConfiguration) *NullableClientV1RequestClientGatewayConfiguration { + return &NullableClientV1RequestClientGatewayConfiguration{value: val, isSet: true} +} + +func (v NullableClientV1RequestClientGatewayConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientV1RequestClientGatewayConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go new file mode 100644 index 0000000000..6c036e8854 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go @@ -0,0 +1,388 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitFinalV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitFinalV1Request{} + +// CommitFinalV1Request struct for CommitFinalV1Request +type CommitFinalV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + CommitFinalClaim string `json:"commitFinalClaim"` + CommitFinalClaimFormat map[string]interface{} `json:"commitFinalClaimFormat,omitempty"` + HashCommitPrepareAck string `json:"hashCommitPrepareAck"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitFinalV1Request instantiates a new CommitFinalV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommitFinalV1Request(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, commitFinalClaim string, hashCommitPrepareAck string, signature string, sequenceNumber float32) *CommitFinalV1Request { + this := CommitFinalV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.CommitFinalClaim = commitFinalClaim + this.HashCommitPrepareAck = hashCommitPrepareAck + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitFinalV1RequestWithDefaults instantiates a new CommitFinalV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitFinalV1RequestWithDefaults() *CommitFinalV1Request { + this := CommitFinalV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitFinalV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitFinalV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitFinalV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitFinalV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitFinalV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitFinalV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitFinalV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitFinalV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetCommitFinalClaim returns the CommitFinalClaim field value +func (o *CommitFinalV1Request) GetCommitFinalClaim() string { + if o == nil { + var ret string + return ret + } + + return o.CommitFinalClaim +} + +// GetCommitFinalClaimOk returns a tuple with the CommitFinalClaim field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetCommitFinalClaimOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitFinalClaim, true +} + +// SetCommitFinalClaim sets field value +func (o *CommitFinalV1Request) SetCommitFinalClaim(v string) { + o.CommitFinalClaim = v +} + +// GetCommitFinalClaimFormat returns the CommitFinalClaimFormat field value if set, zero value otherwise. +func (o *CommitFinalV1Request) GetCommitFinalClaimFormat() map[string]interface{} { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + var ret map[string]interface{} + return ret + } + return o.CommitFinalClaimFormat +} + +// GetCommitFinalClaimFormatOk returns a tuple with the CommitFinalClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetCommitFinalClaimFormatOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + return map[string]interface{}{}, false + } + return o.CommitFinalClaimFormat, true +} + +// HasCommitFinalClaimFormat returns a boolean if a field has been set. +func (o *CommitFinalV1Request) HasCommitFinalClaimFormat() bool { + if o != nil && !IsNil(o.CommitFinalClaimFormat) { + return true + } + + return false +} + +// SetCommitFinalClaimFormat gets a reference to the given map[string]interface{} and assigns it to the CommitFinalClaimFormat field. +func (o *CommitFinalV1Request) SetCommitFinalClaimFormat(v map[string]interface{}) { + o.CommitFinalClaimFormat = v +} + +// GetHashCommitPrepareAck returns the HashCommitPrepareAck field value +func (o *CommitFinalV1Request) GetHashCommitPrepareAck() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitPrepareAck +} + +// GetHashCommitPrepareAckOk returns a tuple with the HashCommitPrepareAck field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetHashCommitPrepareAckOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitPrepareAck, true +} + +// SetHashCommitPrepareAck sets field value +func (o *CommitFinalV1Request) SetHashCommitPrepareAck(v string) { + o.HashCommitPrepareAck = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CommitFinalV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CommitFinalV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *CommitFinalV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *CommitFinalV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *CommitFinalV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *CommitFinalV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *CommitFinalV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitFinalV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitFinalV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitFinalV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitFinalV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitFinalV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["commitFinalClaim"] = o.CommitFinalClaim + if !IsNil(o.CommitFinalClaimFormat) { + toSerialize["commitFinalClaimFormat"] = o.CommitFinalClaimFormat + } + toSerialize["hashCommitPrepareAck"] = o.HashCommitPrepareAck + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitFinalV1Request struct { + value *CommitFinalV1Request + isSet bool +} + +func (v NullableCommitFinalV1Request) Get() *CommitFinalV1Request { + return v.value +} + +func (v *NullableCommitFinalV1Request) Set(val *CommitFinalV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableCommitFinalV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitFinalV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitFinalV1Request(val *CommitFinalV1Request) *NullableCommitFinalV1Request { + return &NullableCommitFinalV1Request{value: val, isSet: true} +} + +func (v NullableCommitFinalV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitFinalV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go new file mode 100644 index 0000000000..1a4a77487f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go @@ -0,0 +1,378 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitFinalV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitFinalV1Response{} + +// CommitFinalV1Response struct for CommitFinalV1Response +type CommitFinalV1Response struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + CommitAcknowledgementClaim string `json:"commitAcknowledgementClaim"` + CommitAcknowledgementClaimFormat map[string]interface{} `json:"commitAcknowledgementClaimFormat,omitempty"` + HashCommitFinal string `json:"hashCommitFinal"` + ServerTransferNumber *int32 `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitFinalV1Response instantiates a new CommitFinalV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommitFinalV1Response(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, commitAcknowledgementClaim string, hashCommitFinal string, signature string, sequenceNumber float32) *CommitFinalV1Response { + this := CommitFinalV1Response{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.CommitAcknowledgementClaim = commitAcknowledgementClaim + this.HashCommitFinal = hashCommitFinal + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitFinalV1ResponseWithDefaults instantiates a new CommitFinalV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitFinalV1ResponseWithDefaults() *CommitFinalV1Response { + this := CommitFinalV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitFinalV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitFinalV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitFinalV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitFinalV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitFinalV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitFinalV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitFinalV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitFinalV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetCommitAcknowledgementClaim returns the CommitAcknowledgementClaim field value +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaim() string { + if o == nil { + var ret string + return ret + } + + return o.CommitAcknowledgementClaim +} + +// GetCommitAcknowledgementClaimOk returns a tuple with the CommitAcknowledgementClaim field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaimOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitAcknowledgementClaim, true +} + +// SetCommitAcknowledgementClaim sets field value +func (o *CommitFinalV1Response) SetCommitAcknowledgementClaim(v string) { + o.CommitAcknowledgementClaim = v +} + +// GetCommitAcknowledgementClaimFormat returns the CommitAcknowledgementClaimFormat field value if set, zero value otherwise. +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaimFormat() map[string]interface{} { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + var ret map[string]interface{} + return ret + } + return o.CommitAcknowledgementClaimFormat +} + +// GetCommitAcknowledgementClaimFormatOk returns a tuple with the CommitAcknowledgementClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaimFormatOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + return map[string]interface{}{}, false + } + return o.CommitAcknowledgementClaimFormat, true +} + +// HasCommitAcknowledgementClaimFormat returns a boolean if a field has been set. +func (o *CommitFinalV1Response) HasCommitAcknowledgementClaimFormat() bool { + if o != nil && !IsNil(o.CommitAcknowledgementClaimFormat) { + return true + } + + return false +} + +// SetCommitAcknowledgementClaimFormat gets a reference to the given map[string]interface{} and assigns it to the CommitAcknowledgementClaimFormat field. +func (o *CommitFinalV1Response) SetCommitAcknowledgementClaimFormat(v map[string]interface{}) { + o.CommitAcknowledgementClaimFormat = v +} + +// GetHashCommitFinal returns the HashCommitFinal field value +func (o *CommitFinalV1Response) GetHashCommitFinal() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitFinal +} + +// GetHashCommitFinalOk returns a tuple with the HashCommitFinal field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetHashCommitFinalOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitFinal, true +} + +// SetHashCommitFinal sets field value +func (o *CommitFinalV1Response) SetHashCommitFinal(v string) { + o.HashCommitFinal = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise. +func (o *CommitFinalV1Response) GetServerTransferNumber() int32 { + if o == nil || IsNil(o.ServerTransferNumber) { + var ret int32 + return ret + } + return *o.ServerTransferNumber +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetServerTransferNumberOk() (*int32, bool) { + if o == nil || IsNil(o.ServerTransferNumber) { + return nil, false + } + return o.ServerTransferNumber, true +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *CommitFinalV1Response) HasServerTransferNumber() bool { + if o != nil && !IsNil(o.ServerTransferNumber) { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given int32 and assigns it to the ServerTransferNumber field. +func (o *CommitFinalV1Response) SetServerTransferNumber(v int32) { + o.ServerTransferNumber = &v +} + +// GetSignature returns the Signature field value +func (o *CommitFinalV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitFinalV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitFinalV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitFinalV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitFinalV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitFinalV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["commitAcknowledgementClaim"] = o.CommitAcknowledgementClaim + if !IsNil(o.CommitAcknowledgementClaimFormat) { + toSerialize["commitAcknowledgementClaimFormat"] = o.CommitAcknowledgementClaimFormat + } + toSerialize["hashCommitFinal"] = o.HashCommitFinal + if !IsNil(o.ServerTransferNumber) { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitFinalV1Response struct { + value *CommitFinalV1Response + isSet bool +} + +func (v NullableCommitFinalV1Response) Get() *CommitFinalV1Response { + return v.value +} + +func (v *NullableCommitFinalV1Response) Set(val *CommitFinalV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableCommitFinalV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitFinalV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitFinalV1Response(val *CommitFinalV1Response) *NullableCommitFinalV1Response { + return &NullableCommitFinalV1Response{value: val, isSet: true} +} + +func (v NullableCommitFinalV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitFinalV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go new file mode 100644 index 0000000000..ccfbc71a2b --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitPreparationV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitPreparationV1Request{} + +// CommitPreparationV1Request struct for CommitPreparationV1Request +type CommitPreparationV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashLockEvidenceAck string `json:"hashLockEvidenceAck"` + ClientTransferNumber *int32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitPreparationV1Request instantiates a new CommitPreparationV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommitPreparationV1Request(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, hashLockEvidenceAck string, signature string, sequenceNumber float32) *CommitPreparationV1Request { + this := CommitPreparationV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashLockEvidenceAck = hashLockEvidenceAck + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitPreparationV1RequestWithDefaults instantiates a new CommitPreparationV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitPreparationV1RequestWithDefaults() *CommitPreparationV1Request { + this := CommitPreparationV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitPreparationV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitPreparationV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitPreparationV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitPreparationV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitPreparationV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitPreparationV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitPreparationV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitPreparationV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashLockEvidenceAck returns the HashLockEvidenceAck field value +func (o *CommitPreparationV1Request) GetHashLockEvidenceAck() string { + if o == nil { + var ret string + return ret + } + + return o.HashLockEvidenceAck +} + +// GetHashLockEvidenceAckOk returns a tuple with the HashLockEvidenceAck field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetHashLockEvidenceAckOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLockEvidenceAck, true +} + +// SetHashLockEvidenceAck sets field value +func (o *CommitPreparationV1Request) SetHashLockEvidenceAck(v string) { + o.HashLockEvidenceAck = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise. +func (o *CommitPreparationV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber) { + var ret int32 + return ret + } + return *o.ClientTransferNumber +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil || IsNil(o.ClientTransferNumber) { + return nil, false + } + return o.ClientTransferNumber, true +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *CommitPreparationV1Request) HasClientTransferNumber() bool { + if o != nil && !IsNil(o.ClientTransferNumber) { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given int32 and assigns it to the ClientTransferNumber field. +func (o *CommitPreparationV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber = &v +} + +// GetSignature returns the Signature field value +func (o *CommitPreparationV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitPreparationV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitPreparationV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitPreparationV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitPreparationV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitPreparationV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashLockEvidenceAck"] = o.HashLockEvidenceAck + if !IsNil(o.ClientTransferNumber) { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitPreparationV1Request struct { + value *CommitPreparationV1Request + isSet bool +} + +func (v NullableCommitPreparationV1Request) Get() *CommitPreparationV1Request { + return v.value +} + +func (v *NullableCommitPreparationV1Request) Set(val *CommitPreparationV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableCommitPreparationV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitPreparationV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitPreparationV1Request(val *CommitPreparationV1Request) *NullableCommitPreparationV1Request { + return &NullableCommitPreparationV1Request{value: val, isSet: true} +} + +func (v NullableCommitPreparationV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitPreparationV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go new file mode 100644 index 0000000000..d64428d091 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitPreparationV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitPreparationV1Response{} + +// CommitPreparationV1Response struct for CommitPreparationV1Response +type CommitPreparationV1Response struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashCommitPrep string `json:"hashCommitPrep"` + ServerTransferNumber *string `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitPreparationV1Response instantiates a new CommitPreparationV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommitPreparationV1Response(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, hashCommitPrep string, signature string, sequenceNumber float32) *CommitPreparationV1Response { + this := CommitPreparationV1Response{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashCommitPrep = hashCommitPrep + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitPreparationV1ResponseWithDefaults instantiates a new CommitPreparationV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitPreparationV1ResponseWithDefaults() *CommitPreparationV1Response { + this := CommitPreparationV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitPreparationV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitPreparationV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitPreparationV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitPreparationV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitPreparationV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitPreparationV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitPreparationV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitPreparationV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashCommitPrep returns the HashCommitPrep field value +func (o *CommitPreparationV1Response) GetHashCommitPrep() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitPrep +} + +// GetHashCommitPrepOk returns a tuple with the HashCommitPrep field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetHashCommitPrepOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitPrep, true +} + +// SetHashCommitPrep sets field value +func (o *CommitPreparationV1Response) SetHashCommitPrep(v string) { + o.HashCommitPrep = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise. +func (o *CommitPreparationV1Response) GetServerTransferNumber() string { + if o == nil || IsNil(o.ServerTransferNumber) { + var ret string + return ret + } + return *o.ServerTransferNumber +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetServerTransferNumberOk() (*string, bool) { + if o == nil || IsNil(o.ServerTransferNumber) { + return nil, false + } + return o.ServerTransferNumber, true +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *CommitPreparationV1Response) HasServerTransferNumber() bool { + if o != nil && !IsNil(o.ServerTransferNumber) { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given string and assigns it to the ServerTransferNumber field. +func (o *CommitPreparationV1Response) SetServerTransferNumber(v string) { + o.ServerTransferNumber = &v +} + +// GetSignature returns the Signature field value +func (o *CommitPreparationV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitPreparationV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitPreparationV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitPreparationV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitPreparationV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitPreparationV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashCommitPrep"] = o.HashCommitPrep + if !IsNil(o.ServerTransferNumber) { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitPreparationV1Response struct { + value *CommitPreparationV1Response + isSet bool +} + +func (v NullableCommitPreparationV1Response) Get() *CommitPreparationV1Response { + return v.value +} + +func (v *NullableCommitPreparationV1Response) Set(val *CommitPreparationV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableCommitPreparationV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitPreparationV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitPreparationV1Response(val *CommitPreparationV1Response) *NullableCommitPreparationV1Response { + return &NullableCommitPreparationV1Response{value: val, isSet: true} +} + +func (v NullableCommitPreparationV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitPreparationV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go new file mode 100644 index 0000000000..183b47aa2f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" + "fmt" +) + +// CredentialProfile the model 'CredentialProfile' +type CredentialProfile string + +// List of CredentialProfile +const ( + SAML CredentialProfile = "SAML" + OAUTH CredentialProfile = "OAUTH" + X509 CredentialProfile = "X509" +) + +// All allowed values of CredentialProfile enum +var AllowedCredentialProfileEnumValues = []CredentialProfile{ + "SAML", + "OAUTH", + "X509", +} + +func (v *CredentialProfile) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CredentialProfile(value) + for _, existing := range AllowedCredentialProfileEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CredentialProfile", value) +} + +// NewCredentialProfileFromValue returns a pointer to a valid CredentialProfile +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCredentialProfileFromValue(v string) (*CredentialProfile, error) { + ev := CredentialProfile(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CredentialProfile: valid values are %v", v, AllowedCredentialProfileEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CredentialProfile) IsValid() bool { + for _, existing := range AllowedCredentialProfileEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CredentialProfile value +func (v CredentialProfile) Ptr() *CredentialProfile { + return &v +} + +type NullableCredentialProfile struct { + value *CredentialProfile + isSet bool +} + +func (v NullableCredentialProfile) Get() *CredentialProfile { + return v.value +} + +func (v *NullableCredentialProfile) Set(val *CredentialProfile) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialProfile(val *CredentialProfile) *NullableCredentialProfile { + return &NullableCredentialProfile{value: val, isSet: true} +} + +func (v NullableCredentialProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go new file mode 100644 index 0000000000..e1a9084f89 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go @@ -0,0 +1,342 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the History type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &History{} + +// History struct for History +type History struct { + Transactions []map[string]interface{} `json:"Transactions,omitempty"` + Actions []map[string]interface{} `json:"Actions,omitempty"` + Origin *string `json:"Origin,omitempty"` + Destination *string `json:"Destination,omitempty"` + Balance *string `json:"Balance,omitempty"` + CurrentStatus map[string]interface{} `json:"CurrentStatus,omitempty"` + ApplicationSpecificParameters map[string]interface{} `json:"ApplicationSpecificParameters,omitempty"` +} + +// NewHistory instantiates a new History object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHistory() *History { + this := History{} + return &this +} + +// NewHistoryWithDefaults instantiates a new History object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHistoryWithDefaults() *History { + this := History{} + return &this +} + +// GetTransactions returns the Transactions field value if set, zero value otherwise. +func (o *History) GetTransactions() []map[string]interface{} { + if o == nil || IsNil(o.Transactions) { + var ret []map[string]interface{} + return ret + } + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetTransactionsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Transactions) { + return nil, false + } + return o.Transactions, true +} + +// HasTransactions returns a boolean if a field has been set. +func (o *History) HasTransactions() bool { + if o != nil && !IsNil(o.Transactions) { + return true + } + + return false +} + +// SetTransactions gets a reference to the given []map[string]interface{} and assigns it to the Transactions field. +func (o *History) SetTransactions(v []map[string]interface{}) { + o.Transactions = v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *History) GetActions() []map[string]interface{} { + if o == nil || IsNil(o.Actions) { + var ret []map[string]interface{} + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetActionsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *History) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []map[string]interface{} and assigns it to the Actions field. +func (o *History) SetActions(v []map[string]interface{}) { + o.Actions = v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *History) GetOrigin() string { + if o == nil || IsNil(o.Origin) { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetOriginOk() (*string, bool) { + if o == nil || IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *History) HasOrigin() bool { + if o != nil && !IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *History) SetOrigin(v string) { + o.Origin = &v +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *History) GetDestination() string { + if o == nil || IsNil(o.Destination) { + var ret string + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetDestinationOk() (*string, bool) { + if o == nil || IsNil(o.Destination) { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *History) HasDestination() bool { + if o != nil && !IsNil(o.Destination) { + return true + } + + return false +} + +// SetDestination gets a reference to the given string and assigns it to the Destination field. +func (o *History) SetDestination(v string) { + o.Destination = &v +} + +// GetBalance returns the Balance field value if set, zero value otherwise. +func (o *History) GetBalance() string { + if o == nil || IsNil(o.Balance) { + var ret string + return ret + } + return *o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetBalanceOk() (*string, bool) { + if o == nil || IsNil(o.Balance) { + return nil, false + } + return o.Balance, true +} + +// HasBalance returns a boolean if a field has been set. +func (o *History) HasBalance() bool { + if o != nil && !IsNil(o.Balance) { + return true + } + + return false +} + +// SetBalance gets a reference to the given string and assigns it to the Balance field. +func (o *History) SetBalance(v string) { + o.Balance = &v +} + +// GetCurrentStatus returns the CurrentStatus field value if set, zero value otherwise. +func (o *History) GetCurrentStatus() map[string]interface{} { + if o == nil || IsNil(o.CurrentStatus) { + var ret map[string]interface{} + return ret + } + return o.CurrentStatus +} + +// GetCurrentStatusOk returns a tuple with the CurrentStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetCurrentStatusOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CurrentStatus) { + return map[string]interface{}{}, false + } + return o.CurrentStatus, true +} + +// HasCurrentStatus returns a boolean if a field has been set. +func (o *History) HasCurrentStatus() bool { + if o != nil && !IsNil(o.CurrentStatus) { + return true + } + + return false +} + +// SetCurrentStatus gets a reference to the given map[string]interface{} and assigns it to the CurrentStatus field. +func (o *History) SetCurrentStatus(v map[string]interface{}) { + o.CurrentStatus = v +} + +// GetApplicationSpecificParameters returns the ApplicationSpecificParameters field value if set, zero value otherwise. +func (o *History) GetApplicationSpecificParameters() map[string]interface{} { + if o == nil || IsNil(o.ApplicationSpecificParameters) { + var ret map[string]interface{} + return ret + } + return o.ApplicationSpecificParameters +} + +// GetApplicationSpecificParametersOk returns a tuple with the ApplicationSpecificParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetApplicationSpecificParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ApplicationSpecificParameters) { + return map[string]interface{}{}, false + } + return o.ApplicationSpecificParameters, true +} + +// HasApplicationSpecificParameters returns a boolean if a field has been set. +func (o *History) HasApplicationSpecificParameters() bool { + if o != nil && !IsNil(o.ApplicationSpecificParameters) { + return true + } + + return false +} + +// SetApplicationSpecificParameters gets a reference to the given map[string]interface{} and assigns it to the ApplicationSpecificParameters field. +func (o *History) SetApplicationSpecificParameters(v map[string]interface{}) { + o.ApplicationSpecificParameters = v +} + +func (o History) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o History) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Transactions) { + toSerialize["Transactions"] = o.Transactions + } + if !IsNil(o.Actions) { + toSerialize["Actions"] = o.Actions + } + if !IsNil(o.Origin) { + toSerialize["Origin"] = o.Origin + } + if !IsNil(o.Destination) { + toSerialize["Destination"] = o.Destination + } + if !IsNil(o.Balance) { + toSerialize["Balance"] = o.Balance + } + if !IsNil(o.CurrentStatus) { + toSerialize["CurrentStatus"] = o.CurrentStatus + } + if !IsNil(o.ApplicationSpecificParameters) { + toSerialize["ApplicationSpecificParameters"] = o.ApplicationSpecificParameters + } + return toSerialize, nil +} + +type NullableHistory struct { + value *History + isSet bool +} + +func (v NullableHistory) Get() *History { + return v.value +} + +func (v *NullableHistory) Set(val *History) { + v.value = val + v.isSet = true +} + +func (v NullableHistory) IsSet() bool { + return v.isSet +} + +func (v *NullableHistory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHistory(val *History) *NullableHistory { + return &NullableHistory{value: val, isSet: true} +} + +func (v NullableHistory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHistory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go new file mode 100644 index 0000000000..f969a663b7 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go @@ -0,0 +1,451 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the LockEvidenceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LockEvidenceV1Request{} + +// LockEvidenceV1Request struct for LockEvidenceV1Request +type LockEvidenceV1Request struct { + SessionID string `json:"sessionID"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + LockEvidenceClaim string `json:"lockEvidenceClaim"` + LockEvidenceFormat map[string]interface{} `json:"lockEvidenceFormat,omitempty"` + LockEvidenceExpiration string `json:"lockEvidenceExpiration"` + HashCommenceAckRequest string `json:"hashCommenceAckRequest"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + MessageType string `json:"messageType"` + MessageHash *string `json:"messageHash,omitempty"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewLockEvidenceV1Request instantiates a new LockEvidenceV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLockEvidenceV1Request(sessionID string, clientIdentityPubkey string, serverIdentityPubkey string, lockEvidenceClaim string, lockEvidenceExpiration string, hashCommenceAckRequest string, signature string, messageType string, sequenceNumber float32) *LockEvidenceV1Request { + this := LockEvidenceV1Request{} + this.SessionID = sessionID + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.LockEvidenceClaim = lockEvidenceClaim + this.LockEvidenceExpiration = lockEvidenceExpiration + this.HashCommenceAckRequest = hashCommenceAckRequest + this.Signature = signature + this.MessageType = messageType + this.SequenceNumber = sequenceNumber + return &this +} + +// NewLockEvidenceV1RequestWithDefaults instantiates a new LockEvidenceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLockEvidenceV1RequestWithDefaults() *LockEvidenceV1Request { + this := LockEvidenceV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *LockEvidenceV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *LockEvidenceV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *LockEvidenceV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *LockEvidenceV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *LockEvidenceV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *LockEvidenceV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetLockEvidenceClaim returns the LockEvidenceClaim field value +func (o *LockEvidenceV1Request) GetLockEvidenceClaim() string { + if o == nil { + var ret string + return ret + } + + return o.LockEvidenceClaim +} + +// GetLockEvidenceClaimOk returns a tuple with the LockEvidenceClaim field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetLockEvidenceClaimOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LockEvidenceClaim, true +} + +// SetLockEvidenceClaim sets field value +func (o *LockEvidenceV1Request) SetLockEvidenceClaim(v string) { + o.LockEvidenceClaim = v +} + +// GetLockEvidenceFormat returns the LockEvidenceFormat field value if set, zero value otherwise. +func (o *LockEvidenceV1Request) GetLockEvidenceFormat() map[string]interface{} { + if o == nil || IsNil(o.LockEvidenceFormat) { + var ret map[string]interface{} + return ret + } + return o.LockEvidenceFormat +} + +// GetLockEvidenceFormatOk returns a tuple with the LockEvidenceFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetLockEvidenceFormatOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.LockEvidenceFormat) { + return map[string]interface{}{}, false + } + return o.LockEvidenceFormat, true +} + +// HasLockEvidenceFormat returns a boolean if a field has been set. +func (o *LockEvidenceV1Request) HasLockEvidenceFormat() bool { + if o != nil && !IsNil(o.LockEvidenceFormat) { + return true + } + + return false +} + +// SetLockEvidenceFormat gets a reference to the given map[string]interface{} and assigns it to the LockEvidenceFormat field. +func (o *LockEvidenceV1Request) SetLockEvidenceFormat(v map[string]interface{}) { + o.LockEvidenceFormat = v +} + +// GetLockEvidenceExpiration returns the LockEvidenceExpiration field value +func (o *LockEvidenceV1Request) GetLockEvidenceExpiration() string { + if o == nil { + var ret string + return ret + } + + return o.LockEvidenceExpiration +} + +// GetLockEvidenceExpirationOk returns a tuple with the LockEvidenceExpiration field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetLockEvidenceExpirationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LockEvidenceExpiration, true +} + +// SetLockEvidenceExpiration sets field value +func (o *LockEvidenceV1Request) SetLockEvidenceExpiration(v string) { + o.LockEvidenceExpiration = v +} + +// GetHashCommenceAckRequest returns the HashCommenceAckRequest field value +func (o *LockEvidenceV1Request) GetHashCommenceAckRequest() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommenceAckRequest +} + +// GetHashCommenceAckRequestOk returns a tuple with the HashCommenceAckRequest field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetHashCommenceAckRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommenceAckRequest, true +} + +// SetHashCommenceAckRequest sets field value +func (o *LockEvidenceV1Request) SetHashCommenceAckRequest(v string) { + o.HashCommenceAckRequest = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LockEvidenceV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LockEvidenceV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *LockEvidenceV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *LockEvidenceV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *LockEvidenceV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *LockEvidenceV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *LockEvidenceV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *LockEvidenceV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetMessageType returns the MessageType field value +func (o *LockEvidenceV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *LockEvidenceV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetMessageHash returns the MessageHash field value if set, zero value otherwise. +func (o *LockEvidenceV1Request) GetMessageHash() string { + if o == nil || IsNil(o.MessageHash) { + var ret string + return ret + } + return *o.MessageHash +} + +// GetMessageHashOk returns a tuple with the MessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.MessageHash) { + return nil, false + } + return o.MessageHash, true +} + +// HasMessageHash returns a boolean if a field has been set. +func (o *LockEvidenceV1Request) HasMessageHash() bool { + if o != nil && !IsNil(o.MessageHash) { + return true + } + + return false +} + +// SetMessageHash gets a reference to the given string and assigns it to the MessageHash field. +func (o *LockEvidenceV1Request) SetMessageHash(v string) { + o.MessageHash = &v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *LockEvidenceV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *LockEvidenceV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o LockEvidenceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LockEvidenceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["lockEvidenceClaim"] = o.LockEvidenceClaim + if !IsNil(o.LockEvidenceFormat) { + toSerialize["lockEvidenceFormat"] = o.LockEvidenceFormat + } + toSerialize["lockEvidenceExpiration"] = o.LockEvidenceExpiration + toSerialize["hashCommenceAckRequest"] = o.HashCommenceAckRequest + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["messageType"] = o.MessageType + if !IsNil(o.MessageHash) { + toSerialize["messageHash"] = o.MessageHash + } + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableLockEvidenceV1Request struct { + value *LockEvidenceV1Request + isSet bool +} + +func (v NullableLockEvidenceV1Request) Get() *LockEvidenceV1Request { + return v.value +} + +func (v *NullableLockEvidenceV1Request) Set(val *LockEvidenceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableLockEvidenceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableLockEvidenceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLockEvidenceV1Request(val *LockEvidenceV1Request) *NullableLockEvidenceV1Request { + return &NullableLockEvidenceV1Request{value: val, isSet: true} +} + +func (v NullableLockEvidenceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLockEvidenceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go new file mode 100644 index 0000000000..18e342aacd --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go @@ -0,0 +1,325 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the LockEvidenceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LockEvidenceV1Response{} + +// LockEvidenceV1Response struct for LockEvidenceV1Response +type LockEvidenceV1Response struct { + SessionID string `json:"sessionID"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashLockEvidenceRequest string `json:"hashLockEvidenceRequest"` + ServerTransferNumber NullableInt32 `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + MessageType string `json:"messageType"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewLockEvidenceV1Response instantiates a new LockEvidenceV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLockEvidenceV1Response(sessionID string, clientIdentityPubkey string, serverIdentityPubkey string, hashLockEvidenceRequest string, signature string, messageType string, sequenceNumber float32) *LockEvidenceV1Response { + this := LockEvidenceV1Response{} + this.SessionID = sessionID + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashLockEvidenceRequest = hashLockEvidenceRequest + this.Signature = signature + this.MessageType = messageType + this.SequenceNumber = sequenceNumber + return &this +} + +// NewLockEvidenceV1ResponseWithDefaults instantiates a new LockEvidenceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLockEvidenceV1ResponseWithDefaults() *LockEvidenceV1Response { + this := LockEvidenceV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *LockEvidenceV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *LockEvidenceV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *LockEvidenceV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *LockEvidenceV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *LockEvidenceV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *LockEvidenceV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashLockEvidenceRequest returns the HashLockEvidenceRequest field value +func (o *LockEvidenceV1Response) GetHashLockEvidenceRequest() string { + if o == nil { + var ret string + return ret + } + + return o.HashLockEvidenceRequest +} + +// GetHashLockEvidenceRequestOk returns a tuple with the HashLockEvidenceRequest field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetHashLockEvidenceRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLockEvidenceRequest, true +} + +// SetHashLockEvidenceRequest sets field value +func (o *LockEvidenceV1Response) SetHashLockEvidenceRequest(v string) { + o.HashLockEvidenceRequest = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LockEvidenceV1Response) GetServerTransferNumber() int32 { + if o == nil || IsNil(o.ServerTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ServerTransferNumber.Get() +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LockEvidenceV1Response) GetServerTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ServerTransferNumber.Get(), o.ServerTransferNumber.IsSet() +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *LockEvidenceV1Response) HasServerTransferNumber() bool { + if o != nil && o.ServerTransferNumber.IsSet() { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given NullableInt32 and assigns it to the ServerTransferNumber field. +func (o *LockEvidenceV1Response) SetServerTransferNumber(v int32) { + o.ServerTransferNumber.Set(&v) +} +// SetServerTransferNumberNil sets the value for ServerTransferNumber to be an explicit nil +func (o *LockEvidenceV1Response) SetServerTransferNumberNil() { + o.ServerTransferNumber.Set(nil) +} + +// UnsetServerTransferNumber ensures that no value is present for ServerTransferNumber, not even an explicit nil +func (o *LockEvidenceV1Response) UnsetServerTransferNumber() { + o.ServerTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *LockEvidenceV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *LockEvidenceV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetMessageType returns the MessageType field value +func (o *LockEvidenceV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *LockEvidenceV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *LockEvidenceV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *LockEvidenceV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o LockEvidenceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LockEvidenceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashLockEvidenceRequest"] = o.HashLockEvidenceRequest + if o.ServerTransferNumber.IsSet() { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["messageType"] = o.MessageType + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableLockEvidenceV1Response struct { + value *LockEvidenceV1Response + isSet bool +} + +func (v NullableLockEvidenceV1Response) Get() *LockEvidenceV1Response { + return v.value +} + +func (v *NullableLockEvidenceV1Response) Set(val *LockEvidenceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableLockEvidenceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableLockEvidenceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLockEvidenceV1Response(val *LockEvidenceV1Response) *NullableLockEvidenceV1Response { + return &NullableLockEvidenceV1Response{value: val, isSet: true} +} + +func (v NullableLockEvidenceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLockEvidenceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go new file mode 100644 index 0000000000..14d5fc34e1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the OdapLocalLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OdapLocalLog{} + +// OdapLocalLog struct for OdapLocalLog +type OdapLocalLog struct { + Key *string `json:"key,omitempty"` + SessionID string `json:"sessionID"` + Data *string `json:"data,omitempty"` + Type string `json:"type"` + Operation string `json:"operation"` + Timestamp *string `json:"timestamp,omitempty"` +} + +// NewOdapLocalLog instantiates a new OdapLocalLog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOdapLocalLog(sessionID string, type_ string, operation string) *OdapLocalLog { + this := OdapLocalLog{} + this.SessionID = sessionID + this.Type = type_ + this.Operation = operation + return &this +} + +// NewOdapLocalLogWithDefaults instantiates a new OdapLocalLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOdapLocalLogWithDefaults() *OdapLocalLog { + this := OdapLocalLog{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *OdapLocalLog) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *OdapLocalLog) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *OdapLocalLog) SetKey(v string) { + o.Key = &v +} + +// GetSessionID returns the SessionID field value +func (o *OdapLocalLog) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *OdapLocalLog) SetSessionID(v string) { + o.SessionID = v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *OdapLocalLog) GetData() string { + if o == nil || IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetDataOk() (*string, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *OdapLocalLog) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *OdapLocalLog) SetData(v string) { + o.Data = &v +} + +// GetType returns the Type field value +func (o *OdapLocalLog) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *OdapLocalLog) SetType(v string) { + o.Type = v +} + +// GetOperation returns the Operation field value +func (o *OdapLocalLog) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *OdapLocalLog) SetOperation(v string) { + o.Operation = v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *OdapLocalLog) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *OdapLocalLog) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *OdapLocalLog) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o OdapLocalLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OdapLocalLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + toSerialize["sessionID"] = o.SessionID + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + toSerialize["type"] = o.Type + toSerialize["operation"] = o.Operation + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableOdapLocalLog struct { + value *OdapLocalLog + isSet bool +} + +func (v NullableOdapLocalLog) Get() *OdapLocalLog { + return v.value +} + +func (v *NullableOdapLocalLog) Set(val *OdapLocalLog) { + v.value = val + v.isSet = true +} + +func (v NullableOdapLocalLog) IsSet() bool { + return v.isSet +} + +func (v *NullableOdapLocalLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOdapLocalLog(val *OdapLocalLog) *NullableOdapLocalLog { + return &NullableOdapLocalLog{value: val, isSet: true} +} + +func (v NullableOdapLocalLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOdapLocalLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go new file mode 100644 index 0000000000..4182a088a9 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go @@ -0,0 +1,522 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the OdapMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OdapMessage{} + +// OdapMessage struct for OdapMessage +type OdapMessage struct { + SequenceNumber *float32 `json:"SequenceNumber,omitempty"` + Phase *string `json:"Phase,omitempty"` + ResourceURL *string `json:"ResourceURL,omitempty"` + DeveloperURN *string `json:"DeveloperURN,omitempty"` + ActionResponse *OdapMessageActionResponse `json:"ActionResponse,omitempty"` + CredentialProfile *string `json:"CredentialProfile,omitempty"` + CredentialBlock []interface{} `json:"CredentialBlock,omitempty"` + CredentialsProfile *PayloadProfile `json:"CredentialsProfile,omitempty"` + ApplicationProfile map[string]interface{} `json:"ApplicationProfile,omitempty"` + Payload map[string]interface{} `json:"Payload,omitempty"` + PayloadHash *string `json:"PayloadHash,omitempty"` + MessageSignature *string `json:"MessageSignature,omitempty"` +} + +// NewOdapMessage instantiates a new OdapMessage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOdapMessage() *OdapMessage { + this := OdapMessage{} + return &this +} + +// NewOdapMessageWithDefaults instantiates a new OdapMessage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOdapMessageWithDefaults() *OdapMessage { + this := OdapMessage{} + return &this +} + +// GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. +func (o *OdapMessage) GetSequenceNumber() float32 { + if o == nil || IsNil(o.SequenceNumber) { + var ret float32 + return ret + } + return *o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetSequenceNumberOk() (*float32, bool) { + if o == nil || IsNil(o.SequenceNumber) { + return nil, false + } + return o.SequenceNumber, true +} + +// HasSequenceNumber returns a boolean if a field has been set. +func (o *OdapMessage) HasSequenceNumber() bool { + if o != nil && !IsNil(o.SequenceNumber) { + return true + } + + return false +} + +// SetSequenceNumber gets a reference to the given float32 and assigns it to the SequenceNumber field. +func (o *OdapMessage) SetSequenceNumber(v float32) { + o.SequenceNumber = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *OdapMessage) GetPhase() string { + if o == nil || IsNil(o.Phase) { + var ret string + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetPhaseOk() (*string, bool) { + if o == nil || IsNil(o.Phase) { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *OdapMessage) HasPhase() bool { + if o != nil && !IsNil(o.Phase) { + return true + } + + return false +} + +// SetPhase gets a reference to the given string and assigns it to the Phase field. +func (o *OdapMessage) SetPhase(v string) { + o.Phase = &v +} + +// GetResourceURL returns the ResourceURL field value if set, zero value otherwise. +func (o *OdapMessage) GetResourceURL() string { + if o == nil || IsNil(o.ResourceURL) { + var ret string + return ret + } + return *o.ResourceURL +} + +// GetResourceURLOk returns a tuple with the ResourceURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetResourceURLOk() (*string, bool) { + if o == nil || IsNil(o.ResourceURL) { + return nil, false + } + return o.ResourceURL, true +} + +// HasResourceURL returns a boolean if a field has been set. +func (o *OdapMessage) HasResourceURL() bool { + if o != nil && !IsNil(o.ResourceURL) { + return true + } + + return false +} + +// SetResourceURL gets a reference to the given string and assigns it to the ResourceURL field. +func (o *OdapMessage) SetResourceURL(v string) { + o.ResourceURL = &v +} + +// GetDeveloperURN returns the DeveloperURN field value if set, zero value otherwise. +func (o *OdapMessage) GetDeveloperURN() string { + if o == nil || IsNil(o.DeveloperURN) { + var ret string + return ret + } + return *o.DeveloperURN +} + +// GetDeveloperURNOk returns a tuple with the DeveloperURN field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetDeveloperURNOk() (*string, bool) { + if o == nil || IsNil(o.DeveloperURN) { + return nil, false + } + return o.DeveloperURN, true +} + +// HasDeveloperURN returns a boolean if a field has been set. +func (o *OdapMessage) HasDeveloperURN() bool { + if o != nil && !IsNil(o.DeveloperURN) { + return true + } + + return false +} + +// SetDeveloperURN gets a reference to the given string and assigns it to the DeveloperURN field. +func (o *OdapMessage) SetDeveloperURN(v string) { + o.DeveloperURN = &v +} + +// GetActionResponse returns the ActionResponse field value if set, zero value otherwise. +func (o *OdapMessage) GetActionResponse() OdapMessageActionResponse { + if o == nil || IsNil(o.ActionResponse) { + var ret OdapMessageActionResponse + return ret + } + return *o.ActionResponse +} + +// GetActionResponseOk returns a tuple with the ActionResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetActionResponseOk() (*OdapMessageActionResponse, bool) { + if o == nil || IsNil(o.ActionResponse) { + return nil, false + } + return o.ActionResponse, true +} + +// HasActionResponse returns a boolean if a field has been set. +func (o *OdapMessage) HasActionResponse() bool { + if o != nil && !IsNil(o.ActionResponse) { + return true + } + + return false +} + +// SetActionResponse gets a reference to the given OdapMessageActionResponse and assigns it to the ActionResponse field. +func (o *OdapMessage) SetActionResponse(v OdapMessageActionResponse) { + o.ActionResponse = &v +} + +// GetCredentialProfile returns the CredentialProfile field value if set, zero value otherwise. +func (o *OdapMessage) GetCredentialProfile() string { + if o == nil || IsNil(o.CredentialProfile) { + var ret string + return ret + } + return *o.CredentialProfile +} + +// GetCredentialProfileOk returns a tuple with the CredentialProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetCredentialProfileOk() (*string, bool) { + if o == nil || IsNil(o.CredentialProfile) { + return nil, false + } + return o.CredentialProfile, true +} + +// HasCredentialProfile returns a boolean if a field has been set. +func (o *OdapMessage) HasCredentialProfile() bool { + if o != nil && !IsNil(o.CredentialProfile) { + return true + } + + return false +} + +// SetCredentialProfile gets a reference to the given string and assigns it to the CredentialProfile field. +func (o *OdapMessage) SetCredentialProfile(v string) { + o.CredentialProfile = &v +} + +// GetCredentialBlock returns the CredentialBlock field value if set, zero value otherwise. +func (o *OdapMessage) GetCredentialBlock() []interface{} { + if o == nil || IsNil(o.CredentialBlock) { + var ret []interface{} + return ret + } + return o.CredentialBlock +} + +// GetCredentialBlockOk returns a tuple with the CredentialBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetCredentialBlockOk() ([]interface{}, bool) { + if o == nil || IsNil(o.CredentialBlock) { + return nil, false + } + return o.CredentialBlock, true +} + +// HasCredentialBlock returns a boolean if a field has been set. +func (o *OdapMessage) HasCredentialBlock() bool { + if o != nil && !IsNil(o.CredentialBlock) { + return true + } + + return false +} + +// SetCredentialBlock gets a reference to the given []interface{} and assigns it to the CredentialBlock field. +func (o *OdapMessage) SetCredentialBlock(v []interface{}) { + o.CredentialBlock = v +} + +// GetCredentialsProfile returns the CredentialsProfile field value if set, zero value otherwise. +func (o *OdapMessage) GetCredentialsProfile() PayloadProfile { + if o == nil || IsNil(o.CredentialsProfile) { + var ret PayloadProfile + return ret + } + return *o.CredentialsProfile +} + +// GetCredentialsProfileOk returns a tuple with the CredentialsProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetCredentialsProfileOk() (*PayloadProfile, bool) { + if o == nil || IsNil(o.CredentialsProfile) { + return nil, false + } + return o.CredentialsProfile, true +} + +// HasCredentialsProfile returns a boolean if a field has been set. +func (o *OdapMessage) HasCredentialsProfile() bool { + if o != nil && !IsNil(o.CredentialsProfile) { + return true + } + + return false +} + +// SetCredentialsProfile gets a reference to the given PayloadProfile and assigns it to the CredentialsProfile field. +func (o *OdapMessage) SetCredentialsProfile(v PayloadProfile) { + o.CredentialsProfile = &v +} + +// GetApplicationProfile returns the ApplicationProfile field value if set, zero value otherwise. +func (o *OdapMessage) GetApplicationProfile() map[string]interface{} { + if o == nil || IsNil(o.ApplicationProfile) { + var ret map[string]interface{} + return ret + } + return o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetApplicationProfileOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ApplicationProfile) { + return map[string]interface{}{}, false + } + return o.ApplicationProfile, true +} + +// HasApplicationProfile returns a boolean if a field has been set. +func (o *OdapMessage) HasApplicationProfile() bool { + if o != nil && !IsNil(o.ApplicationProfile) { + return true + } + + return false +} + +// SetApplicationProfile gets a reference to the given map[string]interface{} and assigns it to the ApplicationProfile field. +func (o *OdapMessage) SetApplicationProfile(v map[string]interface{}) { + o.ApplicationProfile = v +} + +// GetPayload returns the Payload field value if set, zero value otherwise. +func (o *OdapMessage) GetPayload() map[string]interface{} { + if o == nil || IsNil(o.Payload) { + var ret map[string]interface{} + return ret + } + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Payload) { + return map[string]interface{}{}, false + } + return o.Payload, true +} + +// HasPayload returns a boolean if a field has been set. +func (o *OdapMessage) HasPayload() bool { + if o != nil && !IsNil(o.Payload) { + return true + } + + return false +} + +// SetPayload gets a reference to the given map[string]interface{} and assigns it to the Payload field. +func (o *OdapMessage) SetPayload(v map[string]interface{}) { + o.Payload = v +} + +// GetPayloadHash returns the PayloadHash field value if set, zero value otherwise. +func (o *OdapMessage) GetPayloadHash() string { + if o == nil || IsNil(o.PayloadHash) { + var ret string + return ret + } + return *o.PayloadHash +} + +// GetPayloadHashOk returns a tuple with the PayloadHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetPayloadHashOk() (*string, bool) { + if o == nil || IsNil(o.PayloadHash) { + return nil, false + } + return o.PayloadHash, true +} + +// HasPayloadHash returns a boolean if a field has been set. +func (o *OdapMessage) HasPayloadHash() bool { + if o != nil && !IsNil(o.PayloadHash) { + return true + } + + return false +} + +// SetPayloadHash gets a reference to the given string and assigns it to the PayloadHash field. +func (o *OdapMessage) SetPayloadHash(v string) { + o.PayloadHash = &v +} + +// GetMessageSignature returns the MessageSignature field value if set, zero value otherwise. +func (o *OdapMessage) GetMessageSignature() string { + if o == nil || IsNil(o.MessageSignature) { + var ret string + return ret + } + return *o.MessageSignature +} + +// GetMessageSignatureOk returns a tuple with the MessageSignature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetMessageSignatureOk() (*string, bool) { + if o == nil || IsNil(o.MessageSignature) { + return nil, false + } + return o.MessageSignature, true +} + +// HasMessageSignature returns a boolean if a field has been set. +func (o *OdapMessage) HasMessageSignature() bool { + if o != nil && !IsNil(o.MessageSignature) { + return true + } + + return false +} + +// SetMessageSignature gets a reference to the given string and assigns it to the MessageSignature field. +func (o *OdapMessage) SetMessageSignature(v string) { + o.MessageSignature = &v +} + +func (o OdapMessage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OdapMessage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SequenceNumber) { + toSerialize["SequenceNumber"] = o.SequenceNumber + } + if !IsNil(o.Phase) { + toSerialize["Phase"] = o.Phase + } + if !IsNil(o.ResourceURL) { + toSerialize["ResourceURL"] = o.ResourceURL + } + if !IsNil(o.DeveloperURN) { + toSerialize["DeveloperURN"] = o.DeveloperURN + } + if !IsNil(o.ActionResponse) { + toSerialize["ActionResponse"] = o.ActionResponse + } + if !IsNil(o.CredentialProfile) { + toSerialize["CredentialProfile"] = o.CredentialProfile + } + if !IsNil(o.CredentialBlock) { + toSerialize["CredentialBlock"] = o.CredentialBlock + } + if !IsNil(o.CredentialsProfile) { + toSerialize["CredentialsProfile"] = o.CredentialsProfile + } + if !IsNil(o.ApplicationProfile) { + toSerialize["ApplicationProfile"] = o.ApplicationProfile + } + if !IsNil(o.Payload) { + toSerialize["Payload"] = o.Payload + } + if !IsNil(o.PayloadHash) { + toSerialize["PayloadHash"] = o.PayloadHash + } + if !IsNil(o.MessageSignature) { + toSerialize["MessageSignature"] = o.MessageSignature + } + return toSerialize, nil +} + +type NullableOdapMessage struct { + value *OdapMessage + isSet bool +} + +func (v NullableOdapMessage) Get() *OdapMessage { + return v.value +} + +func (v *NullableOdapMessage) Set(val *OdapMessage) { + v.value = val + v.isSet = true +} + +func (v NullableOdapMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableOdapMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOdapMessage(val *OdapMessage) *NullableOdapMessage { + return &NullableOdapMessage{value: val, isSet: true} +} + +func (v NullableOdapMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOdapMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go new file mode 100644 index 0000000000..13c79a657f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the OdapMessageActionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OdapMessageActionResponse{} + +// OdapMessageActionResponse struct for OdapMessageActionResponse +type OdapMessageActionResponse struct { + ResponseCode *string `json:"ResponseCode,omitempty"` + Arguments []interface{} `json:"Arguments,omitempty"` +} + +// NewOdapMessageActionResponse instantiates a new OdapMessageActionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOdapMessageActionResponse() *OdapMessageActionResponse { + this := OdapMessageActionResponse{} + return &this +} + +// NewOdapMessageActionResponseWithDefaults instantiates a new OdapMessageActionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOdapMessageActionResponseWithDefaults() *OdapMessageActionResponse { + this := OdapMessageActionResponse{} + return &this +} + +// GetResponseCode returns the ResponseCode field value if set, zero value otherwise. +func (o *OdapMessageActionResponse) GetResponseCode() string { + if o == nil || IsNil(o.ResponseCode) { + var ret string + return ret + } + return *o.ResponseCode +} + +// GetResponseCodeOk returns a tuple with the ResponseCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessageActionResponse) GetResponseCodeOk() (*string, bool) { + if o == nil || IsNil(o.ResponseCode) { + return nil, false + } + return o.ResponseCode, true +} + +// HasResponseCode returns a boolean if a field has been set. +func (o *OdapMessageActionResponse) HasResponseCode() bool { + if o != nil && !IsNil(o.ResponseCode) { + return true + } + + return false +} + +// SetResponseCode gets a reference to the given string and assigns it to the ResponseCode field. +func (o *OdapMessageActionResponse) SetResponseCode(v string) { + o.ResponseCode = &v +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *OdapMessageActionResponse) GetArguments() []interface{} { + if o == nil || IsNil(o.Arguments) { + var ret []interface{} + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessageActionResponse) GetArgumentsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Arguments) { + return nil, false + } + return o.Arguments, true +} + +// HasArguments returns a boolean if a field has been set. +func (o *OdapMessageActionResponse) HasArguments() bool { + if o != nil && !IsNil(o.Arguments) { + return true + } + + return false +} + +// SetArguments gets a reference to the given []interface{} and assigns it to the Arguments field. +func (o *OdapMessageActionResponse) SetArguments(v []interface{}) { + o.Arguments = v +} + +func (o OdapMessageActionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OdapMessageActionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ResponseCode) { + toSerialize["ResponseCode"] = o.ResponseCode + } + if !IsNil(o.Arguments) { + toSerialize["Arguments"] = o.Arguments + } + return toSerialize, nil +} + +type NullableOdapMessageActionResponse struct { + value *OdapMessageActionResponse + isSet bool +} + +func (v NullableOdapMessageActionResponse) Get() *OdapMessageActionResponse { + return v.value +} + +func (v *NullableOdapMessageActionResponse) Set(val *OdapMessageActionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableOdapMessageActionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableOdapMessageActionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOdapMessageActionResponse(val *OdapMessageActionResponse) *NullableOdapMessageActionResponse { + return &NullableOdapMessageActionResponse{value: val, isSet: true} +} + +func (v NullableOdapMessageActionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOdapMessageActionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go new file mode 100644 index 0000000000..d6304a9214 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the PayloadProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PayloadProfile{} + +// PayloadProfile struct for PayloadProfile +type PayloadProfile struct { + AssetProfile AssetProfile `json:"assetProfile"` + Capabilities *string `json:"capabilities,omitempty"` +} + +// NewPayloadProfile instantiates a new PayloadProfile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPayloadProfile(assetProfile AssetProfile) *PayloadProfile { + this := PayloadProfile{} + this.AssetProfile = assetProfile + return &this +} + +// NewPayloadProfileWithDefaults instantiates a new PayloadProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPayloadProfileWithDefaults() *PayloadProfile { + this := PayloadProfile{} + return &this +} + +// GetAssetProfile returns the AssetProfile field value +func (o *PayloadProfile) GetAssetProfile() AssetProfile { + if o == nil { + var ret AssetProfile + return ret + } + + return o.AssetProfile +} + +// GetAssetProfileOk returns a tuple with the AssetProfile field value +// and a boolean to check if the value has been set. +func (o *PayloadProfile) GetAssetProfileOk() (*AssetProfile, bool) { + if o == nil { + return nil, false + } + return &o.AssetProfile, true +} + +// SetAssetProfile sets field value +func (o *PayloadProfile) SetAssetProfile(v AssetProfile) { + o.AssetProfile = v +} + +// GetCapabilities returns the Capabilities field value if set, zero value otherwise. +func (o *PayloadProfile) GetCapabilities() string { + if o == nil || IsNil(o.Capabilities) { + var ret string + return ret + } + return *o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayloadProfile) GetCapabilitiesOk() (*string, bool) { + if o == nil || IsNil(o.Capabilities) { + return nil, false + } + return o.Capabilities, true +} + +// HasCapabilities returns a boolean if a field has been set. +func (o *PayloadProfile) HasCapabilities() bool { + if o != nil && !IsNil(o.Capabilities) { + return true + } + + return false +} + +// SetCapabilities gets a reference to the given string and assigns it to the Capabilities field. +func (o *PayloadProfile) SetCapabilities(v string) { + o.Capabilities = &v +} + +func (o PayloadProfile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayloadProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetProfile"] = o.AssetProfile + if !IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } + return toSerialize, nil +} + +type NullablePayloadProfile struct { + value *PayloadProfile + isSet bool +} + +func (v NullablePayloadProfile) Get() *PayloadProfile { + return v.value +} + +func (v *NullablePayloadProfile) Set(val *PayloadProfile) { + v.value = val + v.isSet = true +} + +func (v NullablePayloadProfile) IsSet() bool { + return v.isSet +} + +func (v *NullablePayloadProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayloadProfile(val *PayloadProfile) *NullablePayloadProfile { + return &NullablePayloadProfile{value: val, isSet: true} +} + +func (v NullablePayloadProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayloadProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go new file mode 100644 index 0000000000..f7369b839d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverSuccessV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverSuccessV1Message{} + +// RecoverSuccessV1Message struct for RecoverSuccessV1Message +type RecoverSuccessV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + Signature string `json:"signature"` +} + +// NewRecoverSuccessV1Message instantiates a new RecoverSuccessV1Message object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRecoverSuccessV1Message(sessionID string, success bool, signature string) *RecoverSuccessV1Message { + this := RecoverSuccessV1Message{} + this.SessionID = sessionID + this.Success = success + this.Signature = signature + return &this +} + +// NewRecoverSuccessV1MessageWithDefaults instantiates a new RecoverSuccessV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverSuccessV1MessageWithDefaults() *RecoverSuccessV1Message { + this := RecoverSuccessV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverSuccessV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverSuccessV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverSuccessV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RecoverSuccessV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RecoverSuccessV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RecoverSuccessV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetSignature returns the Signature field value +func (o *RecoverSuccessV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverSuccessV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverSuccessV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverSuccessV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverSuccessV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverSuccessV1Message struct { + value *RecoverSuccessV1Message + isSet bool +} + +func (v NullableRecoverSuccessV1Message) Get() *RecoverSuccessV1Message { + return v.value +} + +func (v *NullableRecoverSuccessV1Message) Set(val *RecoverSuccessV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverSuccessV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverSuccessV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverSuccessV1Message(val *RecoverSuccessV1Message) *NullableRecoverSuccessV1Message { + return &NullableRecoverSuccessV1Message{value: val, isSet: true} +} + +func (v NullableRecoverSuccessV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverSuccessV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go new file mode 100644 index 0000000000..fbce34db52 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverUpdateAckV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverUpdateAckV1Message{} + +// RecoverUpdateAckV1Message struct for RecoverUpdateAckV1Message +type RecoverUpdateAckV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + ChangedEntriesHash []string `json:"changedEntriesHash"` + Signature string `json:"signature"` +} + +// NewRecoverUpdateAckV1Message instantiates a new RecoverUpdateAckV1Message object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRecoverUpdateAckV1Message(sessionID string, success bool, changedEntriesHash []string, signature string) *RecoverUpdateAckV1Message { + this := RecoverUpdateAckV1Message{} + this.SessionID = sessionID + this.Success = success + this.ChangedEntriesHash = changedEntriesHash + this.Signature = signature + return &this +} + +// NewRecoverUpdateAckV1MessageWithDefaults instantiates a new RecoverUpdateAckV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverUpdateAckV1MessageWithDefaults() *RecoverUpdateAckV1Message { + this := RecoverUpdateAckV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverUpdateAckV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverUpdateAckV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RecoverUpdateAckV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RecoverUpdateAckV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetChangedEntriesHash returns the ChangedEntriesHash field value +func (o *RecoverUpdateAckV1Message) GetChangedEntriesHash() []string { + if o == nil { + var ret []string + return ret + } + + return o.ChangedEntriesHash +} + +// GetChangedEntriesHashOk returns a tuple with the ChangedEntriesHash field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetChangedEntriesHashOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ChangedEntriesHash, true +} + +// SetChangedEntriesHash sets field value +func (o *RecoverUpdateAckV1Message) SetChangedEntriesHash(v []string) { + o.ChangedEntriesHash = v +} + +// GetSignature returns the Signature field value +func (o *RecoverUpdateAckV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverUpdateAckV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverUpdateAckV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverUpdateAckV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["changedEntriesHash"] = o.ChangedEntriesHash + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverUpdateAckV1Message struct { + value *RecoverUpdateAckV1Message + isSet bool +} + +func (v NullableRecoverUpdateAckV1Message) Get() *RecoverUpdateAckV1Message { + return v.value +} + +func (v *NullableRecoverUpdateAckV1Message) Set(val *RecoverUpdateAckV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverUpdateAckV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverUpdateAckV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverUpdateAckV1Message(val *RecoverUpdateAckV1Message) *NullableRecoverUpdateAckV1Message { + return &NullableRecoverUpdateAckV1Message{value: val, isSet: true} +} + +func (v NullableRecoverUpdateAckV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverUpdateAckV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go new file mode 100644 index 0000000000..44bc5ac196 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverUpdateV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverUpdateV1Message{} + +// RecoverUpdateV1Message struct for RecoverUpdateV1Message +type RecoverUpdateV1Message struct { + SessionID string `json:"sessionID"` + RecoveredLogs []OdapLocalLog `json:"recoveredLogs"` + Signature string `json:"signature"` +} + +// NewRecoverUpdateV1Message instantiates a new RecoverUpdateV1Message object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRecoverUpdateV1Message(sessionID string, recoveredLogs []OdapLocalLog, signature string) *RecoverUpdateV1Message { + this := RecoverUpdateV1Message{} + this.SessionID = sessionID + this.RecoveredLogs = recoveredLogs + this.Signature = signature + return &this +} + +// NewRecoverUpdateV1MessageWithDefaults instantiates a new RecoverUpdateV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverUpdateV1MessageWithDefaults() *RecoverUpdateV1Message { + this := RecoverUpdateV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverUpdateV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverUpdateV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetRecoveredLogs returns the RecoveredLogs field value +func (o *RecoverUpdateV1Message) GetRecoveredLogs() []OdapLocalLog { + if o == nil { + var ret []OdapLocalLog + return ret + } + + return o.RecoveredLogs +} + +// GetRecoveredLogsOk returns a tuple with the RecoveredLogs field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateV1Message) GetRecoveredLogsOk() ([]OdapLocalLog, bool) { + if o == nil { + return nil, false + } + return o.RecoveredLogs, true +} + +// SetRecoveredLogs sets field value +func (o *RecoverUpdateV1Message) SetRecoveredLogs(v []OdapLocalLog) { + o.RecoveredLogs = v +} + +// GetSignature returns the Signature field value +func (o *RecoverUpdateV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverUpdateV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverUpdateV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverUpdateV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["recoveredLogs"] = o.RecoveredLogs + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverUpdateV1Message struct { + value *RecoverUpdateV1Message + isSet bool +} + +func (v NullableRecoverUpdateV1Message) Get() *RecoverUpdateV1Message { + return v.value +} + +func (v *NullableRecoverUpdateV1Message) Set(val *RecoverUpdateV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverUpdateV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverUpdateV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverUpdateV1Message(val *RecoverUpdateV1Message) *NullableRecoverUpdateV1Message { + return &NullableRecoverUpdateV1Message{value: val, isSet: true} +} + +func (v NullableRecoverUpdateV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverUpdateV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go new file mode 100644 index 0000000000..09caa267aa --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverV1Message{} + +// RecoverV1Message struct for RecoverV1Message +type RecoverV1Message struct { + SessionID string `json:"sessionID"` + OdapPhase string `json:"odapPhase"` + SequenceNumber float32 `json:"sequenceNumber"` + LastLogEntryTimestamp string `json:"lastLogEntryTimestamp"` + IsBackup bool `json:"isBackup"` + NewBasePath string `json:"newBasePath"` + NewGatewayPubKey *string `json:"newGatewayPubKey,omitempty"` + Signature string `json:"signature"` +} + +// NewRecoverV1Message instantiates a new RecoverV1Message object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRecoverV1Message(sessionID string, odapPhase string, sequenceNumber float32, lastLogEntryTimestamp string, isBackup bool, newBasePath string, signature string) *RecoverV1Message { + this := RecoverV1Message{} + this.SessionID = sessionID + this.OdapPhase = odapPhase + this.SequenceNumber = sequenceNumber + this.LastLogEntryTimestamp = lastLogEntryTimestamp + this.IsBackup = isBackup + this.NewBasePath = newBasePath + this.Signature = signature + return &this +} + +// NewRecoverV1MessageWithDefaults instantiates a new RecoverV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverV1MessageWithDefaults() *RecoverV1Message { + this := RecoverV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetOdapPhase returns the OdapPhase field value +func (o *RecoverV1Message) GetOdapPhase() string { + if o == nil { + var ret string + return ret + } + + return o.OdapPhase +} + +// GetOdapPhaseOk returns a tuple with the OdapPhase field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetOdapPhaseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OdapPhase, true +} + +// SetOdapPhase sets field value +func (o *RecoverV1Message) SetOdapPhase(v string) { + o.OdapPhase = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *RecoverV1Message) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *RecoverV1Message) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +// GetLastLogEntryTimestamp returns the LastLogEntryTimestamp field value +func (o *RecoverV1Message) GetLastLogEntryTimestamp() string { + if o == nil { + var ret string + return ret + } + + return o.LastLogEntryTimestamp +} + +// GetLastLogEntryTimestampOk returns a tuple with the LastLogEntryTimestamp field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetLastLogEntryTimestampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastLogEntryTimestamp, true +} + +// SetLastLogEntryTimestamp sets field value +func (o *RecoverV1Message) SetLastLogEntryTimestamp(v string) { + o.LastLogEntryTimestamp = v +} + +// GetIsBackup returns the IsBackup field value +func (o *RecoverV1Message) GetIsBackup() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsBackup +} + +// GetIsBackupOk returns a tuple with the IsBackup field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetIsBackupOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsBackup, true +} + +// SetIsBackup sets field value +func (o *RecoverV1Message) SetIsBackup(v bool) { + o.IsBackup = v +} + +// GetNewBasePath returns the NewBasePath field value +func (o *RecoverV1Message) GetNewBasePath() string { + if o == nil { + var ret string + return ret + } + + return o.NewBasePath +} + +// GetNewBasePathOk returns a tuple with the NewBasePath field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetNewBasePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NewBasePath, true +} + +// SetNewBasePath sets field value +func (o *RecoverV1Message) SetNewBasePath(v string) { + o.NewBasePath = v +} + +// GetNewGatewayPubKey returns the NewGatewayPubKey field value if set, zero value otherwise. +func (o *RecoverV1Message) GetNewGatewayPubKey() string { + if o == nil || IsNil(o.NewGatewayPubKey) { + var ret string + return ret + } + return *o.NewGatewayPubKey +} + +// GetNewGatewayPubKeyOk returns a tuple with the NewGatewayPubKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetNewGatewayPubKeyOk() (*string, bool) { + if o == nil || IsNil(o.NewGatewayPubKey) { + return nil, false + } + return o.NewGatewayPubKey, true +} + +// HasNewGatewayPubKey returns a boolean if a field has been set. +func (o *RecoverV1Message) HasNewGatewayPubKey() bool { + if o != nil && !IsNil(o.NewGatewayPubKey) { + return true + } + + return false +} + +// SetNewGatewayPubKey gets a reference to the given string and assigns it to the NewGatewayPubKey field. +func (o *RecoverV1Message) SetNewGatewayPubKey(v string) { + o.NewGatewayPubKey = &v +} + +// GetSignature returns the Signature field value +func (o *RecoverV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["odapPhase"] = o.OdapPhase + toSerialize["sequenceNumber"] = o.SequenceNumber + toSerialize["lastLogEntryTimestamp"] = o.LastLogEntryTimestamp + toSerialize["isBackup"] = o.IsBackup + toSerialize["newBasePath"] = o.NewBasePath + if !IsNil(o.NewGatewayPubKey) { + toSerialize["newGatewayPubKey"] = o.NewGatewayPubKey + } + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverV1Message struct { + value *RecoverV1Message + isSet bool +} + +func (v NullableRecoverV1Message) Get() *RecoverV1Message { + return v.value +} + +func (v *NullableRecoverV1Message) Set(val *RecoverV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverV1Message(val *RecoverV1Message) *NullableRecoverV1Message { + return &NullableRecoverV1Message{value: val, isSet: true} +} + +func (v NullableRecoverV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go new file mode 100644 index 0000000000..023dd96b6e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RollbackAckV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RollbackAckV1Message{} + +// RollbackAckV1Message struct for RollbackAckV1Message +type RollbackAckV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + Signature string `json:"signature"` +} + +// NewRollbackAckV1Message instantiates a new RollbackAckV1Message object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRollbackAckV1Message(sessionID string, success bool, signature string) *RollbackAckV1Message { + this := RollbackAckV1Message{} + this.SessionID = sessionID + this.Success = success + this.Signature = signature + return &this +} + +// NewRollbackAckV1MessageWithDefaults instantiates a new RollbackAckV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRollbackAckV1MessageWithDefaults() *RollbackAckV1Message { + this := RollbackAckV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RollbackAckV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RollbackAckV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RollbackAckV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RollbackAckV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RollbackAckV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RollbackAckV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetSignature returns the Signature field value +func (o *RollbackAckV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RollbackAckV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RollbackAckV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RollbackAckV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RollbackAckV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRollbackAckV1Message struct { + value *RollbackAckV1Message + isSet bool +} + +func (v NullableRollbackAckV1Message) Get() *RollbackAckV1Message { + return v.value +} + +func (v *NullableRollbackAckV1Message) Set(val *RollbackAckV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRollbackAckV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRollbackAckV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRollbackAckV1Message(val *RollbackAckV1Message) *NullableRollbackAckV1Message { + return &NullableRollbackAckV1Message{value: val, isSet: true} +} + +func (v NullableRollbackAckV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRollbackAckV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go new file mode 100644 index 0000000000..1187067463 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RollbackV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RollbackV1Message{} + +// RollbackV1Message struct for RollbackV1Message +type RollbackV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + ActionPerformed []string `json:"actionPerformed"` + Proofs []string `json:"proofs"` + Signature string `json:"signature"` +} + +// NewRollbackV1Message instantiates a new RollbackV1Message object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRollbackV1Message(sessionID string, success bool, actionPerformed []string, proofs []string, signature string) *RollbackV1Message { + this := RollbackV1Message{} + this.SessionID = sessionID + this.Success = success + this.ActionPerformed = actionPerformed + this.Proofs = proofs + this.Signature = signature + return &this +} + +// NewRollbackV1MessageWithDefaults instantiates a new RollbackV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRollbackV1MessageWithDefaults() *RollbackV1Message { + this := RollbackV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RollbackV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RollbackV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RollbackV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RollbackV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetActionPerformed returns the ActionPerformed field value +func (o *RollbackV1Message) GetActionPerformed() []string { + if o == nil { + var ret []string + return ret + } + + return o.ActionPerformed +} + +// GetActionPerformedOk returns a tuple with the ActionPerformed field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetActionPerformedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ActionPerformed, true +} + +// SetActionPerformed sets field value +func (o *RollbackV1Message) SetActionPerformed(v []string) { + o.ActionPerformed = v +} + +// GetProofs returns the Proofs field value +func (o *RollbackV1Message) GetProofs() []string { + if o == nil { + var ret []string + return ret + } + + return o.Proofs +} + +// GetProofsOk returns a tuple with the Proofs field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetProofsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Proofs, true +} + +// SetProofs sets field value +func (o *RollbackV1Message) SetProofs(v []string) { + o.Proofs = v +} + +// GetSignature returns the Signature field value +func (o *RollbackV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RollbackV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RollbackV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RollbackV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["actionPerformed"] = o.ActionPerformed + toSerialize["proofs"] = o.Proofs + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRollbackV1Message struct { + value *RollbackV1Message + isSet bool +} + +func (v NullableRollbackV1Message) Get() *RollbackV1Message { + return v.value +} + +func (v *NullableRollbackV1Message) Set(val *RollbackV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRollbackV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRollbackV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRollbackV1Message(val *RollbackV1Message) *NullableRollbackV1Message { + return &NullableRollbackV1Message{value: val, isSet: true} +} + +func (v NullableRollbackV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRollbackV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go new file mode 100644 index 0000000000..33655779f6 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go @@ -0,0 +1,2286 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the SessionData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SessionData{} + +// SessionData struct for SessionData +type SessionData struct { + Id *string `json:"id,omitempty"` + Step *float32 `json:"step,omitempty"` + Version *string `json:"version,omitempty"` + LastSequenceNumber *float32 `json:"lastSequenceNumber,omitempty"` + LoggingProfile *string `json:"loggingProfile,omitempty"` + AccessControlProfile *string `json:"accessControlProfile,omitempty"` + ApplicationProfile *string `json:"applicationProfile,omitempty"` + PayloadProfile *PayloadProfile `json:"payloadProfile,omitempty"` + AssetProfile *AssetProfile `json:"assetProfile,omitempty"` + AllowedSourceBackupGateways []string `json:"allowedSourceBackupGateways,omitempty"` + AllowedRecipientBackupGateways []string `json:"allowedRecipientBackupGateways,omitempty"` + SourceBasePath *string `json:"sourceBasePath,omitempty"` + RecipientBasePath *string `json:"recipientBasePath,omitempty"` + OriginatorPubkey *string `json:"originatorPubkey,omitempty"` + BeneficiaryPubkey *string `json:"beneficiaryPubkey,omitempty"` + SourceGatewayPubkey *string `json:"sourceGatewayPubkey,omitempty"` + SourceGatewayDltSystem *string `json:"sourceGatewayDltSystem,omitempty"` + RecipientGatewayPubkey *string `json:"recipientGatewayPubkey,omitempty"` + RecipientGatewayDltSystem *string `json:"recipientGatewayDltSystem,omitempty"` + InitializationRequestMessageHash *string `json:"initializationRequestMessageHash,omitempty"` + InitializationResponseMessageHash *string `json:"initializationResponseMessageHash,omitempty"` + InitializationRequestMessageRcvTimeStamp *string `json:"initializationRequestMessageRcvTimeStamp,omitempty"` + InitializationRequestMessageProcessedTimeStamp *string `json:"initializationRequestMessageProcessedTimeStamp,omitempty"` + ClientSignatureInitializationRequestMessage *string `json:"clientSignatureInitializationRequestMessage,omitempty"` + ServerSignatureInitializationResponseMessage *string `json:"serverSignatureInitializationResponseMessage,omitempty"` + TransferCommenceMessageRequestHash *string `json:"transferCommenceMessageRequestHash,omitempty"` + TransferCommenceMessageResponseHash *string `json:"transferCommenceMessageResponseHash,omitempty"` + ClientSignatureTransferCommenceRequestMessage *string `json:"clientSignatureTransferCommenceRequestMessage,omitempty"` + ServerSignatureTransferCommenceResponseMessage *string `json:"serverSignatureTransferCommenceResponseMessage,omitempty"` + LockEvidenceRequestMessageHash *string `json:"lockEvidenceRequestMessageHash,omitempty"` + LockEvidenceResponseMessageHash *string `json:"lockEvidenceResponseMessageHash,omitempty"` + ClientSignatureLockEvidenceRequestMessage *string `json:"clientSignatureLockEvidenceRequestMessage,omitempty"` + ServerSignatureLockEvidenceResponseMessage *string `json:"serverSignatureLockEvidenceResponseMessage,omitempty"` + LockEvidenceClaim *string `json:"lockEvidenceClaim,omitempty"` + CommitPrepareRequestMessageHash *string `json:"commitPrepareRequestMessageHash,omitempty"` + CommitPrepareResponseMessageHash *string `json:"commitPrepareResponseMessageHash,omitempty"` + ClientSignatureCommitPreparationRequestMessage *string `json:"clientSignatureCommitPreparationRequestMessage,omitempty"` + ServerSignatureCommitPreparationResponseMessage *string `json:"serverSignatureCommitPreparationResponseMessage,omitempty"` + CommitFinalRequestMessageHash *string `json:"commitFinalRequestMessageHash,omitempty"` + CommitFinalResponseMessageHash *string `json:"commitFinalResponseMessageHash,omitempty"` + CommitFinalClaim *string `json:"commitFinalClaim,omitempty"` + CommitFinalClaimFormat *string `json:"commitFinalClaimFormat,omitempty"` + CommitAcknowledgementClaim *string `json:"commitAcknowledgementClaim,omitempty"` + CommitAcknowledgementClaimFormat *string `json:"commitAcknowledgementClaimFormat,omitempty"` + ClientSignatureCommitFinalRequestMessage *string `json:"clientSignatureCommitFinalRequestMessage,omitempty"` + ServerSignatureCommitFinalResponseMessage *string `json:"serverSignatureCommitFinalResponseMessage,omitempty"` + TransferCompleteMessageHash *string `json:"transferCompleteMessageHash,omitempty"` + ClientSignatureTransferCompleteMessage *string `json:"clientSignatureTransferCompleteMessage,omitempty"` + MaxRetries *float32 `json:"maxRetries,omitempty"` + RecipientLedgerAssetID *string `json:"recipientLedgerAssetID,omitempty"` + SourceLedgerAssetID *string `json:"sourceLedgerAssetID,omitempty"` + MaxTimeout *float32 `json:"maxTimeout,omitempty"` + LastLogEntryTimestamp *string `json:"lastLogEntryTimestamp,omitempty"` + UnlockAssetClaim *string `json:"unlockAssetClaim,omitempty"` + RecreateAssetClaim *string `json:"recreateAssetClaim,omitempty"` + DeleteAssetClaim *string `json:"deleteAssetClaim,omitempty"` + LastMessageReceivedTimestamp *string `json:"lastMessageReceivedTimestamp,omitempty"` + Rollback *bool `json:"rollback,omitempty"` + RollbackMessageHash *string `json:"rollbackMessageHash,omitempty"` + RollbackProofs []string `json:"rollbackProofs,omitempty"` + RollbackActionsPerformed []string `json:"rollbackActionsPerformed,omitempty"` +} + +// NewSessionData instantiates a new SessionData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSessionData() *SessionData { + this := SessionData{} + return &this +} + +// NewSessionDataWithDefaults instantiates a new SessionData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSessionDataWithDefaults() *SessionData { + this := SessionData{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SessionData) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SessionData) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SessionData) SetId(v string) { + o.Id = &v +} + +// GetStep returns the Step field value if set, zero value otherwise. +func (o *SessionData) GetStep() float32 { + if o == nil || IsNil(o.Step) { + var ret float32 + return ret + } + return *o.Step +} + +// GetStepOk returns a tuple with the Step field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetStepOk() (*float32, bool) { + if o == nil || IsNil(o.Step) { + return nil, false + } + return o.Step, true +} + +// HasStep returns a boolean if a field has been set. +func (o *SessionData) HasStep() bool { + if o != nil && !IsNil(o.Step) { + return true + } + + return false +} + +// SetStep gets a reference to the given float32 and assigns it to the Step field. +func (o *SessionData) SetStep(v float32) { + o.Step = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SessionData) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SessionData) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SessionData) SetVersion(v string) { + o.Version = &v +} + +// GetLastSequenceNumber returns the LastSequenceNumber field value if set, zero value otherwise. +func (o *SessionData) GetLastSequenceNumber() float32 { + if o == nil || IsNil(o.LastSequenceNumber) { + var ret float32 + return ret + } + return *o.LastSequenceNumber +} + +// GetLastSequenceNumberOk returns a tuple with the LastSequenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLastSequenceNumberOk() (*float32, bool) { + if o == nil || IsNil(o.LastSequenceNumber) { + return nil, false + } + return o.LastSequenceNumber, true +} + +// HasLastSequenceNumber returns a boolean if a field has been set. +func (o *SessionData) HasLastSequenceNumber() bool { + if o != nil && !IsNil(o.LastSequenceNumber) { + return true + } + + return false +} + +// SetLastSequenceNumber gets a reference to the given float32 and assigns it to the LastSequenceNumber field. +func (o *SessionData) SetLastSequenceNumber(v float32) { + o.LastSequenceNumber = &v +} + +// GetLoggingProfile returns the LoggingProfile field value if set, zero value otherwise. +func (o *SessionData) GetLoggingProfile() string { + if o == nil || IsNil(o.LoggingProfile) { + var ret string + return ret + } + return *o.LoggingProfile +} + +// GetLoggingProfileOk returns a tuple with the LoggingProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLoggingProfileOk() (*string, bool) { + if o == nil || IsNil(o.LoggingProfile) { + return nil, false + } + return o.LoggingProfile, true +} + +// HasLoggingProfile returns a boolean if a field has been set. +func (o *SessionData) HasLoggingProfile() bool { + if o != nil && !IsNil(o.LoggingProfile) { + return true + } + + return false +} + +// SetLoggingProfile gets a reference to the given string and assigns it to the LoggingProfile field. +func (o *SessionData) SetLoggingProfile(v string) { + o.LoggingProfile = &v +} + +// GetAccessControlProfile returns the AccessControlProfile field value if set, zero value otherwise. +func (o *SessionData) GetAccessControlProfile() string { + if o == nil || IsNil(o.AccessControlProfile) { + var ret string + return ret + } + return *o.AccessControlProfile +} + +// GetAccessControlProfileOk returns a tuple with the AccessControlProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAccessControlProfileOk() (*string, bool) { + if o == nil || IsNil(o.AccessControlProfile) { + return nil, false + } + return o.AccessControlProfile, true +} + +// HasAccessControlProfile returns a boolean if a field has been set. +func (o *SessionData) HasAccessControlProfile() bool { + if o != nil && !IsNil(o.AccessControlProfile) { + return true + } + + return false +} + +// SetAccessControlProfile gets a reference to the given string and assigns it to the AccessControlProfile field. +func (o *SessionData) SetAccessControlProfile(v string) { + o.AccessControlProfile = &v +} + +// GetApplicationProfile returns the ApplicationProfile field value if set, zero value otherwise. +func (o *SessionData) GetApplicationProfile() string { + if o == nil || IsNil(o.ApplicationProfile) { + var ret string + return ret + } + return *o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetApplicationProfileOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationProfile) { + return nil, false + } + return o.ApplicationProfile, true +} + +// HasApplicationProfile returns a boolean if a field has been set. +func (o *SessionData) HasApplicationProfile() bool { + if o != nil && !IsNil(o.ApplicationProfile) { + return true + } + + return false +} + +// SetApplicationProfile gets a reference to the given string and assigns it to the ApplicationProfile field. +func (o *SessionData) SetApplicationProfile(v string) { + o.ApplicationProfile = &v +} + +// GetPayloadProfile returns the PayloadProfile field value if set, zero value otherwise. +func (o *SessionData) GetPayloadProfile() PayloadProfile { + if o == nil || IsNil(o.PayloadProfile) { + var ret PayloadProfile + return ret + } + return *o.PayloadProfile +} + +// GetPayloadProfileOk returns a tuple with the PayloadProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetPayloadProfileOk() (*PayloadProfile, bool) { + if o == nil || IsNil(o.PayloadProfile) { + return nil, false + } + return o.PayloadProfile, true +} + +// HasPayloadProfile returns a boolean if a field has been set. +func (o *SessionData) HasPayloadProfile() bool { + if o != nil && !IsNil(o.PayloadProfile) { + return true + } + + return false +} + +// SetPayloadProfile gets a reference to the given PayloadProfile and assigns it to the PayloadProfile field. +func (o *SessionData) SetPayloadProfile(v PayloadProfile) { + o.PayloadProfile = &v +} + +// GetAssetProfile returns the AssetProfile field value if set, zero value otherwise. +func (o *SessionData) GetAssetProfile() AssetProfile { + if o == nil || IsNil(o.AssetProfile) { + var ret AssetProfile + return ret + } + return *o.AssetProfile +} + +// GetAssetProfileOk returns a tuple with the AssetProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAssetProfileOk() (*AssetProfile, bool) { + if o == nil || IsNil(o.AssetProfile) { + return nil, false + } + return o.AssetProfile, true +} + +// HasAssetProfile returns a boolean if a field has been set. +func (o *SessionData) HasAssetProfile() bool { + if o != nil && !IsNil(o.AssetProfile) { + return true + } + + return false +} + +// SetAssetProfile gets a reference to the given AssetProfile and assigns it to the AssetProfile field. +func (o *SessionData) SetAssetProfile(v AssetProfile) { + o.AssetProfile = &v +} + +// GetAllowedSourceBackupGateways returns the AllowedSourceBackupGateways field value if set, zero value otherwise. +func (o *SessionData) GetAllowedSourceBackupGateways() []string { + if o == nil || IsNil(o.AllowedSourceBackupGateways) { + var ret []string + return ret + } + return o.AllowedSourceBackupGateways +} + +// GetAllowedSourceBackupGatewaysOk returns a tuple with the AllowedSourceBackupGateways field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAllowedSourceBackupGatewaysOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedSourceBackupGateways) { + return nil, false + } + return o.AllowedSourceBackupGateways, true +} + +// HasAllowedSourceBackupGateways returns a boolean if a field has been set. +func (o *SessionData) HasAllowedSourceBackupGateways() bool { + if o != nil && !IsNil(o.AllowedSourceBackupGateways) { + return true + } + + return false +} + +// SetAllowedSourceBackupGateways gets a reference to the given []string and assigns it to the AllowedSourceBackupGateways field. +func (o *SessionData) SetAllowedSourceBackupGateways(v []string) { + o.AllowedSourceBackupGateways = v +} + +// GetAllowedRecipientBackupGateways returns the AllowedRecipientBackupGateways field value if set, zero value otherwise. +func (o *SessionData) GetAllowedRecipientBackupGateways() []string { + if o == nil || IsNil(o.AllowedRecipientBackupGateways) { + var ret []string + return ret + } + return o.AllowedRecipientBackupGateways +} + +// GetAllowedRecipientBackupGatewaysOk returns a tuple with the AllowedRecipientBackupGateways field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAllowedRecipientBackupGatewaysOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRecipientBackupGateways) { + return nil, false + } + return o.AllowedRecipientBackupGateways, true +} + +// HasAllowedRecipientBackupGateways returns a boolean if a field has been set. +func (o *SessionData) HasAllowedRecipientBackupGateways() bool { + if o != nil && !IsNil(o.AllowedRecipientBackupGateways) { + return true + } + + return false +} + +// SetAllowedRecipientBackupGateways gets a reference to the given []string and assigns it to the AllowedRecipientBackupGateways field. +func (o *SessionData) SetAllowedRecipientBackupGateways(v []string) { + o.AllowedRecipientBackupGateways = v +} + +// GetSourceBasePath returns the SourceBasePath field value if set, zero value otherwise. +func (o *SessionData) GetSourceBasePath() string { + if o == nil || IsNil(o.SourceBasePath) { + var ret string + return ret + } + return *o.SourceBasePath +} + +// GetSourceBasePathOk returns a tuple with the SourceBasePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceBasePathOk() (*string, bool) { + if o == nil || IsNil(o.SourceBasePath) { + return nil, false + } + return o.SourceBasePath, true +} + +// HasSourceBasePath returns a boolean if a field has been set. +func (o *SessionData) HasSourceBasePath() bool { + if o != nil && !IsNil(o.SourceBasePath) { + return true + } + + return false +} + +// SetSourceBasePath gets a reference to the given string and assigns it to the SourceBasePath field. +func (o *SessionData) SetSourceBasePath(v string) { + o.SourceBasePath = &v +} + +// GetRecipientBasePath returns the RecipientBasePath field value if set, zero value otherwise. +func (o *SessionData) GetRecipientBasePath() string { + if o == nil || IsNil(o.RecipientBasePath) { + var ret string + return ret + } + return *o.RecipientBasePath +} + +// GetRecipientBasePathOk returns a tuple with the RecipientBasePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientBasePathOk() (*string, bool) { + if o == nil || IsNil(o.RecipientBasePath) { + return nil, false + } + return o.RecipientBasePath, true +} + +// HasRecipientBasePath returns a boolean if a field has been set. +func (o *SessionData) HasRecipientBasePath() bool { + if o != nil && !IsNil(o.RecipientBasePath) { + return true + } + + return false +} + +// SetRecipientBasePath gets a reference to the given string and assigns it to the RecipientBasePath field. +func (o *SessionData) SetRecipientBasePath(v string) { + o.RecipientBasePath = &v +} + +// GetOriginatorPubkey returns the OriginatorPubkey field value if set, zero value otherwise. +func (o *SessionData) GetOriginatorPubkey() string { + if o == nil || IsNil(o.OriginatorPubkey) { + var ret string + return ret + } + return *o.OriginatorPubkey +} + +// GetOriginatorPubkeyOk returns a tuple with the OriginatorPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetOriginatorPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.OriginatorPubkey) { + return nil, false + } + return o.OriginatorPubkey, true +} + +// HasOriginatorPubkey returns a boolean if a field has been set. +func (o *SessionData) HasOriginatorPubkey() bool { + if o != nil && !IsNil(o.OriginatorPubkey) { + return true + } + + return false +} + +// SetOriginatorPubkey gets a reference to the given string and assigns it to the OriginatorPubkey field. +func (o *SessionData) SetOriginatorPubkey(v string) { + o.OriginatorPubkey = &v +} + +// GetBeneficiaryPubkey returns the BeneficiaryPubkey field value if set, zero value otherwise. +func (o *SessionData) GetBeneficiaryPubkey() string { + if o == nil || IsNil(o.BeneficiaryPubkey) { + var ret string + return ret + } + return *o.BeneficiaryPubkey +} + +// GetBeneficiaryPubkeyOk returns a tuple with the BeneficiaryPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetBeneficiaryPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.BeneficiaryPubkey) { + return nil, false + } + return o.BeneficiaryPubkey, true +} + +// HasBeneficiaryPubkey returns a boolean if a field has been set. +func (o *SessionData) HasBeneficiaryPubkey() bool { + if o != nil && !IsNil(o.BeneficiaryPubkey) { + return true + } + + return false +} + +// SetBeneficiaryPubkey gets a reference to the given string and assigns it to the BeneficiaryPubkey field. +func (o *SessionData) SetBeneficiaryPubkey(v string) { + o.BeneficiaryPubkey = &v +} + +// GetSourceGatewayPubkey returns the SourceGatewayPubkey field value if set, zero value otherwise. +func (o *SessionData) GetSourceGatewayPubkey() string { + if o == nil || IsNil(o.SourceGatewayPubkey) { + var ret string + return ret + } + return *o.SourceGatewayPubkey +} + +// GetSourceGatewayPubkeyOk returns a tuple with the SourceGatewayPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceGatewayPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.SourceGatewayPubkey) { + return nil, false + } + return o.SourceGatewayPubkey, true +} + +// HasSourceGatewayPubkey returns a boolean if a field has been set. +func (o *SessionData) HasSourceGatewayPubkey() bool { + if o != nil && !IsNil(o.SourceGatewayPubkey) { + return true + } + + return false +} + +// SetSourceGatewayPubkey gets a reference to the given string and assigns it to the SourceGatewayPubkey field. +func (o *SessionData) SetSourceGatewayPubkey(v string) { + o.SourceGatewayPubkey = &v +} + +// GetSourceGatewayDltSystem returns the SourceGatewayDltSystem field value if set, zero value otherwise. +func (o *SessionData) GetSourceGatewayDltSystem() string { + if o == nil || IsNil(o.SourceGatewayDltSystem) { + var ret string + return ret + } + return *o.SourceGatewayDltSystem +} + +// GetSourceGatewayDltSystemOk returns a tuple with the SourceGatewayDltSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceGatewayDltSystemOk() (*string, bool) { + if o == nil || IsNil(o.SourceGatewayDltSystem) { + return nil, false + } + return o.SourceGatewayDltSystem, true +} + +// HasSourceGatewayDltSystem returns a boolean if a field has been set. +func (o *SessionData) HasSourceGatewayDltSystem() bool { + if o != nil && !IsNil(o.SourceGatewayDltSystem) { + return true + } + + return false +} + +// SetSourceGatewayDltSystem gets a reference to the given string and assigns it to the SourceGatewayDltSystem field. +func (o *SessionData) SetSourceGatewayDltSystem(v string) { + o.SourceGatewayDltSystem = &v +} + +// GetRecipientGatewayPubkey returns the RecipientGatewayPubkey field value if set, zero value otherwise. +func (o *SessionData) GetRecipientGatewayPubkey() string { + if o == nil || IsNil(o.RecipientGatewayPubkey) { + var ret string + return ret + } + return *o.RecipientGatewayPubkey +} + +// GetRecipientGatewayPubkeyOk returns a tuple with the RecipientGatewayPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientGatewayPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.RecipientGatewayPubkey) { + return nil, false + } + return o.RecipientGatewayPubkey, true +} + +// HasRecipientGatewayPubkey returns a boolean if a field has been set. +func (o *SessionData) HasRecipientGatewayPubkey() bool { + if o != nil && !IsNil(o.RecipientGatewayPubkey) { + return true + } + + return false +} + +// SetRecipientGatewayPubkey gets a reference to the given string and assigns it to the RecipientGatewayPubkey field. +func (o *SessionData) SetRecipientGatewayPubkey(v string) { + o.RecipientGatewayPubkey = &v +} + +// GetRecipientGatewayDltSystem returns the RecipientGatewayDltSystem field value if set, zero value otherwise. +func (o *SessionData) GetRecipientGatewayDltSystem() string { + if o == nil || IsNil(o.RecipientGatewayDltSystem) { + var ret string + return ret + } + return *o.RecipientGatewayDltSystem +} + +// GetRecipientGatewayDltSystemOk returns a tuple with the RecipientGatewayDltSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientGatewayDltSystemOk() (*string, bool) { + if o == nil || IsNil(o.RecipientGatewayDltSystem) { + return nil, false + } + return o.RecipientGatewayDltSystem, true +} + +// HasRecipientGatewayDltSystem returns a boolean if a field has been set. +func (o *SessionData) HasRecipientGatewayDltSystem() bool { + if o != nil && !IsNil(o.RecipientGatewayDltSystem) { + return true + } + + return false +} + +// SetRecipientGatewayDltSystem gets a reference to the given string and assigns it to the RecipientGatewayDltSystem field. +func (o *SessionData) SetRecipientGatewayDltSystem(v string) { + o.RecipientGatewayDltSystem = &v +} + +// GetInitializationRequestMessageHash returns the InitializationRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetInitializationRequestMessageHash() string { + if o == nil || IsNil(o.InitializationRequestMessageHash) { + var ret string + return ret + } + return *o.InitializationRequestMessageHash +} + +// GetInitializationRequestMessageHashOk returns a tuple with the InitializationRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.InitializationRequestMessageHash) { + return nil, false + } + return o.InitializationRequestMessageHash, true +} + +// HasInitializationRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasInitializationRequestMessageHash() bool { + if o != nil && !IsNil(o.InitializationRequestMessageHash) { + return true + } + + return false +} + +// SetInitializationRequestMessageHash gets a reference to the given string and assigns it to the InitializationRequestMessageHash field. +func (o *SessionData) SetInitializationRequestMessageHash(v string) { + o.InitializationRequestMessageHash = &v +} + +// GetInitializationResponseMessageHash returns the InitializationResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetInitializationResponseMessageHash() string { + if o == nil || IsNil(o.InitializationResponseMessageHash) { + var ret string + return ret + } + return *o.InitializationResponseMessageHash +} + +// GetInitializationResponseMessageHashOk returns a tuple with the InitializationResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.InitializationResponseMessageHash) { + return nil, false + } + return o.InitializationResponseMessageHash, true +} + +// HasInitializationResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasInitializationResponseMessageHash() bool { + if o != nil && !IsNil(o.InitializationResponseMessageHash) { + return true + } + + return false +} + +// SetInitializationResponseMessageHash gets a reference to the given string and assigns it to the InitializationResponseMessageHash field. +func (o *SessionData) SetInitializationResponseMessageHash(v string) { + o.InitializationResponseMessageHash = &v +} + +// GetInitializationRequestMessageRcvTimeStamp returns the InitializationRequestMessageRcvTimeStamp field value if set, zero value otherwise. +func (o *SessionData) GetInitializationRequestMessageRcvTimeStamp() string { + if o == nil || IsNil(o.InitializationRequestMessageRcvTimeStamp) { + var ret string + return ret + } + return *o.InitializationRequestMessageRcvTimeStamp +} + +// GetInitializationRequestMessageRcvTimeStampOk returns a tuple with the InitializationRequestMessageRcvTimeStamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationRequestMessageRcvTimeStampOk() (*string, bool) { + if o == nil || IsNil(o.InitializationRequestMessageRcvTimeStamp) { + return nil, false + } + return o.InitializationRequestMessageRcvTimeStamp, true +} + +// HasInitializationRequestMessageRcvTimeStamp returns a boolean if a field has been set. +func (o *SessionData) HasInitializationRequestMessageRcvTimeStamp() bool { + if o != nil && !IsNil(o.InitializationRequestMessageRcvTimeStamp) { + return true + } + + return false +} + +// SetInitializationRequestMessageRcvTimeStamp gets a reference to the given string and assigns it to the InitializationRequestMessageRcvTimeStamp field. +func (o *SessionData) SetInitializationRequestMessageRcvTimeStamp(v string) { + o.InitializationRequestMessageRcvTimeStamp = &v +} + +// GetInitializationRequestMessageProcessedTimeStamp returns the InitializationRequestMessageProcessedTimeStamp field value if set, zero value otherwise. +func (o *SessionData) GetInitializationRequestMessageProcessedTimeStamp() string { + if o == nil || IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + var ret string + return ret + } + return *o.InitializationRequestMessageProcessedTimeStamp +} + +// GetInitializationRequestMessageProcessedTimeStampOk returns a tuple with the InitializationRequestMessageProcessedTimeStamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationRequestMessageProcessedTimeStampOk() (*string, bool) { + if o == nil || IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + return nil, false + } + return o.InitializationRequestMessageProcessedTimeStamp, true +} + +// HasInitializationRequestMessageProcessedTimeStamp returns a boolean if a field has been set. +func (o *SessionData) HasInitializationRequestMessageProcessedTimeStamp() bool { + if o != nil && !IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + return true + } + + return false +} + +// SetInitializationRequestMessageProcessedTimeStamp gets a reference to the given string and assigns it to the InitializationRequestMessageProcessedTimeStamp field. +func (o *SessionData) SetInitializationRequestMessageProcessedTimeStamp(v string) { + o.InitializationRequestMessageProcessedTimeStamp = &v +} + +// GetClientSignatureInitializationRequestMessage returns the ClientSignatureInitializationRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureInitializationRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureInitializationRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureInitializationRequestMessage +} + +// GetClientSignatureInitializationRequestMessageOk returns a tuple with the ClientSignatureInitializationRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureInitializationRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureInitializationRequestMessage) { + return nil, false + } + return o.ClientSignatureInitializationRequestMessage, true +} + +// HasClientSignatureInitializationRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureInitializationRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureInitializationRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureInitializationRequestMessage gets a reference to the given string and assigns it to the ClientSignatureInitializationRequestMessage field. +func (o *SessionData) SetClientSignatureInitializationRequestMessage(v string) { + o.ClientSignatureInitializationRequestMessage = &v +} + +// GetServerSignatureInitializationResponseMessage returns the ServerSignatureInitializationResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureInitializationResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureInitializationResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureInitializationResponseMessage +} + +// GetServerSignatureInitializationResponseMessageOk returns a tuple with the ServerSignatureInitializationResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureInitializationResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureInitializationResponseMessage) { + return nil, false + } + return o.ServerSignatureInitializationResponseMessage, true +} + +// HasServerSignatureInitializationResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureInitializationResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureInitializationResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureInitializationResponseMessage gets a reference to the given string and assigns it to the ServerSignatureInitializationResponseMessage field. +func (o *SessionData) SetServerSignatureInitializationResponseMessage(v string) { + o.ServerSignatureInitializationResponseMessage = &v +} + +// GetTransferCommenceMessageRequestHash returns the TransferCommenceMessageRequestHash field value if set, zero value otherwise. +func (o *SessionData) GetTransferCommenceMessageRequestHash() string { + if o == nil || IsNil(o.TransferCommenceMessageRequestHash) { + var ret string + return ret + } + return *o.TransferCommenceMessageRequestHash +} + +// GetTransferCommenceMessageRequestHashOk returns a tuple with the TransferCommenceMessageRequestHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetTransferCommenceMessageRequestHashOk() (*string, bool) { + if o == nil || IsNil(o.TransferCommenceMessageRequestHash) { + return nil, false + } + return o.TransferCommenceMessageRequestHash, true +} + +// HasTransferCommenceMessageRequestHash returns a boolean if a field has been set. +func (o *SessionData) HasTransferCommenceMessageRequestHash() bool { + if o != nil && !IsNil(o.TransferCommenceMessageRequestHash) { + return true + } + + return false +} + +// SetTransferCommenceMessageRequestHash gets a reference to the given string and assigns it to the TransferCommenceMessageRequestHash field. +func (o *SessionData) SetTransferCommenceMessageRequestHash(v string) { + o.TransferCommenceMessageRequestHash = &v +} + +// GetTransferCommenceMessageResponseHash returns the TransferCommenceMessageResponseHash field value if set, zero value otherwise. +func (o *SessionData) GetTransferCommenceMessageResponseHash() string { + if o == nil || IsNil(o.TransferCommenceMessageResponseHash) { + var ret string + return ret + } + return *o.TransferCommenceMessageResponseHash +} + +// GetTransferCommenceMessageResponseHashOk returns a tuple with the TransferCommenceMessageResponseHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetTransferCommenceMessageResponseHashOk() (*string, bool) { + if o == nil || IsNil(o.TransferCommenceMessageResponseHash) { + return nil, false + } + return o.TransferCommenceMessageResponseHash, true +} + +// HasTransferCommenceMessageResponseHash returns a boolean if a field has been set. +func (o *SessionData) HasTransferCommenceMessageResponseHash() bool { + if o != nil && !IsNil(o.TransferCommenceMessageResponseHash) { + return true + } + + return false +} + +// SetTransferCommenceMessageResponseHash gets a reference to the given string and assigns it to the TransferCommenceMessageResponseHash field. +func (o *SessionData) SetTransferCommenceMessageResponseHash(v string) { + o.TransferCommenceMessageResponseHash = &v +} + +// GetClientSignatureTransferCommenceRequestMessage returns the ClientSignatureTransferCommenceRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureTransferCommenceRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureTransferCommenceRequestMessage +} + +// GetClientSignatureTransferCommenceRequestMessageOk returns a tuple with the ClientSignatureTransferCommenceRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureTransferCommenceRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + return nil, false + } + return o.ClientSignatureTransferCommenceRequestMessage, true +} + +// HasClientSignatureTransferCommenceRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureTransferCommenceRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureTransferCommenceRequestMessage gets a reference to the given string and assigns it to the ClientSignatureTransferCommenceRequestMessage field. +func (o *SessionData) SetClientSignatureTransferCommenceRequestMessage(v string) { + o.ClientSignatureTransferCommenceRequestMessage = &v +} + +// GetServerSignatureTransferCommenceResponseMessage returns the ServerSignatureTransferCommenceResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureTransferCommenceResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureTransferCommenceResponseMessage +} + +// GetServerSignatureTransferCommenceResponseMessageOk returns a tuple with the ServerSignatureTransferCommenceResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureTransferCommenceResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + return nil, false + } + return o.ServerSignatureTransferCommenceResponseMessage, true +} + +// HasServerSignatureTransferCommenceResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureTransferCommenceResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureTransferCommenceResponseMessage gets a reference to the given string and assigns it to the ServerSignatureTransferCommenceResponseMessage field. +func (o *SessionData) SetServerSignatureTransferCommenceResponseMessage(v string) { + o.ServerSignatureTransferCommenceResponseMessage = &v +} + +// GetLockEvidenceRequestMessageHash returns the LockEvidenceRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetLockEvidenceRequestMessageHash() string { + if o == nil || IsNil(o.LockEvidenceRequestMessageHash) { + var ret string + return ret + } + return *o.LockEvidenceRequestMessageHash +} + +// GetLockEvidenceRequestMessageHashOk returns a tuple with the LockEvidenceRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLockEvidenceRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.LockEvidenceRequestMessageHash) { + return nil, false + } + return o.LockEvidenceRequestMessageHash, true +} + +// HasLockEvidenceRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasLockEvidenceRequestMessageHash() bool { + if o != nil && !IsNil(o.LockEvidenceRequestMessageHash) { + return true + } + + return false +} + +// SetLockEvidenceRequestMessageHash gets a reference to the given string and assigns it to the LockEvidenceRequestMessageHash field. +func (o *SessionData) SetLockEvidenceRequestMessageHash(v string) { + o.LockEvidenceRequestMessageHash = &v +} + +// GetLockEvidenceResponseMessageHash returns the LockEvidenceResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetLockEvidenceResponseMessageHash() string { + if o == nil || IsNil(o.LockEvidenceResponseMessageHash) { + var ret string + return ret + } + return *o.LockEvidenceResponseMessageHash +} + +// GetLockEvidenceResponseMessageHashOk returns a tuple with the LockEvidenceResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLockEvidenceResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.LockEvidenceResponseMessageHash) { + return nil, false + } + return o.LockEvidenceResponseMessageHash, true +} + +// HasLockEvidenceResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasLockEvidenceResponseMessageHash() bool { + if o != nil && !IsNil(o.LockEvidenceResponseMessageHash) { + return true + } + + return false +} + +// SetLockEvidenceResponseMessageHash gets a reference to the given string and assigns it to the LockEvidenceResponseMessageHash field. +func (o *SessionData) SetLockEvidenceResponseMessageHash(v string) { + o.LockEvidenceResponseMessageHash = &v +} + +// GetClientSignatureLockEvidenceRequestMessage returns the ClientSignatureLockEvidenceRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureLockEvidenceRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureLockEvidenceRequestMessage +} + +// GetClientSignatureLockEvidenceRequestMessageOk returns a tuple with the ClientSignatureLockEvidenceRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureLockEvidenceRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + return nil, false + } + return o.ClientSignatureLockEvidenceRequestMessage, true +} + +// HasClientSignatureLockEvidenceRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureLockEvidenceRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureLockEvidenceRequestMessage gets a reference to the given string and assigns it to the ClientSignatureLockEvidenceRequestMessage field. +func (o *SessionData) SetClientSignatureLockEvidenceRequestMessage(v string) { + o.ClientSignatureLockEvidenceRequestMessage = &v +} + +// GetServerSignatureLockEvidenceResponseMessage returns the ServerSignatureLockEvidenceResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureLockEvidenceResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureLockEvidenceResponseMessage +} + +// GetServerSignatureLockEvidenceResponseMessageOk returns a tuple with the ServerSignatureLockEvidenceResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureLockEvidenceResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + return nil, false + } + return o.ServerSignatureLockEvidenceResponseMessage, true +} + +// HasServerSignatureLockEvidenceResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureLockEvidenceResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureLockEvidenceResponseMessage gets a reference to the given string and assigns it to the ServerSignatureLockEvidenceResponseMessage field. +func (o *SessionData) SetServerSignatureLockEvidenceResponseMessage(v string) { + o.ServerSignatureLockEvidenceResponseMessage = &v +} + +// GetLockEvidenceClaim returns the LockEvidenceClaim field value if set, zero value otherwise. +func (o *SessionData) GetLockEvidenceClaim() string { + if o == nil || IsNil(o.LockEvidenceClaim) { + var ret string + return ret + } + return *o.LockEvidenceClaim +} + +// GetLockEvidenceClaimOk returns a tuple with the LockEvidenceClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLockEvidenceClaimOk() (*string, bool) { + if o == nil || IsNil(o.LockEvidenceClaim) { + return nil, false + } + return o.LockEvidenceClaim, true +} + +// HasLockEvidenceClaim returns a boolean if a field has been set. +func (o *SessionData) HasLockEvidenceClaim() bool { + if o != nil && !IsNil(o.LockEvidenceClaim) { + return true + } + + return false +} + +// SetLockEvidenceClaim gets a reference to the given string and assigns it to the LockEvidenceClaim field. +func (o *SessionData) SetLockEvidenceClaim(v string) { + o.LockEvidenceClaim = &v +} + +// GetCommitPrepareRequestMessageHash returns the CommitPrepareRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitPrepareRequestMessageHash() string { + if o == nil || IsNil(o.CommitPrepareRequestMessageHash) { + var ret string + return ret + } + return *o.CommitPrepareRequestMessageHash +} + +// GetCommitPrepareRequestMessageHashOk returns a tuple with the CommitPrepareRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitPrepareRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitPrepareRequestMessageHash) { + return nil, false + } + return o.CommitPrepareRequestMessageHash, true +} + +// HasCommitPrepareRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitPrepareRequestMessageHash() bool { + if o != nil && !IsNil(o.CommitPrepareRequestMessageHash) { + return true + } + + return false +} + +// SetCommitPrepareRequestMessageHash gets a reference to the given string and assigns it to the CommitPrepareRequestMessageHash field. +func (o *SessionData) SetCommitPrepareRequestMessageHash(v string) { + o.CommitPrepareRequestMessageHash = &v +} + +// GetCommitPrepareResponseMessageHash returns the CommitPrepareResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitPrepareResponseMessageHash() string { + if o == nil || IsNil(o.CommitPrepareResponseMessageHash) { + var ret string + return ret + } + return *o.CommitPrepareResponseMessageHash +} + +// GetCommitPrepareResponseMessageHashOk returns a tuple with the CommitPrepareResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitPrepareResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitPrepareResponseMessageHash) { + return nil, false + } + return o.CommitPrepareResponseMessageHash, true +} + +// HasCommitPrepareResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitPrepareResponseMessageHash() bool { + if o != nil && !IsNil(o.CommitPrepareResponseMessageHash) { + return true + } + + return false +} + +// SetCommitPrepareResponseMessageHash gets a reference to the given string and assigns it to the CommitPrepareResponseMessageHash field. +func (o *SessionData) SetCommitPrepareResponseMessageHash(v string) { + o.CommitPrepareResponseMessageHash = &v +} + +// GetClientSignatureCommitPreparationRequestMessage returns the ClientSignatureCommitPreparationRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureCommitPreparationRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureCommitPreparationRequestMessage +} + +// GetClientSignatureCommitPreparationRequestMessageOk returns a tuple with the ClientSignatureCommitPreparationRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureCommitPreparationRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + return nil, false + } + return o.ClientSignatureCommitPreparationRequestMessage, true +} + +// HasClientSignatureCommitPreparationRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureCommitPreparationRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureCommitPreparationRequestMessage gets a reference to the given string and assigns it to the ClientSignatureCommitPreparationRequestMessage field. +func (o *SessionData) SetClientSignatureCommitPreparationRequestMessage(v string) { + o.ClientSignatureCommitPreparationRequestMessage = &v +} + +// GetServerSignatureCommitPreparationResponseMessage returns the ServerSignatureCommitPreparationResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureCommitPreparationResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureCommitPreparationResponseMessage +} + +// GetServerSignatureCommitPreparationResponseMessageOk returns a tuple with the ServerSignatureCommitPreparationResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureCommitPreparationResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + return nil, false + } + return o.ServerSignatureCommitPreparationResponseMessage, true +} + +// HasServerSignatureCommitPreparationResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureCommitPreparationResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureCommitPreparationResponseMessage gets a reference to the given string and assigns it to the ServerSignatureCommitPreparationResponseMessage field. +func (o *SessionData) SetServerSignatureCommitPreparationResponseMessage(v string) { + o.ServerSignatureCommitPreparationResponseMessage = &v +} + +// GetCommitFinalRequestMessageHash returns the CommitFinalRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalRequestMessageHash() string { + if o == nil || IsNil(o.CommitFinalRequestMessageHash) { + var ret string + return ret + } + return *o.CommitFinalRequestMessageHash +} + +// GetCommitFinalRequestMessageHashOk returns a tuple with the CommitFinalRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalRequestMessageHash) { + return nil, false + } + return o.CommitFinalRequestMessageHash, true +} + +// HasCommitFinalRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalRequestMessageHash() bool { + if o != nil && !IsNil(o.CommitFinalRequestMessageHash) { + return true + } + + return false +} + +// SetCommitFinalRequestMessageHash gets a reference to the given string and assigns it to the CommitFinalRequestMessageHash field. +func (o *SessionData) SetCommitFinalRequestMessageHash(v string) { + o.CommitFinalRequestMessageHash = &v +} + +// GetCommitFinalResponseMessageHash returns the CommitFinalResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalResponseMessageHash() string { + if o == nil || IsNil(o.CommitFinalResponseMessageHash) { + var ret string + return ret + } + return *o.CommitFinalResponseMessageHash +} + +// GetCommitFinalResponseMessageHashOk returns a tuple with the CommitFinalResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalResponseMessageHash) { + return nil, false + } + return o.CommitFinalResponseMessageHash, true +} + +// HasCommitFinalResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalResponseMessageHash() bool { + if o != nil && !IsNil(o.CommitFinalResponseMessageHash) { + return true + } + + return false +} + +// SetCommitFinalResponseMessageHash gets a reference to the given string and assigns it to the CommitFinalResponseMessageHash field. +func (o *SessionData) SetCommitFinalResponseMessageHash(v string) { + o.CommitFinalResponseMessageHash = &v +} + +// GetCommitFinalClaim returns the CommitFinalClaim field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalClaim() string { + if o == nil || IsNil(o.CommitFinalClaim) { + var ret string + return ret + } + return *o.CommitFinalClaim +} + +// GetCommitFinalClaimOk returns a tuple with the CommitFinalClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalClaimOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalClaim) { + return nil, false + } + return o.CommitFinalClaim, true +} + +// HasCommitFinalClaim returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalClaim() bool { + if o != nil && !IsNil(o.CommitFinalClaim) { + return true + } + + return false +} + +// SetCommitFinalClaim gets a reference to the given string and assigns it to the CommitFinalClaim field. +func (o *SessionData) SetCommitFinalClaim(v string) { + o.CommitFinalClaim = &v +} + +// GetCommitFinalClaimFormat returns the CommitFinalClaimFormat field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalClaimFormat() string { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + var ret string + return ret + } + return *o.CommitFinalClaimFormat +} + +// GetCommitFinalClaimFormatOk returns a tuple with the CommitFinalClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalClaimFormatOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + return nil, false + } + return o.CommitFinalClaimFormat, true +} + +// HasCommitFinalClaimFormat returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalClaimFormat() bool { + if o != nil && !IsNil(o.CommitFinalClaimFormat) { + return true + } + + return false +} + +// SetCommitFinalClaimFormat gets a reference to the given string and assigns it to the CommitFinalClaimFormat field. +func (o *SessionData) SetCommitFinalClaimFormat(v string) { + o.CommitFinalClaimFormat = &v +} + +// GetCommitAcknowledgementClaim returns the CommitAcknowledgementClaim field value if set, zero value otherwise. +func (o *SessionData) GetCommitAcknowledgementClaim() string { + if o == nil || IsNil(o.CommitAcknowledgementClaim) { + var ret string + return ret + } + return *o.CommitAcknowledgementClaim +} + +// GetCommitAcknowledgementClaimOk returns a tuple with the CommitAcknowledgementClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitAcknowledgementClaimOk() (*string, bool) { + if o == nil || IsNil(o.CommitAcknowledgementClaim) { + return nil, false + } + return o.CommitAcknowledgementClaim, true +} + +// HasCommitAcknowledgementClaim returns a boolean if a field has been set. +func (o *SessionData) HasCommitAcknowledgementClaim() bool { + if o != nil && !IsNil(o.CommitAcknowledgementClaim) { + return true + } + + return false +} + +// SetCommitAcknowledgementClaim gets a reference to the given string and assigns it to the CommitAcknowledgementClaim field. +func (o *SessionData) SetCommitAcknowledgementClaim(v string) { + o.CommitAcknowledgementClaim = &v +} + +// GetCommitAcknowledgementClaimFormat returns the CommitAcknowledgementClaimFormat field value if set, zero value otherwise. +func (o *SessionData) GetCommitAcknowledgementClaimFormat() string { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + var ret string + return ret + } + return *o.CommitAcknowledgementClaimFormat +} + +// GetCommitAcknowledgementClaimFormatOk returns a tuple with the CommitAcknowledgementClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitAcknowledgementClaimFormatOk() (*string, bool) { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + return nil, false + } + return o.CommitAcknowledgementClaimFormat, true +} + +// HasCommitAcknowledgementClaimFormat returns a boolean if a field has been set. +func (o *SessionData) HasCommitAcknowledgementClaimFormat() bool { + if o != nil && !IsNil(o.CommitAcknowledgementClaimFormat) { + return true + } + + return false +} + +// SetCommitAcknowledgementClaimFormat gets a reference to the given string and assigns it to the CommitAcknowledgementClaimFormat field. +func (o *SessionData) SetCommitAcknowledgementClaimFormat(v string) { + o.CommitAcknowledgementClaimFormat = &v +} + +// GetClientSignatureCommitFinalRequestMessage returns the ClientSignatureCommitFinalRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureCommitFinalRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureCommitFinalRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureCommitFinalRequestMessage +} + +// GetClientSignatureCommitFinalRequestMessageOk returns a tuple with the ClientSignatureCommitFinalRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureCommitFinalRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureCommitFinalRequestMessage) { + return nil, false + } + return o.ClientSignatureCommitFinalRequestMessage, true +} + +// HasClientSignatureCommitFinalRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureCommitFinalRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureCommitFinalRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureCommitFinalRequestMessage gets a reference to the given string and assigns it to the ClientSignatureCommitFinalRequestMessage field. +func (o *SessionData) SetClientSignatureCommitFinalRequestMessage(v string) { + o.ClientSignatureCommitFinalRequestMessage = &v +} + +// GetServerSignatureCommitFinalResponseMessage returns the ServerSignatureCommitFinalResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureCommitFinalResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureCommitFinalResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureCommitFinalResponseMessage +} + +// GetServerSignatureCommitFinalResponseMessageOk returns a tuple with the ServerSignatureCommitFinalResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureCommitFinalResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureCommitFinalResponseMessage) { + return nil, false + } + return o.ServerSignatureCommitFinalResponseMessage, true +} + +// HasServerSignatureCommitFinalResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureCommitFinalResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureCommitFinalResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureCommitFinalResponseMessage gets a reference to the given string and assigns it to the ServerSignatureCommitFinalResponseMessage field. +func (o *SessionData) SetServerSignatureCommitFinalResponseMessage(v string) { + o.ServerSignatureCommitFinalResponseMessage = &v +} + +// GetTransferCompleteMessageHash returns the TransferCompleteMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetTransferCompleteMessageHash() string { + if o == nil || IsNil(o.TransferCompleteMessageHash) { + var ret string + return ret + } + return *o.TransferCompleteMessageHash +} + +// GetTransferCompleteMessageHashOk returns a tuple with the TransferCompleteMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetTransferCompleteMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.TransferCompleteMessageHash) { + return nil, false + } + return o.TransferCompleteMessageHash, true +} + +// HasTransferCompleteMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasTransferCompleteMessageHash() bool { + if o != nil && !IsNil(o.TransferCompleteMessageHash) { + return true + } + + return false +} + +// SetTransferCompleteMessageHash gets a reference to the given string and assigns it to the TransferCompleteMessageHash field. +func (o *SessionData) SetTransferCompleteMessageHash(v string) { + o.TransferCompleteMessageHash = &v +} + +// GetClientSignatureTransferCompleteMessage returns the ClientSignatureTransferCompleteMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureTransferCompleteMessage() string { + if o == nil || IsNil(o.ClientSignatureTransferCompleteMessage) { + var ret string + return ret + } + return *o.ClientSignatureTransferCompleteMessage +} + +// GetClientSignatureTransferCompleteMessageOk returns a tuple with the ClientSignatureTransferCompleteMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureTransferCompleteMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureTransferCompleteMessage) { + return nil, false + } + return o.ClientSignatureTransferCompleteMessage, true +} + +// HasClientSignatureTransferCompleteMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureTransferCompleteMessage() bool { + if o != nil && !IsNil(o.ClientSignatureTransferCompleteMessage) { + return true + } + + return false +} + +// SetClientSignatureTransferCompleteMessage gets a reference to the given string and assigns it to the ClientSignatureTransferCompleteMessage field. +func (o *SessionData) SetClientSignatureTransferCompleteMessage(v string) { + o.ClientSignatureTransferCompleteMessage = &v +} + +// GetMaxRetries returns the MaxRetries field value if set, zero value otherwise. +func (o *SessionData) GetMaxRetries() float32 { + if o == nil || IsNil(o.MaxRetries) { + var ret float32 + return ret + } + return *o.MaxRetries +} + +// GetMaxRetriesOk returns a tuple with the MaxRetries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetMaxRetriesOk() (*float32, bool) { + if o == nil || IsNil(o.MaxRetries) { + return nil, false + } + return o.MaxRetries, true +} + +// HasMaxRetries returns a boolean if a field has been set. +func (o *SessionData) HasMaxRetries() bool { + if o != nil && !IsNil(o.MaxRetries) { + return true + } + + return false +} + +// SetMaxRetries gets a reference to the given float32 and assigns it to the MaxRetries field. +func (o *SessionData) SetMaxRetries(v float32) { + o.MaxRetries = &v +} + +// GetRecipientLedgerAssetID returns the RecipientLedgerAssetID field value if set, zero value otherwise. +func (o *SessionData) GetRecipientLedgerAssetID() string { + if o == nil || IsNil(o.RecipientLedgerAssetID) { + var ret string + return ret + } + return *o.RecipientLedgerAssetID +} + +// GetRecipientLedgerAssetIDOk returns a tuple with the RecipientLedgerAssetID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientLedgerAssetIDOk() (*string, bool) { + if o == nil || IsNil(o.RecipientLedgerAssetID) { + return nil, false + } + return o.RecipientLedgerAssetID, true +} + +// HasRecipientLedgerAssetID returns a boolean if a field has been set. +func (o *SessionData) HasRecipientLedgerAssetID() bool { + if o != nil && !IsNil(o.RecipientLedgerAssetID) { + return true + } + + return false +} + +// SetRecipientLedgerAssetID gets a reference to the given string and assigns it to the RecipientLedgerAssetID field. +func (o *SessionData) SetRecipientLedgerAssetID(v string) { + o.RecipientLedgerAssetID = &v +} + +// GetSourceLedgerAssetID returns the SourceLedgerAssetID field value if set, zero value otherwise. +func (o *SessionData) GetSourceLedgerAssetID() string { + if o == nil || IsNil(o.SourceLedgerAssetID) { + var ret string + return ret + } + return *o.SourceLedgerAssetID +} + +// GetSourceLedgerAssetIDOk returns a tuple with the SourceLedgerAssetID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceLedgerAssetIDOk() (*string, bool) { + if o == nil || IsNil(o.SourceLedgerAssetID) { + return nil, false + } + return o.SourceLedgerAssetID, true +} + +// HasSourceLedgerAssetID returns a boolean if a field has been set. +func (o *SessionData) HasSourceLedgerAssetID() bool { + if o != nil && !IsNil(o.SourceLedgerAssetID) { + return true + } + + return false +} + +// SetSourceLedgerAssetID gets a reference to the given string and assigns it to the SourceLedgerAssetID field. +func (o *SessionData) SetSourceLedgerAssetID(v string) { + o.SourceLedgerAssetID = &v +} + +// GetMaxTimeout returns the MaxTimeout field value if set, zero value otherwise. +func (o *SessionData) GetMaxTimeout() float32 { + if o == nil || IsNil(o.MaxTimeout) { + var ret float32 + return ret + } + return *o.MaxTimeout +} + +// GetMaxTimeoutOk returns a tuple with the MaxTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetMaxTimeoutOk() (*float32, bool) { + if o == nil || IsNil(o.MaxTimeout) { + return nil, false + } + return o.MaxTimeout, true +} + +// HasMaxTimeout returns a boolean if a field has been set. +func (o *SessionData) HasMaxTimeout() bool { + if o != nil && !IsNil(o.MaxTimeout) { + return true + } + + return false +} + +// SetMaxTimeout gets a reference to the given float32 and assigns it to the MaxTimeout field. +func (o *SessionData) SetMaxTimeout(v float32) { + o.MaxTimeout = &v +} + +// GetLastLogEntryTimestamp returns the LastLogEntryTimestamp field value if set, zero value otherwise. +func (o *SessionData) GetLastLogEntryTimestamp() string { + if o == nil || IsNil(o.LastLogEntryTimestamp) { + var ret string + return ret + } + return *o.LastLogEntryTimestamp +} + +// GetLastLogEntryTimestampOk returns a tuple with the LastLogEntryTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLastLogEntryTimestampOk() (*string, bool) { + if o == nil || IsNil(o.LastLogEntryTimestamp) { + return nil, false + } + return o.LastLogEntryTimestamp, true +} + +// HasLastLogEntryTimestamp returns a boolean if a field has been set. +func (o *SessionData) HasLastLogEntryTimestamp() bool { + if o != nil && !IsNil(o.LastLogEntryTimestamp) { + return true + } + + return false +} + +// SetLastLogEntryTimestamp gets a reference to the given string and assigns it to the LastLogEntryTimestamp field. +func (o *SessionData) SetLastLogEntryTimestamp(v string) { + o.LastLogEntryTimestamp = &v +} + +// GetUnlockAssetClaim returns the UnlockAssetClaim field value if set, zero value otherwise. +func (o *SessionData) GetUnlockAssetClaim() string { + if o == nil || IsNil(o.UnlockAssetClaim) { + var ret string + return ret + } + return *o.UnlockAssetClaim +} + +// GetUnlockAssetClaimOk returns a tuple with the UnlockAssetClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetUnlockAssetClaimOk() (*string, bool) { + if o == nil || IsNil(o.UnlockAssetClaim) { + return nil, false + } + return o.UnlockAssetClaim, true +} + +// HasUnlockAssetClaim returns a boolean if a field has been set. +func (o *SessionData) HasUnlockAssetClaim() bool { + if o != nil && !IsNil(o.UnlockAssetClaim) { + return true + } + + return false +} + +// SetUnlockAssetClaim gets a reference to the given string and assigns it to the UnlockAssetClaim field. +func (o *SessionData) SetUnlockAssetClaim(v string) { + o.UnlockAssetClaim = &v +} + +// GetRecreateAssetClaim returns the RecreateAssetClaim field value if set, zero value otherwise. +func (o *SessionData) GetRecreateAssetClaim() string { + if o == nil || IsNil(o.RecreateAssetClaim) { + var ret string + return ret + } + return *o.RecreateAssetClaim +} + +// GetRecreateAssetClaimOk returns a tuple with the RecreateAssetClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecreateAssetClaimOk() (*string, bool) { + if o == nil || IsNil(o.RecreateAssetClaim) { + return nil, false + } + return o.RecreateAssetClaim, true +} + +// HasRecreateAssetClaim returns a boolean if a field has been set. +func (o *SessionData) HasRecreateAssetClaim() bool { + if o != nil && !IsNil(o.RecreateAssetClaim) { + return true + } + + return false +} + +// SetRecreateAssetClaim gets a reference to the given string and assigns it to the RecreateAssetClaim field. +func (o *SessionData) SetRecreateAssetClaim(v string) { + o.RecreateAssetClaim = &v +} + +// GetDeleteAssetClaim returns the DeleteAssetClaim field value if set, zero value otherwise. +func (o *SessionData) GetDeleteAssetClaim() string { + if o == nil || IsNil(o.DeleteAssetClaim) { + var ret string + return ret + } + return *o.DeleteAssetClaim +} + +// GetDeleteAssetClaimOk returns a tuple with the DeleteAssetClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetDeleteAssetClaimOk() (*string, bool) { + if o == nil || IsNil(o.DeleteAssetClaim) { + return nil, false + } + return o.DeleteAssetClaim, true +} + +// HasDeleteAssetClaim returns a boolean if a field has been set. +func (o *SessionData) HasDeleteAssetClaim() bool { + if o != nil && !IsNil(o.DeleteAssetClaim) { + return true + } + + return false +} + +// SetDeleteAssetClaim gets a reference to the given string and assigns it to the DeleteAssetClaim field. +func (o *SessionData) SetDeleteAssetClaim(v string) { + o.DeleteAssetClaim = &v +} + +// GetLastMessageReceivedTimestamp returns the LastMessageReceivedTimestamp field value if set, zero value otherwise. +func (o *SessionData) GetLastMessageReceivedTimestamp() string { + if o == nil || IsNil(o.LastMessageReceivedTimestamp) { + var ret string + return ret + } + return *o.LastMessageReceivedTimestamp +} + +// GetLastMessageReceivedTimestampOk returns a tuple with the LastMessageReceivedTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLastMessageReceivedTimestampOk() (*string, bool) { + if o == nil || IsNil(o.LastMessageReceivedTimestamp) { + return nil, false + } + return o.LastMessageReceivedTimestamp, true +} + +// HasLastMessageReceivedTimestamp returns a boolean if a field has been set. +func (o *SessionData) HasLastMessageReceivedTimestamp() bool { + if o != nil && !IsNil(o.LastMessageReceivedTimestamp) { + return true + } + + return false +} + +// SetLastMessageReceivedTimestamp gets a reference to the given string and assigns it to the LastMessageReceivedTimestamp field. +func (o *SessionData) SetLastMessageReceivedTimestamp(v string) { + o.LastMessageReceivedTimestamp = &v +} + +// GetRollback returns the Rollback field value if set, zero value otherwise. +func (o *SessionData) GetRollback() bool { + if o == nil || IsNil(o.Rollback) { + var ret bool + return ret + } + return *o.Rollback +} + +// GetRollbackOk returns a tuple with the Rollback field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackOk() (*bool, bool) { + if o == nil || IsNil(o.Rollback) { + return nil, false + } + return o.Rollback, true +} + +// HasRollback returns a boolean if a field has been set. +func (o *SessionData) HasRollback() bool { + if o != nil && !IsNil(o.Rollback) { + return true + } + + return false +} + +// SetRollback gets a reference to the given bool and assigns it to the Rollback field. +func (o *SessionData) SetRollback(v bool) { + o.Rollback = &v +} + +// GetRollbackMessageHash returns the RollbackMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetRollbackMessageHash() string { + if o == nil || IsNil(o.RollbackMessageHash) { + var ret string + return ret + } + return *o.RollbackMessageHash +} + +// GetRollbackMessageHashOk returns a tuple with the RollbackMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.RollbackMessageHash) { + return nil, false + } + return o.RollbackMessageHash, true +} + +// HasRollbackMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasRollbackMessageHash() bool { + if o != nil && !IsNil(o.RollbackMessageHash) { + return true + } + + return false +} + +// SetRollbackMessageHash gets a reference to the given string and assigns it to the RollbackMessageHash field. +func (o *SessionData) SetRollbackMessageHash(v string) { + o.RollbackMessageHash = &v +} + +// GetRollbackProofs returns the RollbackProofs field value if set, zero value otherwise. +func (o *SessionData) GetRollbackProofs() []string { + if o == nil || IsNil(o.RollbackProofs) { + var ret []string + return ret + } + return o.RollbackProofs +} + +// GetRollbackProofsOk returns a tuple with the RollbackProofs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackProofsOk() ([]string, bool) { + if o == nil || IsNil(o.RollbackProofs) { + return nil, false + } + return o.RollbackProofs, true +} + +// HasRollbackProofs returns a boolean if a field has been set. +func (o *SessionData) HasRollbackProofs() bool { + if o != nil && !IsNil(o.RollbackProofs) { + return true + } + + return false +} + +// SetRollbackProofs gets a reference to the given []string and assigns it to the RollbackProofs field. +func (o *SessionData) SetRollbackProofs(v []string) { + o.RollbackProofs = v +} + +// GetRollbackActionsPerformed returns the RollbackActionsPerformed field value if set, zero value otherwise. +func (o *SessionData) GetRollbackActionsPerformed() []string { + if o == nil || IsNil(o.RollbackActionsPerformed) { + var ret []string + return ret + } + return o.RollbackActionsPerformed +} + +// GetRollbackActionsPerformedOk returns a tuple with the RollbackActionsPerformed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackActionsPerformedOk() ([]string, bool) { + if o == nil || IsNil(o.RollbackActionsPerformed) { + return nil, false + } + return o.RollbackActionsPerformed, true +} + +// HasRollbackActionsPerformed returns a boolean if a field has been set. +func (o *SessionData) HasRollbackActionsPerformed() bool { + if o != nil && !IsNil(o.RollbackActionsPerformed) { + return true + } + + return false +} + +// SetRollbackActionsPerformed gets a reference to the given []string and assigns it to the RollbackActionsPerformed field. +func (o *SessionData) SetRollbackActionsPerformed(v []string) { + o.RollbackActionsPerformed = v +} + +func (o SessionData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SessionData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Step) { + toSerialize["step"] = o.Step + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.LastSequenceNumber) { + toSerialize["lastSequenceNumber"] = o.LastSequenceNumber + } + if !IsNil(o.LoggingProfile) { + toSerialize["loggingProfile"] = o.LoggingProfile + } + if !IsNil(o.AccessControlProfile) { + toSerialize["accessControlProfile"] = o.AccessControlProfile + } + if !IsNil(o.ApplicationProfile) { + toSerialize["applicationProfile"] = o.ApplicationProfile + } + if !IsNil(o.PayloadProfile) { + toSerialize["payloadProfile"] = o.PayloadProfile + } + if !IsNil(o.AssetProfile) { + toSerialize["assetProfile"] = o.AssetProfile + } + if !IsNil(o.AllowedSourceBackupGateways) { + toSerialize["allowedSourceBackupGateways"] = o.AllowedSourceBackupGateways + } + if !IsNil(o.AllowedRecipientBackupGateways) { + toSerialize["allowedRecipientBackupGateways"] = o.AllowedRecipientBackupGateways + } + if !IsNil(o.SourceBasePath) { + toSerialize["sourceBasePath"] = o.SourceBasePath + } + if !IsNil(o.RecipientBasePath) { + toSerialize["recipientBasePath"] = o.RecipientBasePath + } + if !IsNil(o.OriginatorPubkey) { + toSerialize["originatorPubkey"] = o.OriginatorPubkey + } + if !IsNil(o.BeneficiaryPubkey) { + toSerialize["beneficiaryPubkey"] = o.BeneficiaryPubkey + } + if !IsNil(o.SourceGatewayPubkey) { + toSerialize["sourceGatewayPubkey"] = o.SourceGatewayPubkey + } + if !IsNil(o.SourceGatewayDltSystem) { + toSerialize["sourceGatewayDltSystem"] = o.SourceGatewayDltSystem + } + if !IsNil(o.RecipientGatewayPubkey) { + toSerialize["recipientGatewayPubkey"] = o.RecipientGatewayPubkey + } + if !IsNil(o.RecipientGatewayDltSystem) { + toSerialize["recipientGatewayDltSystem"] = o.RecipientGatewayDltSystem + } + if !IsNil(o.InitializationRequestMessageHash) { + toSerialize["initializationRequestMessageHash"] = o.InitializationRequestMessageHash + } + if !IsNil(o.InitializationResponseMessageHash) { + toSerialize["initializationResponseMessageHash"] = o.InitializationResponseMessageHash + } + if !IsNil(o.InitializationRequestMessageRcvTimeStamp) { + toSerialize["initializationRequestMessageRcvTimeStamp"] = o.InitializationRequestMessageRcvTimeStamp + } + if !IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + toSerialize["initializationRequestMessageProcessedTimeStamp"] = o.InitializationRequestMessageProcessedTimeStamp + } + if !IsNil(o.ClientSignatureInitializationRequestMessage) { + toSerialize["clientSignatureInitializationRequestMessage"] = o.ClientSignatureInitializationRequestMessage + } + if !IsNil(o.ServerSignatureInitializationResponseMessage) { + toSerialize["serverSignatureInitializationResponseMessage"] = o.ServerSignatureInitializationResponseMessage + } + if !IsNil(o.TransferCommenceMessageRequestHash) { + toSerialize["transferCommenceMessageRequestHash"] = o.TransferCommenceMessageRequestHash + } + if !IsNil(o.TransferCommenceMessageResponseHash) { + toSerialize["transferCommenceMessageResponseHash"] = o.TransferCommenceMessageResponseHash + } + if !IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + toSerialize["clientSignatureTransferCommenceRequestMessage"] = o.ClientSignatureTransferCommenceRequestMessage + } + if !IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + toSerialize["serverSignatureTransferCommenceResponseMessage"] = o.ServerSignatureTransferCommenceResponseMessage + } + if !IsNil(o.LockEvidenceRequestMessageHash) { + toSerialize["lockEvidenceRequestMessageHash"] = o.LockEvidenceRequestMessageHash + } + if !IsNil(o.LockEvidenceResponseMessageHash) { + toSerialize["lockEvidenceResponseMessageHash"] = o.LockEvidenceResponseMessageHash + } + if !IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + toSerialize["clientSignatureLockEvidenceRequestMessage"] = o.ClientSignatureLockEvidenceRequestMessage + } + if !IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + toSerialize["serverSignatureLockEvidenceResponseMessage"] = o.ServerSignatureLockEvidenceResponseMessage + } + if !IsNil(o.LockEvidenceClaim) { + toSerialize["lockEvidenceClaim"] = o.LockEvidenceClaim + } + if !IsNil(o.CommitPrepareRequestMessageHash) { + toSerialize["commitPrepareRequestMessageHash"] = o.CommitPrepareRequestMessageHash + } + if !IsNil(o.CommitPrepareResponseMessageHash) { + toSerialize["commitPrepareResponseMessageHash"] = o.CommitPrepareResponseMessageHash + } + if !IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + toSerialize["clientSignatureCommitPreparationRequestMessage"] = o.ClientSignatureCommitPreparationRequestMessage + } + if !IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + toSerialize["serverSignatureCommitPreparationResponseMessage"] = o.ServerSignatureCommitPreparationResponseMessage + } + if !IsNil(o.CommitFinalRequestMessageHash) { + toSerialize["commitFinalRequestMessageHash"] = o.CommitFinalRequestMessageHash + } + if !IsNil(o.CommitFinalResponseMessageHash) { + toSerialize["commitFinalResponseMessageHash"] = o.CommitFinalResponseMessageHash + } + if !IsNil(o.CommitFinalClaim) { + toSerialize["commitFinalClaim"] = o.CommitFinalClaim + } + if !IsNil(o.CommitFinalClaimFormat) { + toSerialize["commitFinalClaimFormat"] = o.CommitFinalClaimFormat + } + if !IsNil(o.CommitAcknowledgementClaim) { + toSerialize["commitAcknowledgementClaim"] = o.CommitAcknowledgementClaim + } + if !IsNil(o.CommitAcknowledgementClaimFormat) { + toSerialize["commitAcknowledgementClaimFormat"] = o.CommitAcknowledgementClaimFormat + } + if !IsNil(o.ClientSignatureCommitFinalRequestMessage) { + toSerialize["clientSignatureCommitFinalRequestMessage"] = o.ClientSignatureCommitFinalRequestMessage + } + if !IsNil(o.ServerSignatureCommitFinalResponseMessage) { + toSerialize["serverSignatureCommitFinalResponseMessage"] = o.ServerSignatureCommitFinalResponseMessage + } + if !IsNil(o.TransferCompleteMessageHash) { + toSerialize["transferCompleteMessageHash"] = o.TransferCompleteMessageHash + } + if !IsNil(o.ClientSignatureTransferCompleteMessage) { + toSerialize["clientSignatureTransferCompleteMessage"] = o.ClientSignatureTransferCompleteMessage + } + if !IsNil(o.MaxRetries) { + toSerialize["maxRetries"] = o.MaxRetries + } + if !IsNil(o.RecipientLedgerAssetID) { + toSerialize["recipientLedgerAssetID"] = o.RecipientLedgerAssetID + } + if !IsNil(o.SourceLedgerAssetID) { + toSerialize["sourceLedgerAssetID"] = o.SourceLedgerAssetID + } + if !IsNil(o.MaxTimeout) { + toSerialize["maxTimeout"] = o.MaxTimeout + } + if !IsNil(o.LastLogEntryTimestamp) { + toSerialize["lastLogEntryTimestamp"] = o.LastLogEntryTimestamp + } + if !IsNil(o.UnlockAssetClaim) { + toSerialize["unlockAssetClaim"] = o.UnlockAssetClaim + } + if !IsNil(o.RecreateAssetClaim) { + toSerialize["recreateAssetClaim"] = o.RecreateAssetClaim + } + if !IsNil(o.DeleteAssetClaim) { + toSerialize["deleteAssetClaim"] = o.DeleteAssetClaim + } + if !IsNil(o.LastMessageReceivedTimestamp) { + toSerialize["lastMessageReceivedTimestamp"] = o.LastMessageReceivedTimestamp + } + if !IsNil(o.Rollback) { + toSerialize["rollback"] = o.Rollback + } + if !IsNil(o.RollbackMessageHash) { + toSerialize["rollbackMessageHash"] = o.RollbackMessageHash + } + if !IsNil(o.RollbackProofs) { + toSerialize["rollbackProofs"] = o.RollbackProofs + } + if !IsNil(o.RollbackActionsPerformed) { + toSerialize["rollbackActionsPerformed"] = o.RollbackActionsPerformed + } + return toSerialize, nil +} + +type NullableSessionData struct { + value *SessionData + isSet bool +} + +func (v NullableSessionData) Get() *SessionData { + return v.value +} + +func (v *NullableSessionData) Set(val *SessionData) { + v.value = val + v.isSet = true +} + +func (v NullableSessionData) IsSet() bool { + return v.isSet +} + +func (v *NullableSessionData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSessionData(val *SessionData) *NullableSessionData { + return &NullableSessionData{value: val, isSet: true} +} + +func (v NullableSessionData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSessionData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go new file mode 100644 index 0000000000..9dc12f5ce5 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go @@ -0,0 +1,496 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferCommenceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferCommenceV1Request{} + +// TransferCommenceV1Request struct for TransferCommenceV1Request +type TransferCommenceV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + OriginatorPubkey string `json:"originatorPubkey"` + BeneficiaryPubkey string `json:"beneficiaryPubkey"` + SenderDltSystem string `json:"senderDltSystem"` + RecipientDltSystem string `json:"recipientDltSystem"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashAssetProfile string `json:"hashAssetProfile"` + AssetUnit *int32 `json:"assetUnit,omitempty"` + HashPrevMessage string `json:"hashPrevMessage"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber int32 `json:"sequenceNumber"` +} + +// NewTransferCommenceV1Request instantiates a new TransferCommenceV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferCommenceV1Request(sessionID string, messageType string, originatorPubkey string, beneficiaryPubkey string, senderDltSystem string, recipientDltSystem string, clientIdentityPubkey string, serverIdentityPubkey string, hashAssetProfile string, hashPrevMessage string, signature string, sequenceNumber int32) *TransferCommenceV1Request { + this := TransferCommenceV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.OriginatorPubkey = originatorPubkey + this.BeneficiaryPubkey = beneficiaryPubkey + this.SenderDltSystem = senderDltSystem + this.RecipientDltSystem = recipientDltSystem + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashAssetProfile = hashAssetProfile + this.HashPrevMessage = hashPrevMessage + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewTransferCommenceV1RequestWithDefaults instantiates a new TransferCommenceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferCommenceV1RequestWithDefaults() *TransferCommenceV1Request { + this := TransferCommenceV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *TransferCommenceV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferCommenceV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *TransferCommenceV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferCommenceV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetOriginatorPubkey returns the OriginatorPubkey field value +func (o *TransferCommenceV1Request) GetOriginatorPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.OriginatorPubkey +} + +// GetOriginatorPubkeyOk returns a tuple with the OriginatorPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetOriginatorPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginatorPubkey, true +} + +// SetOriginatorPubkey sets field value +func (o *TransferCommenceV1Request) SetOriginatorPubkey(v string) { + o.OriginatorPubkey = v +} + +// GetBeneficiaryPubkey returns the BeneficiaryPubkey field value +func (o *TransferCommenceV1Request) GetBeneficiaryPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.BeneficiaryPubkey +} + +// GetBeneficiaryPubkeyOk returns a tuple with the BeneficiaryPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetBeneficiaryPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BeneficiaryPubkey, true +} + +// SetBeneficiaryPubkey sets field value +func (o *TransferCommenceV1Request) SetBeneficiaryPubkey(v string) { + o.BeneficiaryPubkey = v +} + +// GetSenderDltSystem returns the SenderDltSystem field value +func (o *TransferCommenceV1Request) GetSenderDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.SenderDltSystem +} + +// GetSenderDltSystemOk returns a tuple with the SenderDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSenderDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SenderDltSystem, true +} + +// SetSenderDltSystem sets field value +func (o *TransferCommenceV1Request) SetSenderDltSystem(v string) { + o.SenderDltSystem = v +} + +// GetRecipientDltSystem returns the RecipientDltSystem field value +func (o *TransferCommenceV1Request) GetRecipientDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientDltSystem +} + +// GetRecipientDltSystemOk returns a tuple with the RecipientDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetRecipientDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientDltSystem, true +} + +// SetRecipientDltSystem sets field value +func (o *TransferCommenceV1Request) SetRecipientDltSystem(v string) { + o.RecipientDltSystem = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *TransferCommenceV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *TransferCommenceV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferCommenceV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferCommenceV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashAssetProfile returns the HashAssetProfile field value +func (o *TransferCommenceV1Request) GetHashAssetProfile() string { + if o == nil { + var ret string + return ret + } + + return o.HashAssetProfile +} + +// GetHashAssetProfileOk returns a tuple with the HashAssetProfile field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetHashAssetProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashAssetProfile, true +} + +// SetHashAssetProfile sets field value +func (o *TransferCommenceV1Request) SetHashAssetProfile(v string) { + o.HashAssetProfile = v +} + +// GetAssetUnit returns the AssetUnit field value if set, zero value otherwise. +func (o *TransferCommenceV1Request) GetAssetUnit() int32 { + if o == nil || IsNil(o.AssetUnit) { + var ret int32 + return ret + } + return *o.AssetUnit +} + +// GetAssetUnitOk returns a tuple with the AssetUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetAssetUnitOk() (*int32, bool) { + if o == nil || IsNil(o.AssetUnit) { + return nil, false + } + return o.AssetUnit, true +} + +// HasAssetUnit returns a boolean if a field has been set. +func (o *TransferCommenceV1Request) HasAssetUnit() bool { + if o != nil && !IsNil(o.AssetUnit) { + return true + } + + return false +} + +// SetAssetUnit gets a reference to the given int32 and assigns it to the AssetUnit field. +func (o *TransferCommenceV1Request) SetAssetUnit(v int32) { + o.AssetUnit = &v +} + +// GetHashPrevMessage returns the HashPrevMessage field value +func (o *TransferCommenceV1Request) GetHashPrevMessage() string { + if o == nil { + var ret string + return ret + } + + return o.HashPrevMessage +} + +// GetHashPrevMessageOk returns a tuple with the HashPrevMessage field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetHashPrevMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashPrevMessage, true +} + +// SetHashPrevMessage sets field value +func (o *TransferCommenceV1Request) SetHashPrevMessage(v string) { + o.HashPrevMessage = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransferCommenceV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransferCommenceV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *TransferCommenceV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *TransferCommenceV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *TransferCommenceV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *TransferCommenceV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *TransferCommenceV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferCommenceV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferCommenceV1Request) GetSequenceNumber() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSequenceNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferCommenceV1Request) SetSequenceNumber(v int32) { + o.SequenceNumber = v +} + +func (o TransferCommenceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferCommenceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["originatorPubkey"] = o.OriginatorPubkey + toSerialize["beneficiaryPubkey"] = o.BeneficiaryPubkey + toSerialize["senderDltSystem"] = o.SenderDltSystem + toSerialize["recipientDltSystem"] = o.RecipientDltSystem + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashAssetProfile"] = o.HashAssetProfile + if !IsNil(o.AssetUnit) { + toSerialize["assetUnit"] = o.AssetUnit + } + toSerialize["hashPrevMessage"] = o.HashPrevMessage + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableTransferCommenceV1Request struct { + value *TransferCommenceV1Request + isSet bool +} + +func (v NullableTransferCommenceV1Request) Get() *TransferCommenceV1Request { + return v.value +} + +func (v *NullableTransferCommenceV1Request) Set(val *TransferCommenceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableTransferCommenceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferCommenceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferCommenceV1Request(val *TransferCommenceV1Request) *NullableTransferCommenceV1Request { + return &NullableTransferCommenceV1Request{value: val, isSet: true} +} + +func (v NullableTransferCommenceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferCommenceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go new file mode 100644 index 0000000000..941bfddb2d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go @@ -0,0 +1,361 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferCommenceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferCommenceV1Response{} + +// TransferCommenceV1Response struct for TransferCommenceV1Response +type TransferCommenceV1Response struct { + SessionID string `json:"sessionID"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashCommenceRequest string `json:"hashCommenceRequest"` + ServerTransferNumber NullableInt32 `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + MessageType string `json:"messageType"` + MessageHash *string `json:"messageHash,omitempty"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewTransferCommenceV1Response instantiates a new TransferCommenceV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferCommenceV1Response(sessionID string, clientIdentityPubkey string, serverIdentityPubkey string, hashCommenceRequest string, signature string, messageType string, sequenceNumber float32) *TransferCommenceV1Response { + this := TransferCommenceV1Response{} + this.SessionID = sessionID + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashCommenceRequest = hashCommenceRequest + this.Signature = signature + this.MessageType = messageType + this.SequenceNumber = sequenceNumber + return &this +} + +// NewTransferCommenceV1ResponseWithDefaults instantiates a new TransferCommenceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferCommenceV1ResponseWithDefaults() *TransferCommenceV1Response { + this := TransferCommenceV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *TransferCommenceV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferCommenceV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *TransferCommenceV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *TransferCommenceV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferCommenceV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferCommenceV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashCommenceRequest returns the HashCommenceRequest field value +func (o *TransferCommenceV1Response) GetHashCommenceRequest() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommenceRequest +} + +// GetHashCommenceRequestOk returns a tuple with the HashCommenceRequest field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetHashCommenceRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommenceRequest, true +} + +// SetHashCommenceRequest sets field value +func (o *TransferCommenceV1Response) SetHashCommenceRequest(v string) { + o.HashCommenceRequest = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransferCommenceV1Response) GetServerTransferNumber() int32 { + if o == nil || IsNil(o.ServerTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ServerTransferNumber.Get() +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransferCommenceV1Response) GetServerTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ServerTransferNumber.Get(), o.ServerTransferNumber.IsSet() +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *TransferCommenceV1Response) HasServerTransferNumber() bool { + if o != nil && o.ServerTransferNumber.IsSet() { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given NullableInt32 and assigns it to the ServerTransferNumber field. +func (o *TransferCommenceV1Response) SetServerTransferNumber(v int32) { + o.ServerTransferNumber.Set(&v) +} +// SetServerTransferNumberNil sets the value for ServerTransferNumber to be an explicit nil +func (o *TransferCommenceV1Response) SetServerTransferNumberNil() { + o.ServerTransferNumber.Set(nil) +} + +// UnsetServerTransferNumber ensures that no value is present for ServerTransferNumber, not even an explicit nil +func (o *TransferCommenceV1Response) UnsetServerTransferNumber() { + o.ServerTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *TransferCommenceV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferCommenceV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetMessageType returns the MessageType field value +func (o *TransferCommenceV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferCommenceV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetMessageHash returns the MessageHash field value if set, zero value otherwise. +func (o *TransferCommenceV1Response) GetMessageHash() string { + if o == nil || IsNil(o.MessageHash) { + var ret string + return ret + } + return *o.MessageHash +} + +// GetMessageHashOk returns a tuple with the MessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.MessageHash) { + return nil, false + } + return o.MessageHash, true +} + +// HasMessageHash returns a boolean if a field has been set. +func (o *TransferCommenceV1Response) HasMessageHash() bool { + if o != nil && !IsNil(o.MessageHash) { + return true + } + + return false +} + +// SetMessageHash gets a reference to the given string and assigns it to the MessageHash field. +func (o *TransferCommenceV1Response) SetMessageHash(v string) { + o.MessageHash = &v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferCommenceV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferCommenceV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o TransferCommenceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferCommenceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashCommenceRequest"] = o.HashCommenceRequest + if o.ServerTransferNumber.IsSet() { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["messageType"] = o.MessageType + if !IsNil(o.MessageHash) { + toSerialize["messageHash"] = o.MessageHash + } + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableTransferCommenceV1Response struct { + value *TransferCommenceV1Response + isSet bool +} + +func (v NullableTransferCommenceV1Response) Get() *TransferCommenceV1Response { + return v.value +} + +func (v *NullableTransferCommenceV1Response) Set(val *TransferCommenceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableTransferCommenceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferCommenceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferCommenceV1Response(val *TransferCommenceV1Response) *NullableTransferCommenceV1Response { + return &NullableTransferCommenceV1Response{value: val, isSet: true} +} + +func (v NullableTransferCommenceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferCommenceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go new file mode 100644 index 0000000000..08ddec0203 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go @@ -0,0 +1,352 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferCompleteV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferCompleteV1Request{} + +// TransferCompleteV1Request struct for TransferCompleteV1Request +type TransferCompleteV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashCommitFinalAck string `json:"hashCommitFinalAck"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + HashTransferCommence string `json:"hashTransferCommence"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewTransferCompleteV1Request instantiates a new TransferCompleteV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferCompleteV1Request(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, hashCommitFinalAck string, signature string, hashTransferCommence string, sequenceNumber float32) *TransferCompleteV1Request { + this := TransferCompleteV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashCommitFinalAck = hashCommitFinalAck + this.Signature = signature + this.HashTransferCommence = hashTransferCommence + this.SequenceNumber = sequenceNumber + return &this +} + +// NewTransferCompleteV1RequestWithDefaults instantiates a new TransferCompleteV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferCompleteV1RequestWithDefaults() *TransferCompleteV1Request { + this := TransferCompleteV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *TransferCompleteV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferCompleteV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *TransferCompleteV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferCompleteV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *TransferCompleteV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *TransferCompleteV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferCompleteV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferCompleteV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashCommitFinalAck returns the HashCommitFinalAck field value +func (o *TransferCompleteV1Request) GetHashCommitFinalAck() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitFinalAck +} + +// GetHashCommitFinalAckOk returns a tuple with the HashCommitFinalAck field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetHashCommitFinalAckOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitFinalAck, true +} + +// SetHashCommitFinalAck sets field value +func (o *TransferCompleteV1Request) SetHashCommitFinalAck(v string) { + o.HashCommitFinalAck = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransferCompleteV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransferCompleteV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *TransferCompleteV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *TransferCompleteV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *TransferCompleteV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *TransferCompleteV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *TransferCompleteV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferCompleteV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetHashTransferCommence returns the HashTransferCommence field value +func (o *TransferCompleteV1Request) GetHashTransferCommence() string { + if o == nil { + var ret string + return ret + } + + return o.HashTransferCommence +} + +// GetHashTransferCommenceOk returns a tuple with the HashTransferCommence field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetHashTransferCommenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashTransferCommence, true +} + +// SetHashTransferCommence sets field value +func (o *TransferCompleteV1Request) SetHashTransferCommence(v string) { + o.HashTransferCommence = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferCompleteV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferCompleteV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o TransferCompleteV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferCompleteV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashCommitFinalAck"] = o.HashCommitFinalAck + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["hashTransferCommence"] = o.HashTransferCommence + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableTransferCompleteV1Request struct { + value *TransferCompleteV1Request + isSet bool +} + +func (v NullableTransferCompleteV1Request) Get() *TransferCompleteV1Request { + return v.value +} + +func (v *NullableTransferCompleteV1Request) Set(val *TransferCompleteV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableTransferCompleteV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferCompleteV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferCompleteV1Request(val *TransferCompleteV1Request) *NullableTransferCompleteV1Request { + return &NullableTransferCompleteV1Request{value: val, isSet: true} +} + +func (v NullableTransferCompleteV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferCompleteV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go new file mode 100644 index 0000000000..e488dc7418 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go @@ -0,0 +1,1035 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferInitializationV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferInitializationV1Request{} + +// TransferInitializationV1Request struct for TransferInitializationV1Request +type TransferInitializationV1Request struct { + MessageType string `json:"messageType"` + SessionID string `json:"sessionID"` + Version *string `json:"version,omitempty"` + DeveloperURN *string `json:"developerURN,omitempty"` + CredentialProfile *CredentialProfile `json:"credentialProfile,omitempty"` + PayloadProfile PayloadProfile `json:"payloadProfile"` + ApplicationProfile string `json:"applicationProfile"` + LoggingProfile string `json:"loggingProfile"` + AccessControlProfile string `json:"accessControlProfile"` + Signature string `json:"signature"` + SourceGatewayPubkey string `json:"sourceGatewayPubkey"` + SourceGatewayDltSystem string `json:"sourceGatewayDltSystem"` + RecipientGatewayPubkey string `json:"recipientGatewayPubkey"` + RecipientGatewayDltSystem string `json:"recipientGatewayDltSystem"` + EscrowType *string `json:"escrowType,omitempty"` + ExpiryTime *string `json:"expiryTime,omitempty"` + MultipleClaimsAllowed *bool `json:"multipleClaimsAllowed,omitempty"` + MultipleCancelsAllowed *bool `json:"multipleCancelsAllowed,omitempty"` + Permissions map[string]interface{} `json:"permissions,omitempty"` + Origin *string `json:"origin,omitempty"` + Destination *string `json:"destination,omitempty"` + SubsequentCalls map[string]interface{} `json:"subsequentCalls,omitempty"` + Histories []History `json:"histories,omitempty"` + SequenceNumber int32 `json:"sequenceNumber"` + SourceBasePath string `json:"sourceBasePath"` + RecipientBasePath string `json:"recipientBasePath"` + MaxRetries float32 `json:"maxRetries"` + MaxTimeout float32 `json:"maxTimeout"` + BackupGatewaysAllowed []string `json:"backupGatewaysAllowed"` + RecipientLedgerAssetID string `json:"recipientLedgerAssetID"` + SourceLedgerAssetID string `json:"sourceLedgerAssetID"` +} + +// NewTransferInitializationV1Request instantiates a new TransferInitializationV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferInitializationV1Request(messageType string, sessionID string, payloadProfile PayloadProfile, applicationProfile string, loggingProfile string, accessControlProfile string, signature string, sourceGatewayPubkey string, sourceGatewayDltSystem string, recipientGatewayPubkey string, recipientGatewayDltSystem string, sequenceNumber int32, sourceBasePath string, recipientBasePath string, maxRetries float32, maxTimeout float32, backupGatewaysAllowed []string, recipientLedgerAssetID string, sourceLedgerAssetID string) *TransferInitializationV1Request { + this := TransferInitializationV1Request{} + this.MessageType = messageType + this.SessionID = sessionID + this.PayloadProfile = payloadProfile + this.ApplicationProfile = applicationProfile + this.LoggingProfile = loggingProfile + this.AccessControlProfile = accessControlProfile + this.Signature = signature + this.SourceGatewayPubkey = sourceGatewayPubkey + this.SourceGatewayDltSystem = sourceGatewayDltSystem + this.RecipientGatewayPubkey = recipientGatewayPubkey + this.RecipientGatewayDltSystem = recipientGatewayDltSystem + this.SequenceNumber = sequenceNumber + this.SourceBasePath = sourceBasePath + this.RecipientBasePath = recipientBasePath + this.MaxRetries = maxRetries + this.MaxTimeout = maxTimeout + this.BackupGatewaysAllowed = backupGatewaysAllowed + this.RecipientLedgerAssetID = recipientLedgerAssetID + this.SourceLedgerAssetID = sourceLedgerAssetID + return &this +} + +// NewTransferInitializationV1RequestWithDefaults instantiates a new TransferInitializationV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferInitializationV1RequestWithDefaults() *TransferInitializationV1Request { + this := TransferInitializationV1Request{} + return &this +} + +// GetMessageType returns the MessageType field value +func (o *TransferInitializationV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferInitializationV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetSessionID returns the SessionID field value +func (o *TransferInitializationV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferInitializationV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *TransferInitializationV1Request) SetVersion(v string) { + o.Version = &v +} + +// GetDeveloperURN returns the DeveloperURN field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetDeveloperURN() string { + if o == nil || IsNil(o.DeveloperURN) { + var ret string + return ret + } + return *o.DeveloperURN +} + +// GetDeveloperURNOk returns a tuple with the DeveloperURN field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetDeveloperURNOk() (*string, bool) { + if o == nil || IsNil(o.DeveloperURN) { + return nil, false + } + return o.DeveloperURN, true +} + +// HasDeveloperURN returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasDeveloperURN() bool { + if o != nil && !IsNil(o.DeveloperURN) { + return true + } + + return false +} + +// SetDeveloperURN gets a reference to the given string and assigns it to the DeveloperURN field. +func (o *TransferInitializationV1Request) SetDeveloperURN(v string) { + o.DeveloperURN = &v +} + +// GetCredentialProfile returns the CredentialProfile field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetCredentialProfile() CredentialProfile { + if o == nil || IsNil(o.CredentialProfile) { + var ret CredentialProfile + return ret + } + return *o.CredentialProfile +} + +// GetCredentialProfileOk returns a tuple with the CredentialProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetCredentialProfileOk() (*CredentialProfile, bool) { + if o == nil || IsNil(o.CredentialProfile) { + return nil, false + } + return o.CredentialProfile, true +} + +// HasCredentialProfile returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasCredentialProfile() bool { + if o != nil && !IsNil(o.CredentialProfile) { + return true + } + + return false +} + +// SetCredentialProfile gets a reference to the given CredentialProfile and assigns it to the CredentialProfile field. +func (o *TransferInitializationV1Request) SetCredentialProfile(v CredentialProfile) { + o.CredentialProfile = &v +} + +// GetPayloadProfile returns the PayloadProfile field value +func (o *TransferInitializationV1Request) GetPayloadProfile() PayloadProfile { + if o == nil { + var ret PayloadProfile + return ret + } + + return o.PayloadProfile +} + +// GetPayloadProfileOk returns a tuple with the PayloadProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetPayloadProfileOk() (*PayloadProfile, bool) { + if o == nil { + return nil, false + } + return &o.PayloadProfile, true +} + +// SetPayloadProfile sets field value +func (o *TransferInitializationV1Request) SetPayloadProfile(v PayloadProfile) { + o.PayloadProfile = v +} + +// GetApplicationProfile returns the ApplicationProfile field value +func (o *TransferInitializationV1Request) GetApplicationProfile() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetApplicationProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationProfile, true +} + +// SetApplicationProfile sets field value +func (o *TransferInitializationV1Request) SetApplicationProfile(v string) { + o.ApplicationProfile = v +} + +// GetLoggingProfile returns the LoggingProfile field value +func (o *TransferInitializationV1Request) GetLoggingProfile() string { + if o == nil { + var ret string + return ret + } + + return o.LoggingProfile +} + +// GetLoggingProfileOk returns a tuple with the LoggingProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetLoggingProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LoggingProfile, true +} + +// SetLoggingProfile sets field value +func (o *TransferInitializationV1Request) SetLoggingProfile(v string) { + o.LoggingProfile = v +} + +// GetAccessControlProfile returns the AccessControlProfile field value +func (o *TransferInitializationV1Request) GetAccessControlProfile() string { + if o == nil { + var ret string + return ret + } + + return o.AccessControlProfile +} + +// GetAccessControlProfileOk returns a tuple with the AccessControlProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetAccessControlProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessControlProfile, true +} + +// SetAccessControlProfile sets field value +func (o *TransferInitializationV1Request) SetAccessControlProfile(v string) { + o.AccessControlProfile = v +} + +// GetSignature returns the Signature field value +func (o *TransferInitializationV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferInitializationV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSourceGatewayPubkey returns the SourceGatewayPubkey field value +func (o *TransferInitializationV1Request) GetSourceGatewayPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.SourceGatewayPubkey +} + +// GetSourceGatewayPubkeyOk returns a tuple with the SourceGatewayPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceGatewayPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceGatewayPubkey, true +} + +// SetSourceGatewayPubkey sets field value +func (o *TransferInitializationV1Request) SetSourceGatewayPubkey(v string) { + o.SourceGatewayPubkey = v +} + +// GetSourceGatewayDltSystem returns the SourceGatewayDltSystem field value +func (o *TransferInitializationV1Request) GetSourceGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.SourceGatewayDltSystem +} + +// GetSourceGatewayDltSystemOk returns a tuple with the SourceGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceGatewayDltSystem, true +} + +// SetSourceGatewayDltSystem sets field value +func (o *TransferInitializationV1Request) SetSourceGatewayDltSystem(v string) { + o.SourceGatewayDltSystem = v +} + +// GetRecipientGatewayPubkey returns the RecipientGatewayPubkey field value +func (o *TransferInitializationV1Request) GetRecipientGatewayPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayPubkey +} + +// GetRecipientGatewayPubkeyOk returns a tuple with the RecipientGatewayPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientGatewayPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayPubkey, true +} + +// SetRecipientGatewayPubkey sets field value +func (o *TransferInitializationV1Request) SetRecipientGatewayPubkey(v string) { + o.RecipientGatewayPubkey = v +} + +// GetRecipientGatewayDltSystem returns the RecipientGatewayDltSystem field value +func (o *TransferInitializationV1Request) GetRecipientGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayDltSystem +} + +// GetRecipientGatewayDltSystemOk returns a tuple with the RecipientGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayDltSystem, true +} + +// SetRecipientGatewayDltSystem sets field value +func (o *TransferInitializationV1Request) SetRecipientGatewayDltSystem(v string) { + o.RecipientGatewayDltSystem = v +} + +// GetEscrowType returns the EscrowType field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetEscrowType() string { + if o == nil || IsNil(o.EscrowType) { + var ret string + return ret + } + return *o.EscrowType +} + +// GetEscrowTypeOk returns a tuple with the EscrowType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetEscrowTypeOk() (*string, bool) { + if o == nil || IsNil(o.EscrowType) { + return nil, false + } + return o.EscrowType, true +} + +// HasEscrowType returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasEscrowType() bool { + if o != nil && !IsNil(o.EscrowType) { + return true + } + + return false +} + +// SetEscrowType gets a reference to the given string and assigns it to the EscrowType field. +func (o *TransferInitializationV1Request) SetEscrowType(v string) { + o.EscrowType = &v +} + +// GetExpiryTime returns the ExpiryTime field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetExpiryTime() string { + if o == nil || IsNil(o.ExpiryTime) { + var ret string + return ret + } + return *o.ExpiryTime +} + +// GetExpiryTimeOk returns a tuple with the ExpiryTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetExpiryTimeOk() (*string, bool) { + if o == nil || IsNil(o.ExpiryTime) { + return nil, false + } + return o.ExpiryTime, true +} + +// HasExpiryTime returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasExpiryTime() bool { + if o != nil && !IsNil(o.ExpiryTime) { + return true + } + + return false +} + +// SetExpiryTime gets a reference to the given string and assigns it to the ExpiryTime field. +func (o *TransferInitializationV1Request) SetExpiryTime(v string) { + o.ExpiryTime = &v +} + +// GetMultipleClaimsAllowed returns the MultipleClaimsAllowed field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetMultipleClaimsAllowed() bool { + if o == nil || IsNil(o.MultipleClaimsAllowed) { + var ret bool + return ret + } + return *o.MultipleClaimsAllowed +} + +// GetMultipleClaimsAllowedOk returns a tuple with the MultipleClaimsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMultipleClaimsAllowedOk() (*bool, bool) { + if o == nil || IsNil(o.MultipleClaimsAllowed) { + return nil, false + } + return o.MultipleClaimsAllowed, true +} + +// HasMultipleClaimsAllowed returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasMultipleClaimsAllowed() bool { + if o != nil && !IsNil(o.MultipleClaimsAllowed) { + return true + } + + return false +} + +// SetMultipleClaimsAllowed gets a reference to the given bool and assigns it to the MultipleClaimsAllowed field. +func (o *TransferInitializationV1Request) SetMultipleClaimsAllowed(v bool) { + o.MultipleClaimsAllowed = &v +} + +// GetMultipleCancelsAllowed returns the MultipleCancelsAllowed field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetMultipleCancelsAllowed() bool { + if o == nil || IsNil(o.MultipleCancelsAllowed) { + var ret bool + return ret + } + return *o.MultipleCancelsAllowed +} + +// GetMultipleCancelsAllowedOk returns a tuple with the MultipleCancelsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMultipleCancelsAllowedOk() (*bool, bool) { + if o == nil || IsNil(o.MultipleCancelsAllowed) { + return nil, false + } + return o.MultipleCancelsAllowed, true +} + +// HasMultipleCancelsAllowed returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasMultipleCancelsAllowed() bool { + if o != nil && !IsNil(o.MultipleCancelsAllowed) { + return true + } + + return false +} + +// SetMultipleCancelsAllowed gets a reference to the given bool and assigns it to the MultipleCancelsAllowed field. +func (o *TransferInitializationV1Request) SetMultipleCancelsAllowed(v bool) { + o.MultipleCancelsAllowed = &v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetPermissions() map[string]interface{} { + if o == nil || IsNil(o.Permissions) { + var ret map[string]interface{} + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetPermissionsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Permissions) { + return map[string]interface{}{}, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given map[string]interface{} and assigns it to the Permissions field. +func (o *TransferInitializationV1Request) SetPermissions(v map[string]interface{}) { + o.Permissions = v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetOrigin() string { + if o == nil || IsNil(o.Origin) { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetOriginOk() (*string, bool) { + if o == nil || IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasOrigin() bool { + if o != nil && !IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *TransferInitializationV1Request) SetOrigin(v string) { + o.Origin = &v +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetDestination() string { + if o == nil || IsNil(o.Destination) { + var ret string + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetDestinationOk() (*string, bool) { + if o == nil || IsNil(o.Destination) { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasDestination() bool { + if o != nil && !IsNil(o.Destination) { + return true + } + + return false +} + +// SetDestination gets a reference to the given string and assigns it to the Destination field. +func (o *TransferInitializationV1Request) SetDestination(v string) { + o.Destination = &v +} + +// GetSubsequentCalls returns the SubsequentCalls field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetSubsequentCalls() map[string]interface{} { + if o == nil || IsNil(o.SubsequentCalls) { + var ret map[string]interface{} + return ret + } + return o.SubsequentCalls +} + +// GetSubsequentCallsOk returns a tuple with the SubsequentCalls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSubsequentCallsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.SubsequentCalls) { + return map[string]interface{}{}, false + } + return o.SubsequentCalls, true +} + +// HasSubsequentCalls returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasSubsequentCalls() bool { + if o != nil && !IsNil(o.SubsequentCalls) { + return true + } + + return false +} + +// SetSubsequentCalls gets a reference to the given map[string]interface{} and assigns it to the SubsequentCalls field. +func (o *TransferInitializationV1Request) SetSubsequentCalls(v map[string]interface{}) { + o.SubsequentCalls = v +} + +// GetHistories returns the Histories field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetHistories() []History { + if o == nil || IsNil(o.Histories) { + var ret []History + return ret + } + return o.Histories +} + +// GetHistoriesOk returns a tuple with the Histories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetHistoriesOk() ([]History, bool) { + if o == nil || IsNil(o.Histories) { + return nil, false + } + return o.Histories, true +} + +// HasHistories returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasHistories() bool { + if o != nil && !IsNil(o.Histories) { + return true + } + + return false +} + +// SetHistories gets a reference to the given []History and assigns it to the Histories field. +func (o *TransferInitializationV1Request) SetHistories(v []History) { + o.Histories = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferInitializationV1Request) GetSequenceNumber() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSequenceNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferInitializationV1Request) SetSequenceNumber(v int32) { + o.SequenceNumber = v +} + +// GetSourceBasePath returns the SourceBasePath field value +func (o *TransferInitializationV1Request) GetSourceBasePath() string { + if o == nil { + var ret string + return ret + } + + return o.SourceBasePath +} + +// GetSourceBasePathOk returns a tuple with the SourceBasePath field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceBasePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceBasePath, true +} + +// SetSourceBasePath sets field value +func (o *TransferInitializationV1Request) SetSourceBasePath(v string) { + o.SourceBasePath = v +} + +// GetRecipientBasePath returns the RecipientBasePath field value +func (o *TransferInitializationV1Request) GetRecipientBasePath() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientBasePath +} + +// GetRecipientBasePathOk returns a tuple with the RecipientBasePath field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientBasePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientBasePath, true +} + +// SetRecipientBasePath sets field value +func (o *TransferInitializationV1Request) SetRecipientBasePath(v string) { + o.RecipientBasePath = v +} + +// GetMaxRetries returns the MaxRetries field value +func (o *TransferInitializationV1Request) GetMaxRetries() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxRetries +} + +// GetMaxRetriesOk returns a tuple with the MaxRetries field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMaxRetriesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxRetries, true +} + +// SetMaxRetries sets field value +func (o *TransferInitializationV1Request) SetMaxRetries(v float32) { + o.MaxRetries = v +} + +// GetMaxTimeout returns the MaxTimeout field value +func (o *TransferInitializationV1Request) GetMaxTimeout() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxTimeout +} + +// GetMaxTimeoutOk returns a tuple with the MaxTimeout field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMaxTimeoutOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxTimeout, true +} + +// SetMaxTimeout sets field value +func (o *TransferInitializationV1Request) SetMaxTimeout(v float32) { + o.MaxTimeout = v +} + +// GetBackupGatewaysAllowed returns the BackupGatewaysAllowed field value +func (o *TransferInitializationV1Request) GetBackupGatewaysAllowed() []string { + if o == nil { + var ret []string + return ret + } + + return o.BackupGatewaysAllowed +} + +// GetBackupGatewaysAllowedOk returns a tuple with the BackupGatewaysAllowed field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetBackupGatewaysAllowedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BackupGatewaysAllowed, true +} + +// SetBackupGatewaysAllowed sets field value +func (o *TransferInitializationV1Request) SetBackupGatewaysAllowed(v []string) { + o.BackupGatewaysAllowed = v +} + +// GetRecipientLedgerAssetID returns the RecipientLedgerAssetID field value +func (o *TransferInitializationV1Request) GetRecipientLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientLedgerAssetID +} + +// GetRecipientLedgerAssetIDOk returns a tuple with the RecipientLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientLedgerAssetID, true +} + +// SetRecipientLedgerAssetID sets field value +func (o *TransferInitializationV1Request) SetRecipientLedgerAssetID(v string) { + o.RecipientLedgerAssetID = v +} + +// GetSourceLedgerAssetID returns the SourceLedgerAssetID field value +func (o *TransferInitializationV1Request) GetSourceLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.SourceLedgerAssetID +} + +// GetSourceLedgerAssetIDOk returns a tuple with the SourceLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceLedgerAssetID, true +} + +// SetSourceLedgerAssetID sets field value +func (o *TransferInitializationV1Request) SetSourceLedgerAssetID(v string) { + o.SourceLedgerAssetID = v +} + +func (o TransferInitializationV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferInitializationV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messageType"] = o.MessageType + toSerialize["sessionID"] = o.SessionID + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.DeveloperURN) { + toSerialize["developerURN"] = o.DeveloperURN + } + if !IsNil(o.CredentialProfile) { + toSerialize["credentialProfile"] = o.CredentialProfile + } + toSerialize["payloadProfile"] = o.PayloadProfile + toSerialize["applicationProfile"] = o.ApplicationProfile + toSerialize["loggingProfile"] = o.LoggingProfile + toSerialize["accessControlProfile"] = o.AccessControlProfile + toSerialize["signature"] = o.Signature + toSerialize["sourceGatewayPubkey"] = o.SourceGatewayPubkey + toSerialize["sourceGatewayDltSystem"] = o.SourceGatewayDltSystem + toSerialize["recipientGatewayPubkey"] = o.RecipientGatewayPubkey + toSerialize["recipientGatewayDltSystem"] = o.RecipientGatewayDltSystem + if !IsNil(o.EscrowType) { + toSerialize["escrowType"] = o.EscrowType + } + if !IsNil(o.ExpiryTime) { + toSerialize["expiryTime"] = o.ExpiryTime + } + if !IsNil(o.MultipleClaimsAllowed) { + toSerialize["multipleClaimsAllowed"] = o.MultipleClaimsAllowed + } + if !IsNil(o.MultipleCancelsAllowed) { + toSerialize["multipleCancelsAllowed"] = o.MultipleCancelsAllowed + } + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + if !IsNil(o.Origin) { + toSerialize["origin"] = o.Origin + } + if !IsNil(o.Destination) { + toSerialize["destination"] = o.Destination + } + if !IsNil(o.SubsequentCalls) { + toSerialize["subsequentCalls"] = o.SubsequentCalls + } + if !IsNil(o.Histories) { + toSerialize["histories"] = o.Histories + } + toSerialize["sequenceNumber"] = o.SequenceNumber + toSerialize["sourceBasePath"] = o.SourceBasePath + toSerialize["recipientBasePath"] = o.RecipientBasePath + toSerialize["maxRetries"] = o.MaxRetries + toSerialize["maxTimeout"] = o.MaxTimeout + toSerialize["backupGatewaysAllowed"] = o.BackupGatewaysAllowed + toSerialize["recipientLedgerAssetID"] = o.RecipientLedgerAssetID + toSerialize["sourceLedgerAssetID"] = o.SourceLedgerAssetID + return toSerialize, nil +} + +type NullableTransferInitializationV1Request struct { + value *TransferInitializationV1Request + isSet bool +} + +func (v NullableTransferInitializationV1Request) Get() *TransferInitializationV1Request { + return v.value +} + +func (v *NullableTransferInitializationV1Request) Set(val *TransferInitializationV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableTransferInitializationV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferInitializationV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferInitializationV1Request(val *TransferInitializationV1Request) *NullableTransferInitializationV1Request { + return &NullableTransferInitializationV1Request{value: val, isSet: true} +} + +func (v NullableTransferInitializationV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferInitializationV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go new file mode 100644 index 0000000000..8c10c1f3c2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go @@ -0,0 +1,405 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferInitializationV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferInitializationV1Response{} + +// TransferInitializationV1Response struct for TransferInitializationV1Response +type TransferInitializationV1Response struct { + MessageType string `json:"messageType"` + SessionID string `json:"sessionID"` + SequenceNumber float32 `json:"sequenceNumber"` + OdapPhase *string `json:"odapPhase,omitempty"` + InitialRequestMessageHash string `json:"initialRequestMessageHash"` + Destination *string `json:"destination,omitempty"` + TimeStamp string `json:"timeStamp"` + ProcessedTimeStamp string `json:"processedTimeStamp"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + Signature string `json:"signature"` + BackupGatewaysAllowed []string `json:"backupGatewaysAllowed"` +} + +// NewTransferInitializationV1Response instantiates a new TransferInitializationV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferInitializationV1Response(messageType string, sessionID string, sequenceNumber float32, initialRequestMessageHash string, timeStamp string, processedTimeStamp string, serverIdentityPubkey string, signature string, backupGatewaysAllowed []string) *TransferInitializationV1Response { + this := TransferInitializationV1Response{} + this.MessageType = messageType + this.SessionID = sessionID + this.SequenceNumber = sequenceNumber + this.InitialRequestMessageHash = initialRequestMessageHash + this.TimeStamp = timeStamp + this.ProcessedTimeStamp = processedTimeStamp + this.ServerIdentityPubkey = serverIdentityPubkey + this.Signature = signature + this.BackupGatewaysAllowed = backupGatewaysAllowed + return &this +} + +// NewTransferInitializationV1ResponseWithDefaults instantiates a new TransferInitializationV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferInitializationV1ResponseWithDefaults() *TransferInitializationV1Response { + this := TransferInitializationV1Response{} + return &this +} + +// GetMessageType returns the MessageType field value +func (o *TransferInitializationV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferInitializationV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetSessionID returns the SessionID field value +func (o *TransferInitializationV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferInitializationV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferInitializationV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferInitializationV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +// GetOdapPhase returns the OdapPhase field value if set, zero value otherwise. +func (o *TransferInitializationV1Response) GetOdapPhase() string { + if o == nil || IsNil(o.OdapPhase) { + var ret string + return ret + } + return *o.OdapPhase +} + +// GetOdapPhaseOk returns a tuple with the OdapPhase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetOdapPhaseOk() (*string, bool) { + if o == nil || IsNil(o.OdapPhase) { + return nil, false + } + return o.OdapPhase, true +} + +// HasOdapPhase returns a boolean if a field has been set. +func (o *TransferInitializationV1Response) HasOdapPhase() bool { + if o != nil && !IsNil(o.OdapPhase) { + return true + } + + return false +} + +// SetOdapPhase gets a reference to the given string and assigns it to the OdapPhase field. +func (o *TransferInitializationV1Response) SetOdapPhase(v string) { + o.OdapPhase = &v +} + +// GetInitialRequestMessageHash returns the InitialRequestMessageHash field value +func (o *TransferInitializationV1Response) GetInitialRequestMessageHash() string { + if o == nil { + var ret string + return ret + } + + return o.InitialRequestMessageHash +} + +// GetInitialRequestMessageHashOk returns a tuple with the InitialRequestMessageHash field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetInitialRequestMessageHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InitialRequestMessageHash, true +} + +// SetInitialRequestMessageHash sets field value +func (o *TransferInitializationV1Response) SetInitialRequestMessageHash(v string) { + o.InitialRequestMessageHash = v +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *TransferInitializationV1Response) GetDestination() string { + if o == nil || IsNil(o.Destination) { + var ret string + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetDestinationOk() (*string, bool) { + if o == nil || IsNil(o.Destination) { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *TransferInitializationV1Response) HasDestination() bool { + if o != nil && !IsNil(o.Destination) { + return true + } + + return false +} + +// SetDestination gets a reference to the given string and assigns it to the Destination field. +func (o *TransferInitializationV1Response) SetDestination(v string) { + o.Destination = &v +} + +// GetTimeStamp returns the TimeStamp field value +func (o *TransferInitializationV1Response) GetTimeStamp() string { + if o == nil { + var ret string + return ret + } + + return o.TimeStamp +} + +// GetTimeStampOk returns a tuple with the TimeStamp field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetTimeStampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TimeStamp, true +} + +// SetTimeStamp sets field value +func (o *TransferInitializationV1Response) SetTimeStamp(v string) { + o.TimeStamp = v +} + +// GetProcessedTimeStamp returns the ProcessedTimeStamp field value +func (o *TransferInitializationV1Response) GetProcessedTimeStamp() string { + if o == nil { + var ret string + return ret + } + + return o.ProcessedTimeStamp +} + +// GetProcessedTimeStampOk returns a tuple with the ProcessedTimeStamp field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetProcessedTimeStampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProcessedTimeStamp, true +} + +// SetProcessedTimeStamp sets field value +func (o *TransferInitializationV1Response) SetProcessedTimeStamp(v string) { + o.ProcessedTimeStamp = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferInitializationV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferInitializationV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetSignature returns the Signature field value +func (o *TransferInitializationV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferInitializationV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetBackupGatewaysAllowed returns the BackupGatewaysAllowed field value +func (o *TransferInitializationV1Response) GetBackupGatewaysAllowed() []string { + if o == nil { + var ret []string + return ret + } + + return o.BackupGatewaysAllowed +} + +// GetBackupGatewaysAllowedOk returns a tuple with the BackupGatewaysAllowed field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetBackupGatewaysAllowedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BackupGatewaysAllowed, true +} + +// SetBackupGatewaysAllowed sets field value +func (o *TransferInitializationV1Response) SetBackupGatewaysAllowed(v []string) { + o.BackupGatewaysAllowed = v +} + +func (o TransferInitializationV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferInitializationV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messageType"] = o.MessageType + toSerialize["sessionID"] = o.SessionID + toSerialize["sequenceNumber"] = o.SequenceNumber + if !IsNil(o.OdapPhase) { + toSerialize["odapPhase"] = o.OdapPhase + } + toSerialize["initialRequestMessageHash"] = o.InitialRequestMessageHash + if !IsNil(o.Destination) { + toSerialize["destination"] = o.Destination + } + toSerialize["timeStamp"] = o.TimeStamp + toSerialize["processedTimeStamp"] = o.ProcessedTimeStamp + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["signature"] = o.Signature + toSerialize["backupGatewaysAllowed"] = o.BackupGatewaysAllowed + return toSerialize, nil +} + +type NullableTransferInitializationV1Response struct { + value *TransferInitializationV1Response + isSet bool +} + +func (v NullableTransferInitializationV1Response) Get() *TransferInitializationV1Response { + return v.value +} + +func (v *NullableTransferInitializationV1Response) Set(val *TransferInitializationV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableTransferInitializationV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferInitializationV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferInitializationV1Response(val *TransferInitializationV1Response) *NullableTransferInitializationV1Response { + return &NullableTransferInitializationV1Response{value: val, isSet: true} +} + +func (v NullableTransferInitializationV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferInitializationV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..aeea828105 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..b9b0d7cfcf --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,224 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-odap-hermes + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-odap-hermes_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService ClientRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.ClientRequestV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase1TransferInitiationRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase1TransferInitiationRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase1TransferInitiationResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase1TransferInitiationResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2LockEvidenceRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2LockEvidenceRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2LockEvidenceResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2LockEvidenceResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2TransferCommenceRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2TransferCommenceRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2TransferCommenceResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2TransferCommenceResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitFinalRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitFinalRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitFinalResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitFinalResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitPreparationRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitPreparationRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitPreparationResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitPreparationResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3TransferCompleteRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3TransferCompleteRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverUpdateAckV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverUpdateAckV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverUpdateV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverUpdateV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverV1Success", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverV1Success(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RollbackAckV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RollbackAckV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RollbackV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RollbackV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 0000000000..dc24222e86 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..ce060be401 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Odap Hermes + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..3b1993e776 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AssetProfile.java +src/main/java/org/openapitools/client/model/ClientV1Request.java +src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java +src/main/java/org/openapitools/client/model/CommitFinalV1Request.java +src/main/java/org/openapitools/client/model/CommitFinalV1Response.java +src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java +src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java +src/main/java/org/openapitools/client/model/CredentialProfile.java +src/main/java/org/openapitools/client/model/History.java +src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java +src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java +src/main/java/org/openapitools/client/model/OdapLocalLog.java +src/main/java/org/openapitools/client/model/OdapMessage.java +src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java +src/main/java/org/openapitools/client/model/PayloadProfile.java +src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java +src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java +src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java +src/main/java/org/openapitools/client/model/RecoverV1Message.java +src/main/java/org/openapitools/client/model/RollbackAckV1Message.java +src/main/java/org/openapitools/client/model/RollbackV1Message.java +src/main/java/org/openapitools/client/model/SessionData.java +src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java +src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java +src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java +src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java +src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..7602359f31 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,180 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Odap Hermes +- API version: v2.0.0-alpha.2 + +Implementation for Odap and Hermes + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + ClientV1Request clientV1Request = new ClientV1Request(); // ClientV1Request | + try { + Object result = apiInstance.clientRequestV1(clientV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#clientRequestV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**clientRequestV1**](docs/DefaultApi.md#clientRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest | +*DefaultApi* | [**phase1TransferInitiationRequestV1**](docs/DefaultApi.md#phase1TransferInitiationRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest | +*DefaultApi* | [**phase1TransferInitiationResponseV1**](docs/DefaultApi.md#phase1TransferInitiationResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse | +*DefaultApi* | [**phase2LockEvidenceRequestV1**](docs/DefaultApi.md#phase2LockEvidenceRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest | +*DefaultApi* | [**phase2LockEvidenceResponseV1**](docs/DefaultApi.md#phase2LockEvidenceResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse | +*DefaultApi* | [**phase2TransferCommenceRequestV1**](docs/DefaultApi.md#phase2TransferCommenceRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest | +*DefaultApi* | [**phase2TransferCommenceResponseV1**](docs/DefaultApi.md#phase2TransferCommenceResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse | +*DefaultApi* | [**phase3CommitFinalRequestV1**](docs/DefaultApi.md#phase3CommitFinalRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest | +*DefaultApi* | [**phase3CommitFinalResponseV1**](docs/DefaultApi.md#phase3CommitFinalResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse | +*DefaultApi* | [**phase3CommitPreparationRequestV1**](docs/DefaultApi.md#phase3CommitPreparationRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest | +*DefaultApi* | [**phase3CommitPreparationResponseV1**](docs/DefaultApi.md#phase3CommitPreparationResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse | +*DefaultApi* | [**phase3TransferCompleteRequestV1**](docs/DefaultApi.md#phase3TransferCompleteRequestV1) | **GET** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest | +*DefaultApi* | [**recoverUpdateAckV1Message**](docs/DefaultApi.md#recoverUpdateAckV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage | +*DefaultApi* | [**recoverUpdateV1Message**](docs/DefaultApi.md#recoverUpdateV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage | +*DefaultApi* | [**recoverV1Message**](docs/DefaultApi.md#recoverV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage | +*DefaultApi* | [**recoverV1Success**](docs/DefaultApi.md#recoverV1Success) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage | +*DefaultApi* | [**rollbackAckV1Message**](docs/DefaultApi.md#rollbackAckV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage | +*DefaultApi* | [**rollbackV1Message**](docs/DefaultApi.md#rollbackV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage | + + +## Documentation for Models + + - [AssetProfile](docs/AssetProfile.md) + - [ClientV1Request](docs/ClientV1Request.md) + - [ClientV1RequestClientGatewayConfiguration](docs/ClientV1RequestClientGatewayConfiguration.md) + - [CommitFinalV1Request](docs/CommitFinalV1Request.md) + - [CommitFinalV1Response](docs/CommitFinalV1Response.md) + - [CommitPreparationV1Request](docs/CommitPreparationV1Request.md) + - [CommitPreparationV1Response](docs/CommitPreparationV1Response.md) + - [CredentialProfile](docs/CredentialProfile.md) + - [History](docs/History.md) + - [LockEvidenceV1Request](docs/LockEvidenceV1Request.md) + - [LockEvidenceV1Response](docs/LockEvidenceV1Response.md) + - [OdapLocalLog](docs/OdapLocalLog.md) + - [OdapMessage](docs/OdapMessage.md) + - [OdapMessageActionResponse](docs/OdapMessageActionResponse.md) + - [PayloadProfile](docs/PayloadProfile.md) + - [RecoverSuccessV1Message](docs/RecoverSuccessV1Message.md) + - [RecoverUpdateAckV1Message](docs/RecoverUpdateAckV1Message.md) + - [RecoverUpdateV1Message](docs/RecoverUpdateV1Message.md) + - [RecoverV1Message](docs/RecoverV1Message.md) + - [RollbackAckV1Message](docs/RollbackAckV1Message.md) + - [RollbackV1Message](docs/RollbackV1Message.md) + - [SessionData](docs/SessionData.md) + - [TransferCommenceV1Request](docs/TransferCommenceV1Request.md) + - [TransferCommenceV1Response](docs/TransferCommenceV1Response.md) + - [TransferCompleteV1Request](docs/TransferCompleteV1Request.md) + - [TransferInitializationV1Request](docs/TransferInitializationV1Request.md) + - [TransferInitializationV1Response](docs/TransferInitializationV1Response.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..b530e32169 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1637 @@ +openapi: 3.0.3 +info: + description: Implementation for Odap and Hermes + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Odap Hermes + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest: + post: + description: "" + operationId: phase1TransferInitiationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest: + post: + description: "" + operationId: phase2TransferCommenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest: + post: + description: "" + operationId: phase2LockEvidenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest: + post: + description: "" + operationId: phase3CommitPreparationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest: + post: + description: "" + operationId: phase3CommitFinalRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest: + get: + description: "" + operationId: phase3TransferCompleteRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCompleteV1Request' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest: + post: + description: "" + operationId: clientRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientV1Request' + responses: + "200": + content: + application/json: + schema: {} + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse: + post: + description: "" + operationId: phase1TransferInitiationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse: + post: + description: "" + operationId: phase2TransferCommenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse: + post: + description: "" + operationId: phase2LockEvidenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse: + post: + description: "" + operationId: phase3CommitPreparationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse: + post: + description: "" + operationId: phase3CommitFinalResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Response' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage: + post: + description: "" + operationId: RecoverV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage: + post: + description: "" + operationId: RecoverUpdateV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage: + post: + description: "" + operationId: RecoverUpdateAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage: + post: + description: "" + operationId: RecoverV1Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuccessV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage: + post: + description: "" + operationId: RollbackV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage: + post: + description: "" + operationId: RollbackAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cactus: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage + x-content-type: application/json + x-accepts: application/json +components: + schemas: + CredentialProfile: + enum: + - SAML + - OAUTH + - X509 + type: string + PayloadProfile: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + properties: + assetProfile: + $ref: '#/components/schemas/AssetProfile' + capabilities: + type: string + required: + - assetProfile + type: object + ApplicationProfile: + type: object + Payload: + type: object + AssetProfile: + example: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + properties: + issuer: + type: string + assetCode: + type: string + assetCodeType: + type: string + issuanceDate: + type: string + expirationDate: + type: string + verificationEndPoint: + type: string + digitalSignature: + type: string + prospectusLink: + type: string + keyInformationLink: + items: {} + type: array + keyWord: + items: {} + type: array + transferRestriction: + items: {} + type: array + ledgerRequirements: + items: {} + type: array + required: + - expirationDate + type: object + LoggingProfile: + items: + type: string + type: array + AccessControlProfile: + items: + type: string + type: array + Permissions: + type: object + Transaction: + type: object + ActionCategory: + type: object + History: + example: + Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + properties: + Transactions: + items: + $ref: '#/components/schemas/Transaction' + type: array + Actions: + items: + $ref: '#/components/schemas/ActionCategory' + type: array + Origin: + type: string + Destination: + type: string + Balance: + type: string + CurrentStatus: + type: object + ApplicationSpecificParameters: + type: object + type: object + SenderDltSystem: + type: object + RecipientDltSystem: + type: object + LockEvidenceClaim: + type: object + LockClaimFormat: + type: object + CommitFinalClaim: + type: object + CommitFinalClaimFormat: + type: object + CommitAcknowledgementClaim: + type: object + CommitAcknowledgementClaimFormat: + type: object + SessionData: + properties: + id: + type: string + step: + type: number + version: + type: string + lastSequenceNumber: + type: number + loggingProfile: + type: string + accessControlProfile: + type: string + applicationProfile: + type: string + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + assetProfile: + $ref: '#/components/schemas/AssetProfile' + allowedSourceBackupGateways: + items: + type: string + type: array + allowedRecipientBackupGateways: + items: + type: string + type: array + sourceBasePath: + type: string + recipientBasePath: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + initializationRequestMessageHash: + type: string + initializationResponseMessageHash: + type: string + initializationRequestMessageRcvTimeStamp: + type: string + initializationRequestMessageProcessedTimeStamp: + type: string + clientSignatureInitializationRequestMessage: + type: string + serverSignatureInitializationResponseMessage: + type: string + transferCommenceMessageRequestHash: + type: string + transferCommenceMessageResponseHash: + type: string + clientSignatureTransferCommenceRequestMessage: + type: string + serverSignatureTransferCommenceResponseMessage: + type: string + lockEvidenceRequestMessageHash: + type: string + lockEvidenceResponseMessageHash: + type: string + clientSignatureLockEvidenceRequestMessage: + type: string + serverSignatureLockEvidenceResponseMessage: + type: string + lockEvidenceClaim: + type: string + commitPrepareRequestMessageHash: + type: string + commitPrepareResponseMessageHash: + type: string + clientSignatureCommitPreparationRequestMessage: + type: string + serverSignatureCommitPreparationResponseMessage: + type: string + commitFinalRequestMessageHash: + type: string + commitFinalResponseMessageHash: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: string + clientSignatureCommitFinalRequestMessage: + type: string + serverSignatureCommitFinalResponseMessage: + type: string + transferCompleteMessageHash: + type: string + clientSignatureTransferCompleteMessage: + type: string + maxRetries: + type: number + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + maxTimeout: + type: number + lastLogEntryTimestamp: + type: string + unlockAssetClaim: + type: string + recreateAssetClaim: + type: string + deleteAssetClaim: + type: string + lastMessageReceivedTimestamp: + type: string + rollback: + type: boolean + rollbackMessageHash: + type: string + rollbackProofs: + items: + type: string + type: array + rollbackActionsPerformed: + items: + enum: + - CREATE + - DELETE + - LOCK + - UNLOCK + type: string + type: array + type: object + TransferInitializationV1Request: + example: + recipientLedgerAssetID: recipientLedgerAssetID + subsequentCalls: "{}" + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + signature: signature + credentialProfile: null + origin: origin + destination: destination + recipientGatewayPubkey: recipientGatewayPubkey + sessionID: sessionID + sourceBasePath: sourceBasePath + loggingProfile: loggingProfile + sourceLedgerAssetID: sourceLedgerAssetID + messageType: messageType + permissions: "{}" + multipleClaimsAllowed: true + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + applicationProfile: applicationProfile + sourceGatewayPubkey: sourceGatewayPubkey + recipientGatewayDltSystem: recipientGatewayDltSystem + sequenceNumber: 0 + accessControlProfile: accessControlProfile + developerURN: developerURN + histories: + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + version: version + multipleCancelsAllowed: true + escrowType: FAUCET + maxRetries: 6.027456183070403 + sourceGatewayDltSystem: sourceGatewayDltSystem + recipientBasePath: recipientBasePath + maxTimeout: 1.4658129805029452 + expiryTime: expiryTime + properties: + messageType: + type: string + sessionID: + type: string + version: + type: string + developerURN: + type: string + credentialProfile: + $ref: '#/components/schemas/CredentialProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + applicationProfile: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + signature: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + escrowType: + enum: + - FAUCET + - TIMELOCK + - HASHLOCK + - HASHTIMELOCK + - MULTICLAIMPC + - DESTROY + - BURN + type: string + expiryTime: + type: string + multipleClaimsAllowed: + type: boolean + multipleCancelsAllowed: + type: boolean + permissions: + type: object + origin: + type: string + destination: + type: string + subsequentCalls: + type: object + histories: + items: + $ref: '#/components/schemas/History' + type: array + sequenceNumber: + type: integer + sourceBasePath: + type: string + recipientBasePath: + type: string + maxRetries: + type: number + maxTimeout: + type: number + backupGatewaysAllowed: + items: + type: string + type: array + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - backupGatewaysAllowed + - loggingProfile + - maxRetries + - maxTimeout + - messageType + - payloadProfile + - recipientBasePath + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - sequenceNumber + - sessionID + - signature + - sourceBasePath + - sourceGatewayDltSystem + - sourceGatewayPubkey + - sourceLedgerAssetID + type: object + TransferInitializationV1Response: + example: + timeStamp: timeStamp + sequenceNumber: 0.8008281904610115 + odapPhase: TransferInitialization + initialRequestMessageHash: initialRequestMessageHash + messageType: messageType + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + processedTimeStamp: processedTimeStamp + signature: signature + destination: destination + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + messageType: + type: string + sessionID: + type: string + sequenceNumber: + type: number + odapPhase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + initialRequestMessageHash: + type: string + destination: + type: string + timeStamp: + type: string + processedTimeStamp: + type: string + serverIdentityPubkey: + type: string + signature: + type: string + backupGatewaysAllowed: + items: + type: string + type: array + required: + - backupGatewaysAllowed + - initialRequestMessageHash + - messageType + - processedTimeStamp + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + - timeStamp + type: object + TransferCommenceV1Request: + example: + beneficiaryPubkey: beneficiaryPubkey + sequenceNumber: 1 + hashAssetProfile: hashAssetProfile + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 6 + signature: signature + recipientDltSystem: recipientDltSystem + sessionID: sessionID + hashPrevMessage: hashPrevMessage + serverIdentityPubkey: serverIdentityPubkey + assetUnit: 0 + messageType: messageType + senderDltSystem: senderDltSystem + originatorPubkey: originatorPubkey + properties: + sessionID: + type: string + messageType: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + senderDltSystem: + type: string + recipientDltSystem: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashAssetProfile: + type: string + assetUnit: + type: integer + hashPrevMessage: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: integer + required: + - beneficiaryPubkey + - clientIdentityPubkey + - hashAssetProfile + - hashPrevMessage + - messageType + - originatorPubkey + - recipientDltSystem + - senderDltSystem + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCommenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + messageHash: messageHash + sessionID: sessionID + hashCommenceRequest: hashCommenceRequest + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Request: + example: + sequenceNumber: 6.027456183070403 + lockEvidenceExpiration: lockEvidenceExpiration + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 0 + messageType: messageType + signature: signature + lockEvidenceClaim: lockEvidenceClaim + lockEvidenceFormat: "{}" + hashCommenceAckRequest: hashCommenceAckRequest + messageHash: messageHash + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + lockEvidenceClaim: + type: string + lockEvidenceFormat: + type: object + lockEvidenceExpiration: + type: string + hashCommenceAckRequest: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceAckRequest + - lockEvidenceClaim + - lockEvidenceExpiration + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + hashLockEvidenceRequest: hashLockEvidenceRequest + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + hashLockEvidenceAck: hashLockEvidenceAck + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceAck: + type: string + clientTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Response: + example: + sequenceNumber: 0.8008281904610115 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + hashCommitPrep: hashCommitPrep + signature: signature + serverTransferNumber: serverTransferNumber + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitPrep: + type: string + serverTransferNumber: + type: string + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitPrep + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + clientTransferNumber: 0 + signature: signature + commitFinalClaim: commitFinalClaim + commitFinalClaimFormat: "{}" + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + hashCommitPrepareAck: hashCommitPrepareAck + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: object + hashCommitPrepareAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitFinalClaim + - hashCommitPrepareAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + commitAcknowledgementClaimFormat: "{}" + signature: signature + serverTransferNumber: 0 + commitAcknowledgementClaim: commitAcknowledgementClaim + hashCommitFinal: hashCommitFinal + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: object + hashCommitFinal: + type: string + serverTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitAcknowledgementClaim + - hashCommitFinal + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCompleteV1Request: + example: + sequenceNumber: 6.027456183070403 + hashCommitFinalAck: hashCommitFinalAck + clientIdentityPubkey: clientIdentityPubkey + hashTransferCommence: hashTransferCommence + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitFinalAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + hashTransferCommence: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitFinalAck + - hashTransferCommence + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + ClientV1Request: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + beneficiaryPubkey: beneficiaryPubkey + recipientLedgerAssetID: recipientLedgerAssetID + clientIdentityPubkey: clientIdentityPubkey + serverDltSystem: serverDltSystem + accessControlProfile: accessControlProfile + recipientGatewayPubkey: recipientGatewayPubkey + assetControlProfile: assetControlProfile + version: version + serverIdentityPubkey: serverIdentityPubkey + loggingProfile: loggingProfile + serverGatewayConfiguration: + apiHost: apiHost + sourceLedgerAssetID: sourceLedgerAssetID + clientGatewayConfiguration: + apiHost: apiHost + maxRetries: 0.8008281904610115 + sourceGatewayDltSystem: sourceGatewayDltSystem + maxTimeout: 6.027456183070403 + applicationProfile: applicationProfile + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + originatorPubkey: originatorPubkey + clientDltSystem: clientDltSystem + recipientGatewayDltSystem: recipientGatewayDltSystem + properties: + version: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + assetControlProfile: + type: string + applicationProfile: + type: string + assetProfile: + $ref: '#/components/schemas/AssetProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + sourceGatewayDltSystem: + type: string + recipientGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + clientDltSystem: + type: string + serverDltSystem: + type: string + clientGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + serverGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + maxRetries: + type: number + maxTimeout: + type: number + sourceLedgerAssetID: + type: string + recipientLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - assetControlProfile + - assetProfile + - beneficiaryPubkey + - clientDltSystem + - clientGatewayConfiguration + - clientIdentityPubkey + - loggingProfile + - maxRetries + - maxTimeout + - originatorPubkey + - payloadProfile + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - serverDltSystem + - serverGatewayConfiguration + - serverIdentityPubkey + - sourceGatewayDltSystem + - sourceLedgerAssetID + - version + type: object + RecoverV1Message: + example: + sequenceNumber: 0.8008281904610115 + isBackup: true + odapPhase: odapPhase + signature: signature + sessionID: sessionID + newGatewayPubKey: newGatewayPubKey + newBasePath: newBasePath + lastLogEntryTimestamp: lastLogEntryTimestamp + properties: + sessionID: + type: string + odapPhase: + type: string + sequenceNumber: + type: number + lastLogEntryTimestamp: + type: string + isBackup: + type: boolean + newBasePath: + type: string + newGatewayPubKey: + type: string + signature: + type: string + required: + - isBackup + - lastLogEntryTimestamp + - newBasePath + - odapPhase + - sequenceNumber + - sessionID + - signature + type: object + RecoverUpdateV1Message: + example: + signature: signature + sessionID: sessionID + recoveredLogs: + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + sessionID: + type: string + recoveredLogs: + items: + $ref: '#/components/schemas/OdapLocalLog' + type: array + signature: + type: string + required: + - recoveredLogs + - sessionID + - signature + type: object + RecoverUpdateAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + changedEntriesHash: + - changedEntriesHash + - changedEntriesHash + properties: + sessionID: + type: string + success: + type: boolean + changedEntriesHash: + items: + type: string + type: array + signature: + type: string + required: + - changedEntriesHash + - sessionID + - signature + - success + type: object + RecoverSuccessV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + RollbackV1Message: + example: + actionPerformed: + - actionPerformed + - actionPerformed + signature: signature + success: true + proofs: + - proofs + - proofs + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + actionPerformed: + items: + type: string + type: array + proofs: + items: + type: string + type: array + signature: + type: string + required: + - actionPerformed + - proofs + - sessionID + - signature + - success + type: object + RollbackAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + OdapLocalLog: + example: + data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + key: + type: string + sessionID: + type: string + data: + type: string + type: + type: string + operation: + type: string + timestamp: + type: string + required: + - operation + - sessionID + - type + type: object + OdapMessage: + properties: + SequenceNumber: + type: number + Phase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + ResourceURL: + type: string + DeveloperURN: + type: string + ActionResponse: + $ref: '#/components/schemas/OdapMessage_ActionResponse' + CredentialProfile: + enum: + - SAML + - OAuth + - X509 + type: string + CredentialBlock: + items: {} + type: array + CredentialsProfile: + $ref: '#/components/schemas/PayloadProfile' + ApplicationProfile: + type: object + Payload: + type: object + PayloadHash: + type: string + MessageSignature: + type: string + type: object + ClientV1Request_clientGatewayConfiguration: + example: + apiHost: apiHost + properties: + apiHost: + type: string + required: + - apiHost + type: object + OdapMessage_ActionResponse: + properties: + ResponseCode: + enum: + - "200" + - "404" + type: string + x-enum-varnames: + - OK + - RESOURCE_NOT_FOUND + Arguments: + items: {} + type: array + type: object + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..63180fb6ed --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..e01e52db12 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..72985702c3 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..8271c9bb9e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..a31a143124 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..d3a98a7cce --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AssetProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClientV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClientV1RequestClientGatewayConfiguration.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitFinalV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitFinalV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitPreparationV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitPreparationV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.History.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.LockEvidenceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.LockEvidenceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OdapLocalLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OdapMessage.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OdapMessageActionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PayloadProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverSuccessV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverUpdateAckV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverUpdateV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RollbackAckV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RollbackV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SessionData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferCommenceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferCommenceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferCompleteV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferInitializationV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferInitializationV1Response.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..41f9de7a8c --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..8641aa8337 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..6c533444c1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..ab7fcbf94a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..0fa74bfe33 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,2132 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.ClientV1Request; +import org.openapitools.client.model.CommitFinalV1Request; +import org.openapitools.client.model.CommitFinalV1Response; +import org.openapitools.client.model.CommitPreparationV1Request; +import org.openapitools.client.model.CommitPreparationV1Response; +import org.openapitools.client.model.LockEvidenceV1Request; +import org.openapitools.client.model.LockEvidenceV1Response; +import org.openapitools.client.model.RecoverSuccessV1Message; +import org.openapitools.client.model.RecoverUpdateAckV1Message; +import org.openapitools.client.model.RecoverUpdateV1Message; +import org.openapitools.client.model.RecoverV1Message; +import org.openapitools.client.model.RollbackAckV1Message; +import org.openapitools.client.model.RollbackV1Message; +import org.openapitools.client.model.TransferCommenceV1Request; +import org.openapitools.client.model.TransferCommenceV1Response; +import org.openapitools.client.model.TransferCompleteV1Request; +import org.openapitools.client.model.TransferInitializationV1Request; +import org.openapitools.client.model.TransferInitializationV1Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for clientRequestV1 + * @param clientV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clientRequestV1Call(ClientV1Request clientV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = clientV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call clientRequestV1ValidateBeforeCall(ClientV1Request clientV1Request, final ApiCallback _callback) throws ApiException { + return clientRequestV1Call(clientV1Request, _callback); + + } + + /** + * + * + * @param clientV1Request (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object clientRequestV1(ClientV1Request clientV1Request) throws ApiException { + ApiResponse localVarResp = clientRequestV1WithHttpInfo(clientV1Request); + return localVarResp.getData(); + } + + /** + * + * + * @param clientV1Request (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse clientRequestV1WithHttpInfo(ClientV1Request clientV1Request) throws ApiException { + okhttp3.Call localVarCall = clientRequestV1ValidateBeforeCall(clientV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param clientV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clientRequestV1Async(ClientV1Request clientV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = clientRequestV1ValidateBeforeCall(clientV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for phase1TransferInitiationRequestV1 + * @param transferInitializationV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationRequestV1Call(TransferInitializationV1Request transferInitializationV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferInitializationV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase1TransferInitiationRequestV1ValidateBeforeCall(TransferInitializationV1Request transferInitializationV1Request, final ApiCallback _callback) throws ApiException { + return phase1TransferInitiationRequestV1Call(transferInitializationV1Request, _callback); + + } + + /** + * + * + * @param transferInitializationV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase1TransferInitiationRequestV1(TransferInitializationV1Request transferInitializationV1Request) throws ApiException { + phase1TransferInitiationRequestV1WithHttpInfo(transferInitializationV1Request); + } + + /** + * + * + * @param transferInitializationV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase1TransferInitiationRequestV1WithHttpInfo(TransferInitializationV1Request transferInitializationV1Request) throws ApiException { + okhttp3.Call localVarCall = phase1TransferInitiationRequestV1ValidateBeforeCall(transferInitializationV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferInitializationV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationRequestV1Async(TransferInitializationV1Request transferInitializationV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase1TransferInitiationRequestV1ValidateBeforeCall(transferInitializationV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase1TransferInitiationResponseV1 + * @param transferInitializationV1Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationResponseV1Call(TransferInitializationV1Response transferInitializationV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferInitializationV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase1TransferInitiationResponseV1ValidateBeforeCall(TransferInitializationV1Response transferInitializationV1Response, final ApiCallback _callback) throws ApiException { + return phase1TransferInitiationResponseV1Call(transferInitializationV1Response, _callback); + + } + + /** + * + * + * @param transferInitializationV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase1TransferInitiationResponseV1(TransferInitializationV1Response transferInitializationV1Response) throws ApiException { + phase1TransferInitiationResponseV1WithHttpInfo(transferInitializationV1Response); + } + + /** + * + * + * @param transferInitializationV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase1TransferInitiationResponseV1WithHttpInfo(TransferInitializationV1Response transferInitializationV1Response) throws ApiException { + okhttp3.Call localVarCall = phase1TransferInitiationResponseV1ValidateBeforeCall(transferInitializationV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferInitializationV1Response (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationResponseV1Async(TransferInitializationV1Response transferInitializationV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase1TransferInitiationResponseV1ValidateBeforeCall(transferInitializationV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2LockEvidenceRequestV1 + * @param lockEvidenceV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceRequestV1Call(LockEvidenceV1Request lockEvidenceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = lockEvidenceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase2LockEvidenceRequestV1ValidateBeforeCall(LockEvidenceV1Request lockEvidenceV1Request, final ApiCallback _callback) throws ApiException { + return phase2LockEvidenceRequestV1Call(lockEvidenceV1Request, _callback); + + } + + /** + * + * + * @param lockEvidenceV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2LockEvidenceRequestV1(LockEvidenceV1Request lockEvidenceV1Request) throws ApiException { + phase2LockEvidenceRequestV1WithHttpInfo(lockEvidenceV1Request); + } + + /** + * + * + * @param lockEvidenceV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2LockEvidenceRequestV1WithHttpInfo(LockEvidenceV1Request lockEvidenceV1Request) throws ApiException { + okhttp3.Call localVarCall = phase2LockEvidenceRequestV1ValidateBeforeCall(lockEvidenceV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param lockEvidenceV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceRequestV1Async(LockEvidenceV1Request lockEvidenceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2LockEvidenceRequestV1ValidateBeforeCall(lockEvidenceV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2LockEvidenceResponseV1 + * @param lockEvidenceV1Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceResponseV1Call(LockEvidenceV1Response lockEvidenceV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = lockEvidenceV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase2LockEvidenceResponseV1ValidateBeforeCall(LockEvidenceV1Response lockEvidenceV1Response, final ApiCallback _callback) throws ApiException { + return phase2LockEvidenceResponseV1Call(lockEvidenceV1Response, _callback); + + } + + /** + * + * + * @param lockEvidenceV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2LockEvidenceResponseV1(LockEvidenceV1Response lockEvidenceV1Response) throws ApiException { + phase2LockEvidenceResponseV1WithHttpInfo(lockEvidenceV1Response); + } + + /** + * + * + * @param lockEvidenceV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2LockEvidenceResponseV1WithHttpInfo(LockEvidenceV1Response lockEvidenceV1Response) throws ApiException { + okhttp3.Call localVarCall = phase2LockEvidenceResponseV1ValidateBeforeCall(lockEvidenceV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param lockEvidenceV1Response (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceResponseV1Async(LockEvidenceV1Response lockEvidenceV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2LockEvidenceResponseV1ValidateBeforeCall(lockEvidenceV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2TransferCommenceRequestV1 + * @param transferCommenceV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceRequestV1Call(TransferCommenceV1Request transferCommenceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferCommenceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase2TransferCommenceRequestV1ValidateBeforeCall(TransferCommenceV1Request transferCommenceV1Request, final ApiCallback _callback) throws ApiException { + return phase2TransferCommenceRequestV1Call(transferCommenceV1Request, _callback); + + } + + /** + * + * + * @param transferCommenceV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2TransferCommenceRequestV1(TransferCommenceV1Request transferCommenceV1Request) throws ApiException { + phase2TransferCommenceRequestV1WithHttpInfo(transferCommenceV1Request); + } + + /** + * + * + * @param transferCommenceV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2TransferCommenceRequestV1WithHttpInfo(TransferCommenceV1Request transferCommenceV1Request) throws ApiException { + okhttp3.Call localVarCall = phase2TransferCommenceRequestV1ValidateBeforeCall(transferCommenceV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferCommenceV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceRequestV1Async(TransferCommenceV1Request transferCommenceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2TransferCommenceRequestV1ValidateBeforeCall(transferCommenceV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2TransferCommenceResponseV1 + * @param transferCommenceV1Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceResponseV1Call(TransferCommenceV1Response transferCommenceV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferCommenceV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase2TransferCommenceResponseV1ValidateBeforeCall(TransferCommenceV1Response transferCommenceV1Response, final ApiCallback _callback) throws ApiException { + return phase2TransferCommenceResponseV1Call(transferCommenceV1Response, _callback); + + } + + /** + * + * + * @param transferCommenceV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2TransferCommenceResponseV1(TransferCommenceV1Response transferCommenceV1Response) throws ApiException { + phase2TransferCommenceResponseV1WithHttpInfo(transferCommenceV1Response); + } + + /** + * + * + * @param transferCommenceV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2TransferCommenceResponseV1WithHttpInfo(TransferCommenceV1Response transferCommenceV1Response) throws ApiException { + okhttp3.Call localVarCall = phase2TransferCommenceResponseV1ValidateBeforeCall(transferCommenceV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferCommenceV1Response (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceResponseV1Async(TransferCommenceV1Response transferCommenceV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2TransferCommenceResponseV1ValidateBeforeCall(transferCommenceV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitFinalRequestV1 + * @param commitFinalV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalRequestV1Call(CommitFinalV1Request commitFinalV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitFinalV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase3CommitFinalRequestV1ValidateBeforeCall(CommitFinalV1Request commitFinalV1Request, final ApiCallback _callback) throws ApiException { + return phase3CommitFinalRequestV1Call(commitFinalV1Request, _callback); + + } + + /** + * + * + * @param commitFinalV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitFinalRequestV1(CommitFinalV1Request commitFinalV1Request) throws ApiException { + phase3CommitFinalRequestV1WithHttpInfo(commitFinalV1Request); + } + + /** + * + * + * @param commitFinalV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitFinalRequestV1WithHttpInfo(CommitFinalV1Request commitFinalV1Request) throws ApiException { + okhttp3.Call localVarCall = phase3CommitFinalRequestV1ValidateBeforeCall(commitFinalV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitFinalV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalRequestV1Async(CommitFinalV1Request commitFinalV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitFinalRequestV1ValidateBeforeCall(commitFinalV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitFinalResponseV1 + * @param commitFinalV1Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalResponseV1Call(CommitFinalV1Response commitFinalV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitFinalV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase3CommitFinalResponseV1ValidateBeforeCall(CommitFinalV1Response commitFinalV1Response, final ApiCallback _callback) throws ApiException { + return phase3CommitFinalResponseV1Call(commitFinalV1Response, _callback); + + } + + /** + * + * + * @param commitFinalV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitFinalResponseV1(CommitFinalV1Response commitFinalV1Response) throws ApiException { + phase3CommitFinalResponseV1WithHttpInfo(commitFinalV1Response); + } + + /** + * + * + * @param commitFinalV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitFinalResponseV1WithHttpInfo(CommitFinalV1Response commitFinalV1Response) throws ApiException { + okhttp3.Call localVarCall = phase3CommitFinalResponseV1ValidateBeforeCall(commitFinalV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitFinalV1Response (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalResponseV1Async(CommitFinalV1Response commitFinalV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitFinalResponseV1ValidateBeforeCall(commitFinalV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitPreparationRequestV1 + * @param commitPreparationV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationRequestV1Call(CommitPreparationV1Request commitPreparationV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitPreparationV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase3CommitPreparationRequestV1ValidateBeforeCall(CommitPreparationV1Request commitPreparationV1Request, final ApiCallback _callback) throws ApiException { + return phase3CommitPreparationRequestV1Call(commitPreparationV1Request, _callback); + + } + + /** + * + * + * @param commitPreparationV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitPreparationRequestV1(CommitPreparationV1Request commitPreparationV1Request) throws ApiException { + phase3CommitPreparationRequestV1WithHttpInfo(commitPreparationV1Request); + } + + /** + * + * + * @param commitPreparationV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitPreparationRequestV1WithHttpInfo(CommitPreparationV1Request commitPreparationV1Request) throws ApiException { + okhttp3.Call localVarCall = phase3CommitPreparationRequestV1ValidateBeforeCall(commitPreparationV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitPreparationV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationRequestV1Async(CommitPreparationV1Request commitPreparationV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitPreparationRequestV1ValidateBeforeCall(commitPreparationV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitPreparationResponseV1 + * @param commitPreparationV1Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationResponseV1Call(CommitPreparationV1Response commitPreparationV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitPreparationV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase3CommitPreparationResponseV1ValidateBeforeCall(CommitPreparationV1Response commitPreparationV1Response, final ApiCallback _callback) throws ApiException { + return phase3CommitPreparationResponseV1Call(commitPreparationV1Response, _callback); + + } + + /** + * + * + * @param commitPreparationV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitPreparationResponseV1(CommitPreparationV1Response commitPreparationV1Response) throws ApiException { + phase3CommitPreparationResponseV1WithHttpInfo(commitPreparationV1Response); + } + + /** + * + * + * @param commitPreparationV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitPreparationResponseV1WithHttpInfo(CommitPreparationV1Response commitPreparationV1Response) throws ApiException { + okhttp3.Call localVarCall = phase3CommitPreparationResponseV1ValidateBeforeCall(commitPreparationV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitPreparationV1Response (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationResponseV1Async(CommitPreparationV1Response commitPreparationV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitPreparationResponseV1ValidateBeforeCall(commitPreparationV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3TransferCompleteRequestV1 + * @param transferCompleteV1Request (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3TransferCompleteRequestV1Call(TransferCompleteV1Request transferCompleteV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferCompleteV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase3TransferCompleteRequestV1ValidateBeforeCall(TransferCompleteV1Request transferCompleteV1Request, final ApiCallback _callback) throws ApiException { + return phase3TransferCompleteRequestV1Call(transferCompleteV1Request, _callback); + + } + + /** + * + * + * @param transferCompleteV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3TransferCompleteRequestV1(TransferCompleteV1Request transferCompleteV1Request) throws ApiException { + phase3TransferCompleteRequestV1WithHttpInfo(transferCompleteV1Request); + } + + /** + * + * + * @param transferCompleteV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3TransferCompleteRequestV1WithHttpInfo(TransferCompleteV1Request transferCompleteV1Request) throws ApiException { + okhttp3.Call localVarCall = phase3TransferCompleteRequestV1ValidateBeforeCall(transferCompleteV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferCompleteV1Request (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3TransferCompleteRequestV1Async(TransferCompleteV1Request transferCompleteV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3TransferCompleteRequestV1ValidateBeforeCall(transferCompleteV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverUpdateAckV1Message + * @param recoverUpdateAckV1Message (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateAckV1MessageCall(RecoverUpdateAckV1Message recoverUpdateAckV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverUpdateAckV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call recoverUpdateAckV1MessageValidateBeforeCall(RecoverUpdateAckV1Message recoverUpdateAckV1Message, final ApiCallback _callback) throws ApiException { + return recoverUpdateAckV1MessageCall(recoverUpdateAckV1Message, _callback); + + } + + /** + * + * + * @param recoverUpdateAckV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverUpdateAckV1Message(RecoverUpdateAckV1Message recoverUpdateAckV1Message) throws ApiException { + recoverUpdateAckV1MessageWithHttpInfo(recoverUpdateAckV1Message); + } + + /** + * + * + * @param recoverUpdateAckV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverUpdateAckV1MessageWithHttpInfo(RecoverUpdateAckV1Message recoverUpdateAckV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverUpdateAckV1MessageValidateBeforeCall(recoverUpdateAckV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverUpdateAckV1Message (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateAckV1MessageAsync(RecoverUpdateAckV1Message recoverUpdateAckV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverUpdateAckV1MessageValidateBeforeCall(recoverUpdateAckV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverUpdateV1Message + * @param recoverUpdateV1Message (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateV1MessageCall(RecoverUpdateV1Message recoverUpdateV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverUpdateV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call recoverUpdateV1MessageValidateBeforeCall(RecoverUpdateV1Message recoverUpdateV1Message, final ApiCallback _callback) throws ApiException { + return recoverUpdateV1MessageCall(recoverUpdateV1Message, _callback); + + } + + /** + * + * + * @param recoverUpdateV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverUpdateV1Message(RecoverUpdateV1Message recoverUpdateV1Message) throws ApiException { + recoverUpdateV1MessageWithHttpInfo(recoverUpdateV1Message); + } + + /** + * + * + * @param recoverUpdateV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverUpdateV1MessageWithHttpInfo(RecoverUpdateV1Message recoverUpdateV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverUpdateV1MessageValidateBeforeCall(recoverUpdateV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverUpdateV1Message (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateV1MessageAsync(RecoverUpdateV1Message recoverUpdateV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverUpdateV1MessageValidateBeforeCall(recoverUpdateV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverV1Message + * @param recoverV1Message (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1MessageCall(RecoverV1Message recoverV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call recoverV1MessageValidateBeforeCall(RecoverV1Message recoverV1Message, final ApiCallback _callback) throws ApiException { + return recoverV1MessageCall(recoverV1Message, _callback); + + } + + /** + * + * + * @param recoverV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverV1Message(RecoverV1Message recoverV1Message) throws ApiException { + recoverV1MessageWithHttpInfo(recoverV1Message); + } + + /** + * + * + * @param recoverV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverV1MessageWithHttpInfo(RecoverV1Message recoverV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverV1MessageValidateBeforeCall(recoverV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverV1Message (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1MessageAsync(RecoverV1Message recoverV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverV1MessageValidateBeforeCall(recoverV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverV1Success + * @param recoverSuccessV1Message (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1SuccessCall(RecoverSuccessV1Message recoverSuccessV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverSuccessV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call recoverV1SuccessValidateBeforeCall(RecoverSuccessV1Message recoverSuccessV1Message, final ApiCallback _callback) throws ApiException { + return recoverV1SuccessCall(recoverSuccessV1Message, _callback); + + } + + /** + * + * + * @param recoverSuccessV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverV1Success(RecoverSuccessV1Message recoverSuccessV1Message) throws ApiException { + recoverV1SuccessWithHttpInfo(recoverSuccessV1Message); + } + + /** + * + * + * @param recoverSuccessV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverV1SuccessWithHttpInfo(RecoverSuccessV1Message recoverSuccessV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverV1SuccessValidateBeforeCall(recoverSuccessV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverSuccessV1Message (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1SuccessAsync(RecoverSuccessV1Message recoverSuccessV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverV1SuccessValidateBeforeCall(recoverSuccessV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for rollbackAckV1Message + * @param rollbackAckV1Message (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackAckV1MessageCall(RollbackAckV1Message rollbackAckV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = rollbackAckV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call rollbackAckV1MessageValidateBeforeCall(RollbackAckV1Message rollbackAckV1Message, final ApiCallback _callback) throws ApiException { + return rollbackAckV1MessageCall(rollbackAckV1Message, _callback); + + } + + /** + * + * + * @param rollbackAckV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void rollbackAckV1Message(RollbackAckV1Message rollbackAckV1Message) throws ApiException { + rollbackAckV1MessageWithHttpInfo(rollbackAckV1Message); + } + + /** + * + * + * @param rollbackAckV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse rollbackAckV1MessageWithHttpInfo(RollbackAckV1Message rollbackAckV1Message) throws ApiException { + okhttp3.Call localVarCall = rollbackAckV1MessageValidateBeforeCall(rollbackAckV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param rollbackAckV1Message (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackAckV1MessageAsync(RollbackAckV1Message rollbackAckV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = rollbackAckV1MessageValidateBeforeCall(rollbackAckV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for rollbackV1Message + * @param rollbackV1Message (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackV1MessageCall(RollbackV1Message rollbackV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = rollbackV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call rollbackV1MessageValidateBeforeCall(RollbackV1Message rollbackV1Message, final ApiCallback _callback) throws ApiException { + return rollbackV1MessageCall(rollbackV1Message, _callback); + + } + + /** + * + * + * @param rollbackV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void rollbackV1Message(RollbackV1Message rollbackV1Message) throws ApiException { + rollbackV1MessageWithHttpInfo(rollbackV1Message); + } + + /** + * + * + * @param rollbackV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse rollbackV1MessageWithHttpInfo(RollbackV1Message rollbackV1Message) throws ApiException { + okhttp3.Call localVarCall = rollbackV1MessageValidateBeforeCall(rollbackV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param rollbackV1Message (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackV1MessageAsync(RollbackV1Message rollbackV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = rollbackV1MessageValidateBeforeCall(rollbackV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..714e9b0441 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..a55e830c78 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..62643a0ee8 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..ed73077993 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..08eadc4aab --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java new file mode 100644 index 0000000000..af87ad7941 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java @@ -0,0 +1,595 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * AssetProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AssetProfile { + public static final String SERIALIZED_NAME_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + private String issuer; + + public static final String SERIALIZED_NAME_ASSET_CODE = "assetCode"; + @SerializedName(SERIALIZED_NAME_ASSET_CODE) + private String assetCode; + + public static final String SERIALIZED_NAME_ASSET_CODE_TYPE = "assetCodeType"; + @SerializedName(SERIALIZED_NAME_ASSET_CODE_TYPE) + private String assetCodeType; + + public static final String SERIALIZED_NAME_ISSUANCE_DATE = "issuanceDate"; + @SerializedName(SERIALIZED_NAME_ISSUANCE_DATE) + private String issuanceDate; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expirationDate"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + private String expirationDate; + + public static final String SERIALIZED_NAME_VERIFICATION_END_POINT = "verificationEndPoint"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_END_POINT) + private String verificationEndPoint; + + public static final String SERIALIZED_NAME_DIGITAL_SIGNATURE = "digitalSignature"; + @SerializedName(SERIALIZED_NAME_DIGITAL_SIGNATURE) + private String digitalSignature; + + public static final String SERIALIZED_NAME_PROSPECTUS_LINK = "prospectusLink"; + @SerializedName(SERIALIZED_NAME_PROSPECTUS_LINK) + private String prospectusLink; + + public static final String SERIALIZED_NAME_KEY_INFORMATION_LINK = "keyInformationLink"; + @SerializedName(SERIALIZED_NAME_KEY_INFORMATION_LINK) + private List keyInformationLink; + + public static final String SERIALIZED_NAME_KEY_WORD = "keyWord"; + @SerializedName(SERIALIZED_NAME_KEY_WORD) + private List keyWord; + + public static final String SERIALIZED_NAME_TRANSFER_RESTRICTION = "transferRestriction"; + @SerializedName(SERIALIZED_NAME_TRANSFER_RESTRICTION) + private List transferRestriction; + + public static final String SERIALIZED_NAME_LEDGER_REQUIREMENTS = "ledgerRequirements"; + @SerializedName(SERIALIZED_NAME_LEDGER_REQUIREMENTS) + private List ledgerRequirements; + + public AssetProfile() { + } + + public AssetProfile issuer(String issuer) { + + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + **/ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + + public AssetProfile assetCode(String assetCode) { + + this.assetCode = assetCode; + return this; + } + + /** + * Get assetCode + * @return assetCode + **/ + @javax.annotation.Nullable + public String getAssetCode() { + return assetCode; + } + + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + + + public AssetProfile assetCodeType(String assetCodeType) { + + this.assetCodeType = assetCodeType; + return this; + } + + /** + * Get assetCodeType + * @return assetCodeType + **/ + @javax.annotation.Nullable + public String getAssetCodeType() { + return assetCodeType; + } + + + public void setAssetCodeType(String assetCodeType) { + this.assetCodeType = assetCodeType; + } + + + public AssetProfile issuanceDate(String issuanceDate) { + + this.issuanceDate = issuanceDate; + return this; + } + + /** + * Get issuanceDate + * @return issuanceDate + **/ + @javax.annotation.Nullable + public String getIssuanceDate() { + return issuanceDate; + } + + + public void setIssuanceDate(String issuanceDate) { + this.issuanceDate = issuanceDate; + } + + + public AssetProfile expirationDate(String expirationDate) { + + this.expirationDate = expirationDate; + return this; + } + + /** + * Get expirationDate + * @return expirationDate + **/ + @javax.annotation.Nonnull + public String getExpirationDate() { + return expirationDate; + } + + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + + public AssetProfile verificationEndPoint(String verificationEndPoint) { + + this.verificationEndPoint = verificationEndPoint; + return this; + } + + /** + * Get verificationEndPoint + * @return verificationEndPoint + **/ + @javax.annotation.Nullable + public String getVerificationEndPoint() { + return verificationEndPoint; + } + + + public void setVerificationEndPoint(String verificationEndPoint) { + this.verificationEndPoint = verificationEndPoint; + } + + + public AssetProfile digitalSignature(String digitalSignature) { + + this.digitalSignature = digitalSignature; + return this; + } + + /** + * Get digitalSignature + * @return digitalSignature + **/ + @javax.annotation.Nullable + public String getDigitalSignature() { + return digitalSignature; + } + + + public void setDigitalSignature(String digitalSignature) { + this.digitalSignature = digitalSignature; + } + + + public AssetProfile prospectusLink(String prospectusLink) { + + this.prospectusLink = prospectusLink; + return this; + } + + /** + * Get prospectusLink + * @return prospectusLink + **/ + @javax.annotation.Nullable + public String getProspectusLink() { + return prospectusLink; + } + + + public void setProspectusLink(String prospectusLink) { + this.prospectusLink = prospectusLink; + } + + + public AssetProfile keyInformationLink(List keyInformationLink) { + + this.keyInformationLink = keyInformationLink; + return this; + } + + public AssetProfile addKeyInformationLinkItem(Object keyInformationLinkItem) { + if (this.keyInformationLink == null) { + this.keyInformationLink = new ArrayList<>(); + } + this.keyInformationLink.add(keyInformationLinkItem); + return this; + } + + /** + * Get keyInformationLink + * @return keyInformationLink + **/ + @javax.annotation.Nullable + public List getKeyInformationLink() { + return keyInformationLink; + } + + + public void setKeyInformationLink(List keyInformationLink) { + this.keyInformationLink = keyInformationLink; + } + + + public AssetProfile keyWord(List keyWord) { + + this.keyWord = keyWord; + return this; + } + + public AssetProfile addKeyWordItem(Object keyWordItem) { + if (this.keyWord == null) { + this.keyWord = new ArrayList<>(); + } + this.keyWord.add(keyWordItem); + return this; + } + + /** + * Get keyWord + * @return keyWord + **/ + @javax.annotation.Nullable + public List getKeyWord() { + return keyWord; + } + + + public void setKeyWord(List keyWord) { + this.keyWord = keyWord; + } + + + public AssetProfile transferRestriction(List transferRestriction) { + + this.transferRestriction = transferRestriction; + return this; + } + + public AssetProfile addTransferRestrictionItem(Object transferRestrictionItem) { + if (this.transferRestriction == null) { + this.transferRestriction = new ArrayList<>(); + } + this.transferRestriction.add(transferRestrictionItem); + return this; + } + + /** + * Get transferRestriction + * @return transferRestriction + **/ + @javax.annotation.Nullable + public List getTransferRestriction() { + return transferRestriction; + } + + + public void setTransferRestriction(List transferRestriction) { + this.transferRestriction = transferRestriction; + } + + + public AssetProfile ledgerRequirements(List ledgerRequirements) { + + this.ledgerRequirements = ledgerRequirements; + return this; + } + + public AssetProfile addLedgerRequirementsItem(Object ledgerRequirementsItem) { + if (this.ledgerRequirements == null) { + this.ledgerRequirements = new ArrayList<>(); + } + this.ledgerRequirements.add(ledgerRequirementsItem); + return this; + } + + /** + * Get ledgerRequirements + * @return ledgerRequirements + **/ + @javax.annotation.Nullable + public List getLedgerRequirements() { + return ledgerRequirements; + } + + + public void setLedgerRequirements(List ledgerRequirements) { + this.ledgerRequirements = ledgerRequirements; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetProfile assetProfile = (AssetProfile) o; + return Objects.equals(this.issuer, assetProfile.issuer) && + Objects.equals(this.assetCode, assetProfile.assetCode) && + Objects.equals(this.assetCodeType, assetProfile.assetCodeType) && + Objects.equals(this.issuanceDate, assetProfile.issuanceDate) && + Objects.equals(this.expirationDate, assetProfile.expirationDate) && + Objects.equals(this.verificationEndPoint, assetProfile.verificationEndPoint) && + Objects.equals(this.digitalSignature, assetProfile.digitalSignature) && + Objects.equals(this.prospectusLink, assetProfile.prospectusLink) && + Objects.equals(this.keyInformationLink, assetProfile.keyInformationLink) && + Objects.equals(this.keyWord, assetProfile.keyWord) && + Objects.equals(this.transferRestriction, assetProfile.transferRestriction) && + Objects.equals(this.ledgerRequirements, assetProfile.ledgerRequirements); + } + + @Override + public int hashCode() { + return Objects.hash(issuer, assetCode, assetCodeType, issuanceDate, expirationDate, verificationEndPoint, digitalSignature, prospectusLink, keyInformationLink, keyWord, transferRestriction, ledgerRequirements); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetProfile {\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" assetCode: ").append(toIndentedString(assetCode)).append("\n"); + sb.append(" assetCodeType: ").append(toIndentedString(assetCodeType)).append("\n"); + sb.append(" issuanceDate: ").append(toIndentedString(issuanceDate)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" verificationEndPoint: ").append(toIndentedString(verificationEndPoint)).append("\n"); + sb.append(" digitalSignature: ").append(toIndentedString(digitalSignature)).append("\n"); + sb.append(" prospectusLink: ").append(toIndentedString(prospectusLink)).append("\n"); + sb.append(" keyInformationLink: ").append(toIndentedString(keyInformationLink)).append("\n"); + sb.append(" keyWord: ").append(toIndentedString(keyWord)).append("\n"); + sb.append(" transferRestriction: ").append(toIndentedString(transferRestriction)).append("\n"); + sb.append(" ledgerRequirements: ").append(toIndentedString(ledgerRequirements)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("issuer"); + openapiFields.add("assetCode"); + openapiFields.add("assetCodeType"); + openapiFields.add("issuanceDate"); + openapiFields.add("expirationDate"); + openapiFields.add("verificationEndPoint"); + openapiFields.add("digitalSignature"); + openapiFields.add("prospectusLink"); + openapiFields.add("keyInformationLink"); + openapiFields.add("keyWord"); + openapiFields.add("transferRestriction"); + openapiFields.add("ledgerRequirements"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("expirationDate"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AssetProfile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AssetProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetProfile is not found in the empty JSON string", AssetProfile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AssetProfile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetProfile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetProfile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonNull()) && !jsonObj.get("issuer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + } + if ((jsonObj.get("assetCode") != null && !jsonObj.get("assetCode").isJsonNull()) && !jsonObj.get("assetCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetCode").toString())); + } + if ((jsonObj.get("assetCodeType") != null && !jsonObj.get("assetCodeType").isJsonNull()) && !jsonObj.get("assetCodeType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetCodeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetCodeType").toString())); + } + if ((jsonObj.get("issuanceDate") != null && !jsonObj.get("issuanceDate").isJsonNull()) && !jsonObj.get("issuanceDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuanceDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuanceDate").toString())); + } + if (!jsonObj.get("expirationDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expirationDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expirationDate").toString())); + } + if ((jsonObj.get("verificationEndPoint") != null && !jsonObj.get("verificationEndPoint").isJsonNull()) && !jsonObj.get("verificationEndPoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verificationEndPoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationEndPoint").toString())); + } + if ((jsonObj.get("digitalSignature") != null && !jsonObj.get("digitalSignature").isJsonNull()) && !jsonObj.get("digitalSignature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `digitalSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("digitalSignature").toString())); + } + if ((jsonObj.get("prospectusLink") != null && !jsonObj.get("prospectusLink").isJsonNull()) && !jsonObj.get("prospectusLink").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `prospectusLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prospectusLink").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("keyInformationLink") != null && !jsonObj.get("keyInformationLink").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `keyInformationLink` to be an array in the JSON string but got `%s`", jsonObj.get("keyInformationLink").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("keyWord") != null && !jsonObj.get("keyWord").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `keyWord` to be an array in the JSON string but got `%s`", jsonObj.get("keyWord").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transferRestriction") != null && !jsonObj.get("transferRestriction").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transferRestriction` to be an array in the JSON string but got `%s`", jsonObj.get("transferRestriction").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("ledgerRequirements") != null && !jsonObj.get("ledgerRequirements").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerRequirements` to be an array in the JSON string but got `%s`", jsonObj.get("ledgerRequirements").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetProfile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetProfile + * @throws IOException if the JSON string is invalid with respect to AssetProfile + */ + public static AssetProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetProfile.class); + } + + /** + * Convert an instance of AssetProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java new file mode 100644 index 0000000000..1fbee77688 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java @@ -0,0 +1,882 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.ClientV1RequestClientGatewayConfiguration; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClientV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClientV1Request { + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_LOGGING_PROFILE = "loggingProfile"; + @SerializedName(SERIALIZED_NAME_LOGGING_PROFILE) + private String loggingProfile; + + public static final String SERIALIZED_NAME_ACCESS_CONTROL_PROFILE = "accessControlProfile"; + @SerializedName(SERIALIZED_NAME_ACCESS_CONTROL_PROFILE) + private String accessControlProfile; + + public static final String SERIALIZED_NAME_ASSET_CONTROL_PROFILE = "assetControlProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_CONTROL_PROFILE) + private String assetControlProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "applicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private String applicationProfile; + + public static final String SERIALIZED_NAME_ASSET_PROFILE = "assetProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_PROFILE) + private AssetProfile assetProfile; + + public static final String SERIALIZED_NAME_PAYLOAD_PROFILE = "payloadProfile"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_PROFILE) + private PayloadProfile payloadProfile; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM = "sourceGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM) + private String sourceGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM = "recipientGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM) + private String recipientGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY = "recipientGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY) + private String recipientGatewayPubkey; + + public static final String SERIALIZED_NAME_ORIGINATOR_PUBKEY = "originatorPubkey"; + @SerializedName(SERIALIZED_NAME_ORIGINATOR_PUBKEY) + private String originatorPubkey; + + public static final String SERIALIZED_NAME_BENEFICIARY_PUBKEY = "beneficiaryPubkey"; + @SerializedName(SERIALIZED_NAME_BENEFICIARY_PUBKEY) + private String beneficiaryPubkey; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_CLIENT_DLT_SYSTEM = "clientDltSystem"; + @SerializedName(SERIALIZED_NAME_CLIENT_DLT_SYSTEM) + private String clientDltSystem; + + public static final String SERIALIZED_NAME_SERVER_DLT_SYSTEM = "serverDltSystem"; + @SerializedName(SERIALIZED_NAME_SERVER_DLT_SYSTEM) + private String serverDltSystem; + + public static final String SERIALIZED_NAME_CLIENT_GATEWAY_CONFIGURATION = "clientGatewayConfiguration"; + @SerializedName(SERIALIZED_NAME_CLIENT_GATEWAY_CONFIGURATION) + private ClientV1RequestClientGatewayConfiguration clientGatewayConfiguration; + + public static final String SERIALIZED_NAME_SERVER_GATEWAY_CONFIGURATION = "serverGatewayConfiguration"; + @SerializedName(SERIALIZED_NAME_SERVER_GATEWAY_CONFIGURATION) + private ClientV1RequestClientGatewayConfiguration serverGatewayConfiguration; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private BigDecimal maxRetries; + + public static final String SERIALIZED_NAME_MAX_TIMEOUT = "maxTimeout"; + @SerializedName(SERIALIZED_NAME_MAX_TIMEOUT) + private BigDecimal maxTimeout; + + public static final String SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D = "sourceLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D) + private String sourceLedgerAssetID; + + public static final String SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D = "recipientLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D) + private String recipientLedgerAssetID; + + public ClientV1Request() { + } + + public ClientV1Request version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public ClientV1Request loggingProfile(String loggingProfile) { + + this.loggingProfile = loggingProfile; + return this; + } + + /** + * Get loggingProfile + * @return loggingProfile + **/ + @javax.annotation.Nonnull + public String getLoggingProfile() { + return loggingProfile; + } + + + public void setLoggingProfile(String loggingProfile) { + this.loggingProfile = loggingProfile; + } + + + public ClientV1Request accessControlProfile(String accessControlProfile) { + + this.accessControlProfile = accessControlProfile; + return this; + } + + /** + * Get accessControlProfile + * @return accessControlProfile + **/ + @javax.annotation.Nonnull + public String getAccessControlProfile() { + return accessControlProfile; + } + + + public void setAccessControlProfile(String accessControlProfile) { + this.accessControlProfile = accessControlProfile; + } + + + public ClientV1Request assetControlProfile(String assetControlProfile) { + + this.assetControlProfile = assetControlProfile; + return this; + } + + /** + * Get assetControlProfile + * @return assetControlProfile + **/ + @javax.annotation.Nonnull + public String getAssetControlProfile() { + return assetControlProfile; + } + + + public void setAssetControlProfile(String assetControlProfile) { + this.assetControlProfile = assetControlProfile; + } + + + public ClientV1Request applicationProfile(String applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nonnull + public String getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(String applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public ClientV1Request assetProfile(AssetProfile assetProfile) { + + this.assetProfile = assetProfile; + return this; + } + + /** + * Get assetProfile + * @return assetProfile + **/ + @javax.annotation.Nonnull + public AssetProfile getAssetProfile() { + return assetProfile; + } + + + public void setAssetProfile(AssetProfile assetProfile) { + this.assetProfile = assetProfile; + } + + + public ClientV1Request payloadProfile(PayloadProfile payloadProfile) { + + this.payloadProfile = payloadProfile; + return this; + } + + /** + * Get payloadProfile + * @return payloadProfile + **/ + @javax.annotation.Nonnull + public PayloadProfile getPayloadProfile() { + return payloadProfile; + } + + + public void setPayloadProfile(PayloadProfile payloadProfile) { + this.payloadProfile = payloadProfile; + } + + + public ClientV1Request sourceGatewayDltSystem(String sourceGatewayDltSystem) { + + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + return this; + } + + /** + * Get sourceGatewayDltSystem + * @return sourceGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getSourceGatewayDltSystem() { + return sourceGatewayDltSystem; + } + + + public void setSourceGatewayDltSystem(String sourceGatewayDltSystem) { + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + } + + + public ClientV1Request recipientGatewayDltSystem(String recipientGatewayDltSystem) { + + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + return this; + } + + /** + * Get recipientGatewayDltSystem + * @return recipientGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayDltSystem() { + return recipientGatewayDltSystem; + } + + + public void setRecipientGatewayDltSystem(String recipientGatewayDltSystem) { + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + } + + + public ClientV1Request recipientGatewayPubkey(String recipientGatewayPubkey) { + + this.recipientGatewayPubkey = recipientGatewayPubkey; + return this; + } + + /** + * Get recipientGatewayPubkey + * @return recipientGatewayPubkey + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayPubkey() { + return recipientGatewayPubkey; + } + + + public void setRecipientGatewayPubkey(String recipientGatewayPubkey) { + this.recipientGatewayPubkey = recipientGatewayPubkey; + } + + + public ClientV1Request originatorPubkey(String originatorPubkey) { + + this.originatorPubkey = originatorPubkey; + return this; + } + + /** + * Get originatorPubkey + * @return originatorPubkey + **/ + @javax.annotation.Nonnull + public String getOriginatorPubkey() { + return originatorPubkey; + } + + + public void setOriginatorPubkey(String originatorPubkey) { + this.originatorPubkey = originatorPubkey; + } + + + public ClientV1Request beneficiaryPubkey(String beneficiaryPubkey) { + + this.beneficiaryPubkey = beneficiaryPubkey; + return this; + } + + /** + * Get beneficiaryPubkey + * @return beneficiaryPubkey + **/ + @javax.annotation.Nonnull + public String getBeneficiaryPubkey() { + return beneficiaryPubkey; + } + + + public void setBeneficiaryPubkey(String beneficiaryPubkey) { + this.beneficiaryPubkey = beneficiaryPubkey; + } + + + public ClientV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public ClientV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public ClientV1Request clientDltSystem(String clientDltSystem) { + + this.clientDltSystem = clientDltSystem; + return this; + } + + /** + * Get clientDltSystem + * @return clientDltSystem + **/ + @javax.annotation.Nonnull + public String getClientDltSystem() { + return clientDltSystem; + } + + + public void setClientDltSystem(String clientDltSystem) { + this.clientDltSystem = clientDltSystem; + } + + + public ClientV1Request serverDltSystem(String serverDltSystem) { + + this.serverDltSystem = serverDltSystem; + return this; + } + + /** + * Get serverDltSystem + * @return serverDltSystem + **/ + @javax.annotation.Nonnull + public String getServerDltSystem() { + return serverDltSystem; + } + + + public void setServerDltSystem(String serverDltSystem) { + this.serverDltSystem = serverDltSystem; + } + + + public ClientV1Request clientGatewayConfiguration(ClientV1RequestClientGatewayConfiguration clientGatewayConfiguration) { + + this.clientGatewayConfiguration = clientGatewayConfiguration; + return this; + } + + /** + * Get clientGatewayConfiguration + * @return clientGatewayConfiguration + **/ + @javax.annotation.Nonnull + public ClientV1RequestClientGatewayConfiguration getClientGatewayConfiguration() { + return clientGatewayConfiguration; + } + + + public void setClientGatewayConfiguration(ClientV1RequestClientGatewayConfiguration clientGatewayConfiguration) { + this.clientGatewayConfiguration = clientGatewayConfiguration; + } + + + public ClientV1Request serverGatewayConfiguration(ClientV1RequestClientGatewayConfiguration serverGatewayConfiguration) { + + this.serverGatewayConfiguration = serverGatewayConfiguration; + return this; + } + + /** + * Get serverGatewayConfiguration + * @return serverGatewayConfiguration + **/ + @javax.annotation.Nonnull + public ClientV1RequestClientGatewayConfiguration getServerGatewayConfiguration() { + return serverGatewayConfiguration; + } + + + public void setServerGatewayConfiguration(ClientV1RequestClientGatewayConfiguration serverGatewayConfiguration) { + this.serverGatewayConfiguration = serverGatewayConfiguration; + } + + + public ClientV1Request maxRetries(BigDecimal maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Get maxRetries + * @return maxRetries + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxRetries() { + return maxRetries; + } + + + public void setMaxRetries(BigDecimal maxRetries) { + this.maxRetries = maxRetries; + } + + + public ClientV1Request maxTimeout(BigDecimal maxTimeout) { + + this.maxTimeout = maxTimeout; + return this; + } + + /** + * Get maxTimeout + * @return maxTimeout + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxTimeout() { + return maxTimeout; + } + + + public void setMaxTimeout(BigDecimal maxTimeout) { + this.maxTimeout = maxTimeout; + } + + + public ClientV1Request sourceLedgerAssetID(String sourceLedgerAssetID) { + + this.sourceLedgerAssetID = sourceLedgerAssetID; + return this; + } + + /** + * Get sourceLedgerAssetID + * @return sourceLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getSourceLedgerAssetID() { + return sourceLedgerAssetID; + } + + + public void setSourceLedgerAssetID(String sourceLedgerAssetID) { + this.sourceLedgerAssetID = sourceLedgerAssetID; + } + + + public ClientV1Request recipientLedgerAssetID(String recipientLedgerAssetID) { + + this.recipientLedgerAssetID = recipientLedgerAssetID; + return this; + } + + /** + * Get recipientLedgerAssetID + * @return recipientLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getRecipientLedgerAssetID() { + return recipientLedgerAssetID; + } + + + public void setRecipientLedgerAssetID(String recipientLedgerAssetID) { + this.recipientLedgerAssetID = recipientLedgerAssetID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientV1Request clientV1Request = (ClientV1Request) o; + return Objects.equals(this.version, clientV1Request.version) && + Objects.equals(this.loggingProfile, clientV1Request.loggingProfile) && + Objects.equals(this.accessControlProfile, clientV1Request.accessControlProfile) && + Objects.equals(this.assetControlProfile, clientV1Request.assetControlProfile) && + Objects.equals(this.applicationProfile, clientV1Request.applicationProfile) && + Objects.equals(this.assetProfile, clientV1Request.assetProfile) && + Objects.equals(this.payloadProfile, clientV1Request.payloadProfile) && + Objects.equals(this.sourceGatewayDltSystem, clientV1Request.sourceGatewayDltSystem) && + Objects.equals(this.recipientGatewayDltSystem, clientV1Request.recipientGatewayDltSystem) && + Objects.equals(this.recipientGatewayPubkey, clientV1Request.recipientGatewayPubkey) && + Objects.equals(this.originatorPubkey, clientV1Request.originatorPubkey) && + Objects.equals(this.beneficiaryPubkey, clientV1Request.beneficiaryPubkey) && + Objects.equals(this.clientIdentityPubkey, clientV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, clientV1Request.serverIdentityPubkey) && + Objects.equals(this.clientDltSystem, clientV1Request.clientDltSystem) && + Objects.equals(this.serverDltSystem, clientV1Request.serverDltSystem) && + Objects.equals(this.clientGatewayConfiguration, clientV1Request.clientGatewayConfiguration) && + Objects.equals(this.serverGatewayConfiguration, clientV1Request.serverGatewayConfiguration) && + Objects.equals(this.maxRetries, clientV1Request.maxRetries) && + Objects.equals(this.maxTimeout, clientV1Request.maxTimeout) && + Objects.equals(this.sourceLedgerAssetID, clientV1Request.sourceLedgerAssetID) && + Objects.equals(this.recipientLedgerAssetID, clientV1Request.recipientLedgerAssetID); + } + + @Override + public int hashCode() { + return Objects.hash(version, loggingProfile, accessControlProfile, assetControlProfile, applicationProfile, assetProfile, payloadProfile, sourceGatewayDltSystem, recipientGatewayDltSystem, recipientGatewayPubkey, originatorPubkey, beneficiaryPubkey, clientIdentityPubkey, serverIdentityPubkey, clientDltSystem, serverDltSystem, clientGatewayConfiguration, serverGatewayConfiguration, maxRetries, maxTimeout, sourceLedgerAssetID, recipientLedgerAssetID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientV1Request {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" loggingProfile: ").append(toIndentedString(loggingProfile)).append("\n"); + sb.append(" accessControlProfile: ").append(toIndentedString(accessControlProfile)).append("\n"); + sb.append(" assetControlProfile: ").append(toIndentedString(assetControlProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" assetProfile: ").append(toIndentedString(assetProfile)).append("\n"); + sb.append(" payloadProfile: ").append(toIndentedString(payloadProfile)).append("\n"); + sb.append(" sourceGatewayDltSystem: ").append(toIndentedString(sourceGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayDltSystem: ").append(toIndentedString(recipientGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayPubkey: ").append(toIndentedString(recipientGatewayPubkey)).append("\n"); + sb.append(" originatorPubkey: ").append(toIndentedString(originatorPubkey)).append("\n"); + sb.append(" beneficiaryPubkey: ").append(toIndentedString(beneficiaryPubkey)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" clientDltSystem: ").append(toIndentedString(clientDltSystem)).append("\n"); + sb.append(" serverDltSystem: ").append(toIndentedString(serverDltSystem)).append("\n"); + sb.append(" clientGatewayConfiguration: ").append(toIndentedString(clientGatewayConfiguration)).append("\n"); + sb.append(" serverGatewayConfiguration: ").append(toIndentedString(serverGatewayConfiguration)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" maxTimeout: ").append(toIndentedString(maxTimeout)).append("\n"); + sb.append(" sourceLedgerAssetID: ").append(toIndentedString(sourceLedgerAssetID)).append("\n"); + sb.append(" recipientLedgerAssetID: ").append(toIndentedString(recipientLedgerAssetID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + openapiFields.add("loggingProfile"); + openapiFields.add("accessControlProfile"); + openapiFields.add("assetControlProfile"); + openapiFields.add("applicationProfile"); + openapiFields.add("assetProfile"); + openapiFields.add("payloadProfile"); + openapiFields.add("sourceGatewayDltSystem"); + openapiFields.add("recipientGatewayDltSystem"); + openapiFields.add("recipientGatewayPubkey"); + openapiFields.add("originatorPubkey"); + openapiFields.add("beneficiaryPubkey"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("clientDltSystem"); + openapiFields.add("serverDltSystem"); + openapiFields.add("clientGatewayConfiguration"); + openapiFields.add("serverGatewayConfiguration"); + openapiFields.add("maxRetries"); + openapiFields.add("maxTimeout"); + openapiFields.add("sourceLedgerAssetID"); + openapiFields.add("recipientLedgerAssetID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("loggingProfile"); + openapiRequiredFields.add("accessControlProfile"); + openapiRequiredFields.add("assetControlProfile"); + openapiRequiredFields.add("applicationProfile"); + openapiRequiredFields.add("assetProfile"); + openapiRequiredFields.add("payloadProfile"); + openapiRequiredFields.add("sourceGatewayDltSystem"); + openapiRequiredFields.add("recipientGatewayDltSystem"); + openapiRequiredFields.add("recipientGatewayPubkey"); + openapiRequiredFields.add("originatorPubkey"); + openapiRequiredFields.add("beneficiaryPubkey"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("clientDltSystem"); + openapiRequiredFields.add("serverDltSystem"); + openapiRequiredFields.add("clientGatewayConfiguration"); + openapiRequiredFields.add("serverGatewayConfiguration"); + openapiRequiredFields.add("maxRetries"); + openapiRequiredFields.add("maxTimeout"); + openapiRequiredFields.add("sourceLedgerAssetID"); + openapiRequiredFields.add("recipientLedgerAssetID"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClientV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClientV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientV1Request is not found in the empty JSON string", ClientV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClientV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClientV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if (!jsonObj.get("loggingProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loggingProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loggingProfile").toString())); + } + if (!jsonObj.get("accessControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accessControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessControlProfile").toString())); + } + if (!jsonObj.get("assetControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetControlProfile").toString())); + } + if (!jsonObj.get("applicationProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationProfile").toString())); + } + // validate the required field `assetProfile` + AssetProfile.validateJsonObject(jsonObj.getAsJsonObject("assetProfile")); + // validate the required field `payloadProfile` + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("payloadProfile")); + if (!jsonObj.get("sourceGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayDltSystem").toString())); + } + if (!jsonObj.get("recipientGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayDltSystem").toString())); + } + if (!jsonObj.get("recipientGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayPubkey").toString())); + } + if (!jsonObj.get("originatorPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originatorPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originatorPubkey").toString())); + } + if (!jsonObj.get("beneficiaryPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `beneficiaryPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("beneficiaryPubkey").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("clientDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientDltSystem").toString())); + } + if (!jsonObj.get("serverDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverDltSystem").toString())); + } + // validate the required field `clientGatewayConfiguration` + ClientV1RequestClientGatewayConfiguration.validateJsonObject(jsonObj.getAsJsonObject("clientGatewayConfiguration")); + // validate the required field `serverGatewayConfiguration` + ClientV1RequestClientGatewayConfiguration.validateJsonObject(jsonObj.getAsJsonObject("serverGatewayConfiguration")); + if (!jsonObj.get("sourceLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceLedgerAssetID").toString())); + } + if (!jsonObj.get("recipientLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientLedgerAssetID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClientV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClientV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClientV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientV1Request + * @throws IOException if the JSON string is invalid with respect to ClientV1Request + */ + public static ClientV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientV1Request.class); + } + + /** + * Convert an instance of ClientV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java new file mode 100644 index 0000000000..8424559876 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClientV1RequestClientGatewayConfiguration + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClientV1RequestClientGatewayConfiguration { + public static final String SERIALIZED_NAME_API_HOST = "apiHost"; + @SerializedName(SERIALIZED_NAME_API_HOST) + private String apiHost; + + public ClientV1RequestClientGatewayConfiguration() { + } + + public ClientV1RequestClientGatewayConfiguration apiHost(String apiHost) { + + this.apiHost = apiHost; + return this; + } + + /** + * Get apiHost + * @return apiHost + **/ + @javax.annotation.Nonnull + public String getApiHost() { + return apiHost; + } + + + public void setApiHost(String apiHost) { + this.apiHost = apiHost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientV1RequestClientGatewayConfiguration clientV1RequestClientGatewayConfiguration = (ClientV1RequestClientGatewayConfiguration) o; + return Objects.equals(this.apiHost, clientV1RequestClientGatewayConfiguration.apiHost); + } + + @Override + public int hashCode() { + return Objects.hash(apiHost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientV1RequestClientGatewayConfiguration {\n"); + sb.append(" apiHost: ").append(toIndentedString(apiHost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("apiHost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("apiHost"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClientV1RequestClientGatewayConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClientV1RequestClientGatewayConfiguration.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientV1RequestClientGatewayConfiguration is not found in the empty JSON string", ClientV1RequestClientGatewayConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClientV1RequestClientGatewayConfiguration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientV1RequestClientGatewayConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClientV1RequestClientGatewayConfiguration.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("apiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `apiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiHost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClientV1RequestClientGatewayConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientV1RequestClientGatewayConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientV1RequestClientGatewayConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClientV1RequestClientGatewayConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClientV1RequestClientGatewayConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientV1RequestClientGatewayConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientV1RequestClientGatewayConfiguration + * @throws IOException if the JSON string is invalid with respect to ClientV1RequestClientGatewayConfiguration + */ + public static ClientV1RequestClientGatewayConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientV1RequestClientGatewayConfiguration.class); + } + + /** + * Convert an instance of ClientV1RequestClientGatewayConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java new file mode 100644 index 0000000000..e5372c39e8 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitFinalV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitFinalV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM = "commitFinalClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM) + private String commitFinalClaim; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT = "commitFinalClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT) + private Object commitFinalClaimFormat; + + public static final String SERIALIZED_NAME_HASH_COMMIT_PREPARE_ACK = "hashCommitPrepareAck"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_PREPARE_ACK) + private String hashCommitPrepareAck; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitFinalV1Request() { + } + + public CommitFinalV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitFinalV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitFinalV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitFinalV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitFinalV1Request commitFinalClaim(String commitFinalClaim) { + + this.commitFinalClaim = commitFinalClaim; + return this; + } + + /** + * Get commitFinalClaim + * @return commitFinalClaim + **/ + @javax.annotation.Nonnull + public String getCommitFinalClaim() { + return commitFinalClaim; + } + + + public void setCommitFinalClaim(String commitFinalClaim) { + this.commitFinalClaim = commitFinalClaim; + } + + + public CommitFinalV1Request commitFinalClaimFormat(Object commitFinalClaimFormat) { + + this.commitFinalClaimFormat = commitFinalClaimFormat; + return this; + } + + /** + * Get commitFinalClaimFormat + * @return commitFinalClaimFormat + **/ + @javax.annotation.Nullable + public Object getCommitFinalClaimFormat() { + return commitFinalClaimFormat; + } + + + public void setCommitFinalClaimFormat(Object commitFinalClaimFormat) { + this.commitFinalClaimFormat = commitFinalClaimFormat; + } + + + public CommitFinalV1Request hashCommitPrepareAck(String hashCommitPrepareAck) { + + this.hashCommitPrepareAck = hashCommitPrepareAck; + return this; + } + + /** + * Get hashCommitPrepareAck + * @return hashCommitPrepareAck + **/ + @javax.annotation.Nonnull + public String getHashCommitPrepareAck() { + return hashCommitPrepareAck; + } + + + public void setHashCommitPrepareAck(String hashCommitPrepareAck) { + this.hashCommitPrepareAck = hashCommitPrepareAck; + } + + + public CommitFinalV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public CommitFinalV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitFinalV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitFinalV1Request commitFinalV1Request = (CommitFinalV1Request) o; + return Objects.equals(this.sessionID, commitFinalV1Request.sessionID) && + Objects.equals(this.messageType, commitFinalV1Request.messageType) && + Objects.equals(this.clientIdentityPubkey, commitFinalV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitFinalV1Request.serverIdentityPubkey) && + Objects.equals(this.commitFinalClaim, commitFinalV1Request.commitFinalClaim) && + Objects.equals(this.commitFinalClaimFormat, commitFinalV1Request.commitFinalClaimFormat) && + Objects.equals(this.hashCommitPrepareAck, commitFinalV1Request.hashCommitPrepareAck) && + Objects.equals(this.clientTransferNumber, commitFinalV1Request.clientTransferNumber) && + Objects.equals(this.signature, commitFinalV1Request.signature) && + Objects.equals(this.sequenceNumber, commitFinalV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, commitFinalClaim, commitFinalClaimFormat, hashCommitPrepareAck, clientTransferNumber, signature, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitFinalV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" commitFinalClaim: ").append(toIndentedString(commitFinalClaim)).append("\n"); + sb.append(" commitFinalClaimFormat: ").append(toIndentedString(commitFinalClaimFormat)).append("\n"); + sb.append(" hashCommitPrepareAck: ").append(toIndentedString(hashCommitPrepareAck)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("commitFinalClaim"); + openapiFields.add("commitFinalClaimFormat"); + openapiFields.add("hashCommitPrepareAck"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("commitFinalClaim"); + openapiRequiredFields.add("hashCommitPrepareAck"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitFinalV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitFinalV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitFinalV1Request is not found in the empty JSON string", CommitFinalV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitFinalV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitFinalV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitFinalV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("commitFinalClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalClaim").toString())); + } + if (!jsonObj.get("hashCommitPrepareAck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitPrepareAck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitPrepareAck").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitFinalV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitFinalV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitFinalV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitFinalV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitFinalV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitFinalV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitFinalV1Request + * @throws IOException if the JSON string is invalid with respect to CommitFinalV1Request + */ + public static CommitFinalV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitFinalV1Request.class); + } + + /** + * Convert an instance of CommitFinalV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java new file mode 100644 index 0000000000..c5c9a14f93 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java @@ -0,0 +1,494 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitFinalV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitFinalV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM = "commitAcknowledgementClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM) + private String commitAcknowledgementClaim; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT = "commitAcknowledgementClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT) + private Object commitAcknowledgementClaimFormat; + + public static final String SERIALIZED_NAME_HASH_COMMIT_FINAL = "hashCommitFinal"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_FINAL) + private String hashCommitFinal; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private Integer serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitFinalV1Response() { + } + + public CommitFinalV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitFinalV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitFinalV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitFinalV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitFinalV1Response commitAcknowledgementClaim(String commitAcknowledgementClaim) { + + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + return this; + } + + /** + * Get commitAcknowledgementClaim + * @return commitAcknowledgementClaim + **/ + @javax.annotation.Nonnull + public String getCommitAcknowledgementClaim() { + return commitAcknowledgementClaim; + } + + + public void setCommitAcknowledgementClaim(String commitAcknowledgementClaim) { + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + } + + + public CommitFinalV1Response commitAcknowledgementClaimFormat(Object commitAcknowledgementClaimFormat) { + + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + return this; + } + + /** + * Get commitAcknowledgementClaimFormat + * @return commitAcknowledgementClaimFormat + **/ + @javax.annotation.Nullable + public Object getCommitAcknowledgementClaimFormat() { + return commitAcknowledgementClaimFormat; + } + + + public void setCommitAcknowledgementClaimFormat(Object commitAcknowledgementClaimFormat) { + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + } + + + public CommitFinalV1Response hashCommitFinal(String hashCommitFinal) { + + this.hashCommitFinal = hashCommitFinal; + return this; + } + + /** + * Get hashCommitFinal + * @return hashCommitFinal + **/ + @javax.annotation.Nonnull + public String getHashCommitFinal() { + return hashCommitFinal; + } + + + public void setHashCommitFinal(String hashCommitFinal) { + this.hashCommitFinal = hashCommitFinal; + } + + + public CommitFinalV1Response serverTransferNumber(Integer serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public Integer getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(Integer serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public CommitFinalV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitFinalV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitFinalV1Response commitFinalV1Response = (CommitFinalV1Response) o; + return Objects.equals(this.sessionID, commitFinalV1Response.sessionID) && + Objects.equals(this.messageType, commitFinalV1Response.messageType) && + Objects.equals(this.clientIdentityPubkey, commitFinalV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitFinalV1Response.serverIdentityPubkey) && + Objects.equals(this.commitAcknowledgementClaim, commitFinalV1Response.commitAcknowledgementClaim) && + Objects.equals(this.commitAcknowledgementClaimFormat, commitFinalV1Response.commitAcknowledgementClaimFormat) && + Objects.equals(this.hashCommitFinal, commitFinalV1Response.hashCommitFinal) && + Objects.equals(this.serverTransferNumber, commitFinalV1Response.serverTransferNumber) && + Objects.equals(this.signature, commitFinalV1Response.signature) && + Objects.equals(this.sequenceNumber, commitFinalV1Response.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, commitAcknowledgementClaim, commitAcknowledgementClaimFormat, hashCommitFinal, serverTransferNumber, signature, sequenceNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitFinalV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" commitAcknowledgementClaim: ").append(toIndentedString(commitAcknowledgementClaim)).append("\n"); + sb.append(" commitAcknowledgementClaimFormat: ").append(toIndentedString(commitAcknowledgementClaimFormat)).append("\n"); + sb.append(" hashCommitFinal: ").append(toIndentedString(hashCommitFinal)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("commitAcknowledgementClaim"); + openapiFields.add("commitAcknowledgementClaimFormat"); + openapiFields.add("hashCommitFinal"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("commitAcknowledgementClaim"); + openapiRequiredFields.add("hashCommitFinal"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitFinalV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitFinalV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitFinalV1Response is not found in the empty JSON string", CommitFinalV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitFinalV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitFinalV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitFinalV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("commitAcknowledgementClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitAcknowledgementClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitAcknowledgementClaim").toString())); + } + if (!jsonObj.get("hashCommitFinal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitFinal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitFinal").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitFinalV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitFinalV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitFinalV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitFinalV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitFinalV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitFinalV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitFinalV1Response + * @throws IOException if the JSON string is invalid with respect to CommitFinalV1Response + */ + public static CommitFinalV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitFinalV1Response.class); + } + + /** + * Convert an instance of CommitFinalV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java new file mode 100644 index 0000000000..d1416e54a4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java @@ -0,0 +1,434 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitPreparationV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitPreparationV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_LOCK_EVIDENCE_ACK = "hashLockEvidenceAck"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK_EVIDENCE_ACK) + private String hashLockEvidenceAck; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitPreparationV1Request() { + } + + public CommitPreparationV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitPreparationV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitPreparationV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitPreparationV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitPreparationV1Request hashLockEvidenceAck(String hashLockEvidenceAck) { + + this.hashLockEvidenceAck = hashLockEvidenceAck; + return this; + } + + /** + * Get hashLockEvidenceAck + * @return hashLockEvidenceAck + **/ + @javax.annotation.Nonnull + public String getHashLockEvidenceAck() { + return hashLockEvidenceAck; + } + + + public void setHashLockEvidenceAck(String hashLockEvidenceAck) { + this.hashLockEvidenceAck = hashLockEvidenceAck; + } + + + public CommitPreparationV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public CommitPreparationV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitPreparationV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitPreparationV1Request commitPreparationV1Request = (CommitPreparationV1Request) o; + return Objects.equals(this.sessionID, commitPreparationV1Request.sessionID) && + Objects.equals(this.messageType, commitPreparationV1Request.messageType) && + Objects.equals(this.clientIdentityPubkey, commitPreparationV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitPreparationV1Request.serverIdentityPubkey) && + Objects.equals(this.hashLockEvidenceAck, commitPreparationV1Request.hashLockEvidenceAck) && + Objects.equals(this.clientTransferNumber, commitPreparationV1Request.clientTransferNumber) && + Objects.equals(this.signature, commitPreparationV1Request.signature) && + Objects.equals(this.sequenceNumber, commitPreparationV1Request.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, hashLockEvidenceAck, clientTransferNumber, signature, sequenceNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitPreparationV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashLockEvidenceAck: ").append(toIndentedString(hashLockEvidenceAck)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashLockEvidenceAck"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashLockEvidenceAck"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitPreparationV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitPreparationV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitPreparationV1Request is not found in the empty JSON string", CommitPreparationV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitPreparationV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitPreparationV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitPreparationV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashLockEvidenceAck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLockEvidenceAck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLockEvidenceAck").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitPreparationV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitPreparationV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitPreparationV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitPreparationV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitPreparationV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitPreparationV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitPreparationV1Request + * @throws IOException if the JSON string is invalid with respect to CommitPreparationV1Request + */ + public static CommitPreparationV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitPreparationV1Request.class); + } + + /** + * Convert an instance of CommitPreparationV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java new file mode 100644 index 0000000000..ec2ae067dd --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java @@ -0,0 +1,437 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitPreparationV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitPreparationV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_COMMIT_PREP = "hashCommitPrep"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_PREP) + private String hashCommitPrep; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private String serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitPreparationV1Response() { + } + + public CommitPreparationV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitPreparationV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitPreparationV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitPreparationV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitPreparationV1Response hashCommitPrep(String hashCommitPrep) { + + this.hashCommitPrep = hashCommitPrep; + return this; + } + + /** + * Get hashCommitPrep + * @return hashCommitPrep + **/ + @javax.annotation.Nonnull + public String getHashCommitPrep() { + return hashCommitPrep; + } + + + public void setHashCommitPrep(String hashCommitPrep) { + this.hashCommitPrep = hashCommitPrep; + } + + + public CommitPreparationV1Response serverTransferNumber(String serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public String getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(String serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public CommitPreparationV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitPreparationV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitPreparationV1Response commitPreparationV1Response = (CommitPreparationV1Response) o; + return Objects.equals(this.sessionID, commitPreparationV1Response.sessionID) && + Objects.equals(this.messageType, commitPreparationV1Response.messageType) && + Objects.equals(this.clientIdentityPubkey, commitPreparationV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitPreparationV1Response.serverIdentityPubkey) && + Objects.equals(this.hashCommitPrep, commitPreparationV1Response.hashCommitPrep) && + Objects.equals(this.serverTransferNumber, commitPreparationV1Response.serverTransferNumber) && + Objects.equals(this.signature, commitPreparationV1Response.signature) && + Objects.equals(this.sequenceNumber, commitPreparationV1Response.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, hashCommitPrep, serverTransferNumber, signature, sequenceNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitPreparationV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashCommitPrep: ").append(toIndentedString(hashCommitPrep)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashCommitPrep"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashCommitPrep"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitPreparationV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitPreparationV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitPreparationV1Response is not found in the empty JSON string", CommitPreparationV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitPreparationV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitPreparationV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitPreparationV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashCommitPrep").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitPrep` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitPrep").toString())); + } + if ((jsonObj.get("serverTransferNumber") != null && !jsonObj.get("serverTransferNumber").isJsonNull()) && !jsonObj.get("serverTransferNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverTransferNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverTransferNumber").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitPreparationV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitPreparationV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitPreparationV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitPreparationV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitPreparationV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitPreparationV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitPreparationV1Response + * @throws IOException if the JSON string is invalid with respect to CommitPreparationV1Response + */ + public static CommitPreparationV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitPreparationV1Response.class); + } + + /** + * Convert an instance of CommitPreparationV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java new file mode 100644 index 0000000000..3f76e13abc --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets CredentialProfile + */ +@JsonAdapter(CredentialProfile.Adapter.class) +public enum CredentialProfile { + + SAML("SAML"), + + OAUTH("OAUTH"), + + X509("X509"); + + private String value; + + CredentialProfile(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CredentialProfile fromValue(String value) { + for (CredentialProfile b : CredentialProfile.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CredentialProfile enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CredentialProfile read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CredentialProfile.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java new file mode 100644 index 0000000000..bcab549e6e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * History + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class History { + public static final String SERIALIZED_NAME_TRANSACTIONS = "Transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions; + + public static final String SERIALIZED_NAME_ACTIONS = "Actions"; + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions; + + public static final String SERIALIZED_NAME_ORIGIN = "Origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_DESTINATION = "Destination"; + @SerializedName(SERIALIZED_NAME_DESTINATION) + private String destination; + + public static final String SERIALIZED_NAME_BALANCE = "Balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private String balance; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + private Object currentStatus; + + public static final String SERIALIZED_NAME_APPLICATION_SPECIFIC_PARAMETERS = "ApplicationSpecificParameters"; + @SerializedName(SERIALIZED_NAME_APPLICATION_SPECIFIC_PARAMETERS) + private Object applicationSpecificParameters; + + public History() { + } + + public History transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public History addTransactionsItem(Object transactionsItem) { + if (this.transactions == null) { + this.transactions = new ArrayList<>(); + } + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nullable + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + public History actions(List actions) { + + this.actions = actions; + return this; + } + + public History addActionsItem(Object actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + + /** + * Get actions + * @return actions + **/ + @javax.annotation.Nullable + public List getActions() { + return actions; + } + + + public void setActions(List actions) { + this.actions = actions; + } + + + public History origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public History destination(String destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + + public History balance(String balance) { + + this.balance = balance; + return this; + } + + /** + * Get balance + * @return balance + **/ + @javax.annotation.Nullable + public String getBalance() { + return balance; + } + + + public void setBalance(String balance) { + this.balance = balance; + } + + + public History currentStatus(Object currentStatus) { + + this.currentStatus = currentStatus; + return this; + } + + /** + * Get currentStatus + * @return currentStatus + **/ + @javax.annotation.Nullable + public Object getCurrentStatus() { + return currentStatus; + } + + + public void setCurrentStatus(Object currentStatus) { + this.currentStatus = currentStatus; + } + + + public History applicationSpecificParameters(Object applicationSpecificParameters) { + + this.applicationSpecificParameters = applicationSpecificParameters; + return this; + } + + /** + * Get applicationSpecificParameters + * @return applicationSpecificParameters + **/ + @javax.annotation.Nullable + public Object getApplicationSpecificParameters() { + return applicationSpecificParameters; + } + + + public void setApplicationSpecificParameters(Object applicationSpecificParameters) { + this.applicationSpecificParameters = applicationSpecificParameters; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + History history = (History) o; + return Objects.equals(this.transactions, history.transactions) && + Objects.equals(this.actions, history.actions) && + Objects.equals(this.origin, history.origin) && + Objects.equals(this.destination, history.destination) && + Objects.equals(this.balance, history.balance) && + Objects.equals(this.currentStatus, history.currentStatus) && + Objects.equals(this.applicationSpecificParameters, history.applicationSpecificParameters); + } + + @Override + public int hashCode() { + return Objects.hash(transactions, actions, origin, destination, balance, currentStatus, applicationSpecificParameters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class History {\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" applicationSpecificParameters: ").append(toIndentedString(applicationSpecificParameters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Transactions"); + openapiFields.add("Actions"); + openapiFields.add("Origin"); + openapiFields.add("Destination"); + openapiFields.add("Balance"); + openapiFields.add("CurrentStatus"); + openapiFields.add("ApplicationSpecificParameters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to History + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!History.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in History is not found in the empty JSON string", History.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!History.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `History` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("Transactions") != null && !jsonObj.get("Transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Transactions` to be an array in the JSON string but got `%s`", jsonObj.get("Transactions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Actions") != null && !jsonObj.get("Actions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Actions` to be an array in the JSON string but got `%s`", jsonObj.get("Actions").toString())); + } + if ((jsonObj.get("Origin") != null && !jsonObj.get("Origin").isJsonNull()) && !jsonObj.get("Origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Origin").toString())); + } + if ((jsonObj.get("Destination") != null && !jsonObj.get("Destination").isJsonNull()) && !jsonObj.get("Destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Destination").toString())); + } + if ((jsonObj.get("Balance") != null && !jsonObj.get("Balance").isJsonNull()) && !jsonObj.get("Balance").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Balance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Balance").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!History.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'History' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(History.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, History value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public History read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of History given an JSON string + * + * @param jsonString JSON string + * @return An instance of History + * @throws IOException if the JSON string is invalid with respect to History + */ + public static History fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, History.class); + } + + /** + * Convert an instance of History to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java new file mode 100644 index 0000000000..2dbdc621bb --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java @@ -0,0 +1,569 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * LockEvidenceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LockEvidenceV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM = "lockEvidenceClaim"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM) + private String lockEvidenceClaim; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_FORMAT = "lockEvidenceFormat"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_FORMAT) + private Object lockEvidenceFormat; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_EXPIRATION = "lockEvidenceExpiration"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_EXPIRATION) + private String lockEvidenceExpiration; + + public static final String SERIALIZED_NAME_HASH_COMMENCE_ACK_REQUEST = "hashCommenceAckRequest"; + @SerializedName(SERIALIZED_NAME_HASH_COMMENCE_ACK_REQUEST) + private String hashCommenceAckRequest; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_MESSAGE_HASH = "messageHash"; + @SerializedName(SERIALIZED_NAME_MESSAGE_HASH) + private String messageHash; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public LockEvidenceV1Request() { + } + + public LockEvidenceV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public LockEvidenceV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public LockEvidenceV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public LockEvidenceV1Request lockEvidenceClaim(String lockEvidenceClaim) { + + this.lockEvidenceClaim = lockEvidenceClaim; + return this; + } + + /** + * Get lockEvidenceClaim + * @return lockEvidenceClaim + **/ + @javax.annotation.Nonnull + public String getLockEvidenceClaim() { + return lockEvidenceClaim; + } + + + public void setLockEvidenceClaim(String lockEvidenceClaim) { + this.lockEvidenceClaim = lockEvidenceClaim; + } + + + public LockEvidenceV1Request lockEvidenceFormat(Object lockEvidenceFormat) { + + this.lockEvidenceFormat = lockEvidenceFormat; + return this; + } + + /** + * Get lockEvidenceFormat + * @return lockEvidenceFormat + **/ + @javax.annotation.Nullable + public Object getLockEvidenceFormat() { + return lockEvidenceFormat; + } + + + public void setLockEvidenceFormat(Object lockEvidenceFormat) { + this.lockEvidenceFormat = lockEvidenceFormat; + } + + + public LockEvidenceV1Request lockEvidenceExpiration(String lockEvidenceExpiration) { + + this.lockEvidenceExpiration = lockEvidenceExpiration; + return this; + } + + /** + * Get lockEvidenceExpiration + * @return lockEvidenceExpiration + **/ + @javax.annotation.Nonnull + public String getLockEvidenceExpiration() { + return lockEvidenceExpiration; + } + + + public void setLockEvidenceExpiration(String lockEvidenceExpiration) { + this.lockEvidenceExpiration = lockEvidenceExpiration; + } + + + public LockEvidenceV1Request hashCommenceAckRequest(String hashCommenceAckRequest) { + + this.hashCommenceAckRequest = hashCommenceAckRequest; + return this; + } + + /** + * Get hashCommenceAckRequest + * @return hashCommenceAckRequest + **/ + @javax.annotation.Nonnull + public String getHashCommenceAckRequest() { + return hashCommenceAckRequest; + } + + + public void setHashCommenceAckRequest(String hashCommenceAckRequest) { + this.hashCommenceAckRequest = hashCommenceAckRequest; + } + + + public LockEvidenceV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public LockEvidenceV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public LockEvidenceV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public LockEvidenceV1Request messageHash(String messageHash) { + + this.messageHash = messageHash; + return this; + } + + /** + * Get messageHash + * @return messageHash + **/ + @javax.annotation.Nullable + public String getMessageHash() { + return messageHash; + } + + + public void setMessageHash(String messageHash) { + this.messageHash = messageHash; + } + + + public LockEvidenceV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LockEvidenceV1Request lockEvidenceV1Request = (LockEvidenceV1Request) o; + return Objects.equals(this.sessionID, lockEvidenceV1Request.sessionID) && + Objects.equals(this.clientIdentityPubkey, lockEvidenceV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, lockEvidenceV1Request.serverIdentityPubkey) && + Objects.equals(this.lockEvidenceClaim, lockEvidenceV1Request.lockEvidenceClaim) && + Objects.equals(this.lockEvidenceFormat, lockEvidenceV1Request.lockEvidenceFormat) && + Objects.equals(this.lockEvidenceExpiration, lockEvidenceV1Request.lockEvidenceExpiration) && + Objects.equals(this.hashCommenceAckRequest, lockEvidenceV1Request.hashCommenceAckRequest) && + Objects.equals(this.clientTransferNumber, lockEvidenceV1Request.clientTransferNumber) && + Objects.equals(this.signature, lockEvidenceV1Request.signature) && + Objects.equals(this.messageType, lockEvidenceV1Request.messageType) && + Objects.equals(this.messageHash, lockEvidenceV1Request.messageHash) && + Objects.equals(this.sequenceNumber, lockEvidenceV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, clientIdentityPubkey, serverIdentityPubkey, lockEvidenceClaim, lockEvidenceFormat, lockEvidenceExpiration, hashCommenceAckRequest, clientTransferNumber, signature, messageType, messageHash, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LockEvidenceV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" lockEvidenceClaim: ").append(toIndentedString(lockEvidenceClaim)).append("\n"); + sb.append(" lockEvidenceFormat: ").append(toIndentedString(lockEvidenceFormat)).append("\n"); + sb.append(" lockEvidenceExpiration: ").append(toIndentedString(lockEvidenceExpiration)).append("\n"); + sb.append(" hashCommenceAckRequest: ").append(toIndentedString(hashCommenceAckRequest)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" messageHash: ").append(toIndentedString(messageHash)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("lockEvidenceClaim"); + openapiFields.add("lockEvidenceFormat"); + openapiFields.add("lockEvidenceExpiration"); + openapiFields.add("hashCommenceAckRequest"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("messageType"); + openapiFields.add("messageHash"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("lockEvidenceClaim"); + openapiRequiredFields.add("lockEvidenceExpiration"); + openapiRequiredFields.add("hashCommenceAckRequest"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to LockEvidenceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!LockEvidenceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LockEvidenceV1Request is not found in the empty JSON string", LockEvidenceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!LockEvidenceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LockEvidenceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LockEvidenceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("lockEvidenceClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceClaim").toString())); + } + if (!jsonObj.get("lockEvidenceExpiration").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceExpiration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceExpiration").toString())); + } + if (!jsonObj.get("hashCommenceAckRequest").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommenceAckRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommenceAckRequest").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if ((jsonObj.get("messageHash") != null && !jsonObj.get("messageHash").isJsonNull()) && !jsonObj.get("messageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LockEvidenceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LockEvidenceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LockEvidenceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LockEvidenceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LockEvidenceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LockEvidenceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of LockEvidenceV1Request + * @throws IOException if the JSON string is invalid with respect to LockEvidenceV1Request + */ + public static LockEvidenceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LockEvidenceV1Request.class); + } + + /** + * Convert an instance of LockEvidenceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java new file mode 100644 index 0000000000..c4c86fe265 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java @@ -0,0 +1,446 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * LockEvidenceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LockEvidenceV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_LOCK_EVIDENCE_REQUEST = "hashLockEvidenceRequest"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK_EVIDENCE_REQUEST) + private String hashLockEvidenceRequest; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private Integer serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public LockEvidenceV1Response() { + } + + public LockEvidenceV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public LockEvidenceV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public LockEvidenceV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public LockEvidenceV1Response hashLockEvidenceRequest(String hashLockEvidenceRequest) { + + this.hashLockEvidenceRequest = hashLockEvidenceRequest; + return this; + } + + /** + * Get hashLockEvidenceRequest + * @return hashLockEvidenceRequest + **/ + @javax.annotation.Nonnull + public String getHashLockEvidenceRequest() { + return hashLockEvidenceRequest; + } + + + public void setHashLockEvidenceRequest(String hashLockEvidenceRequest) { + this.hashLockEvidenceRequest = hashLockEvidenceRequest; + } + + + public LockEvidenceV1Response serverTransferNumber(Integer serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public Integer getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(Integer serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public LockEvidenceV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public LockEvidenceV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public LockEvidenceV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LockEvidenceV1Response lockEvidenceV1Response = (LockEvidenceV1Response) o; + return Objects.equals(this.sessionID, lockEvidenceV1Response.sessionID) && + Objects.equals(this.clientIdentityPubkey, lockEvidenceV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, lockEvidenceV1Response.serverIdentityPubkey) && + Objects.equals(this.hashLockEvidenceRequest, lockEvidenceV1Response.hashLockEvidenceRequest) && + Objects.equals(this.serverTransferNumber, lockEvidenceV1Response.serverTransferNumber) && + Objects.equals(this.signature, lockEvidenceV1Response.signature) && + Objects.equals(this.messageType, lockEvidenceV1Response.messageType) && + Objects.equals(this.sequenceNumber, lockEvidenceV1Response.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, clientIdentityPubkey, serverIdentityPubkey, hashLockEvidenceRequest, serverTransferNumber, signature, messageType, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LockEvidenceV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashLockEvidenceRequest: ").append(toIndentedString(hashLockEvidenceRequest)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashLockEvidenceRequest"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("messageType"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashLockEvidenceRequest"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to LockEvidenceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!LockEvidenceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LockEvidenceV1Response is not found in the empty JSON string", LockEvidenceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!LockEvidenceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LockEvidenceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LockEvidenceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashLockEvidenceRequest").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLockEvidenceRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLockEvidenceRequest").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LockEvidenceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LockEvidenceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LockEvidenceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LockEvidenceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LockEvidenceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LockEvidenceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of LockEvidenceV1Response + * @throws IOException if the JSON string is invalid with respect to LockEvidenceV1Response + */ + public static LockEvidenceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LockEvidenceV1Response.class); + } + + /** + * Convert an instance of LockEvidenceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java new file mode 100644 index 0000000000..b261e42872 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java @@ -0,0 +1,373 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OdapLocalLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OdapLocalLog { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; + + public OdapLocalLog() { + } + + public OdapLocalLog key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public OdapLocalLog sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public OdapLocalLog data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + public OdapLocalLog type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public OdapLocalLog operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + **/ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + public OdapLocalLog timestamp(String timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + public String getTimestamp() { + return timestamp; + } + + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OdapLocalLog odapLocalLog = (OdapLocalLog) o; + return Objects.equals(this.key, odapLocalLog.key) && + Objects.equals(this.sessionID, odapLocalLog.sessionID) && + Objects.equals(this.data, odapLocalLog.data) && + Objects.equals(this.type, odapLocalLog.type) && + Objects.equals(this.operation, odapLocalLog.operation) && + Objects.equals(this.timestamp, odapLocalLog.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(key, sessionID, data, type, operation, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OdapLocalLog {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("sessionID"); + openapiFields.add("data"); + openapiFields.add("type"); + openapiFields.add("operation"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("operation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OdapLocalLog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OdapLocalLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OdapLocalLog is not found in the empty JSON string", OdapLocalLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OdapLocalLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OdapLocalLog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OdapLocalLog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + if ((jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonNull()) && !jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OdapLocalLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OdapLocalLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OdapLocalLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OdapLocalLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OdapLocalLog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OdapLocalLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of OdapLocalLog + * @throws IOException if the JSON string is invalid with respect to OdapLocalLog + */ + public static OdapLocalLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OdapLocalLog.class); + } + + /** + * Convert an instance of OdapLocalLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java new file mode 100644 index 0000000000..c54203195f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java @@ -0,0 +1,654 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OdapMessageActionResponse; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OdapMessage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OdapMessage { + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "SequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + /** + * Gets or Sets phase + */ + @JsonAdapter(PhaseEnum.Adapter.class) + public enum PhaseEnum { + TRANSFERINITIALIZATION("TransferInitialization"), + + LOCKEVIDENCEVERIFICATION("LockEvidenceVerification"), + + COMMITMENTESTABLISHMENT("CommitmentEstablishment"); + + private String value; + + PhaseEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PhaseEnum fromValue(String value) { + for (PhaseEnum b : PhaseEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PhaseEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PhaseEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PhaseEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PHASE = "Phase"; + @SerializedName(SERIALIZED_NAME_PHASE) + private PhaseEnum phase; + + public static final String SERIALIZED_NAME_RESOURCE_U_R_L = "ResourceURL"; + @SerializedName(SERIALIZED_NAME_RESOURCE_U_R_L) + private String resourceURL; + + public static final String SERIALIZED_NAME_DEVELOPER_U_R_N = "DeveloperURN"; + @SerializedName(SERIALIZED_NAME_DEVELOPER_U_R_N) + private String developerURN; + + public static final String SERIALIZED_NAME_ACTION_RESPONSE = "ActionResponse"; + @SerializedName(SERIALIZED_NAME_ACTION_RESPONSE) + private OdapMessageActionResponse actionResponse; + + /** + * Gets or Sets credentialProfile + */ + @JsonAdapter(CredentialProfileEnum.Adapter.class) + public enum CredentialProfileEnum { + SAML("SAML"), + + OAUTH("OAuth"), + + X509("X509"); + + private String value; + + CredentialProfileEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CredentialProfileEnum fromValue(String value) { + for (CredentialProfileEnum b : CredentialProfileEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CredentialProfileEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CredentialProfileEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CredentialProfileEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CREDENTIAL_PROFILE = "CredentialProfile"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_PROFILE) + private CredentialProfileEnum credentialProfile; + + public static final String SERIALIZED_NAME_CREDENTIAL_BLOCK = "CredentialBlock"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_BLOCK) + private List credentialBlock; + + public static final String SERIALIZED_NAME_CREDENTIALS_PROFILE = "CredentialsProfile"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS_PROFILE) + private PayloadProfile credentialsProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "ApplicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private Object applicationProfile; + + public static final String SERIALIZED_NAME_PAYLOAD = "Payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private Object payload; + + public static final String SERIALIZED_NAME_PAYLOAD_HASH = "PayloadHash"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_HASH) + private String payloadHash; + + public static final String SERIALIZED_NAME_MESSAGE_SIGNATURE = "MessageSignature"; + @SerializedName(SERIALIZED_NAME_MESSAGE_SIGNATURE) + private String messageSignature; + + public OdapMessage() { + } + + public OdapMessage sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nullable + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public OdapMessage phase(PhaseEnum phase) { + + this.phase = phase; + return this; + } + + /** + * Get phase + * @return phase + **/ + @javax.annotation.Nullable + public PhaseEnum getPhase() { + return phase; + } + + + public void setPhase(PhaseEnum phase) { + this.phase = phase; + } + + + public OdapMessage resourceURL(String resourceURL) { + + this.resourceURL = resourceURL; + return this; + } + + /** + * Get resourceURL + * @return resourceURL + **/ + @javax.annotation.Nullable + public String getResourceURL() { + return resourceURL; + } + + + public void setResourceURL(String resourceURL) { + this.resourceURL = resourceURL; + } + + + public OdapMessage developerURN(String developerURN) { + + this.developerURN = developerURN; + return this; + } + + /** + * Get developerURN + * @return developerURN + **/ + @javax.annotation.Nullable + public String getDeveloperURN() { + return developerURN; + } + + + public void setDeveloperURN(String developerURN) { + this.developerURN = developerURN; + } + + + public OdapMessage actionResponse(OdapMessageActionResponse actionResponse) { + + this.actionResponse = actionResponse; + return this; + } + + /** + * Get actionResponse + * @return actionResponse + **/ + @javax.annotation.Nullable + public OdapMessageActionResponse getActionResponse() { + return actionResponse; + } + + + public void setActionResponse(OdapMessageActionResponse actionResponse) { + this.actionResponse = actionResponse; + } + + + public OdapMessage credentialProfile(CredentialProfileEnum credentialProfile) { + + this.credentialProfile = credentialProfile; + return this; + } + + /** + * Get credentialProfile + * @return credentialProfile + **/ + @javax.annotation.Nullable + public CredentialProfileEnum getCredentialProfile() { + return credentialProfile; + } + + + public void setCredentialProfile(CredentialProfileEnum credentialProfile) { + this.credentialProfile = credentialProfile; + } + + + public OdapMessage credentialBlock(List credentialBlock) { + + this.credentialBlock = credentialBlock; + return this; + } + + public OdapMessage addCredentialBlockItem(Object credentialBlockItem) { + if (this.credentialBlock == null) { + this.credentialBlock = new ArrayList<>(); + } + this.credentialBlock.add(credentialBlockItem); + return this; + } + + /** + * Get credentialBlock + * @return credentialBlock + **/ + @javax.annotation.Nullable + public List getCredentialBlock() { + return credentialBlock; + } + + + public void setCredentialBlock(List credentialBlock) { + this.credentialBlock = credentialBlock; + } + + + public OdapMessage credentialsProfile(PayloadProfile credentialsProfile) { + + this.credentialsProfile = credentialsProfile; + return this; + } + + /** + * Get credentialsProfile + * @return credentialsProfile + **/ + @javax.annotation.Nullable + public PayloadProfile getCredentialsProfile() { + return credentialsProfile; + } + + + public void setCredentialsProfile(PayloadProfile credentialsProfile) { + this.credentialsProfile = credentialsProfile; + } + + + public OdapMessage applicationProfile(Object applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nullable + public Object getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(Object applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public OdapMessage payload(Object payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nullable + public Object getPayload() { + return payload; + } + + + public void setPayload(Object payload) { + this.payload = payload; + } + + + public OdapMessage payloadHash(String payloadHash) { + + this.payloadHash = payloadHash; + return this; + } + + /** + * Get payloadHash + * @return payloadHash + **/ + @javax.annotation.Nullable + public String getPayloadHash() { + return payloadHash; + } + + + public void setPayloadHash(String payloadHash) { + this.payloadHash = payloadHash; + } + + + public OdapMessage messageSignature(String messageSignature) { + + this.messageSignature = messageSignature; + return this; + } + + /** + * Get messageSignature + * @return messageSignature + **/ + @javax.annotation.Nullable + public String getMessageSignature() { + return messageSignature; + } + + + public void setMessageSignature(String messageSignature) { + this.messageSignature = messageSignature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OdapMessage odapMessage = (OdapMessage) o; + return Objects.equals(this.sequenceNumber, odapMessage.sequenceNumber) && + Objects.equals(this.phase, odapMessage.phase) && + Objects.equals(this.resourceURL, odapMessage.resourceURL) && + Objects.equals(this.developerURN, odapMessage.developerURN) && + Objects.equals(this.actionResponse, odapMessage.actionResponse) && + Objects.equals(this.credentialProfile, odapMessage.credentialProfile) && + Objects.equals(this.credentialBlock, odapMessage.credentialBlock) && + Objects.equals(this.credentialsProfile, odapMessage.credentialsProfile) && + Objects.equals(this.applicationProfile, odapMessage.applicationProfile) && + Objects.equals(this.payload, odapMessage.payload) && + Objects.equals(this.payloadHash, odapMessage.payloadHash) && + Objects.equals(this.messageSignature, odapMessage.messageSignature); + } + + @Override + public int hashCode() { + return Objects.hash(sequenceNumber, phase, resourceURL, developerURN, actionResponse, credentialProfile, credentialBlock, credentialsProfile, applicationProfile, payload, payloadHash, messageSignature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OdapMessage {\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" phase: ").append(toIndentedString(phase)).append("\n"); + sb.append(" resourceURL: ").append(toIndentedString(resourceURL)).append("\n"); + sb.append(" developerURN: ").append(toIndentedString(developerURN)).append("\n"); + sb.append(" actionResponse: ").append(toIndentedString(actionResponse)).append("\n"); + sb.append(" credentialProfile: ").append(toIndentedString(credentialProfile)).append("\n"); + sb.append(" credentialBlock: ").append(toIndentedString(credentialBlock)).append("\n"); + sb.append(" credentialsProfile: ").append(toIndentedString(credentialsProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" payloadHash: ").append(toIndentedString(payloadHash)).append("\n"); + sb.append(" messageSignature: ").append(toIndentedString(messageSignature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("SequenceNumber"); + openapiFields.add("Phase"); + openapiFields.add("ResourceURL"); + openapiFields.add("DeveloperURN"); + openapiFields.add("ActionResponse"); + openapiFields.add("CredentialProfile"); + openapiFields.add("CredentialBlock"); + openapiFields.add("CredentialsProfile"); + openapiFields.add("ApplicationProfile"); + openapiFields.add("Payload"); + openapiFields.add("PayloadHash"); + openapiFields.add("MessageSignature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OdapMessage + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OdapMessage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OdapMessage is not found in the empty JSON string", OdapMessage.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OdapMessage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OdapMessage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("Phase") != null && !jsonObj.get("Phase").isJsonNull()) && !jsonObj.get("Phase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phase").toString())); + } + if ((jsonObj.get("ResourceURL") != null && !jsonObj.get("ResourceURL").isJsonNull()) && !jsonObj.get("ResourceURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResourceURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResourceURL").toString())); + } + if ((jsonObj.get("DeveloperURN") != null && !jsonObj.get("DeveloperURN").isJsonNull()) && !jsonObj.get("DeveloperURN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeveloperURN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeveloperURN").toString())); + } + // validate the optional field `ActionResponse` + if (jsonObj.get("ActionResponse") != null && !jsonObj.get("ActionResponse").isJsonNull()) { + OdapMessageActionResponse.validateJsonObject(jsonObj.getAsJsonObject("ActionResponse")); + } + if ((jsonObj.get("CredentialProfile") != null && !jsonObj.get("CredentialProfile").isJsonNull()) && !jsonObj.get("CredentialProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CredentialProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CredentialProfile").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("CredentialBlock") != null && !jsonObj.get("CredentialBlock").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CredentialBlock` to be an array in the JSON string but got `%s`", jsonObj.get("CredentialBlock").toString())); + } + // validate the optional field `CredentialsProfile` + if (jsonObj.get("CredentialsProfile") != null && !jsonObj.get("CredentialsProfile").isJsonNull()) { + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("CredentialsProfile")); + } + if ((jsonObj.get("PayloadHash") != null && !jsonObj.get("PayloadHash").isJsonNull()) && !jsonObj.get("PayloadHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PayloadHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayloadHash").toString())); + } + if ((jsonObj.get("MessageSignature") != null && !jsonObj.get("MessageSignature").isJsonNull()) && !jsonObj.get("MessageSignature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MessageSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MessageSignature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OdapMessage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OdapMessage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OdapMessage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OdapMessage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OdapMessage read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OdapMessage given an JSON string + * + * @param jsonString JSON string + * @return An instance of OdapMessage + * @throws IOException if the JSON string is invalid with respect to OdapMessage + */ + public static OdapMessage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OdapMessage.class); + } + + /** + * Convert an instance of OdapMessage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java new file mode 100644 index 0000000000..26a121e1ee --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java @@ -0,0 +1,297 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OdapMessageActionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OdapMessageActionResponse { + /** + * Gets or Sets responseCode + */ + @JsonAdapter(ResponseCodeEnum.Adapter.class) + public enum ResponseCodeEnum { + OK("200"), + + RESOURCE_NOT_FOUND("404"); + + private String value; + + ResponseCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseCodeEnum fromValue(String value) { + for (ResponseCodeEnum b : ResponseCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResponseCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseCodeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_RESPONSE_CODE = "ResponseCode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_CODE) + private ResponseCodeEnum responseCode; + + public static final String SERIALIZED_NAME_ARGUMENTS = "Arguments"; + @SerializedName(SERIALIZED_NAME_ARGUMENTS) + private List arguments; + + public OdapMessageActionResponse() { + } + + public OdapMessageActionResponse responseCode(ResponseCodeEnum responseCode) { + + this.responseCode = responseCode; + return this; + } + + /** + * Get responseCode + * @return responseCode + **/ + @javax.annotation.Nullable + public ResponseCodeEnum getResponseCode() { + return responseCode; + } + + + public void setResponseCode(ResponseCodeEnum responseCode) { + this.responseCode = responseCode; + } + + + public OdapMessageActionResponse arguments(List arguments) { + + this.arguments = arguments; + return this; + } + + public OdapMessageActionResponse addArgumentsItem(Object argumentsItem) { + if (this.arguments == null) { + this.arguments = new ArrayList<>(); + } + this.arguments.add(argumentsItem); + return this; + } + + /** + * Get arguments + * @return arguments + **/ + @javax.annotation.Nullable + public List getArguments() { + return arguments; + } + + + public void setArguments(List arguments) { + this.arguments = arguments; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OdapMessageActionResponse odapMessageActionResponse = (OdapMessageActionResponse) o; + return Objects.equals(this.responseCode, odapMessageActionResponse.responseCode) && + Objects.equals(this.arguments, odapMessageActionResponse.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(responseCode, arguments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OdapMessageActionResponse {\n"); + sb.append(" responseCode: ").append(toIndentedString(responseCode)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ResponseCode"); + openapiFields.add("Arguments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OdapMessageActionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OdapMessageActionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OdapMessageActionResponse is not found in the empty JSON string", OdapMessageActionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OdapMessageActionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OdapMessageActionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("ResponseCode") != null && !jsonObj.get("ResponseCode").isJsonNull()) && !jsonObj.get("ResponseCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseCode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Arguments") != null && !jsonObj.get("Arguments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Arguments` to be an array in the JSON string but got `%s`", jsonObj.get("Arguments").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OdapMessageActionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OdapMessageActionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OdapMessageActionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OdapMessageActionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OdapMessageActionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OdapMessageActionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OdapMessageActionResponse + * @throws IOException if the JSON string is invalid with respect to OdapMessageActionResponse + */ + public static OdapMessageActionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OdapMessageActionResponse.class); + } + + /** + * Convert an instance of OdapMessageActionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java new file mode 100644 index 0000000000..1f8834d0c0 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java @@ -0,0 +1,247 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.AssetProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PayloadProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PayloadProfile { + public static final String SERIALIZED_NAME_ASSET_PROFILE = "assetProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_PROFILE) + private AssetProfile assetProfile; + + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + private String capabilities; + + public PayloadProfile() { + } + + public PayloadProfile assetProfile(AssetProfile assetProfile) { + + this.assetProfile = assetProfile; + return this; + } + + /** + * Get assetProfile + * @return assetProfile + **/ + @javax.annotation.Nonnull + public AssetProfile getAssetProfile() { + return assetProfile; + } + + + public void setAssetProfile(AssetProfile assetProfile) { + this.assetProfile = assetProfile; + } + + + public PayloadProfile capabilities(String capabilities) { + + this.capabilities = capabilities; + return this; + } + + /** + * Get capabilities + * @return capabilities + **/ + @javax.annotation.Nullable + public String getCapabilities() { + return capabilities; + } + + + public void setCapabilities(String capabilities) { + this.capabilities = capabilities; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PayloadProfile payloadProfile = (PayloadProfile) o; + return Objects.equals(this.assetProfile, payloadProfile.assetProfile) && + Objects.equals(this.capabilities, payloadProfile.capabilities); + } + + @Override + public int hashCode() { + return Objects.hash(assetProfile, capabilities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PayloadProfile {\n"); + sb.append(" assetProfile: ").append(toIndentedString(assetProfile)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetProfile"); + openapiFields.add("capabilities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetProfile"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PayloadProfile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PayloadProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PayloadProfile is not found in the empty JSON string", PayloadProfile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PayloadProfile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayloadProfile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PayloadProfile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `assetProfile` + AssetProfile.validateJsonObject(jsonObj.getAsJsonObject("assetProfile")); + if ((jsonObj.get("capabilities") != null && !jsonObj.get("capabilities").isJsonNull()) && !jsonObj.get("capabilities").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `capabilities` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PayloadProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PayloadProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PayloadProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PayloadProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PayloadProfile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PayloadProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of PayloadProfile + * @throws IOException if the JSON string is invalid with respect to PayloadProfile + */ + public static PayloadProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PayloadProfile.class); + } + + /** + * Convert an instance of PayloadProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java new file mode 100644 index 0000000000..433446cda5 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverSuccessV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverSuccessV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverSuccessV1Message() { + } + + public RecoverSuccessV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverSuccessV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RecoverSuccessV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverSuccessV1Message recoverSuccessV1Message = (RecoverSuccessV1Message) o; + return Objects.equals(this.sessionID, recoverSuccessV1Message.sessionID) && + Objects.equals(this.success, recoverSuccessV1Message.success) && + Objects.equals(this.signature, recoverSuccessV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverSuccessV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverSuccessV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverSuccessV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverSuccessV1Message is not found in the empty JSON string", RecoverSuccessV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverSuccessV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverSuccessV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverSuccessV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverSuccessV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverSuccessV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverSuccessV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverSuccessV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverSuccessV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverSuccessV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverSuccessV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverSuccessV1Message + */ + public static RecoverSuccessV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverSuccessV1Message.class); + } + + /** + * Convert an instance of RecoverSuccessV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java new file mode 100644 index 0000000000..9c02c07c88 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java @@ -0,0 +1,322 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverUpdateAckV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverUpdateAckV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_CHANGED_ENTRIES_HASH = "changedEntriesHash"; + @SerializedName(SERIALIZED_NAME_CHANGED_ENTRIES_HASH) + private List changedEntriesHash = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverUpdateAckV1Message() { + } + + public RecoverUpdateAckV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverUpdateAckV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RecoverUpdateAckV1Message changedEntriesHash(List changedEntriesHash) { + + this.changedEntriesHash = changedEntriesHash; + return this; + } + + public RecoverUpdateAckV1Message addChangedEntriesHashItem(String changedEntriesHashItem) { + if (this.changedEntriesHash == null) { + this.changedEntriesHash = new ArrayList<>(); + } + this.changedEntriesHash.add(changedEntriesHashItem); + return this; + } + + /** + * Get changedEntriesHash + * @return changedEntriesHash + **/ + @javax.annotation.Nonnull + public List getChangedEntriesHash() { + return changedEntriesHash; + } + + + public void setChangedEntriesHash(List changedEntriesHash) { + this.changedEntriesHash = changedEntriesHash; + } + + + public RecoverUpdateAckV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverUpdateAckV1Message recoverUpdateAckV1Message = (RecoverUpdateAckV1Message) o; + return Objects.equals(this.sessionID, recoverUpdateAckV1Message.sessionID) && + Objects.equals(this.success, recoverUpdateAckV1Message.success) && + Objects.equals(this.changedEntriesHash, recoverUpdateAckV1Message.changedEntriesHash) && + Objects.equals(this.signature, recoverUpdateAckV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, changedEntriesHash, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverUpdateAckV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" changedEntriesHash: ").append(toIndentedString(changedEntriesHash)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("changedEntriesHash"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("changedEntriesHash"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverUpdateAckV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverUpdateAckV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverUpdateAckV1Message is not found in the empty JSON string", RecoverUpdateAckV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverUpdateAckV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverUpdateAckV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverUpdateAckV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + // ensure the required json array is present + if (jsonObj.get("changedEntriesHash") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("changedEntriesHash").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `changedEntriesHash` to be an array in the JSON string but got `%s`", jsonObj.get("changedEntriesHash").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverUpdateAckV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverUpdateAckV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverUpdateAckV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverUpdateAckV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverUpdateAckV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverUpdateAckV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverUpdateAckV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverUpdateAckV1Message + */ + public static RecoverUpdateAckV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverUpdateAckV1Message.class); + } + + /** + * Convert an instance of RecoverUpdateAckV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java new file mode 100644 index 0000000000..631364fa9a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java @@ -0,0 +1,298 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OdapLocalLog; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverUpdateV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverUpdateV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_RECOVERED_LOGS = "recoveredLogs"; + @SerializedName(SERIALIZED_NAME_RECOVERED_LOGS) + private List recoveredLogs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverUpdateV1Message() { + } + + public RecoverUpdateV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverUpdateV1Message recoveredLogs(List recoveredLogs) { + + this.recoveredLogs = recoveredLogs; + return this; + } + + public RecoverUpdateV1Message addRecoveredLogsItem(OdapLocalLog recoveredLogsItem) { + if (this.recoveredLogs == null) { + this.recoveredLogs = new ArrayList<>(); + } + this.recoveredLogs.add(recoveredLogsItem); + return this; + } + + /** + * Get recoveredLogs + * @return recoveredLogs + **/ + @javax.annotation.Nonnull + public List getRecoveredLogs() { + return recoveredLogs; + } + + + public void setRecoveredLogs(List recoveredLogs) { + this.recoveredLogs = recoveredLogs; + } + + + public RecoverUpdateV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverUpdateV1Message recoverUpdateV1Message = (RecoverUpdateV1Message) o; + return Objects.equals(this.sessionID, recoverUpdateV1Message.sessionID) && + Objects.equals(this.recoveredLogs, recoverUpdateV1Message.recoveredLogs) && + Objects.equals(this.signature, recoverUpdateV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, recoveredLogs, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverUpdateV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" recoveredLogs: ").append(toIndentedString(recoveredLogs)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("recoveredLogs"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("recoveredLogs"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverUpdateV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverUpdateV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverUpdateV1Message is not found in the empty JSON string", RecoverUpdateV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverUpdateV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverUpdateV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverUpdateV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("recoveredLogs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `recoveredLogs` to be an array in the JSON string but got `%s`", jsonObj.get("recoveredLogs").toString())); + } + + JsonArray jsonArrayrecoveredLogs = jsonObj.getAsJsonArray("recoveredLogs"); + // validate the required field `recoveredLogs` (array) + for (int i = 0; i < jsonArrayrecoveredLogs.size(); i++) { + OdapLocalLog.validateJsonObject(jsonArrayrecoveredLogs.get(i).getAsJsonObject()); + }; + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverUpdateV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverUpdateV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverUpdateV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverUpdateV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverUpdateV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverUpdateV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverUpdateV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverUpdateV1Message + */ + public static RecoverUpdateV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverUpdateV1Message.class); + } + + /** + * Convert an instance of RecoverUpdateV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java new file mode 100644 index 0000000000..ab11433b62 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java @@ -0,0 +1,434 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_ODAP_PHASE = "odapPhase"; + @SerializedName(SERIALIZED_NAME_ODAP_PHASE) + private String odapPhase; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public static final String SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP = "lastLogEntryTimestamp"; + @SerializedName(SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP) + private String lastLogEntryTimestamp; + + public static final String SERIALIZED_NAME_IS_BACKUP = "isBackup"; + @SerializedName(SERIALIZED_NAME_IS_BACKUP) + private Boolean isBackup; + + public static final String SERIALIZED_NAME_NEW_BASE_PATH = "newBasePath"; + @SerializedName(SERIALIZED_NAME_NEW_BASE_PATH) + private String newBasePath; + + public static final String SERIALIZED_NAME_NEW_GATEWAY_PUB_KEY = "newGatewayPubKey"; + @SerializedName(SERIALIZED_NAME_NEW_GATEWAY_PUB_KEY) + private String newGatewayPubKey; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverV1Message() { + } + + public RecoverV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverV1Message odapPhase(String odapPhase) { + + this.odapPhase = odapPhase; + return this; + } + + /** + * Get odapPhase + * @return odapPhase + **/ + @javax.annotation.Nonnull + public String getOdapPhase() { + return odapPhase; + } + + + public void setOdapPhase(String odapPhase) { + this.odapPhase = odapPhase; + } + + + public RecoverV1Message sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public RecoverV1Message lastLogEntryTimestamp(String lastLogEntryTimestamp) { + + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + return this; + } + + /** + * Get lastLogEntryTimestamp + * @return lastLogEntryTimestamp + **/ + @javax.annotation.Nonnull + public String getLastLogEntryTimestamp() { + return lastLogEntryTimestamp; + } + + + public void setLastLogEntryTimestamp(String lastLogEntryTimestamp) { + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + } + + + public RecoverV1Message isBackup(Boolean isBackup) { + + this.isBackup = isBackup; + return this; + } + + /** + * Get isBackup + * @return isBackup + **/ + @javax.annotation.Nonnull + public Boolean getIsBackup() { + return isBackup; + } + + + public void setIsBackup(Boolean isBackup) { + this.isBackup = isBackup; + } + + + public RecoverV1Message newBasePath(String newBasePath) { + + this.newBasePath = newBasePath; + return this; + } + + /** + * Get newBasePath + * @return newBasePath + **/ + @javax.annotation.Nonnull + public String getNewBasePath() { + return newBasePath; + } + + + public void setNewBasePath(String newBasePath) { + this.newBasePath = newBasePath; + } + + + public RecoverV1Message newGatewayPubKey(String newGatewayPubKey) { + + this.newGatewayPubKey = newGatewayPubKey; + return this; + } + + /** + * Get newGatewayPubKey + * @return newGatewayPubKey + **/ + @javax.annotation.Nullable + public String getNewGatewayPubKey() { + return newGatewayPubKey; + } + + + public void setNewGatewayPubKey(String newGatewayPubKey) { + this.newGatewayPubKey = newGatewayPubKey; + } + + + public RecoverV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverV1Message recoverV1Message = (RecoverV1Message) o; + return Objects.equals(this.sessionID, recoverV1Message.sessionID) && + Objects.equals(this.odapPhase, recoverV1Message.odapPhase) && + Objects.equals(this.sequenceNumber, recoverV1Message.sequenceNumber) && + Objects.equals(this.lastLogEntryTimestamp, recoverV1Message.lastLogEntryTimestamp) && + Objects.equals(this.isBackup, recoverV1Message.isBackup) && + Objects.equals(this.newBasePath, recoverV1Message.newBasePath) && + Objects.equals(this.newGatewayPubKey, recoverV1Message.newGatewayPubKey) && + Objects.equals(this.signature, recoverV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, odapPhase, sequenceNumber, lastLogEntryTimestamp, isBackup, newBasePath, newGatewayPubKey, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" odapPhase: ").append(toIndentedString(odapPhase)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" lastLogEntryTimestamp: ").append(toIndentedString(lastLogEntryTimestamp)).append("\n"); + sb.append(" isBackup: ").append(toIndentedString(isBackup)).append("\n"); + sb.append(" newBasePath: ").append(toIndentedString(newBasePath)).append("\n"); + sb.append(" newGatewayPubKey: ").append(toIndentedString(newGatewayPubKey)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("odapPhase"); + openapiFields.add("sequenceNumber"); + openapiFields.add("lastLogEntryTimestamp"); + openapiFields.add("isBackup"); + openapiFields.add("newBasePath"); + openapiFields.add("newGatewayPubKey"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("odapPhase"); + openapiRequiredFields.add("sequenceNumber"); + openapiRequiredFields.add("lastLogEntryTimestamp"); + openapiRequiredFields.add("isBackup"); + openapiRequiredFields.add("newBasePath"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverV1Message is not found in the empty JSON string", RecoverV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("odapPhase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `odapPhase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("odapPhase").toString())); + } + if (!jsonObj.get("lastLogEntryTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastLogEntryTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastLogEntryTimestamp").toString())); + } + if (!jsonObj.get("newBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newBasePath").toString())); + } + if ((jsonObj.get("newGatewayPubKey") != null && !jsonObj.get("newGatewayPubKey").isJsonNull()) && !jsonObj.get("newGatewayPubKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newGatewayPubKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newGatewayPubKey").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverV1Message + */ + public static RecoverV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverV1Message.class); + } + + /** + * Convert an instance of RecoverV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java new file mode 100644 index 0000000000..0877f4fc27 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RollbackAckV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RollbackAckV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RollbackAckV1Message() { + } + + public RollbackAckV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RollbackAckV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RollbackAckV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RollbackAckV1Message rollbackAckV1Message = (RollbackAckV1Message) o; + return Objects.equals(this.sessionID, rollbackAckV1Message.sessionID) && + Objects.equals(this.success, rollbackAckV1Message.success) && + Objects.equals(this.signature, rollbackAckV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RollbackAckV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RollbackAckV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RollbackAckV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RollbackAckV1Message is not found in the empty JSON string", RollbackAckV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RollbackAckV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RollbackAckV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RollbackAckV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RollbackAckV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RollbackAckV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RollbackAckV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RollbackAckV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RollbackAckV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RollbackAckV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RollbackAckV1Message + * @throws IOException if the JSON string is invalid with respect to RollbackAckV1Message + */ + public static RollbackAckV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RollbackAckV1Message.class); + } + + /** + * Convert an instance of RollbackAckV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java new file mode 100644 index 0000000000..b2fb0eb43f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java @@ -0,0 +1,365 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RollbackV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RollbackV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_ACTION_PERFORMED = "actionPerformed"; + @SerializedName(SERIALIZED_NAME_ACTION_PERFORMED) + private List actionPerformed = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROOFS = "proofs"; + @SerializedName(SERIALIZED_NAME_PROOFS) + private List proofs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RollbackV1Message() { + } + + public RollbackV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RollbackV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RollbackV1Message actionPerformed(List actionPerformed) { + + this.actionPerformed = actionPerformed; + return this; + } + + public RollbackV1Message addActionPerformedItem(String actionPerformedItem) { + if (this.actionPerformed == null) { + this.actionPerformed = new ArrayList<>(); + } + this.actionPerformed.add(actionPerformedItem); + return this; + } + + /** + * Get actionPerformed + * @return actionPerformed + **/ + @javax.annotation.Nonnull + public List getActionPerformed() { + return actionPerformed; + } + + + public void setActionPerformed(List actionPerformed) { + this.actionPerformed = actionPerformed; + } + + + public RollbackV1Message proofs(List proofs) { + + this.proofs = proofs; + return this; + } + + public RollbackV1Message addProofsItem(String proofsItem) { + if (this.proofs == null) { + this.proofs = new ArrayList<>(); + } + this.proofs.add(proofsItem); + return this; + } + + /** + * Get proofs + * @return proofs + **/ + @javax.annotation.Nonnull + public List getProofs() { + return proofs; + } + + + public void setProofs(List proofs) { + this.proofs = proofs; + } + + + public RollbackV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RollbackV1Message rollbackV1Message = (RollbackV1Message) o; + return Objects.equals(this.sessionID, rollbackV1Message.sessionID) && + Objects.equals(this.success, rollbackV1Message.success) && + Objects.equals(this.actionPerformed, rollbackV1Message.actionPerformed) && + Objects.equals(this.proofs, rollbackV1Message.proofs) && + Objects.equals(this.signature, rollbackV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, actionPerformed, proofs, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RollbackV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" actionPerformed: ").append(toIndentedString(actionPerformed)).append("\n"); + sb.append(" proofs: ").append(toIndentedString(proofs)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("actionPerformed"); + openapiFields.add("proofs"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("actionPerformed"); + openapiRequiredFields.add("proofs"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RollbackV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RollbackV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RollbackV1Message is not found in the empty JSON string", RollbackV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RollbackV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RollbackV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RollbackV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + // ensure the required json array is present + if (jsonObj.get("actionPerformed") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("actionPerformed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `actionPerformed` to be an array in the JSON string but got `%s`", jsonObj.get("actionPerformed").toString())); + } + // ensure the required json array is present + if (jsonObj.get("proofs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("proofs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `proofs` to be an array in the JSON string but got `%s`", jsonObj.get("proofs").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RollbackV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RollbackV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RollbackV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RollbackV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RollbackV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RollbackV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RollbackV1Message + * @throws IOException if the JSON string is invalid with respect to RollbackV1Message + */ + public static RollbackV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RollbackV1Message.class); + } + + /** + * Convert an instance of RollbackV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java new file mode 100644 index 0000000000..03c52fa050 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java @@ -0,0 +1,2147 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SessionData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SessionData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_STEP = "step"; + @SerializedName(SERIALIZED_NAME_STEP) + private BigDecimal step; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_LAST_SEQUENCE_NUMBER = "lastSequenceNumber"; + @SerializedName(SERIALIZED_NAME_LAST_SEQUENCE_NUMBER) + private BigDecimal lastSequenceNumber; + + public static final String SERIALIZED_NAME_LOGGING_PROFILE = "loggingProfile"; + @SerializedName(SERIALIZED_NAME_LOGGING_PROFILE) + private String loggingProfile; + + public static final String SERIALIZED_NAME_ACCESS_CONTROL_PROFILE = "accessControlProfile"; + @SerializedName(SERIALIZED_NAME_ACCESS_CONTROL_PROFILE) + private String accessControlProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "applicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private String applicationProfile; + + public static final String SERIALIZED_NAME_PAYLOAD_PROFILE = "payloadProfile"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_PROFILE) + private PayloadProfile payloadProfile; + + public static final String SERIALIZED_NAME_ASSET_PROFILE = "assetProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_PROFILE) + private AssetProfile assetProfile; + + public static final String SERIALIZED_NAME_ALLOWED_SOURCE_BACKUP_GATEWAYS = "allowedSourceBackupGateways"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SOURCE_BACKUP_GATEWAYS) + private List allowedSourceBackupGateways; + + public static final String SERIALIZED_NAME_ALLOWED_RECIPIENT_BACKUP_GATEWAYS = "allowedRecipientBackupGateways"; + @SerializedName(SERIALIZED_NAME_ALLOWED_RECIPIENT_BACKUP_GATEWAYS) + private List allowedRecipientBackupGateways; + + public static final String SERIALIZED_NAME_SOURCE_BASE_PATH = "sourceBasePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_BASE_PATH) + private String sourceBasePath; + + public static final String SERIALIZED_NAME_RECIPIENT_BASE_PATH = "recipientBasePath"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_BASE_PATH) + private String recipientBasePath; + + public static final String SERIALIZED_NAME_ORIGINATOR_PUBKEY = "originatorPubkey"; + @SerializedName(SERIALIZED_NAME_ORIGINATOR_PUBKEY) + private String originatorPubkey; + + public static final String SERIALIZED_NAME_BENEFICIARY_PUBKEY = "beneficiaryPubkey"; + @SerializedName(SERIALIZED_NAME_BENEFICIARY_PUBKEY) + private String beneficiaryPubkey; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY = "sourceGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY) + private String sourceGatewayPubkey; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM = "sourceGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM) + private String sourceGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY = "recipientGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY) + private String recipientGatewayPubkey; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM = "recipientGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM) + private String recipientGatewayDltSystem; + + public static final String SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_HASH = "initializationRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_HASH) + private String initializationRequestMessageHash; + + public static final String SERIALIZED_NAME_INITIALIZATION_RESPONSE_MESSAGE_HASH = "initializationResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_RESPONSE_MESSAGE_HASH) + private String initializationResponseMessageHash; + + public static final String SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_RCV_TIME_STAMP = "initializationRequestMessageRcvTimeStamp"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_RCV_TIME_STAMP) + private String initializationRequestMessageRcvTimeStamp; + + public static final String SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_PROCESSED_TIME_STAMP = "initializationRequestMessageProcessedTimeStamp"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_PROCESSED_TIME_STAMP) + private String initializationRequestMessageProcessedTimeStamp; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_INITIALIZATION_REQUEST_MESSAGE = "clientSignatureInitializationRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_INITIALIZATION_REQUEST_MESSAGE) + private String clientSignatureInitializationRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_INITIALIZATION_RESPONSE_MESSAGE = "serverSignatureInitializationResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_INITIALIZATION_RESPONSE_MESSAGE) + private String serverSignatureInitializationResponseMessage; + + public static final String SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_REQUEST_HASH = "transferCommenceMessageRequestHash"; + @SerializedName(SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_REQUEST_HASH) + private String transferCommenceMessageRequestHash; + + public static final String SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_RESPONSE_HASH = "transferCommenceMessageResponseHash"; + @SerializedName(SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_RESPONSE_HASH) + private String transferCommenceMessageResponseHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMMENCE_REQUEST_MESSAGE = "clientSignatureTransferCommenceRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMMENCE_REQUEST_MESSAGE) + private String clientSignatureTransferCommenceRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_TRANSFER_COMMENCE_RESPONSE_MESSAGE = "serverSignatureTransferCommenceResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_TRANSFER_COMMENCE_RESPONSE_MESSAGE) + private String serverSignatureTransferCommenceResponseMessage; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_REQUEST_MESSAGE_HASH = "lockEvidenceRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_REQUEST_MESSAGE_HASH) + private String lockEvidenceRequestMessageHash; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_RESPONSE_MESSAGE_HASH = "lockEvidenceResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_RESPONSE_MESSAGE_HASH) + private String lockEvidenceResponseMessageHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_LOCK_EVIDENCE_REQUEST_MESSAGE = "clientSignatureLockEvidenceRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_LOCK_EVIDENCE_REQUEST_MESSAGE) + private String clientSignatureLockEvidenceRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_LOCK_EVIDENCE_RESPONSE_MESSAGE = "serverSignatureLockEvidenceResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_LOCK_EVIDENCE_RESPONSE_MESSAGE) + private String serverSignatureLockEvidenceResponseMessage; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM = "lockEvidenceClaim"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM) + private String lockEvidenceClaim; + + public static final String SERIALIZED_NAME_COMMIT_PREPARE_REQUEST_MESSAGE_HASH = "commitPrepareRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_PREPARE_REQUEST_MESSAGE_HASH) + private String commitPrepareRequestMessageHash; + + public static final String SERIALIZED_NAME_COMMIT_PREPARE_RESPONSE_MESSAGE_HASH = "commitPrepareResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_PREPARE_RESPONSE_MESSAGE_HASH) + private String commitPrepareResponseMessageHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_PREPARATION_REQUEST_MESSAGE = "clientSignatureCommitPreparationRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_PREPARATION_REQUEST_MESSAGE) + private String clientSignatureCommitPreparationRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_PREPARATION_RESPONSE_MESSAGE = "serverSignatureCommitPreparationResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_PREPARATION_RESPONSE_MESSAGE) + private String serverSignatureCommitPreparationResponseMessage; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_REQUEST_MESSAGE_HASH = "commitFinalRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_REQUEST_MESSAGE_HASH) + private String commitFinalRequestMessageHash; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_RESPONSE_MESSAGE_HASH = "commitFinalResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_RESPONSE_MESSAGE_HASH) + private String commitFinalResponseMessageHash; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM = "commitFinalClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM) + private String commitFinalClaim; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT = "commitFinalClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT) + private String commitFinalClaimFormat; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM = "commitAcknowledgementClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM) + private String commitAcknowledgementClaim; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT = "commitAcknowledgementClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT) + private String commitAcknowledgementClaimFormat; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_FINAL_REQUEST_MESSAGE = "clientSignatureCommitFinalRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_FINAL_REQUEST_MESSAGE) + private String clientSignatureCommitFinalRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_FINAL_RESPONSE_MESSAGE = "serverSignatureCommitFinalResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_FINAL_RESPONSE_MESSAGE) + private String serverSignatureCommitFinalResponseMessage; + + public static final String SERIALIZED_NAME_TRANSFER_COMPLETE_MESSAGE_HASH = "transferCompleteMessageHash"; + @SerializedName(SERIALIZED_NAME_TRANSFER_COMPLETE_MESSAGE_HASH) + private String transferCompleteMessageHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMPLETE_MESSAGE = "clientSignatureTransferCompleteMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMPLETE_MESSAGE) + private String clientSignatureTransferCompleteMessage; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private BigDecimal maxRetries; + + public static final String SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D = "recipientLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D) + private String recipientLedgerAssetID; + + public static final String SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D = "sourceLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D) + private String sourceLedgerAssetID; + + public static final String SERIALIZED_NAME_MAX_TIMEOUT = "maxTimeout"; + @SerializedName(SERIALIZED_NAME_MAX_TIMEOUT) + private BigDecimal maxTimeout; + + public static final String SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP = "lastLogEntryTimestamp"; + @SerializedName(SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP) + private String lastLogEntryTimestamp; + + public static final String SERIALIZED_NAME_UNLOCK_ASSET_CLAIM = "unlockAssetClaim"; + @SerializedName(SERIALIZED_NAME_UNLOCK_ASSET_CLAIM) + private String unlockAssetClaim; + + public static final String SERIALIZED_NAME_RECREATE_ASSET_CLAIM = "recreateAssetClaim"; + @SerializedName(SERIALIZED_NAME_RECREATE_ASSET_CLAIM) + private String recreateAssetClaim; + + public static final String SERIALIZED_NAME_DELETE_ASSET_CLAIM = "deleteAssetClaim"; + @SerializedName(SERIALIZED_NAME_DELETE_ASSET_CLAIM) + private String deleteAssetClaim; + + public static final String SERIALIZED_NAME_LAST_MESSAGE_RECEIVED_TIMESTAMP = "lastMessageReceivedTimestamp"; + @SerializedName(SERIALIZED_NAME_LAST_MESSAGE_RECEIVED_TIMESTAMP) + private String lastMessageReceivedTimestamp; + + public static final String SERIALIZED_NAME_ROLLBACK = "rollback"; + @SerializedName(SERIALIZED_NAME_ROLLBACK) + private Boolean rollback; + + public static final String SERIALIZED_NAME_ROLLBACK_MESSAGE_HASH = "rollbackMessageHash"; + @SerializedName(SERIALIZED_NAME_ROLLBACK_MESSAGE_HASH) + private String rollbackMessageHash; + + public static final String SERIALIZED_NAME_ROLLBACK_PROOFS = "rollbackProofs"; + @SerializedName(SERIALIZED_NAME_ROLLBACK_PROOFS) + private List rollbackProofs; + + /** + * Gets or Sets rollbackActionsPerformed + */ + @JsonAdapter(RollbackActionsPerformedEnum.Adapter.class) + public enum RollbackActionsPerformedEnum { + CREATE("CREATE"), + + DELETE("DELETE"), + + LOCK("LOCK"), + + UNLOCK("UNLOCK"); + + private String value; + + RollbackActionsPerformedEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RollbackActionsPerformedEnum fromValue(String value) { + for (RollbackActionsPerformedEnum b : RollbackActionsPerformedEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RollbackActionsPerformedEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RollbackActionsPerformedEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RollbackActionsPerformedEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ROLLBACK_ACTIONS_PERFORMED = "rollbackActionsPerformed"; + @SerializedName(SERIALIZED_NAME_ROLLBACK_ACTIONS_PERFORMED) + private List rollbackActionsPerformed; + + public SessionData() { + } + + public SessionData id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public SessionData step(BigDecimal step) { + + this.step = step; + return this; + } + + /** + * Get step + * @return step + **/ + @javax.annotation.Nullable + public BigDecimal getStep() { + return step; + } + + + public void setStep(BigDecimal step) { + this.step = step; + } + + + public SessionData version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public SessionData lastSequenceNumber(BigDecimal lastSequenceNumber) { + + this.lastSequenceNumber = lastSequenceNumber; + return this; + } + + /** + * Get lastSequenceNumber + * @return lastSequenceNumber + **/ + @javax.annotation.Nullable + public BigDecimal getLastSequenceNumber() { + return lastSequenceNumber; + } + + + public void setLastSequenceNumber(BigDecimal lastSequenceNumber) { + this.lastSequenceNumber = lastSequenceNumber; + } + + + public SessionData loggingProfile(String loggingProfile) { + + this.loggingProfile = loggingProfile; + return this; + } + + /** + * Get loggingProfile + * @return loggingProfile + **/ + @javax.annotation.Nullable + public String getLoggingProfile() { + return loggingProfile; + } + + + public void setLoggingProfile(String loggingProfile) { + this.loggingProfile = loggingProfile; + } + + + public SessionData accessControlProfile(String accessControlProfile) { + + this.accessControlProfile = accessControlProfile; + return this; + } + + /** + * Get accessControlProfile + * @return accessControlProfile + **/ + @javax.annotation.Nullable + public String getAccessControlProfile() { + return accessControlProfile; + } + + + public void setAccessControlProfile(String accessControlProfile) { + this.accessControlProfile = accessControlProfile; + } + + + public SessionData applicationProfile(String applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nullable + public String getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(String applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public SessionData payloadProfile(PayloadProfile payloadProfile) { + + this.payloadProfile = payloadProfile; + return this; + } + + /** + * Get payloadProfile + * @return payloadProfile + **/ + @javax.annotation.Nullable + public PayloadProfile getPayloadProfile() { + return payloadProfile; + } + + + public void setPayloadProfile(PayloadProfile payloadProfile) { + this.payloadProfile = payloadProfile; + } + + + public SessionData assetProfile(AssetProfile assetProfile) { + + this.assetProfile = assetProfile; + return this; + } + + /** + * Get assetProfile + * @return assetProfile + **/ + @javax.annotation.Nullable + public AssetProfile getAssetProfile() { + return assetProfile; + } + + + public void setAssetProfile(AssetProfile assetProfile) { + this.assetProfile = assetProfile; + } + + + public SessionData allowedSourceBackupGateways(List allowedSourceBackupGateways) { + + this.allowedSourceBackupGateways = allowedSourceBackupGateways; + return this; + } + + public SessionData addAllowedSourceBackupGatewaysItem(String allowedSourceBackupGatewaysItem) { + if (this.allowedSourceBackupGateways == null) { + this.allowedSourceBackupGateways = new ArrayList<>(); + } + this.allowedSourceBackupGateways.add(allowedSourceBackupGatewaysItem); + return this; + } + + /** + * Get allowedSourceBackupGateways + * @return allowedSourceBackupGateways + **/ + @javax.annotation.Nullable + public List getAllowedSourceBackupGateways() { + return allowedSourceBackupGateways; + } + + + public void setAllowedSourceBackupGateways(List allowedSourceBackupGateways) { + this.allowedSourceBackupGateways = allowedSourceBackupGateways; + } + + + public SessionData allowedRecipientBackupGateways(List allowedRecipientBackupGateways) { + + this.allowedRecipientBackupGateways = allowedRecipientBackupGateways; + return this; + } + + public SessionData addAllowedRecipientBackupGatewaysItem(String allowedRecipientBackupGatewaysItem) { + if (this.allowedRecipientBackupGateways == null) { + this.allowedRecipientBackupGateways = new ArrayList<>(); + } + this.allowedRecipientBackupGateways.add(allowedRecipientBackupGatewaysItem); + return this; + } + + /** + * Get allowedRecipientBackupGateways + * @return allowedRecipientBackupGateways + **/ + @javax.annotation.Nullable + public List getAllowedRecipientBackupGateways() { + return allowedRecipientBackupGateways; + } + + + public void setAllowedRecipientBackupGateways(List allowedRecipientBackupGateways) { + this.allowedRecipientBackupGateways = allowedRecipientBackupGateways; + } + + + public SessionData sourceBasePath(String sourceBasePath) { + + this.sourceBasePath = sourceBasePath; + return this; + } + + /** + * Get sourceBasePath + * @return sourceBasePath + **/ + @javax.annotation.Nullable + public String getSourceBasePath() { + return sourceBasePath; + } + + + public void setSourceBasePath(String sourceBasePath) { + this.sourceBasePath = sourceBasePath; + } + + + public SessionData recipientBasePath(String recipientBasePath) { + + this.recipientBasePath = recipientBasePath; + return this; + } + + /** + * Get recipientBasePath + * @return recipientBasePath + **/ + @javax.annotation.Nullable + public String getRecipientBasePath() { + return recipientBasePath; + } + + + public void setRecipientBasePath(String recipientBasePath) { + this.recipientBasePath = recipientBasePath; + } + + + public SessionData originatorPubkey(String originatorPubkey) { + + this.originatorPubkey = originatorPubkey; + return this; + } + + /** + * Get originatorPubkey + * @return originatorPubkey + **/ + @javax.annotation.Nullable + public String getOriginatorPubkey() { + return originatorPubkey; + } + + + public void setOriginatorPubkey(String originatorPubkey) { + this.originatorPubkey = originatorPubkey; + } + + + public SessionData beneficiaryPubkey(String beneficiaryPubkey) { + + this.beneficiaryPubkey = beneficiaryPubkey; + return this; + } + + /** + * Get beneficiaryPubkey + * @return beneficiaryPubkey + **/ + @javax.annotation.Nullable + public String getBeneficiaryPubkey() { + return beneficiaryPubkey; + } + + + public void setBeneficiaryPubkey(String beneficiaryPubkey) { + this.beneficiaryPubkey = beneficiaryPubkey; + } + + + public SessionData sourceGatewayPubkey(String sourceGatewayPubkey) { + + this.sourceGatewayPubkey = sourceGatewayPubkey; + return this; + } + + /** + * Get sourceGatewayPubkey + * @return sourceGatewayPubkey + **/ + @javax.annotation.Nullable + public String getSourceGatewayPubkey() { + return sourceGatewayPubkey; + } + + + public void setSourceGatewayPubkey(String sourceGatewayPubkey) { + this.sourceGatewayPubkey = sourceGatewayPubkey; + } + + + public SessionData sourceGatewayDltSystem(String sourceGatewayDltSystem) { + + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + return this; + } + + /** + * Get sourceGatewayDltSystem + * @return sourceGatewayDltSystem + **/ + @javax.annotation.Nullable + public String getSourceGatewayDltSystem() { + return sourceGatewayDltSystem; + } + + + public void setSourceGatewayDltSystem(String sourceGatewayDltSystem) { + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + } + + + public SessionData recipientGatewayPubkey(String recipientGatewayPubkey) { + + this.recipientGatewayPubkey = recipientGatewayPubkey; + return this; + } + + /** + * Get recipientGatewayPubkey + * @return recipientGatewayPubkey + **/ + @javax.annotation.Nullable + public String getRecipientGatewayPubkey() { + return recipientGatewayPubkey; + } + + + public void setRecipientGatewayPubkey(String recipientGatewayPubkey) { + this.recipientGatewayPubkey = recipientGatewayPubkey; + } + + + public SessionData recipientGatewayDltSystem(String recipientGatewayDltSystem) { + + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + return this; + } + + /** + * Get recipientGatewayDltSystem + * @return recipientGatewayDltSystem + **/ + @javax.annotation.Nullable + public String getRecipientGatewayDltSystem() { + return recipientGatewayDltSystem; + } + + + public void setRecipientGatewayDltSystem(String recipientGatewayDltSystem) { + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + } + + + public SessionData initializationRequestMessageHash(String initializationRequestMessageHash) { + + this.initializationRequestMessageHash = initializationRequestMessageHash; + return this; + } + + /** + * Get initializationRequestMessageHash + * @return initializationRequestMessageHash + **/ + @javax.annotation.Nullable + public String getInitializationRequestMessageHash() { + return initializationRequestMessageHash; + } + + + public void setInitializationRequestMessageHash(String initializationRequestMessageHash) { + this.initializationRequestMessageHash = initializationRequestMessageHash; + } + + + public SessionData initializationResponseMessageHash(String initializationResponseMessageHash) { + + this.initializationResponseMessageHash = initializationResponseMessageHash; + return this; + } + + /** + * Get initializationResponseMessageHash + * @return initializationResponseMessageHash + **/ + @javax.annotation.Nullable + public String getInitializationResponseMessageHash() { + return initializationResponseMessageHash; + } + + + public void setInitializationResponseMessageHash(String initializationResponseMessageHash) { + this.initializationResponseMessageHash = initializationResponseMessageHash; + } + + + public SessionData initializationRequestMessageRcvTimeStamp(String initializationRequestMessageRcvTimeStamp) { + + this.initializationRequestMessageRcvTimeStamp = initializationRequestMessageRcvTimeStamp; + return this; + } + + /** + * Get initializationRequestMessageRcvTimeStamp + * @return initializationRequestMessageRcvTimeStamp + **/ + @javax.annotation.Nullable + public String getInitializationRequestMessageRcvTimeStamp() { + return initializationRequestMessageRcvTimeStamp; + } + + + public void setInitializationRequestMessageRcvTimeStamp(String initializationRequestMessageRcvTimeStamp) { + this.initializationRequestMessageRcvTimeStamp = initializationRequestMessageRcvTimeStamp; + } + + + public SessionData initializationRequestMessageProcessedTimeStamp(String initializationRequestMessageProcessedTimeStamp) { + + this.initializationRequestMessageProcessedTimeStamp = initializationRequestMessageProcessedTimeStamp; + return this; + } + + /** + * Get initializationRequestMessageProcessedTimeStamp + * @return initializationRequestMessageProcessedTimeStamp + **/ + @javax.annotation.Nullable + public String getInitializationRequestMessageProcessedTimeStamp() { + return initializationRequestMessageProcessedTimeStamp; + } + + + public void setInitializationRequestMessageProcessedTimeStamp(String initializationRequestMessageProcessedTimeStamp) { + this.initializationRequestMessageProcessedTimeStamp = initializationRequestMessageProcessedTimeStamp; + } + + + public SessionData clientSignatureInitializationRequestMessage(String clientSignatureInitializationRequestMessage) { + + this.clientSignatureInitializationRequestMessage = clientSignatureInitializationRequestMessage; + return this; + } + + /** + * Get clientSignatureInitializationRequestMessage + * @return clientSignatureInitializationRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureInitializationRequestMessage() { + return clientSignatureInitializationRequestMessage; + } + + + public void setClientSignatureInitializationRequestMessage(String clientSignatureInitializationRequestMessage) { + this.clientSignatureInitializationRequestMessage = clientSignatureInitializationRequestMessage; + } + + + public SessionData serverSignatureInitializationResponseMessage(String serverSignatureInitializationResponseMessage) { + + this.serverSignatureInitializationResponseMessage = serverSignatureInitializationResponseMessage; + return this; + } + + /** + * Get serverSignatureInitializationResponseMessage + * @return serverSignatureInitializationResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureInitializationResponseMessage() { + return serverSignatureInitializationResponseMessage; + } + + + public void setServerSignatureInitializationResponseMessage(String serverSignatureInitializationResponseMessage) { + this.serverSignatureInitializationResponseMessage = serverSignatureInitializationResponseMessage; + } + + + public SessionData transferCommenceMessageRequestHash(String transferCommenceMessageRequestHash) { + + this.transferCommenceMessageRequestHash = transferCommenceMessageRequestHash; + return this; + } + + /** + * Get transferCommenceMessageRequestHash + * @return transferCommenceMessageRequestHash + **/ + @javax.annotation.Nullable + public String getTransferCommenceMessageRequestHash() { + return transferCommenceMessageRequestHash; + } + + + public void setTransferCommenceMessageRequestHash(String transferCommenceMessageRequestHash) { + this.transferCommenceMessageRequestHash = transferCommenceMessageRequestHash; + } + + + public SessionData transferCommenceMessageResponseHash(String transferCommenceMessageResponseHash) { + + this.transferCommenceMessageResponseHash = transferCommenceMessageResponseHash; + return this; + } + + /** + * Get transferCommenceMessageResponseHash + * @return transferCommenceMessageResponseHash + **/ + @javax.annotation.Nullable + public String getTransferCommenceMessageResponseHash() { + return transferCommenceMessageResponseHash; + } + + + public void setTransferCommenceMessageResponseHash(String transferCommenceMessageResponseHash) { + this.transferCommenceMessageResponseHash = transferCommenceMessageResponseHash; + } + + + public SessionData clientSignatureTransferCommenceRequestMessage(String clientSignatureTransferCommenceRequestMessage) { + + this.clientSignatureTransferCommenceRequestMessage = clientSignatureTransferCommenceRequestMessage; + return this; + } + + /** + * Get clientSignatureTransferCommenceRequestMessage + * @return clientSignatureTransferCommenceRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureTransferCommenceRequestMessage() { + return clientSignatureTransferCommenceRequestMessage; + } + + + public void setClientSignatureTransferCommenceRequestMessage(String clientSignatureTransferCommenceRequestMessage) { + this.clientSignatureTransferCommenceRequestMessage = clientSignatureTransferCommenceRequestMessage; + } + + + public SessionData serverSignatureTransferCommenceResponseMessage(String serverSignatureTransferCommenceResponseMessage) { + + this.serverSignatureTransferCommenceResponseMessage = serverSignatureTransferCommenceResponseMessage; + return this; + } + + /** + * Get serverSignatureTransferCommenceResponseMessage + * @return serverSignatureTransferCommenceResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureTransferCommenceResponseMessage() { + return serverSignatureTransferCommenceResponseMessage; + } + + + public void setServerSignatureTransferCommenceResponseMessage(String serverSignatureTransferCommenceResponseMessage) { + this.serverSignatureTransferCommenceResponseMessage = serverSignatureTransferCommenceResponseMessage; + } + + + public SessionData lockEvidenceRequestMessageHash(String lockEvidenceRequestMessageHash) { + + this.lockEvidenceRequestMessageHash = lockEvidenceRequestMessageHash; + return this; + } + + /** + * Get lockEvidenceRequestMessageHash + * @return lockEvidenceRequestMessageHash + **/ + @javax.annotation.Nullable + public String getLockEvidenceRequestMessageHash() { + return lockEvidenceRequestMessageHash; + } + + + public void setLockEvidenceRequestMessageHash(String lockEvidenceRequestMessageHash) { + this.lockEvidenceRequestMessageHash = lockEvidenceRequestMessageHash; + } + + + public SessionData lockEvidenceResponseMessageHash(String lockEvidenceResponseMessageHash) { + + this.lockEvidenceResponseMessageHash = lockEvidenceResponseMessageHash; + return this; + } + + /** + * Get lockEvidenceResponseMessageHash + * @return lockEvidenceResponseMessageHash + **/ + @javax.annotation.Nullable + public String getLockEvidenceResponseMessageHash() { + return lockEvidenceResponseMessageHash; + } + + + public void setLockEvidenceResponseMessageHash(String lockEvidenceResponseMessageHash) { + this.lockEvidenceResponseMessageHash = lockEvidenceResponseMessageHash; + } + + + public SessionData clientSignatureLockEvidenceRequestMessage(String clientSignatureLockEvidenceRequestMessage) { + + this.clientSignatureLockEvidenceRequestMessage = clientSignatureLockEvidenceRequestMessage; + return this; + } + + /** + * Get clientSignatureLockEvidenceRequestMessage + * @return clientSignatureLockEvidenceRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureLockEvidenceRequestMessage() { + return clientSignatureLockEvidenceRequestMessage; + } + + + public void setClientSignatureLockEvidenceRequestMessage(String clientSignatureLockEvidenceRequestMessage) { + this.clientSignatureLockEvidenceRequestMessage = clientSignatureLockEvidenceRequestMessage; + } + + + public SessionData serverSignatureLockEvidenceResponseMessage(String serverSignatureLockEvidenceResponseMessage) { + + this.serverSignatureLockEvidenceResponseMessage = serverSignatureLockEvidenceResponseMessage; + return this; + } + + /** + * Get serverSignatureLockEvidenceResponseMessage + * @return serverSignatureLockEvidenceResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureLockEvidenceResponseMessage() { + return serverSignatureLockEvidenceResponseMessage; + } + + + public void setServerSignatureLockEvidenceResponseMessage(String serverSignatureLockEvidenceResponseMessage) { + this.serverSignatureLockEvidenceResponseMessage = serverSignatureLockEvidenceResponseMessage; + } + + + public SessionData lockEvidenceClaim(String lockEvidenceClaim) { + + this.lockEvidenceClaim = lockEvidenceClaim; + return this; + } + + /** + * Get lockEvidenceClaim + * @return lockEvidenceClaim + **/ + @javax.annotation.Nullable + public String getLockEvidenceClaim() { + return lockEvidenceClaim; + } + + + public void setLockEvidenceClaim(String lockEvidenceClaim) { + this.lockEvidenceClaim = lockEvidenceClaim; + } + + + public SessionData commitPrepareRequestMessageHash(String commitPrepareRequestMessageHash) { + + this.commitPrepareRequestMessageHash = commitPrepareRequestMessageHash; + return this; + } + + /** + * Get commitPrepareRequestMessageHash + * @return commitPrepareRequestMessageHash + **/ + @javax.annotation.Nullable + public String getCommitPrepareRequestMessageHash() { + return commitPrepareRequestMessageHash; + } + + + public void setCommitPrepareRequestMessageHash(String commitPrepareRequestMessageHash) { + this.commitPrepareRequestMessageHash = commitPrepareRequestMessageHash; + } + + + public SessionData commitPrepareResponseMessageHash(String commitPrepareResponseMessageHash) { + + this.commitPrepareResponseMessageHash = commitPrepareResponseMessageHash; + return this; + } + + /** + * Get commitPrepareResponseMessageHash + * @return commitPrepareResponseMessageHash + **/ + @javax.annotation.Nullable + public String getCommitPrepareResponseMessageHash() { + return commitPrepareResponseMessageHash; + } + + + public void setCommitPrepareResponseMessageHash(String commitPrepareResponseMessageHash) { + this.commitPrepareResponseMessageHash = commitPrepareResponseMessageHash; + } + + + public SessionData clientSignatureCommitPreparationRequestMessage(String clientSignatureCommitPreparationRequestMessage) { + + this.clientSignatureCommitPreparationRequestMessage = clientSignatureCommitPreparationRequestMessage; + return this; + } + + /** + * Get clientSignatureCommitPreparationRequestMessage + * @return clientSignatureCommitPreparationRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureCommitPreparationRequestMessage() { + return clientSignatureCommitPreparationRequestMessage; + } + + + public void setClientSignatureCommitPreparationRequestMessage(String clientSignatureCommitPreparationRequestMessage) { + this.clientSignatureCommitPreparationRequestMessage = clientSignatureCommitPreparationRequestMessage; + } + + + public SessionData serverSignatureCommitPreparationResponseMessage(String serverSignatureCommitPreparationResponseMessage) { + + this.serverSignatureCommitPreparationResponseMessage = serverSignatureCommitPreparationResponseMessage; + return this; + } + + /** + * Get serverSignatureCommitPreparationResponseMessage + * @return serverSignatureCommitPreparationResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureCommitPreparationResponseMessage() { + return serverSignatureCommitPreparationResponseMessage; + } + + + public void setServerSignatureCommitPreparationResponseMessage(String serverSignatureCommitPreparationResponseMessage) { + this.serverSignatureCommitPreparationResponseMessage = serverSignatureCommitPreparationResponseMessage; + } + + + public SessionData commitFinalRequestMessageHash(String commitFinalRequestMessageHash) { + + this.commitFinalRequestMessageHash = commitFinalRequestMessageHash; + return this; + } + + /** + * Get commitFinalRequestMessageHash + * @return commitFinalRequestMessageHash + **/ + @javax.annotation.Nullable + public String getCommitFinalRequestMessageHash() { + return commitFinalRequestMessageHash; + } + + + public void setCommitFinalRequestMessageHash(String commitFinalRequestMessageHash) { + this.commitFinalRequestMessageHash = commitFinalRequestMessageHash; + } + + + public SessionData commitFinalResponseMessageHash(String commitFinalResponseMessageHash) { + + this.commitFinalResponseMessageHash = commitFinalResponseMessageHash; + return this; + } + + /** + * Get commitFinalResponseMessageHash + * @return commitFinalResponseMessageHash + **/ + @javax.annotation.Nullable + public String getCommitFinalResponseMessageHash() { + return commitFinalResponseMessageHash; + } + + + public void setCommitFinalResponseMessageHash(String commitFinalResponseMessageHash) { + this.commitFinalResponseMessageHash = commitFinalResponseMessageHash; + } + + + public SessionData commitFinalClaim(String commitFinalClaim) { + + this.commitFinalClaim = commitFinalClaim; + return this; + } + + /** + * Get commitFinalClaim + * @return commitFinalClaim + **/ + @javax.annotation.Nullable + public String getCommitFinalClaim() { + return commitFinalClaim; + } + + + public void setCommitFinalClaim(String commitFinalClaim) { + this.commitFinalClaim = commitFinalClaim; + } + + + public SessionData commitFinalClaimFormat(String commitFinalClaimFormat) { + + this.commitFinalClaimFormat = commitFinalClaimFormat; + return this; + } + + /** + * Get commitFinalClaimFormat + * @return commitFinalClaimFormat + **/ + @javax.annotation.Nullable + public String getCommitFinalClaimFormat() { + return commitFinalClaimFormat; + } + + + public void setCommitFinalClaimFormat(String commitFinalClaimFormat) { + this.commitFinalClaimFormat = commitFinalClaimFormat; + } + + + public SessionData commitAcknowledgementClaim(String commitAcknowledgementClaim) { + + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + return this; + } + + /** + * Get commitAcknowledgementClaim + * @return commitAcknowledgementClaim + **/ + @javax.annotation.Nullable + public String getCommitAcknowledgementClaim() { + return commitAcknowledgementClaim; + } + + + public void setCommitAcknowledgementClaim(String commitAcknowledgementClaim) { + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + } + + + public SessionData commitAcknowledgementClaimFormat(String commitAcknowledgementClaimFormat) { + + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + return this; + } + + /** + * Get commitAcknowledgementClaimFormat + * @return commitAcknowledgementClaimFormat + **/ + @javax.annotation.Nullable + public String getCommitAcknowledgementClaimFormat() { + return commitAcknowledgementClaimFormat; + } + + + public void setCommitAcknowledgementClaimFormat(String commitAcknowledgementClaimFormat) { + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + } + + + public SessionData clientSignatureCommitFinalRequestMessage(String clientSignatureCommitFinalRequestMessage) { + + this.clientSignatureCommitFinalRequestMessage = clientSignatureCommitFinalRequestMessage; + return this; + } + + /** + * Get clientSignatureCommitFinalRequestMessage + * @return clientSignatureCommitFinalRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureCommitFinalRequestMessage() { + return clientSignatureCommitFinalRequestMessage; + } + + + public void setClientSignatureCommitFinalRequestMessage(String clientSignatureCommitFinalRequestMessage) { + this.clientSignatureCommitFinalRequestMessage = clientSignatureCommitFinalRequestMessage; + } + + + public SessionData serverSignatureCommitFinalResponseMessage(String serverSignatureCommitFinalResponseMessage) { + + this.serverSignatureCommitFinalResponseMessage = serverSignatureCommitFinalResponseMessage; + return this; + } + + /** + * Get serverSignatureCommitFinalResponseMessage + * @return serverSignatureCommitFinalResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureCommitFinalResponseMessage() { + return serverSignatureCommitFinalResponseMessage; + } + + + public void setServerSignatureCommitFinalResponseMessage(String serverSignatureCommitFinalResponseMessage) { + this.serverSignatureCommitFinalResponseMessage = serverSignatureCommitFinalResponseMessage; + } + + + public SessionData transferCompleteMessageHash(String transferCompleteMessageHash) { + + this.transferCompleteMessageHash = transferCompleteMessageHash; + return this; + } + + /** + * Get transferCompleteMessageHash + * @return transferCompleteMessageHash + **/ + @javax.annotation.Nullable + public String getTransferCompleteMessageHash() { + return transferCompleteMessageHash; + } + + + public void setTransferCompleteMessageHash(String transferCompleteMessageHash) { + this.transferCompleteMessageHash = transferCompleteMessageHash; + } + + + public SessionData clientSignatureTransferCompleteMessage(String clientSignatureTransferCompleteMessage) { + + this.clientSignatureTransferCompleteMessage = clientSignatureTransferCompleteMessage; + return this; + } + + /** + * Get clientSignatureTransferCompleteMessage + * @return clientSignatureTransferCompleteMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureTransferCompleteMessage() { + return clientSignatureTransferCompleteMessage; + } + + + public void setClientSignatureTransferCompleteMessage(String clientSignatureTransferCompleteMessage) { + this.clientSignatureTransferCompleteMessage = clientSignatureTransferCompleteMessage; + } + + + public SessionData maxRetries(BigDecimal maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Get maxRetries + * @return maxRetries + **/ + @javax.annotation.Nullable + public BigDecimal getMaxRetries() { + return maxRetries; + } + + + public void setMaxRetries(BigDecimal maxRetries) { + this.maxRetries = maxRetries; + } + + + public SessionData recipientLedgerAssetID(String recipientLedgerAssetID) { + + this.recipientLedgerAssetID = recipientLedgerAssetID; + return this; + } + + /** + * Get recipientLedgerAssetID + * @return recipientLedgerAssetID + **/ + @javax.annotation.Nullable + public String getRecipientLedgerAssetID() { + return recipientLedgerAssetID; + } + + + public void setRecipientLedgerAssetID(String recipientLedgerAssetID) { + this.recipientLedgerAssetID = recipientLedgerAssetID; + } + + + public SessionData sourceLedgerAssetID(String sourceLedgerAssetID) { + + this.sourceLedgerAssetID = sourceLedgerAssetID; + return this; + } + + /** + * Get sourceLedgerAssetID + * @return sourceLedgerAssetID + **/ + @javax.annotation.Nullable + public String getSourceLedgerAssetID() { + return sourceLedgerAssetID; + } + + + public void setSourceLedgerAssetID(String sourceLedgerAssetID) { + this.sourceLedgerAssetID = sourceLedgerAssetID; + } + + + public SessionData maxTimeout(BigDecimal maxTimeout) { + + this.maxTimeout = maxTimeout; + return this; + } + + /** + * Get maxTimeout + * @return maxTimeout + **/ + @javax.annotation.Nullable + public BigDecimal getMaxTimeout() { + return maxTimeout; + } + + + public void setMaxTimeout(BigDecimal maxTimeout) { + this.maxTimeout = maxTimeout; + } + + + public SessionData lastLogEntryTimestamp(String lastLogEntryTimestamp) { + + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + return this; + } + + /** + * Get lastLogEntryTimestamp + * @return lastLogEntryTimestamp + **/ + @javax.annotation.Nullable + public String getLastLogEntryTimestamp() { + return lastLogEntryTimestamp; + } + + + public void setLastLogEntryTimestamp(String lastLogEntryTimestamp) { + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + } + + + public SessionData unlockAssetClaim(String unlockAssetClaim) { + + this.unlockAssetClaim = unlockAssetClaim; + return this; + } + + /** + * Get unlockAssetClaim + * @return unlockAssetClaim + **/ + @javax.annotation.Nullable + public String getUnlockAssetClaim() { + return unlockAssetClaim; + } + + + public void setUnlockAssetClaim(String unlockAssetClaim) { + this.unlockAssetClaim = unlockAssetClaim; + } + + + public SessionData recreateAssetClaim(String recreateAssetClaim) { + + this.recreateAssetClaim = recreateAssetClaim; + return this; + } + + /** + * Get recreateAssetClaim + * @return recreateAssetClaim + **/ + @javax.annotation.Nullable + public String getRecreateAssetClaim() { + return recreateAssetClaim; + } + + + public void setRecreateAssetClaim(String recreateAssetClaim) { + this.recreateAssetClaim = recreateAssetClaim; + } + + + public SessionData deleteAssetClaim(String deleteAssetClaim) { + + this.deleteAssetClaim = deleteAssetClaim; + return this; + } + + /** + * Get deleteAssetClaim + * @return deleteAssetClaim + **/ + @javax.annotation.Nullable + public String getDeleteAssetClaim() { + return deleteAssetClaim; + } + + + public void setDeleteAssetClaim(String deleteAssetClaim) { + this.deleteAssetClaim = deleteAssetClaim; + } + + + public SessionData lastMessageReceivedTimestamp(String lastMessageReceivedTimestamp) { + + this.lastMessageReceivedTimestamp = lastMessageReceivedTimestamp; + return this; + } + + /** + * Get lastMessageReceivedTimestamp + * @return lastMessageReceivedTimestamp + **/ + @javax.annotation.Nullable + public String getLastMessageReceivedTimestamp() { + return lastMessageReceivedTimestamp; + } + + + public void setLastMessageReceivedTimestamp(String lastMessageReceivedTimestamp) { + this.lastMessageReceivedTimestamp = lastMessageReceivedTimestamp; + } + + + public SessionData rollback(Boolean rollback) { + + this.rollback = rollback; + return this; + } + + /** + * Get rollback + * @return rollback + **/ + @javax.annotation.Nullable + public Boolean getRollback() { + return rollback; + } + + + public void setRollback(Boolean rollback) { + this.rollback = rollback; + } + + + public SessionData rollbackMessageHash(String rollbackMessageHash) { + + this.rollbackMessageHash = rollbackMessageHash; + return this; + } + + /** + * Get rollbackMessageHash + * @return rollbackMessageHash + **/ + @javax.annotation.Nullable + public String getRollbackMessageHash() { + return rollbackMessageHash; + } + + + public void setRollbackMessageHash(String rollbackMessageHash) { + this.rollbackMessageHash = rollbackMessageHash; + } + + + public SessionData rollbackProofs(List rollbackProofs) { + + this.rollbackProofs = rollbackProofs; + return this; + } + + public SessionData addRollbackProofsItem(String rollbackProofsItem) { + if (this.rollbackProofs == null) { + this.rollbackProofs = new ArrayList<>(); + } + this.rollbackProofs.add(rollbackProofsItem); + return this; + } + + /** + * Get rollbackProofs + * @return rollbackProofs + **/ + @javax.annotation.Nullable + public List getRollbackProofs() { + return rollbackProofs; + } + + + public void setRollbackProofs(List rollbackProofs) { + this.rollbackProofs = rollbackProofs; + } + + + public SessionData rollbackActionsPerformed(List rollbackActionsPerformed) { + + this.rollbackActionsPerformed = rollbackActionsPerformed; + return this; + } + + public SessionData addRollbackActionsPerformedItem(RollbackActionsPerformedEnum rollbackActionsPerformedItem) { + if (this.rollbackActionsPerformed == null) { + this.rollbackActionsPerformed = new ArrayList<>(); + } + this.rollbackActionsPerformed.add(rollbackActionsPerformedItem); + return this; + } + + /** + * Get rollbackActionsPerformed + * @return rollbackActionsPerformed + **/ + @javax.annotation.Nullable + public List getRollbackActionsPerformed() { + return rollbackActionsPerformed; + } + + + public void setRollbackActionsPerformed(List rollbackActionsPerformed) { + this.rollbackActionsPerformed = rollbackActionsPerformed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionData sessionData = (SessionData) o; + return Objects.equals(this.id, sessionData.id) && + Objects.equals(this.step, sessionData.step) && + Objects.equals(this.version, sessionData.version) && + Objects.equals(this.lastSequenceNumber, sessionData.lastSequenceNumber) && + Objects.equals(this.loggingProfile, sessionData.loggingProfile) && + Objects.equals(this.accessControlProfile, sessionData.accessControlProfile) && + Objects.equals(this.applicationProfile, sessionData.applicationProfile) && + Objects.equals(this.payloadProfile, sessionData.payloadProfile) && + Objects.equals(this.assetProfile, sessionData.assetProfile) && + Objects.equals(this.allowedSourceBackupGateways, sessionData.allowedSourceBackupGateways) && + Objects.equals(this.allowedRecipientBackupGateways, sessionData.allowedRecipientBackupGateways) && + Objects.equals(this.sourceBasePath, sessionData.sourceBasePath) && + Objects.equals(this.recipientBasePath, sessionData.recipientBasePath) && + Objects.equals(this.originatorPubkey, sessionData.originatorPubkey) && + Objects.equals(this.beneficiaryPubkey, sessionData.beneficiaryPubkey) && + Objects.equals(this.sourceGatewayPubkey, sessionData.sourceGatewayPubkey) && + Objects.equals(this.sourceGatewayDltSystem, sessionData.sourceGatewayDltSystem) && + Objects.equals(this.recipientGatewayPubkey, sessionData.recipientGatewayPubkey) && + Objects.equals(this.recipientGatewayDltSystem, sessionData.recipientGatewayDltSystem) && + Objects.equals(this.initializationRequestMessageHash, sessionData.initializationRequestMessageHash) && + Objects.equals(this.initializationResponseMessageHash, sessionData.initializationResponseMessageHash) && + Objects.equals(this.initializationRequestMessageRcvTimeStamp, sessionData.initializationRequestMessageRcvTimeStamp) && + Objects.equals(this.initializationRequestMessageProcessedTimeStamp, sessionData.initializationRequestMessageProcessedTimeStamp) && + Objects.equals(this.clientSignatureInitializationRequestMessage, sessionData.clientSignatureInitializationRequestMessage) && + Objects.equals(this.serverSignatureInitializationResponseMessage, sessionData.serverSignatureInitializationResponseMessage) && + Objects.equals(this.transferCommenceMessageRequestHash, sessionData.transferCommenceMessageRequestHash) && + Objects.equals(this.transferCommenceMessageResponseHash, sessionData.transferCommenceMessageResponseHash) && + Objects.equals(this.clientSignatureTransferCommenceRequestMessage, sessionData.clientSignatureTransferCommenceRequestMessage) && + Objects.equals(this.serverSignatureTransferCommenceResponseMessage, sessionData.serverSignatureTransferCommenceResponseMessage) && + Objects.equals(this.lockEvidenceRequestMessageHash, sessionData.lockEvidenceRequestMessageHash) && + Objects.equals(this.lockEvidenceResponseMessageHash, sessionData.lockEvidenceResponseMessageHash) && + Objects.equals(this.clientSignatureLockEvidenceRequestMessage, sessionData.clientSignatureLockEvidenceRequestMessage) && + Objects.equals(this.serverSignatureLockEvidenceResponseMessage, sessionData.serverSignatureLockEvidenceResponseMessage) && + Objects.equals(this.lockEvidenceClaim, sessionData.lockEvidenceClaim) && + Objects.equals(this.commitPrepareRequestMessageHash, sessionData.commitPrepareRequestMessageHash) && + Objects.equals(this.commitPrepareResponseMessageHash, sessionData.commitPrepareResponseMessageHash) && + Objects.equals(this.clientSignatureCommitPreparationRequestMessage, sessionData.clientSignatureCommitPreparationRequestMessage) && + Objects.equals(this.serverSignatureCommitPreparationResponseMessage, sessionData.serverSignatureCommitPreparationResponseMessage) && + Objects.equals(this.commitFinalRequestMessageHash, sessionData.commitFinalRequestMessageHash) && + Objects.equals(this.commitFinalResponseMessageHash, sessionData.commitFinalResponseMessageHash) && + Objects.equals(this.commitFinalClaim, sessionData.commitFinalClaim) && + Objects.equals(this.commitFinalClaimFormat, sessionData.commitFinalClaimFormat) && + Objects.equals(this.commitAcknowledgementClaim, sessionData.commitAcknowledgementClaim) && + Objects.equals(this.commitAcknowledgementClaimFormat, sessionData.commitAcknowledgementClaimFormat) && + Objects.equals(this.clientSignatureCommitFinalRequestMessage, sessionData.clientSignatureCommitFinalRequestMessage) && + Objects.equals(this.serverSignatureCommitFinalResponseMessage, sessionData.serverSignatureCommitFinalResponseMessage) && + Objects.equals(this.transferCompleteMessageHash, sessionData.transferCompleteMessageHash) && + Objects.equals(this.clientSignatureTransferCompleteMessage, sessionData.clientSignatureTransferCompleteMessage) && + Objects.equals(this.maxRetries, sessionData.maxRetries) && + Objects.equals(this.recipientLedgerAssetID, sessionData.recipientLedgerAssetID) && + Objects.equals(this.sourceLedgerAssetID, sessionData.sourceLedgerAssetID) && + Objects.equals(this.maxTimeout, sessionData.maxTimeout) && + Objects.equals(this.lastLogEntryTimestamp, sessionData.lastLogEntryTimestamp) && + Objects.equals(this.unlockAssetClaim, sessionData.unlockAssetClaim) && + Objects.equals(this.recreateAssetClaim, sessionData.recreateAssetClaim) && + Objects.equals(this.deleteAssetClaim, sessionData.deleteAssetClaim) && + Objects.equals(this.lastMessageReceivedTimestamp, sessionData.lastMessageReceivedTimestamp) && + Objects.equals(this.rollback, sessionData.rollback) && + Objects.equals(this.rollbackMessageHash, sessionData.rollbackMessageHash) && + Objects.equals(this.rollbackProofs, sessionData.rollbackProofs) && + Objects.equals(this.rollbackActionsPerformed, sessionData.rollbackActionsPerformed); + } + + @Override + public int hashCode() { + return Objects.hash(id, step, version, lastSequenceNumber, loggingProfile, accessControlProfile, applicationProfile, payloadProfile, assetProfile, allowedSourceBackupGateways, allowedRecipientBackupGateways, sourceBasePath, recipientBasePath, originatorPubkey, beneficiaryPubkey, sourceGatewayPubkey, sourceGatewayDltSystem, recipientGatewayPubkey, recipientGatewayDltSystem, initializationRequestMessageHash, initializationResponseMessageHash, initializationRequestMessageRcvTimeStamp, initializationRequestMessageProcessedTimeStamp, clientSignatureInitializationRequestMessage, serverSignatureInitializationResponseMessage, transferCommenceMessageRequestHash, transferCommenceMessageResponseHash, clientSignatureTransferCommenceRequestMessage, serverSignatureTransferCommenceResponseMessage, lockEvidenceRequestMessageHash, lockEvidenceResponseMessageHash, clientSignatureLockEvidenceRequestMessage, serverSignatureLockEvidenceResponseMessage, lockEvidenceClaim, commitPrepareRequestMessageHash, commitPrepareResponseMessageHash, clientSignatureCommitPreparationRequestMessage, serverSignatureCommitPreparationResponseMessage, commitFinalRequestMessageHash, commitFinalResponseMessageHash, commitFinalClaim, commitFinalClaimFormat, commitAcknowledgementClaim, commitAcknowledgementClaimFormat, clientSignatureCommitFinalRequestMessage, serverSignatureCommitFinalResponseMessage, transferCompleteMessageHash, clientSignatureTransferCompleteMessage, maxRetries, recipientLedgerAssetID, sourceLedgerAssetID, maxTimeout, lastLogEntryTimestamp, unlockAssetClaim, recreateAssetClaim, deleteAssetClaim, lastMessageReceivedTimestamp, rollback, rollbackMessageHash, rollbackProofs, rollbackActionsPerformed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" step: ").append(toIndentedString(step)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" lastSequenceNumber: ").append(toIndentedString(lastSequenceNumber)).append("\n"); + sb.append(" loggingProfile: ").append(toIndentedString(loggingProfile)).append("\n"); + sb.append(" accessControlProfile: ").append(toIndentedString(accessControlProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" payloadProfile: ").append(toIndentedString(payloadProfile)).append("\n"); + sb.append(" assetProfile: ").append(toIndentedString(assetProfile)).append("\n"); + sb.append(" allowedSourceBackupGateways: ").append(toIndentedString(allowedSourceBackupGateways)).append("\n"); + sb.append(" allowedRecipientBackupGateways: ").append(toIndentedString(allowedRecipientBackupGateways)).append("\n"); + sb.append(" sourceBasePath: ").append(toIndentedString(sourceBasePath)).append("\n"); + sb.append(" recipientBasePath: ").append(toIndentedString(recipientBasePath)).append("\n"); + sb.append(" originatorPubkey: ").append(toIndentedString(originatorPubkey)).append("\n"); + sb.append(" beneficiaryPubkey: ").append(toIndentedString(beneficiaryPubkey)).append("\n"); + sb.append(" sourceGatewayPubkey: ").append(toIndentedString(sourceGatewayPubkey)).append("\n"); + sb.append(" sourceGatewayDltSystem: ").append(toIndentedString(sourceGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayPubkey: ").append(toIndentedString(recipientGatewayPubkey)).append("\n"); + sb.append(" recipientGatewayDltSystem: ").append(toIndentedString(recipientGatewayDltSystem)).append("\n"); + sb.append(" initializationRequestMessageHash: ").append(toIndentedString(initializationRequestMessageHash)).append("\n"); + sb.append(" initializationResponseMessageHash: ").append(toIndentedString(initializationResponseMessageHash)).append("\n"); + sb.append(" initializationRequestMessageRcvTimeStamp: ").append(toIndentedString(initializationRequestMessageRcvTimeStamp)).append("\n"); + sb.append(" initializationRequestMessageProcessedTimeStamp: ").append(toIndentedString(initializationRequestMessageProcessedTimeStamp)).append("\n"); + sb.append(" clientSignatureInitializationRequestMessage: ").append(toIndentedString(clientSignatureInitializationRequestMessage)).append("\n"); + sb.append(" serverSignatureInitializationResponseMessage: ").append(toIndentedString(serverSignatureInitializationResponseMessage)).append("\n"); + sb.append(" transferCommenceMessageRequestHash: ").append(toIndentedString(transferCommenceMessageRequestHash)).append("\n"); + sb.append(" transferCommenceMessageResponseHash: ").append(toIndentedString(transferCommenceMessageResponseHash)).append("\n"); + sb.append(" clientSignatureTransferCommenceRequestMessage: ").append(toIndentedString(clientSignatureTransferCommenceRequestMessage)).append("\n"); + sb.append(" serverSignatureTransferCommenceResponseMessage: ").append(toIndentedString(serverSignatureTransferCommenceResponseMessage)).append("\n"); + sb.append(" lockEvidenceRequestMessageHash: ").append(toIndentedString(lockEvidenceRequestMessageHash)).append("\n"); + sb.append(" lockEvidenceResponseMessageHash: ").append(toIndentedString(lockEvidenceResponseMessageHash)).append("\n"); + sb.append(" clientSignatureLockEvidenceRequestMessage: ").append(toIndentedString(clientSignatureLockEvidenceRequestMessage)).append("\n"); + sb.append(" serverSignatureLockEvidenceResponseMessage: ").append(toIndentedString(serverSignatureLockEvidenceResponseMessage)).append("\n"); + sb.append(" lockEvidenceClaim: ").append(toIndentedString(lockEvidenceClaim)).append("\n"); + sb.append(" commitPrepareRequestMessageHash: ").append(toIndentedString(commitPrepareRequestMessageHash)).append("\n"); + sb.append(" commitPrepareResponseMessageHash: ").append(toIndentedString(commitPrepareResponseMessageHash)).append("\n"); + sb.append(" clientSignatureCommitPreparationRequestMessage: ").append(toIndentedString(clientSignatureCommitPreparationRequestMessage)).append("\n"); + sb.append(" serverSignatureCommitPreparationResponseMessage: ").append(toIndentedString(serverSignatureCommitPreparationResponseMessage)).append("\n"); + sb.append(" commitFinalRequestMessageHash: ").append(toIndentedString(commitFinalRequestMessageHash)).append("\n"); + sb.append(" commitFinalResponseMessageHash: ").append(toIndentedString(commitFinalResponseMessageHash)).append("\n"); + sb.append(" commitFinalClaim: ").append(toIndentedString(commitFinalClaim)).append("\n"); + sb.append(" commitFinalClaimFormat: ").append(toIndentedString(commitFinalClaimFormat)).append("\n"); + sb.append(" commitAcknowledgementClaim: ").append(toIndentedString(commitAcknowledgementClaim)).append("\n"); + sb.append(" commitAcknowledgementClaimFormat: ").append(toIndentedString(commitAcknowledgementClaimFormat)).append("\n"); + sb.append(" clientSignatureCommitFinalRequestMessage: ").append(toIndentedString(clientSignatureCommitFinalRequestMessage)).append("\n"); + sb.append(" serverSignatureCommitFinalResponseMessage: ").append(toIndentedString(serverSignatureCommitFinalResponseMessage)).append("\n"); + sb.append(" transferCompleteMessageHash: ").append(toIndentedString(transferCompleteMessageHash)).append("\n"); + sb.append(" clientSignatureTransferCompleteMessage: ").append(toIndentedString(clientSignatureTransferCompleteMessage)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" recipientLedgerAssetID: ").append(toIndentedString(recipientLedgerAssetID)).append("\n"); + sb.append(" sourceLedgerAssetID: ").append(toIndentedString(sourceLedgerAssetID)).append("\n"); + sb.append(" maxTimeout: ").append(toIndentedString(maxTimeout)).append("\n"); + sb.append(" lastLogEntryTimestamp: ").append(toIndentedString(lastLogEntryTimestamp)).append("\n"); + sb.append(" unlockAssetClaim: ").append(toIndentedString(unlockAssetClaim)).append("\n"); + sb.append(" recreateAssetClaim: ").append(toIndentedString(recreateAssetClaim)).append("\n"); + sb.append(" deleteAssetClaim: ").append(toIndentedString(deleteAssetClaim)).append("\n"); + sb.append(" lastMessageReceivedTimestamp: ").append(toIndentedString(lastMessageReceivedTimestamp)).append("\n"); + sb.append(" rollback: ").append(toIndentedString(rollback)).append("\n"); + sb.append(" rollbackMessageHash: ").append(toIndentedString(rollbackMessageHash)).append("\n"); + sb.append(" rollbackProofs: ").append(toIndentedString(rollbackProofs)).append("\n"); + sb.append(" rollbackActionsPerformed: ").append(toIndentedString(rollbackActionsPerformed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("step"); + openapiFields.add("version"); + openapiFields.add("lastSequenceNumber"); + openapiFields.add("loggingProfile"); + openapiFields.add("accessControlProfile"); + openapiFields.add("applicationProfile"); + openapiFields.add("payloadProfile"); + openapiFields.add("assetProfile"); + openapiFields.add("allowedSourceBackupGateways"); + openapiFields.add("allowedRecipientBackupGateways"); + openapiFields.add("sourceBasePath"); + openapiFields.add("recipientBasePath"); + openapiFields.add("originatorPubkey"); + openapiFields.add("beneficiaryPubkey"); + openapiFields.add("sourceGatewayPubkey"); + openapiFields.add("sourceGatewayDltSystem"); + openapiFields.add("recipientGatewayPubkey"); + openapiFields.add("recipientGatewayDltSystem"); + openapiFields.add("initializationRequestMessageHash"); + openapiFields.add("initializationResponseMessageHash"); + openapiFields.add("initializationRequestMessageRcvTimeStamp"); + openapiFields.add("initializationRequestMessageProcessedTimeStamp"); + openapiFields.add("clientSignatureInitializationRequestMessage"); + openapiFields.add("serverSignatureInitializationResponseMessage"); + openapiFields.add("transferCommenceMessageRequestHash"); + openapiFields.add("transferCommenceMessageResponseHash"); + openapiFields.add("clientSignatureTransferCommenceRequestMessage"); + openapiFields.add("serverSignatureTransferCommenceResponseMessage"); + openapiFields.add("lockEvidenceRequestMessageHash"); + openapiFields.add("lockEvidenceResponseMessageHash"); + openapiFields.add("clientSignatureLockEvidenceRequestMessage"); + openapiFields.add("serverSignatureLockEvidenceResponseMessage"); + openapiFields.add("lockEvidenceClaim"); + openapiFields.add("commitPrepareRequestMessageHash"); + openapiFields.add("commitPrepareResponseMessageHash"); + openapiFields.add("clientSignatureCommitPreparationRequestMessage"); + openapiFields.add("serverSignatureCommitPreparationResponseMessage"); + openapiFields.add("commitFinalRequestMessageHash"); + openapiFields.add("commitFinalResponseMessageHash"); + openapiFields.add("commitFinalClaim"); + openapiFields.add("commitFinalClaimFormat"); + openapiFields.add("commitAcknowledgementClaim"); + openapiFields.add("commitAcknowledgementClaimFormat"); + openapiFields.add("clientSignatureCommitFinalRequestMessage"); + openapiFields.add("serverSignatureCommitFinalResponseMessage"); + openapiFields.add("transferCompleteMessageHash"); + openapiFields.add("clientSignatureTransferCompleteMessage"); + openapiFields.add("maxRetries"); + openapiFields.add("recipientLedgerAssetID"); + openapiFields.add("sourceLedgerAssetID"); + openapiFields.add("maxTimeout"); + openapiFields.add("lastLogEntryTimestamp"); + openapiFields.add("unlockAssetClaim"); + openapiFields.add("recreateAssetClaim"); + openapiFields.add("deleteAssetClaim"); + openapiFields.add("lastMessageReceivedTimestamp"); + openapiFields.add("rollback"); + openapiFields.add("rollbackMessageHash"); + openapiFields.add("rollbackProofs"); + openapiFields.add("rollbackActionsPerformed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SessionData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SessionData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionData is not found in the empty JSON string", SessionData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SessionData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("loggingProfile") != null && !jsonObj.get("loggingProfile").isJsonNull()) && !jsonObj.get("loggingProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loggingProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loggingProfile").toString())); + } + if ((jsonObj.get("accessControlProfile") != null && !jsonObj.get("accessControlProfile").isJsonNull()) && !jsonObj.get("accessControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accessControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessControlProfile").toString())); + } + if ((jsonObj.get("applicationProfile") != null && !jsonObj.get("applicationProfile").isJsonNull()) && !jsonObj.get("applicationProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationProfile").toString())); + } + // validate the optional field `payloadProfile` + if (jsonObj.get("payloadProfile") != null && !jsonObj.get("payloadProfile").isJsonNull()) { + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("payloadProfile")); + } + // validate the optional field `assetProfile` + if (jsonObj.get("assetProfile") != null && !jsonObj.get("assetProfile").isJsonNull()) { + AssetProfile.validateJsonObject(jsonObj.getAsJsonObject("assetProfile")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowedSourceBackupGateways") != null && !jsonObj.get("allowedSourceBackupGateways").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowedSourceBackupGateways` to be an array in the JSON string but got `%s`", jsonObj.get("allowedSourceBackupGateways").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowedRecipientBackupGateways") != null && !jsonObj.get("allowedRecipientBackupGateways").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowedRecipientBackupGateways` to be an array in the JSON string but got `%s`", jsonObj.get("allowedRecipientBackupGateways").toString())); + } + if ((jsonObj.get("sourceBasePath") != null && !jsonObj.get("sourceBasePath").isJsonNull()) && !jsonObj.get("sourceBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceBasePath").toString())); + } + if ((jsonObj.get("recipientBasePath") != null && !jsonObj.get("recipientBasePath").isJsonNull()) && !jsonObj.get("recipientBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientBasePath").toString())); + } + if ((jsonObj.get("originatorPubkey") != null && !jsonObj.get("originatorPubkey").isJsonNull()) && !jsonObj.get("originatorPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originatorPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originatorPubkey").toString())); + } + if ((jsonObj.get("beneficiaryPubkey") != null && !jsonObj.get("beneficiaryPubkey").isJsonNull()) && !jsonObj.get("beneficiaryPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `beneficiaryPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("beneficiaryPubkey").toString())); + } + if ((jsonObj.get("sourceGatewayPubkey") != null && !jsonObj.get("sourceGatewayPubkey").isJsonNull()) && !jsonObj.get("sourceGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayPubkey").toString())); + } + if ((jsonObj.get("sourceGatewayDltSystem") != null && !jsonObj.get("sourceGatewayDltSystem").isJsonNull()) && !jsonObj.get("sourceGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayDltSystem").toString())); + } + if ((jsonObj.get("recipientGatewayPubkey") != null && !jsonObj.get("recipientGatewayPubkey").isJsonNull()) && !jsonObj.get("recipientGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayPubkey").toString())); + } + if ((jsonObj.get("recipientGatewayDltSystem") != null && !jsonObj.get("recipientGatewayDltSystem").isJsonNull()) && !jsonObj.get("recipientGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayDltSystem").toString())); + } + if ((jsonObj.get("initializationRequestMessageHash") != null && !jsonObj.get("initializationRequestMessageHash").isJsonNull()) && !jsonObj.get("initializationRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationRequestMessageHash").toString())); + } + if ((jsonObj.get("initializationResponseMessageHash") != null && !jsonObj.get("initializationResponseMessageHash").isJsonNull()) && !jsonObj.get("initializationResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationResponseMessageHash").toString())); + } + if ((jsonObj.get("initializationRequestMessageRcvTimeStamp") != null && !jsonObj.get("initializationRequestMessageRcvTimeStamp").isJsonNull()) && !jsonObj.get("initializationRequestMessageRcvTimeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationRequestMessageRcvTimeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationRequestMessageRcvTimeStamp").toString())); + } + if ((jsonObj.get("initializationRequestMessageProcessedTimeStamp") != null && !jsonObj.get("initializationRequestMessageProcessedTimeStamp").isJsonNull()) && !jsonObj.get("initializationRequestMessageProcessedTimeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationRequestMessageProcessedTimeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationRequestMessageProcessedTimeStamp").toString())); + } + if ((jsonObj.get("clientSignatureInitializationRequestMessage") != null && !jsonObj.get("clientSignatureInitializationRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureInitializationRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureInitializationRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureInitializationRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureInitializationResponseMessage") != null && !jsonObj.get("serverSignatureInitializationResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureInitializationResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureInitializationResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureInitializationResponseMessage").toString())); + } + if ((jsonObj.get("transferCommenceMessageRequestHash") != null && !jsonObj.get("transferCommenceMessageRequestHash").isJsonNull()) && !jsonObj.get("transferCommenceMessageRequestHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferCommenceMessageRequestHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferCommenceMessageRequestHash").toString())); + } + if ((jsonObj.get("transferCommenceMessageResponseHash") != null && !jsonObj.get("transferCommenceMessageResponseHash").isJsonNull()) && !jsonObj.get("transferCommenceMessageResponseHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferCommenceMessageResponseHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferCommenceMessageResponseHash").toString())); + } + if ((jsonObj.get("clientSignatureTransferCommenceRequestMessage") != null && !jsonObj.get("clientSignatureTransferCommenceRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureTransferCommenceRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureTransferCommenceRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureTransferCommenceRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureTransferCommenceResponseMessage") != null && !jsonObj.get("serverSignatureTransferCommenceResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureTransferCommenceResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureTransferCommenceResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureTransferCommenceResponseMessage").toString())); + } + if ((jsonObj.get("lockEvidenceRequestMessageHash") != null && !jsonObj.get("lockEvidenceRequestMessageHash").isJsonNull()) && !jsonObj.get("lockEvidenceRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceRequestMessageHash").toString())); + } + if ((jsonObj.get("lockEvidenceResponseMessageHash") != null && !jsonObj.get("lockEvidenceResponseMessageHash").isJsonNull()) && !jsonObj.get("lockEvidenceResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceResponseMessageHash").toString())); + } + if ((jsonObj.get("clientSignatureLockEvidenceRequestMessage") != null && !jsonObj.get("clientSignatureLockEvidenceRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureLockEvidenceRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureLockEvidenceRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureLockEvidenceRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureLockEvidenceResponseMessage") != null && !jsonObj.get("serverSignatureLockEvidenceResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureLockEvidenceResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureLockEvidenceResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureLockEvidenceResponseMessage").toString())); + } + if ((jsonObj.get("lockEvidenceClaim") != null && !jsonObj.get("lockEvidenceClaim").isJsonNull()) && !jsonObj.get("lockEvidenceClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceClaim").toString())); + } + if ((jsonObj.get("commitPrepareRequestMessageHash") != null && !jsonObj.get("commitPrepareRequestMessageHash").isJsonNull()) && !jsonObj.get("commitPrepareRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitPrepareRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitPrepareRequestMessageHash").toString())); + } + if ((jsonObj.get("commitPrepareResponseMessageHash") != null && !jsonObj.get("commitPrepareResponseMessageHash").isJsonNull()) && !jsonObj.get("commitPrepareResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitPrepareResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitPrepareResponseMessageHash").toString())); + } + if ((jsonObj.get("clientSignatureCommitPreparationRequestMessage") != null && !jsonObj.get("clientSignatureCommitPreparationRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureCommitPreparationRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureCommitPreparationRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureCommitPreparationRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureCommitPreparationResponseMessage") != null && !jsonObj.get("serverSignatureCommitPreparationResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureCommitPreparationResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureCommitPreparationResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureCommitPreparationResponseMessage").toString())); + } + if ((jsonObj.get("commitFinalRequestMessageHash") != null && !jsonObj.get("commitFinalRequestMessageHash").isJsonNull()) && !jsonObj.get("commitFinalRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalRequestMessageHash").toString())); + } + if ((jsonObj.get("commitFinalResponseMessageHash") != null && !jsonObj.get("commitFinalResponseMessageHash").isJsonNull()) && !jsonObj.get("commitFinalResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalResponseMessageHash").toString())); + } + if ((jsonObj.get("commitFinalClaim") != null && !jsonObj.get("commitFinalClaim").isJsonNull()) && !jsonObj.get("commitFinalClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalClaim").toString())); + } + if ((jsonObj.get("commitFinalClaimFormat") != null && !jsonObj.get("commitFinalClaimFormat").isJsonNull()) && !jsonObj.get("commitFinalClaimFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalClaimFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalClaimFormat").toString())); + } + if ((jsonObj.get("commitAcknowledgementClaim") != null && !jsonObj.get("commitAcknowledgementClaim").isJsonNull()) && !jsonObj.get("commitAcknowledgementClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitAcknowledgementClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitAcknowledgementClaim").toString())); + } + if ((jsonObj.get("commitAcknowledgementClaimFormat") != null && !jsonObj.get("commitAcknowledgementClaimFormat").isJsonNull()) && !jsonObj.get("commitAcknowledgementClaimFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitAcknowledgementClaimFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitAcknowledgementClaimFormat").toString())); + } + if ((jsonObj.get("clientSignatureCommitFinalRequestMessage") != null && !jsonObj.get("clientSignatureCommitFinalRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureCommitFinalRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureCommitFinalRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureCommitFinalRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureCommitFinalResponseMessage") != null && !jsonObj.get("serverSignatureCommitFinalResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureCommitFinalResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureCommitFinalResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureCommitFinalResponseMessage").toString())); + } + if ((jsonObj.get("transferCompleteMessageHash") != null && !jsonObj.get("transferCompleteMessageHash").isJsonNull()) && !jsonObj.get("transferCompleteMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferCompleteMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferCompleteMessageHash").toString())); + } + if ((jsonObj.get("clientSignatureTransferCompleteMessage") != null && !jsonObj.get("clientSignatureTransferCompleteMessage").isJsonNull()) && !jsonObj.get("clientSignatureTransferCompleteMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureTransferCompleteMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureTransferCompleteMessage").toString())); + } + if ((jsonObj.get("recipientLedgerAssetID") != null && !jsonObj.get("recipientLedgerAssetID").isJsonNull()) && !jsonObj.get("recipientLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientLedgerAssetID").toString())); + } + if ((jsonObj.get("sourceLedgerAssetID") != null && !jsonObj.get("sourceLedgerAssetID").isJsonNull()) && !jsonObj.get("sourceLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceLedgerAssetID").toString())); + } + if ((jsonObj.get("lastLogEntryTimestamp") != null && !jsonObj.get("lastLogEntryTimestamp").isJsonNull()) && !jsonObj.get("lastLogEntryTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastLogEntryTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastLogEntryTimestamp").toString())); + } + if ((jsonObj.get("unlockAssetClaim") != null && !jsonObj.get("unlockAssetClaim").isJsonNull()) && !jsonObj.get("unlockAssetClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `unlockAssetClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("unlockAssetClaim").toString())); + } + if ((jsonObj.get("recreateAssetClaim") != null && !jsonObj.get("recreateAssetClaim").isJsonNull()) && !jsonObj.get("recreateAssetClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recreateAssetClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recreateAssetClaim").toString())); + } + if ((jsonObj.get("deleteAssetClaim") != null && !jsonObj.get("deleteAssetClaim").isJsonNull()) && !jsonObj.get("deleteAssetClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deleteAssetClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deleteAssetClaim").toString())); + } + if ((jsonObj.get("lastMessageReceivedTimestamp") != null && !jsonObj.get("lastMessageReceivedTimestamp").isJsonNull()) && !jsonObj.get("lastMessageReceivedTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastMessageReceivedTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastMessageReceivedTimestamp").toString())); + } + if ((jsonObj.get("rollbackMessageHash") != null && !jsonObj.get("rollbackMessageHash").isJsonNull()) && !jsonObj.get("rollbackMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rollbackMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rollbackMessageHash").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("rollbackProofs") != null && !jsonObj.get("rollbackProofs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rollbackProofs` to be an array in the JSON string but got `%s`", jsonObj.get("rollbackProofs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("rollbackActionsPerformed") != null && !jsonObj.get("rollbackActionsPerformed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rollbackActionsPerformed` to be an array in the JSON string but got `%s`", jsonObj.get("rollbackActionsPerformed").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionData + * @throws IOException if the JSON string is invalid with respect to SessionData + */ + public static SessionData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionData.class); + } + + /** + * Convert an instance of SessionData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java new file mode 100644 index 0000000000..0dd0d61d51 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java @@ -0,0 +1,633 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferCommenceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferCommenceV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_ORIGINATOR_PUBKEY = "originatorPubkey"; + @SerializedName(SERIALIZED_NAME_ORIGINATOR_PUBKEY) + private String originatorPubkey; + + public static final String SERIALIZED_NAME_BENEFICIARY_PUBKEY = "beneficiaryPubkey"; + @SerializedName(SERIALIZED_NAME_BENEFICIARY_PUBKEY) + private String beneficiaryPubkey; + + public static final String SERIALIZED_NAME_SENDER_DLT_SYSTEM = "senderDltSystem"; + @SerializedName(SERIALIZED_NAME_SENDER_DLT_SYSTEM) + private String senderDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_DLT_SYSTEM = "recipientDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_DLT_SYSTEM) + private String recipientDltSystem; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_ASSET_PROFILE = "hashAssetProfile"; + @SerializedName(SERIALIZED_NAME_HASH_ASSET_PROFILE) + private String hashAssetProfile; + + public static final String SERIALIZED_NAME_ASSET_UNIT = "assetUnit"; + @SerializedName(SERIALIZED_NAME_ASSET_UNIT) + private Integer assetUnit; + + public static final String SERIALIZED_NAME_HASH_PREV_MESSAGE = "hashPrevMessage"; + @SerializedName(SERIALIZED_NAME_HASH_PREV_MESSAGE) + private String hashPrevMessage; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private Integer sequenceNumber; + + public TransferCommenceV1Request() { + } + + public TransferCommenceV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferCommenceV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferCommenceV1Request originatorPubkey(String originatorPubkey) { + + this.originatorPubkey = originatorPubkey; + return this; + } + + /** + * Get originatorPubkey + * @return originatorPubkey + **/ + @javax.annotation.Nonnull + public String getOriginatorPubkey() { + return originatorPubkey; + } + + + public void setOriginatorPubkey(String originatorPubkey) { + this.originatorPubkey = originatorPubkey; + } + + + public TransferCommenceV1Request beneficiaryPubkey(String beneficiaryPubkey) { + + this.beneficiaryPubkey = beneficiaryPubkey; + return this; + } + + /** + * Get beneficiaryPubkey + * @return beneficiaryPubkey + **/ + @javax.annotation.Nonnull + public String getBeneficiaryPubkey() { + return beneficiaryPubkey; + } + + + public void setBeneficiaryPubkey(String beneficiaryPubkey) { + this.beneficiaryPubkey = beneficiaryPubkey; + } + + + public TransferCommenceV1Request senderDltSystem(String senderDltSystem) { + + this.senderDltSystem = senderDltSystem; + return this; + } + + /** + * Get senderDltSystem + * @return senderDltSystem + **/ + @javax.annotation.Nonnull + public String getSenderDltSystem() { + return senderDltSystem; + } + + + public void setSenderDltSystem(String senderDltSystem) { + this.senderDltSystem = senderDltSystem; + } + + + public TransferCommenceV1Request recipientDltSystem(String recipientDltSystem) { + + this.recipientDltSystem = recipientDltSystem; + return this; + } + + /** + * Get recipientDltSystem + * @return recipientDltSystem + **/ + @javax.annotation.Nonnull + public String getRecipientDltSystem() { + return recipientDltSystem; + } + + + public void setRecipientDltSystem(String recipientDltSystem) { + this.recipientDltSystem = recipientDltSystem; + } + + + public TransferCommenceV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public TransferCommenceV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferCommenceV1Request hashAssetProfile(String hashAssetProfile) { + + this.hashAssetProfile = hashAssetProfile; + return this; + } + + /** + * Get hashAssetProfile + * @return hashAssetProfile + **/ + @javax.annotation.Nonnull + public String getHashAssetProfile() { + return hashAssetProfile; + } + + + public void setHashAssetProfile(String hashAssetProfile) { + this.hashAssetProfile = hashAssetProfile; + } + + + public TransferCommenceV1Request assetUnit(Integer assetUnit) { + + this.assetUnit = assetUnit; + return this; + } + + /** + * Get assetUnit + * @return assetUnit + **/ + @javax.annotation.Nullable + public Integer getAssetUnit() { + return assetUnit; + } + + + public void setAssetUnit(Integer assetUnit) { + this.assetUnit = assetUnit; + } + + + public TransferCommenceV1Request hashPrevMessage(String hashPrevMessage) { + + this.hashPrevMessage = hashPrevMessage; + return this; + } + + /** + * Get hashPrevMessage + * @return hashPrevMessage + **/ + @javax.annotation.Nonnull + public String getHashPrevMessage() { + return hashPrevMessage; + } + + + public void setHashPrevMessage(String hashPrevMessage) { + this.hashPrevMessage = hashPrevMessage; + } + + + public TransferCommenceV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public TransferCommenceV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferCommenceV1Request sequenceNumber(Integer sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferCommenceV1Request transferCommenceV1Request = (TransferCommenceV1Request) o; + return Objects.equals(this.sessionID, transferCommenceV1Request.sessionID) && + Objects.equals(this.messageType, transferCommenceV1Request.messageType) && + Objects.equals(this.originatorPubkey, transferCommenceV1Request.originatorPubkey) && + Objects.equals(this.beneficiaryPubkey, transferCommenceV1Request.beneficiaryPubkey) && + Objects.equals(this.senderDltSystem, transferCommenceV1Request.senderDltSystem) && + Objects.equals(this.recipientDltSystem, transferCommenceV1Request.recipientDltSystem) && + Objects.equals(this.clientIdentityPubkey, transferCommenceV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, transferCommenceV1Request.serverIdentityPubkey) && + Objects.equals(this.hashAssetProfile, transferCommenceV1Request.hashAssetProfile) && + Objects.equals(this.assetUnit, transferCommenceV1Request.assetUnit) && + Objects.equals(this.hashPrevMessage, transferCommenceV1Request.hashPrevMessage) && + Objects.equals(this.clientTransferNumber, transferCommenceV1Request.clientTransferNumber) && + Objects.equals(this.signature, transferCommenceV1Request.signature) && + Objects.equals(this.sequenceNumber, transferCommenceV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, originatorPubkey, beneficiaryPubkey, senderDltSystem, recipientDltSystem, clientIdentityPubkey, serverIdentityPubkey, hashAssetProfile, assetUnit, hashPrevMessage, clientTransferNumber, signature, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferCommenceV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" originatorPubkey: ").append(toIndentedString(originatorPubkey)).append("\n"); + sb.append(" beneficiaryPubkey: ").append(toIndentedString(beneficiaryPubkey)).append("\n"); + sb.append(" senderDltSystem: ").append(toIndentedString(senderDltSystem)).append("\n"); + sb.append(" recipientDltSystem: ").append(toIndentedString(recipientDltSystem)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashAssetProfile: ").append(toIndentedString(hashAssetProfile)).append("\n"); + sb.append(" assetUnit: ").append(toIndentedString(assetUnit)).append("\n"); + sb.append(" hashPrevMessage: ").append(toIndentedString(hashPrevMessage)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("originatorPubkey"); + openapiFields.add("beneficiaryPubkey"); + openapiFields.add("senderDltSystem"); + openapiFields.add("recipientDltSystem"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashAssetProfile"); + openapiFields.add("assetUnit"); + openapiFields.add("hashPrevMessage"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("originatorPubkey"); + openapiRequiredFields.add("beneficiaryPubkey"); + openapiRequiredFields.add("senderDltSystem"); + openapiRequiredFields.add("recipientDltSystem"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashAssetProfile"); + openapiRequiredFields.add("hashPrevMessage"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferCommenceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferCommenceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferCommenceV1Request is not found in the empty JSON string", TransferCommenceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferCommenceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferCommenceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferCommenceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("originatorPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originatorPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originatorPubkey").toString())); + } + if (!jsonObj.get("beneficiaryPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `beneficiaryPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("beneficiaryPubkey").toString())); + } + if (!jsonObj.get("senderDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `senderDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("senderDltSystem").toString())); + } + if (!jsonObj.get("recipientDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientDltSystem").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashAssetProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashAssetProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashAssetProfile").toString())); + } + if (!jsonObj.get("hashPrevMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashPrevMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashPrevMessage").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferCommenceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferCommenceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferCommenceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferCommenceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferCommenceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferCommenceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferCommenceV1Request + * @throws IOException if the JSON string is invalid with respect to TransferCommenceV1Request + */ + public static TransferCommenceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferCommenceV1Request.class); + } + + /** + * Convert an instance of TransferCommenceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java new file mode 100644 index 0000000000..2576995e7f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java @@ -0,0 +1,477 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferCommenceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferCommenceV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_COMMENCE_REQUEST = "hashCommenceRequest"; + @SerializedName(SERIALIZED_NAME_HASH_COMMENCE_REQUEST) + private String hashCommenceRequest; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private Integer serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_MESSAGE_HASH = "messageHash"; + @SerializedName(SERIALIZED_NAME_MESSAGE_HASH) + private String messageHash; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public TransferCommenceV1Response() { + } + + public TransferCommenceV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferCommenceV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public TransferCommenceV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferCommenceV1Response hashCommenceRequest(String hashCommenceRequest) { + + this.hashCommenceRequest = hashCommenceRequest; + return this; + } + + /** + * Get hashCommenceRequest + * @return hashCommenceRequest + **/ + @javax.annotation.Nonnull + public String getHashCommenceRequest() { + return hashCommenceRequest; + } + + + public void setHashCommenceRequest(String hashCommenceRequest) { + this.hashCommenceRequest = hashCommenceRequest; + } + + + public TransferCommenceV1Response serverTransferNumber(Integer serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public Integer getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(Integer serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public TransferCommenceV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferCommenceV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferCommenceV1Response messageHash(String messageHash) { + + this.messageHash = messageHash; + return this; + } + + /** + * Get messageHash + * @return messageHash + **/ + @javax.annotation.Nullable + public String getMessageHash() { + return messageHash; + } + + + public void setMessageHash(String messageHash) { + this.messageHash = messageHash; + } + + + public TransferCommenceV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferCommenceV1Response transferCommenceV1Response = (TransferCommenceV1Response) o; + return Objects.equals(this.sessionID, transferCommenceV1Response.sessionID) && + Objects.equals(this.clientIdentityPubkey, transferCommenceV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, transferCommenceV1Response.serverIdentityPubkey) && + Objects.equals(this.hashCommenceRequest, transferCommenceV1Response.hashCommenceRequest) && + Objects.equals(this.serverTransferNumber, transferCommenceV1Response.serverTransferNumber) && + Objects.equals(this.signature, transferCommenceV1Response.signature) && + Objects.equals(this.messageType, transferCommenceV1Response.messageType) && + Objects.equals(this.messageHash, transferCommenceV1Response.messageHash) && + Objects.equals(this.sequenceNumber, transferCommenceV1Response.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, clientIdentityPubkey, serverIdentityPubkey, hashCommenceRequest, serverTransferNumber, signature, messageType, messageHash, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferCommenceV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashCommenceRequest: ").append(toIndentedString(hashCommenceRequest)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" messageHash: ").append(toIndentedString(messageHash)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashCommenceRequest"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("messageType"); + openapiFields.add("messageHash"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashCommenceRequest"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferCommenceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferCommenceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferCommenceV1Response is not found in the empty JSON string", TransferCommenceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferCommenceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferCommenceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferCommenceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashCommenceRequest").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommenceRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommenceRequest").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if ((jsonObj.get("messageHash") != null && !jsonObj.get("messageHash").isJsonNull()) && !jsonObj.get("messageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferCommenceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferCommenceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferCommenceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferCommenceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferCommenceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferCommenceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferCommenceV1Response + * @throws IOException if the JSON string is invalid with respect to TransferCommenceV1Response + */ + public static TransferCommenceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferCommenceV1Response.class); + } + + /** + * Convert an instance of TransferCommenceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java new file mode 100644 index 0000000000..e48439375d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java @@ -0,0 +1,478 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferCompleteV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferCompleteV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_COMMIT_FINAL_ACK = "hashCommitFinalAck"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_FINAL_ACK) + private String hashCommitFinalAck; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_HASH_TRANSFER_COMMENCE = "hashTransferCommence"; + @SerializedName(SERIALIZED_NAME_HASH_TRANSFER_COMMENCE) + private String hashTransferCommence; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public TransferCompleteV1Request() { + } + + public TransferCompleteV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferCompleteV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferCompleteV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public TransferCompleteV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferCompleteV1Request hashCommitFinalAck(String hashCommitFinalAck) { + + this.hashCommitFinalAck = hashCommitFinalAck; + return this; + } + + /** + * Get hashCommitFinalAck + * @return hashCommitFinalAck + **/ + @javax.annotation.Nonnull + public String getHashCommitFinalAck() { + return hashCommitFinalAck; + } + + + public void setHashCommitFinalAck(String hashCommitFinalAck) { + this.hashCommitFinalAck = hashCommitFinalAck; + } + + + public TransferCompleteV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public TransferCompleteV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferCompleteV1Request hashTransferCommence(String hashTransferCommence) { + + this.hashTransferCommence = hashTransferCommence; + return this; + } + + /** + * Get hashTransferCommence + * @return hashTransferCommence + **/ + @javax.annotation.Nonnull + public String getHashTransferCommence() { + return hashTransferCommence; + } + + + public void setHashTransferCommence(String hashTransferCommence) { + this.hashTransferCommence = hashTransferCommence; + } + + + public TransferCompleteV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferCompleteV1Request transferCompleteV1Request = (TransferCompleteV1Request) o; + return Objects.equals(this.sessionID, transferCompleteV1Request.sessionID) && + Objects.equals(this.messageType, transferCompleteV1Request.messageType) && + Objects.equals(this.clientIdentityPubkey, transferCompleteV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, transferCompleteV1Request.serverIdentityPubkey) && + Objects.equals(this.hashCommitFinalAck, transferCompleteV1Request.hashCommitFinalAck) && + Objects.equals(this.clientTransferNumber, transferCompleteV1Request.clientTransferNumber) && + Objects.equals(this.signature, transferCompleteV1Request.signature) && + Objects.equals(this.hashTransferCommence, transferCompleteV1Request.hashTransferCommence) && + Objects.equals(this.sequenceNumber, transferCompleteV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, hashCommitFinalAck, clientTransferNumber, signature, hashTransferCommence, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferCompleteV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashCommitFinalAck: ").append(toIndentedString(hashCommitFinalAck)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" hashTransferCommence: ").append(toIndentedString(hashTransferCommence)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashCommitFinalAck"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("hashTransferCommence"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashCommitFinalAck"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("hashTransferCommence"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferCompleteV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferCompleteV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferCompleteV1Request is not found in the empty JSON string", TransferCompleteV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferCompleteV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferCompleteV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferCompleteV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashCommitFinalAck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitFinalAck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitFinalAck").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("hashTransferCommence").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashTransferCommence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashTransferCommence").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferCompleteV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferCompleteV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferCompleteV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferCompleteV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferCompleteV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferCompleteV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferCompleteV1Request + * @throws IOException if the JSON string is invalid with respect to TransferCompleteV1Request + */ + public static TransferCompleteV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferCompleteV1Request.class); + } + + /** + * Convert an instance of TransferCompleteV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java new file mode 100644 index 0000000000..2f1e9598d2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java @@ -0,0 +1,1232 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CredentialProfile; +import org.openapitools.client.model.History; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferInitializationV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferInitializationV1Request { + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_DEVELOPER_U_R_N = "developerURN"; + @SerializedName(SERIALIZED_NAME_DEVELOPER_U_R_N) + private String developerURN; + + public static final String SERIALIZED_NAME_CREDENTIAL_PROFILE = "credentialProfile"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_PROFILE) + private CredentialProfile credentialProfile; + + public static final String SERIALIZED_NAME_PAYLOAD_PROFILE = "payloadProfile"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_PROFILE) + private PayloadProfile payloadProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "applicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private String applicationProfile; + + public static final String SERIALIZED_NAME_LOGGING_PROFILE = "loggingProfile"; + @SerializedName(SERIALIZED_NAME_LOGGING_PROFILE) + private String loggingProfile; + + public static final String SERIALIZED_NAME_ACCESS_CONTROL_PROFILE = "accessControlProfile"; + @SerializedName(SERIALIZED_NAME_ACCESS_CONTROL_PROFILE) + private String accessControlProfile; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY = "sourceGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY) + private String sourceGatewayPubkey; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM = "sourceGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM) + private String sourceGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY = "recipientGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY) + private String recipientGatewayPubkey; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM = "recipientGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM) + private String recipientGatewayDltSystem; + + /** + * Gets or Sets escrowType + */ + @JsonAdapter(EscrowTypeEnum.Adapter.class) + public enum EscrowTypeEnum { + FAUCET("FAUCET"), + + TIMELOCK("TIMELOCK"), + + HASHLOCK("HASHLOCK"), + + HASHTIMELOCK("HASHTIMELOCK"), + + MULTICLAIMPC("MULTICLAIMPC"), + + DESTROY("DESTROY"), + + BURN("BURN"); + + private String value; + + EscrowTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EscrowTypeEnum fromValue(String value) { + for (EscrowTypeEnum b : EscrowTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EscrowTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EscrowTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EscrowTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ESCROW_TYPE = "escrowType"; + @SerializedName(SERIALIZED_NAME_ESCROW_TYPE) + private EscrowTypeEnum escrowType; + + public static final String SERIALIZED_NAME_EXPIRY_TIME = "expiryTime"; + @SerializedName(SERIALIZED_NAME_EXPIRY_TIME) + private String expiryTime; + + public static final String SERIALIZED_NAME_MULTIPLE_CLAIMS_ALLOWED = "multipleClaimsAllowed"; + @SerializedName(SERIALIZED_NAME_MULTIPLE_CLAIMS_ALLOWED) + private Boolean multipleClaimsAllowed; + + public static final String SERIALIZED_NAME_MULTIPLE_CANCELS_ALLOWED = "multipleCancelsAllowed"; + @SerializedName(SERIALIZED_NAME_MULTIPLE_CANCELS_ALLOWED) + private Boolean multipleCancelsAllowed; + + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private Object permissions; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + @SerializedName(SERIALIZED_NAME_DESTINATION) + private String destination; + + public static final String SERIALIZED_NAME_SUBSEQUENT_CALLS = "subsequentCalls"; + @SerializedName(SERIALIZED_NAME_SUBSEQUENT_CALLS) + private Object subsequentCalls; + + public static final String SERIALIZED_NAME_HISTORIES = "histories"; + @SerializedName(SERIALIZED_NAME_HISTORIES) + private List histories; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private Integer sequenceNumber; + + public static final String SERIALIZED_NAME_SOURCE_BASE_PATH = "sourceBasePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_BASE_PATH) + private String sourceBasePath; + + public static final String SERIALIZED_NAME_RECIPIENT_BASE_PATH = "recipientBasePath"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_BASE_PATH) + private String recipientBasePath; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private BigDecimal maxRetries; + + public static final String SERIALIZED_NAME_MAX_TIMEOUT = "maxTimeout"; + @SerializedName(SERIALIZED_NAME_MAX_TIMEOUT) + private BigDecimal maxTimeout; + + public static final String SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED = "backupGatewaysAllowed"; + @SerializedName(SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED) + private List backupGatewaysAllowed = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D = "recipientLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D) + private String recipientLedgerAssetID; + + public static final String SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D = "sourceLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D) + private String sourceLedgerAssetID; + + public TransferInitializationV1Request() { + } + + public TransferInitializationV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferInitializationV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferInitializationV1Request version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public TransferInitializationV1Request developerURN(String developerURN) { + + this.developerURN = developerURN; + return this; + } + + /** + * Get developerURN + * @return developerURN + **/ + @javax.annotation.Nullable + public String getDeveloperURN() { + return developerURN; + } + + + public void setDeveloperURN(String developerURN) { + this.developerURN = developerURN; + } + + + public TransferInitializationV1Request credentialProfile(CredentialProfile credentialProfile) { + + this.credentialProfile = credentialProfile; + return this; + } + + /** + * Get credentialProfile + * @return credentialProfile + **/ + @javax.annotation.Nullable + public CredentialProfile getCredentialProfile() { + return credentialProfile; + } + + + public void setCredentialProfile(CredentialProfile credentialProfile) { + this.credentialProfile = credentialProfile; + } + + + public TransferInitializationV1Request payloadProfile(PayloadProfile payloadProfile) { + + this.payloadProfile = payloadProfile; + return this; + } + + /** + * Get payloadProfile + * @return payloadProfile + **/ + @javax.annotation.Nonnull + public PayloadProfile getPayloadProfile() { + return payloadProfile; + } + + + public void setPayloadProfile(PayloadProfile payloadProfile) { + this.payloadProfile = payloadProfile; + } + + + public TransferInitializationV1Request applicationProfile(String applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nonnull + public String getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(String applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public TransferInitializationV1Request loggingProfile(String loggingProfile) { + + this.loggingProfile = loggingProfile; + return this; + } + + /** + * Get loggingProfile + * @return loggingProfile + **/ + @javax.annotation.Nonnull + public String getLoggingProfile() { + return loggingProfile; + } + + + public void setLoggingProfile(String loggingProfile) { + this.loggingProfile = loggingProfile; + } + + + public TransferInitializationV1Request accessControlProfile(String accessControlProfile) { + + this.accessControlProfile = accessControlProfile; + return this; + } + + /** + * Get accessControlProfile + * @return accessControlProfile + **/ + @javax.annotation.Nonnull + public String getAccessControlProfile() { + return accessControlProfile; + } + + + public void setAccessControlProfile(String accessControlProfile) { + this.accessControlProfile = accessControlProfile; + } + + + public TransferInitializationV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferInitializationV1Request sourceGatewayPubkey(String sourceGatewayPubkey) { + + this.sourceGatewayPubkey = sourceGatewayPubkey; + return this; + } + + /** + * Get sourceGatewayPubkey + * @return sourceGatewayPubkey + **/ + @javax.annotation.Nonnull + public String getSourceGatewayPubkey() { + return sourceGatewayPubkey; + } + + + public void setSourceGatewayPubkey(String sourceGatewayPubkey) { + this.sourceGatewayPubkey = sourceGatewayPubkey; + } + + + public TransferInitializationV1Request sourceGatewayDltSystem(String sourceGatewayDltSystem) { + + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + return this; + } + + /** + * Get sourceGatewayDltSystem + * @return sourceGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getSourceGatewayDltSystem() { + return sourceGatewayDltSystem; + } + + + public void setSourceGatewayDltSystem(String sourceGatewayDltSystem) { + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + } + + + public TransferInitializationV1Request recipientGatewayPubkey(String recipientGatewayPubkey) { + + this.recipientGatewayPubkey = recipientGatewayPubkey; + return this; + } + + /** + * Get recipientGatewayPubkey + * @return recipientGatewayPubkey + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayPubkey() { + return recipientGatewayPubkey; + } + + + public void setRecipientGatewayPubkey(String recipientGatewayPubkey) { + this.recipientGatewayPubkey = recipientGatewayPubkey; + } + + + public TransferInitializationV1Request recipientGatewayDltSystem(String recipientGatewayDltSystem) { + + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + return this; + } + + /** + * Get recipientGatewayDltSystem + * @return recipientGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayDltSystem() { + return recipientGatewayDltSystem; + } + + + public void setRecipientGatewayDltSystem(String recipientGatewayDltSystem) { + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + } + + + public TransferInitializationV1Request escrowType(EscrowTypeEnum escrowType) { + + this.escrowType = escrowType; + return this; + } + + /** + * Get escrowType + * @return escrowType + **/ + @javax.annotation.Nullable + public EscrowTypeEnum getEscrowType() { + return escrowType; + } + + + public void setEscrowType(EscrowTypeEnum escrowType) { + this.escrowType = escrowType; + } + + + public TransferInitializationV1Request expiryTime(String expiryTime) { + + this.expiryTime = expiryTime; + return this; + } + + /** + * Get expiryTime + * @return expiryTime + **/ + @javax.annotation.Nullable + public String getExpiryTime() { + return expiryTime; + } + + + public void setExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + } + + + public TransferInitializationV1Request multipleClaimsAllowed(Boolean multipleClaimsAllowed) { + + this.multipleClaimsAllowed = multipleClaimsAllowed; + return this; + } + + /** + * Get multipleClaimsAllowed + * @return multipleClaimsAllowed + **/ + @javax.annotation.Nullable + public Boolean getMultipleClaimsAllowed() { + return multipleClaimsAllowed; + } + + + public void setMultipleClaimsAllowed(Boolean multipleClaimsAllowed) { + this.multipleClaimsAllowed = multipleClaimsAllowed; + } + + + public TransferInitializationV1Request multipleCancelsAllowed(Boolean multipleCancelsAllowed) { + + this.multipleCancelsAllowed = multipleCancelsAllowed; + return this; + } + + /** + * Get multipleCancelsAllowed + * @return multipleCancelsAllowed + **/ + @javax.annotation.Nullable + public Boolean getMultipleCancelsAllowed() { + return multipleCancelsAllowed; + } + + + public void setMultipleCancelsAllowed(Boolean multipleCancelsAllowed) { + this.multipleCancelsAllowed = multipleCancelsAllowed; + } + + + public TransferInitializationV1Request permissions(Object permissions) { + + this.permissions = permissions; + return this; + } + + /** + * Get permissions + * @return permissions + **/ + @javax.annotation.Nullable + public Object getPermissions() { + return permissions; + } + + + public void setPermissions(Object permissions) { + this.permissions = permissions; + } + + + public TransferInitializationV1Request origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public TransferInitializationV1Request destination(String destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + + public TransferInitializationV1Request subsequentCalls(Object subsequentCalls) { + + this.subsequentCalls = subsequentCalls; + return this; + } + + /** + * Get subsequentCalls + * @return subsequentCalls + **/ + @javax.annotation.Nullable + public Object getSubsequentCalls() { + return subsequentCalls; + } + + + public void setSubsequentCalls(Object subsequentCalls) { + this.subsequentCalls = subsequentCalls; + } + + + public TransferInitializationV1Request histories(List histories) { + + this.histories = histories; + return this; + } + + public TransferInitializationV1Request addHistoriesItem(History historiesItem) { + if (this.histories == null) { + this.histories = new ArrayList<>(); + } + this.histories.add(historiesItem); + return this; + } + + /** + * Get histories + * @return histories + **/ + @javax.annotation.Nullable + public List getHistories() { + return histories; + } + + + public void setHistories(List histories) { + this.histories = histories; + } + + + public TransferInitializationV1Request sequenceNumber(Integer sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public TransferInitializationV1Request sourceBasePath(String sourceBasePath) { + + this.sourceBasePath = sourceBasePath; + return this; + } + + /** + * Get sourceBasePath + * @return sourceBasePath + **/ + @javax.annotation.Nonnull + public String getSourceBasePath() { + return sourceBasePath; + } + + + public void setSourceBasePath(String sourceBasePath) { + this.sourceBasePath = sourceBasePath; + } + + + public TransferInitializationV1Request recipientBasePath(String recipientBasePath) { + + this.recipientBasePath = recipientBasePath; + return this; + } + + /** + * Get recipientBasePath + * @return recipientBasePath + **/ + @javax.annotation.Nonnull + public String getRecipientBasePath() { + return recipientBasePath; + } + + + public void setRecipientBasePath(String recipientBasePath) { + this.recipientBasePath = recipientBasePath; + } + + + public TransferInitializationV1Request maxRetries(BigDecimal maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Get maxRetries + * @return maxRetries + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxRetries() { + return maxRetries; + } + + + public void setMaxRetries(BigDecimal maxRetries) { + this.maxRetries = maxRetries; + } + + + public TransferInitializationV1Request maxTimeout(BigDecimal maxTimeout) { + + this.maxTimeout = maxTimeout; + return this; + } + + /** + * Get maxTimeout + * @return maxTimeout + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxTimeout() { + return maxTimeout; + } + + + public void setMaxTimeout(BigDecimal maxTimeout) { + this.maxTimeout = maxTimeout; + } + + + public TransferInitializationV1Request backupGatewaysAllowed(List backupGatewaysAllowed) { + + this.backupGatewaysAllowed = backupGatewaysAllowed; + return this; + } + + public TransferInitializationV1Request addBackupGatewaysAllowedItem(String backupGatewaysAllowedItem) { + if (this.backupGatewaysAllowed == null) { + this.backupGatewaysAllowed = new ArrayList<>(); + } + this.backupGatewaysAllowed.add(backupGatewaysAllowedItem); + return this; + } + + /** + * Get backupGatewaysAllowed + * @return backupGatewaysAllowed + **/ + @javax.annotation.Nonnull + public List getBackupGatewaysAllowed() { + return backupGatewaysAllowed; + } + + + public void setBackupGatewaysAllowed(List backupGatewaysAllowed) { + this.backupGatewaysAllowed = backupGatewaysAllowed; + } + + + public TransferInitializationV1Request recipientLedgerAssetID(String recipientLedgerAssetID) { + + this.recipientLedgerAssetID = recipientLedgerAssetID; + return this; + } + + /** + * Get recipientLedgerAssetID + * @return recipientLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getRecipientLedgerAssetID() { + return recipientLedgerAssetID; + } + + + public void setRecipientLedgerAssetID(String recipientLedgerAssetID) { + this.recipientLedgerAssetID = recipientLedgerAssetID; + } + + + public TransferInitializationV1Request sourceLedgerAssetID(String sourceLedgerAssetID) { + + this.sourceLedgerAssetID = sourceLedgerAssetID; + return this; + } + + /** + * Get sourceLedgerAssetID + * @return sourceLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getSourceLedgerAssetID() { + return sourceLedgerAssetID; + } + + + public void setSourceLedgerAssetID(String sourceLedgerAssetID) { + this.sourceLedgerAssetID = sourceLedgerAssetID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferInitializationV1Request transferInitializationV1Request = (TransferInitializationV1Request) o; + return Objects.equals(this.messageType, transferInitializationV1Request.messageType) && + Objects.equals(this.sessionID, transferInitializationV1Request.sessionID) && + Objects.equals(this.version, transferInitializationV1Request.version) && + Objects.equals(this.developerURN, transferInitializationV1Request.developerURN) && + Objects.equals(this.credentialProfile, transferInitializationV1Request.credentialProfile) && + Objects.equals(this.payloadProfile, transferInitializationV1Request.payloadProfile) && + Objects.equals(this.applicationProfile, transferInitializationV1Request.applicationProfile) && + Objects.equals(this.loggingProfile, transferInitializationV1Request.loggingProfile) && + Objects.equals(this.accessControlProfile, transferInitializationV1Request.accessControlProfile) && + Objects.equals(this.signature, transferInitializationV1Request.signature) && + Objects.equals(this.sourceGatewayPubkey, transferInitializationV1Request.sourceGatewayPubkey) && + Objects.equals(this.sourceGatewayDltSystem, transferInitializationV1Request.sourceGatewayDltSystem) && + Objects.equals(this.recipientGatewayPubkey, transferInitializationV1Request.recipientGatewayPubkey) && + Objects.equals(this.recipientGatewayDltSystem, transferInitializationV1Request.recipientGatewayDltSystem) && + Objects.equals(this.escrowType, transferInitializationV1Request.escrowType) && + Objects.equals(this.expiryTime, transferInitializationV1Request.expiryTime) && + Objects.equals(this.multipleClaimsAllowed, transferInitializationV1Request.multipleClaimsAllowed) && + Objects.equals(this.multipleCancelsAllowed, transferInitializationV1Request.multipleCancelsAllowed) && + Objects.equals(this.permissions, transferInitializationV1Request.permissions) && + Objects.equals(this.origin, transferInitializationV1Request.origin) && + Objects.equals(this.destination, transferInitializationV1Request.destination) && + Objects.equals(this.subsequentCalls, transferInitializationV1Request.subsequentCalls) && + Objects.equals(this.histories, transferInitializationV1Request.histories) && + Objects.equals(this.sequenceNumber, transferInitializationV1Request.sequenceNumber) && + Objects.equals(this.sourceBasePath, transferInitializationV1Request.sourceBasePath) && + Objects.equals(this.recipientBasePath, transferInitializationV1Request.recipientBasePath) && + Objects.equals(this.maxRetries, transferInitializationV1Request.maxRetries) && + Objects.equals(this.maxTimeout, transferInitializationV1Request.maxTimeout) && + Objects.equals(this.backupGatewaysAllowed, transferInitializationV1Request.backupGatewaysAllowed) && + Objects.equals(this.recipientLedgerAssetID, transferInitializationV1Request.recipientLedgerAssetID) && + Objects.equals(this.sourceLedgerAssetID, transferInitializationV1Request.sourceLedgerAssetID); + } + + @Override + public int hashCode() { + return Objects.hash(messageType, sessionID, version, developerURN, credentialProfile, payloadProfile, applicationProfile, loggingProfile, accessControlProfile, signature, sourceGatewayPubkey, sourceGatewayDltSystem, recipientGatewayPubkey, recipientGatewayDltSystem, escrowType, expiryTime, multipleClaimsAllowed, multipleCancelsAllowed, permissions, origin, destination, subsequentCalls, histories, sequenceNumber, sourceBasePath, recipientBasePath, maxRetries, maxTimeout, backupGatewaysAllowed, recipientLedgerAssetID, sourceLedgerAssetID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferInitializationV1Request {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" developerURN: ").append(toIndentedString(developerURN)).append("\n"); + sb.append(" credentialProfile: ").append(toIndentedString(credentialProfile)).append("\n"); + sb.append(" payloadProfile: ").append(toIndentedString(payloadProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" loggingProfile: ").append(toIndentedString(loggingProfile)).append("\n"); + sb.append(" accessControlProfile: ").append(toIndentedString(accessControlProfile)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sourceGatewayPubkey: ").append(toIndentedString(sourceGatewayPubkey)).append("\n"); + sb.append(" sourceGatewayDltSystem: ").append(toIndentedString(sourceGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayPubkey: ").append(toIndentedString(recipientGatewayPubkey)).append("\n"); + sb.append(" recipientGatewayDltSystem: ").append(toIndentedString(recipientGatewayDltSystem)).append("\n"); + sb.append(" escrowType: ").append(toIndentedString(escrowType)).append("\n"); + sb.append(" expiryTime: ").append(toIndentedString(expiryTime)).append("\n"); + sb.append(" multipleClaimsAllowed: ").append(toIndentedString(multipleClaimsAllowed)).append("\n"); + sb.append(" multipleCancelsAllowed: ").append(toIndentedString(multipleCancelsAllowed)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" subsequentCalls: ").append(toIndentedString(subsequentCalls)).append("\n"); + sb.append(" histories: ").append(toIndentedString(histories)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" sourceBasePath: ").append(toIndentedString(sourceBasePath)).append("\n"); + sb.append(" recipientBasePath: ").append(toIndentedString(recipientBasePath)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" maxTimeout: ").append(toIndentedString(maxTimeout)).append("\n"); + sb.append(" backupGatewaysAllowed: ").append(toIndentedString(backupGatewaysAllowed)).append("\n"); + sb.append(" recipientLedgerAssetID: ").append(toIndentedString(recipientLedgerAssetID)).append("\n"); + sb.append(" sourceLedgerAssetID: ").append(toIndentedString(sourceLedgerAssetID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("messageType"); + openapiFields.add("sessionID"); + openapiFields.add("version"); + openapiFields.add("developerURN"); + openapiFields.add("credentialProfile"); + openapiFields.add("payloadProfile"); + openapiFields.add("applicationProfile"); + openapiFields.add("loggingProfile"); + openapiFields.add("accessControlProfile"); + openapiFields.add("signature"); + openapiFields.add("sourceGatewayPubkey"); + openapiFields.add("sourceGatewayDltSystem"); + openapiFields.add("recipientGatewayPubkey"); + openapiFields.add("recipientGatewayDltSystem"); + openapiFields.add("escrowType"); + openapiFields.add("expiryTime"); + openapiFields.add("multipleClaimsAllowed"); + openapiFields.add("multipleCancelsAllowed"); + openapiFields.add("permissions"); + openapiFields.add("origin"); + openapiFields.add("destination"); + openapiFields.add("subsequentCalls"); + openapiFields.add("histories"); + openapiFields.add("sequenceNumber"); + openapiFields.add("sourceBasePath"); + openapiFields.add("recipientBasePath"); + openapiFields.add("maxRetries"); + openapiFields.add("maxTimeout"); + openapiFields.add("backupGatewaysAllowed"); + openapiFields.add("recipientLedgerAssetID"); + openapiFields.add("sourceLedgerAssetID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("payloadProfile"); + openapiRequiredFields.add("applicationProfile"); + openapiRequiredFields.add("loggingProfile"); + openapiRequiredFields.add("accessControlProfile"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sourceGatewayPubkey"); + openapiRequiredFields.add("sourceGatewayDltSystem"); + openapiRequiredFields.add("recipientGatewayPubkey"); + openapiRequiredFields.add("recipientGatewayDltSystem"); + openapiRequiredFields.add("sequenceNumber"); + openapiRequiredFields.add("sourceBasePath"); + openapiRequiredFields.add("recipientBasePath"); + openapiRequiredFields.add("maxRetries"); + openapiRequiredFields.add("maxTimeout"); + openapiRequiredFields.add("backupGatewaysAllowed"); + openapiRequiredFields.add("recipientLedgerAssetID"); + openapiRequiredFields.add("sourceLedgerAssetID"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferInitializationV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferInitializationV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferInitializationV1Request is not found in the empty JSON string", TransferInitializationV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferInitializationV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInitializationV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferInitializationV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("developerURN") != null && !jsonObj.get("developerURN").isJsonNull()) && !jsonObj.get("developerURN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `developerURN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("developerURN").toString())); + } + // validate the required field `payloadProfile` + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("payloadProfile")); + if (!jsonObj.get("applicationProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationProfile").toString())); + } + if (!jsonObj.get("loggingProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loggingProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loggingProfile").toString())); + } + if (!jsonObj.get("accessControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accessControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessControlProfile").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("sourceGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayPubkey").toString())); + } + if (!jsonObj.get("sourceGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayDltSystem").toString())); + } + if (!jsonObj.get("recipientGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayPubkey").toString())); + } + if (!jsonObj.get("recipientGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayDltSystem").toString())); + } + if ((jsonObj.get("escrowType") != null && !jsonObj.get("escrowType").isJsonNull()) && !jsonObj.get("escrowType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `escrowType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("escrowType").toString())); + } + if ((jsonObj.get("expiryTime") != null && !jsonObj.get("expiryTime").isJsonNull()) && !jsonObj.get("expiryTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expiryTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryTime").toString())); + } + if ((jsonObj.get("origin") != null && !jsonObj.get("origin").isJsonNull()) && !jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if ((jsonObj.get("destination") != null && !jsonObj.get("destination").isJsonNull()) && !jsonObj.get("destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination").toString())); + } + if (jsonObj.get("histories") != null && !jsonObj.get("histories").isJsonNull()) { + JsonArray jsonArrayhistories = jsonObj.getAsJsonArray("histories"); + if (jsonArrayhistories != null) { + // ensure the json data is an array + if (!jsonObj.get("histories").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `histories` to be an array in the JSON string but got `%s`", jsonObj.get("histories").toString())); + } + + // validate the optional field `histories` (array) + for (int i = 0; i < jsonArrayhistories.size(); i++) { + History.validateJsonObject(jsonArrayhistories.get(i).getAsJsonObject()); + }; + } + } + if (!jsonObj.get("sourceBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceBasePath").toString())); + } + if (!jsonObj.get("recipientBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientBasePath").toString())); + } + // ensure the required json array is present + if (jsonObj.get("backupGatewaysAllowed") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("backupGatewaysAllowed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `backupGatewaysAllowed` to be an array in the JSON string but got `%s`", jsonObj.get("backupGatewaysAllowed").toString())); + } + if (!jsonObj.get("recipientLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientLedgerAssetID").toString())); + } + if (!jsonObj.get("sourceLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceLedgerAssetID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferInitializationV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferInitializationV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferInitializationV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferInitializationV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferInitializationV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferInitializationV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferInitializationV1Request + * @throws IOException if the JSON string is invalid with respect to TransferInitializationV1Request + */ + public static TransferInitializationV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferInitializationV1Request.class); + } + + /** + * Convert an instance of TransferInitializationV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java new file mode 100644 index 0000000000..37319179df --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java @@ -0,0 +1,594 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferInitializationV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferInitializationV1Response { + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + /** + * Gets or Sets odapPhase + */ + @JsonAdapter(OdapPhaseEnum.Adapter.class) + public enum OdapPhaseEnum { + TRANSFERINITIALIZATION("TransferInitialization"), + + LOCKEVIDENCEVERIFICATION("LockEvidenceVerification"), + + COMMITMENTESTABLISHMENT("CommitmentEstablishment"); + + private String value; + + OdapPhaseEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OdapPhaseEnum fromValue(String value) { + for (OdapPhaseEnum b : OdapPhaseEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OdapPhaseEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OdapPhaseEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OdapPhaseEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ODAP_PHASE = "odapPhase"; + @SerializedName(SERIALIZED_NAME_ODAP_PHASE) + private OdapPhaseEnum odapPhase; + + public static final String SERIALIZED_NAME_INITIAL_REQUEST_MESSAGE_HASH = "initialRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_INITIAL_REQUEST_MESSAGE_HASH) + private String initialRequestMessageHash; + + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + @SerializedName(SERIALIZED_NAME_DESTINATION) + private String destination; + + public static final String SERIALIZED_NAME_TIME_STAMP = "timeStamp"; + @SerializedName(SERIALIZED_NAME_TIME_STAMP) + private String timeStamp; + + public static final String SERIALIZED_NAME_PROCESSED_TIME_STAMP = "processedTimeStamp"; + @SerializedName(SERIALIZED_NAME_PROCESSED_TIME_STAMP) + private String processedTimeStamp; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED = "backupGatewaysAllowed"; + @SerializedName(SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED) + private List backupGatewaysAllowed = new ArrayList<>(); + + public TransferInitializationV1Response() { + } + + public TransferInitializationV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferInitializationV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferInitializationV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public TransferInitializationV1Response odapPhase(OdapPhaseEnum odapPhase) { + + this.odapPhase = odapPhase; + return this; + } + + /** + * Get odapPhase + * @return odapPhase + **/ + @javax.annotation.Nullable + public OdapPhaseEnum getOdapPhase() { + return odapPhase; + } + + + public void setOdapPhase(OdapPhaseEnum odapPhase) { + this.odapPhase = odapPhase; + } + + + public TransferInitializationV1Response initialRequestMessageHash(String initialRequestMessageHash) { + + this.initialRequestMessageHash = initialRequestMessageHash; + return this; + } + + /** + * Get initialRequestMessageHash + * @return initialRequestMessageHash + **/ + @javax.annotation.Nonnull + public String getInitialRequestMessageHash() { + return initialRequestMessageHash; + } + + + public void setInitialRequestMessageHash(String initialRequestMessageHash) { + this.initialRequestMessageHash = initialRequestMessageHash; + } + + + public TransferInitializationV1Response destination(String destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + + public TransferInitializationV1Response timeStamp(String timeStamp) { + + this.timeStamp = timeStamp; + return this; + } + + /** + * Get timeStamp + * @return timeStamp + **/ + @javax.annotation.Nonnull + public String getTimeStamp() { + return timeStamp; + } + + + public void setTimeStamp(String timeStamp) { + this.timeStamp = timeStamp; + } + + + public TransferInitializationV1Response processedTimeStamp(String processedTimeStamp) { + + this.processedTimeStamp = processedTimeStamp; + return this; + } + + /** + * Get processedTimeStamp + * @return processedTimeStamp + **/ + @javax.annotation.Nonnull + public String getProcessedTimeStamp() { + return processedTimeStamp; + } + + + public void setProcessedTimeStamp(String processedTimeStamp) { + this.processedTimeStamp = processedTimeStamp; + } + + + public TransferInitializationV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferInitializationV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferInitializationV1Response backupGatewaysAllowed(List backupGatewaysAllowed) { + + this.backupGatewaysAllowed = backupGatewaysAllowed; + return this; + } + + public TransferInitializationV1Response addBackupGatewaysAllowedItem(String backupGatewaysAllowedItem) { + if (this.backupGatewaysAllowed == null) { + this.backupGatewaysAllowed = new ArrayList<>(); + } + this.backupGatewaysAllowed.add(backupGatewaysAllowedItem); + return this; + } + + /** + * Get backupGatewaysAllowed + * @return backupGatewaysAllowed + **/ + @javax.annotation.Nonnull + public List getBackupGatewaysAllowed() { + return backupGatewaysAllowed; + } + + + public void setBackupGatewaysAllowed(List backupGatewaysAllowed) { + this.backupGatewaysAllowed = backupGatewaysAllowed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferInitializationV1Response transferInitializationV1Response = (TransferInitializationV1Response) o; + return Objects.equals(this.messageType, transferInitializationV1Response.messageType) && + Objects.equals(this.sessionID, transferInitializationV1Response.sessionID) && + Objects.equals(this.sequenceNumber, transferInitializationV1Response.sequenceNumber) && + Objects.equals(this.odapPhase, transferInitializationV1Response.odapPhase) && + Objects.equals(this.initialRequestMessageHash, transferInitializationV1Response.initialRequestMessageHash) && + Objects.equals(this.destination, transferInitializationV1Response.destination) && + Objects.equals(this.timeStamp, transferInitializationV1Response.timeStamp) && + Objects.equals(this.processedTimeStamp, transferInitializationV1Response.processedTimeStamp) && + Objects.equals(this.serverIdentityPubkey, transferInitializationV1Response.serverIdentityPubkey) && + Objects.equals(this.signature, transferInitializationV1Response.signature) && + Objects.equals(this.backupGatewaysAllowed, transferInitializationV1Response.backupGatewaysAllowed); + } + + @Override + public int hashCode() { + return Objects.hash(messageType, sessionID, sequenceNumber, odapPhase, initialRequestMessageHash, destination, timeStamp, processedTimeStamp, serverIdentityPubkey, signature, backupGatewaysAllowed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferInitializationV1Response {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" odapPhase: ").append(toIndentedString(odapPhase)).append("\n"); + sb.append(" initialRequestMessageHash: ").append(toIndentedString(initialRequestMessageHash)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" timeStamp: ").append(toIndentedString(timeStamp)).append("\n"); + sb.append(" processedTimeStamp: ").append(toIndentedString(processedTimeStamp)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" backupGatewaysAllowed: ").append(toIndentedString(backupGatewaysAllowed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("messageType"); + openapiFields.add("sessionID"); + openapiFields.add("sequenceNumber"); + openapiFields.add("odapPhase"); + openapiFields.add("initialRequestMessageHash"); + openapiFields.add("destination"); + openapiFields.add("timeStamp"); + openapiFields.add("processedTimeStamp"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("signature"); + openapiFields.add("backupGatewaysAllowed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("sequenceNumber"); + openapiRequiredFields.add("initialRequestMessageHash"); + openapiRequiredFields.add("timeStamp"); + openapiRequiredFields.add("processedTimeStamp"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("backupGatewaysAllowed"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferInitializationV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferInitializationV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferInitializationV1Response is not found in the empty JSON string", TransferInitializationV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferInitializationV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInitializationV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferInitializationV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if ((jsonObj.get("odapPhase") != null && !jsonObj.get("odapPhase").isJsonNull()) && !jsonObj.get("odapPhase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `odapPhase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("odapPhase").toString())); + } + if (!jsonObj.get("initialRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initialRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initialRequestMessageHash").toString())); + } + if ((jsonObj.get("destination") != null && !jsonObj.get("destination").isJsonNull()) && !jsonObj.get("destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination").toString())); + } + if (!jsonObj.get("timeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeStamp").toString())); + } + if (!jsonObj.get("processedTimeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processedTimeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processedTimeStamp").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + // ensure the required json array is present + if (jsonObj.get("backupGatewaysAllowed") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("backupGatewaysAllowed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `backupGatewaysAllowed` to be an array in the JSON string but got `%s`", jsonObj.get("backupGatewaysAllowed").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferInitializationV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferInitializationV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferInitializationV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferInitializationV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferInitializationV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferInitializationV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferInitializationV1Response + * @throws IOException if the JSON string is invalid with respect to TransferInitializationV1Response + */ + public static TransferInitializationV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferInitializationV1Response.class); + } + + /** + * Convert an instance of TransferInitializationV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..5bbbeee650 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,267 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.ClientV1Request; +import org.openapitools.client.model.CommitFinalV1Request; +import org.openapitools.client.model.CommitFinalV1Response; +import org.openapitools.client.model.CommitPreparationV1Request; +import org.openapitools.client.model.CommitPreparationV1Response; +import org.openapitools.client.model.LockEvidenceV1Request; +import org.openapitools.client.model.LockEvidenceV1Response; +import org.openapitools.client.model.RecoverSuccessV1Message; +import org.openapitools.client.model.RecoverUpdateAckV1Message; +import org.openapitools.client.model.RecoverUpdateV1Message; +import org.openapitools.client.model.RecoverV1Message; +import org.openapitools.client.model.RollbackAckV1Message; +import org.openapitools.client.model.RollbackV1Message; +import org.openapitools.client.model.TransferCommenceV1Request; +import org.openapitools.client.model.TransferCommenceV1Response; +import org.openapitools.client.model.TransferCompleteV1Request; +import org.openapitools.client.model.TransferInitializationV1Request; +import org.openapitools.client.model.TransferInitializationV1Response; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void clientRequestV1Test() throws ApiException { + ClientV1Request clientV1Request = null; + Object response = api.clientRequestV1(clientV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase1TransferInitiationRequestV1Test() throws ApiException { + TransferInitializationV1Request transferInitializationV1Request = null; + api.phase1TransferInitiationRequestV1(transferInitializationV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase1TransferInitiationResponseV1Test() throws ApiException { + TransferInitializationV1Response transferInitializationV1Response = null; + api.phase1TransferInitiationResponseV1(transferInitializationV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2LockEvidenceRequestV1Test() throws ApiException { + LockEvidenceV1Request lockEvidenceV1Request = null; + api.phase2LockEvidenceRequestV1(lockEvidenceV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2LockEvidenceResponseV1Test() throws ApiException { + LockEvidenceV1Response lockEvidenceV1Response = null; + api.phase2LockEvidenceResponseV1(lockEvidenceV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2TransferCommenceRequestV1Test() throws ApiException { + TransferCommenceV1Request transferCommenceV1Request = null; + api.phase2TransferCommenceRequestV1(transferCommenceV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2TransferCommenceResponseV1Test() throws ApiException { + TransferCommenceV1Response transferCommenceV1Response = null; + api.phase2TransferCommenceResponseV1(transferCommenceV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitFinalRequestV1Test() throws ApiException { + CommitFinalV1Request commitFinalV1Request = null; + api.phase3CommitFinalRequestV1(commitFinalV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitFinalResponseV1Test() throws ApiException { + CommitFinalV1Response commitFinalV1Response = null; + api.phase3CommitFinalResponseV1(commitFinalV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitPreparationRequestV1Test() throws ApiException { + CommitPreparationV1Request commitPreparationV1Request = null; + api.phase3CommitPreparationRequestV1(commitPreparationV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitPreparationResponseV1Test() throws ApiException { + CommitPreparationV1Response commitPreparationV1Response = null; + api.phase3CommitPreparationResponseV1(commitPreparationV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3TransferCompleteRequestV1Test() throws ApiException { + TransferCompleteV1Request transferCompleteV1Request = null; + api.phase3TransferCompleteRequestV1(transferCompleteV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverUpdateAckV1MessageTest() throws ApiException { + RecoverUpdateAckV1Message recoverUpdateAckV1Message = null; + api.recoverUpdateAckV1Message(recoverUpdateAckV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverUpdateV1MessageTest() throws ApiException { + RecoverUpdateV1Message recoverUpdateV1Message = null; + api.recoverUpdateV1Message(recoverUpdateV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverV1MessageTest() throws ApiException { + RecoverV1Message recoverV1Message = null; + api.recoverV1Message(recoverV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverV1SuccessTest() throws ApiException { + RecoverSuccessV1Message recoverSuccessV1Message = null; + api.recoverV1Success(recoverSuccessV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void rollbackAckV1MessageTest() throws ApiException { + RollbackAckV1Message rollbackAckV1Message = null; + api.rollbackAckV1Message(rollbackAckV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void rollbackV1MessageTest() throws ApiException { + RollbackV1Message rollbackV1Message = null; + api.rollbackV1Message(rollbackV1Message); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java new file mode 100644 index 0000000000..c27c3718f5 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java @@ -0,0 +1,138 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AssetProfile + */ +public class AssetProfileTest { + private final AssetProfile model = new AssetProfile(); + + /** + * Model tests for AssetProfile + */ + @Test + public void testAssetProfile() { + // TODO: test AssetProfile + } + + /** + * Test the property 'issuer' + */ + @Test + public void issuerTest() { + // TODO: test issuer + } + + /** + * Test the property 'assetCode' + */ + @Test + public void assetCodeTest() { + // TODO: test assetCode + } + + /** + * Test the property 'assetCodeType' + */ + @Test + public void assetCodeTypeTest() { + // TODO: test assetCodeType + } + + /** + * Test the property 'issuanceDate' + */ + @Test + public void issuanceDateTest() { + // TODO: test issuanceDate + } + + /** + * Test the property 'expirationDate' + */ + @Test + public void expirationDateTest() { + // TODO: test expirationDate + } + + /** + * Test the property 'verificationEndPoint' + */ + @Test + public void verificationEndPointTest() { + // TODO: test verificationEndPoint + } + + /** + * Test the property 'digitalSignature' + */ + @Test + public void digitalSignatureTest() { + // TODO: test digitalSignature + } + + /** + * Test the property 'prospectusLink' + */ + @Test + public void prospectusLinkTest() { + // TODO: test prospectusLink + } + + /** + * Test the property 'keyInformationLink' + */ + @Test + public void keyInformationLinkTest() { + // TODO: test keyInformationLink + } + + /** + * Test the property 'keyWord' + */ + @Test + public void keyWordTest() { + // TODO: test keyWord + } + + /** + * Test the property 'transferRestriction' + */ + @Test + public void transferRestrictionTest() { + // TODO: test transferRestriction + } + + /** + * Test the property 'ledgerRequirements' + */ + @Test + public void ledgerRequirementsTest() { + // TODO: test ledgerRequirements + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java new file mode 100644 index 0000000000..629e0f4880 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClientV1RequestClientGatewayConfiguration + */ +public class ClientV1RequestClientGatewayConfigurationTest { + private final ClientV1RequestClientGatewayConfiguration model = new ClientV1RequestClientGatewayConfiguration(); + + /** + * Model tests for ClientV1RequestClientGatewayConfiguration + */ + @Test + public void testClientV1RequestClientGatewayConfiguration() { + // TODO: test ClientV1RequestClientGatewayConfiguration + } + + /** + * Test the property 'apiHost' + */ + @Test + public void apiHostTest() { + // TODO: test apiHost + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java new file mode 100644 index 0000000000..2a7769024f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java @@ -0,0 +1,220 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.ClientV1RequestClientGatewayConfiguration; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClientV1Request + */ +public class ClientV1RequestTest { + private final ClientV1Request model = new ClientV1Request(); + + /** + * Model tests for ClientV1Request + */ + @Test + public void testClientV1Request() { + // TODO: test ClientV1Request + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'loggingProfile' + */ + @Test + public void loggingProfileTest() { + // TODO: test loggingProfile + } + + /** + * Test the property 'accessControlProfile' + */ + @Test + public void accessControlProfileTest() { + // TODO: test accessControlProfile + } + + /** + * Test the property 'assetControlProfile' + */ + @Test + public void assetControlProfileTest() { + // TODO: test assetControlProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'assetProfile' + */ + @Test + public void assetProfileTest() { + // TODO: test assetProfile + } + + /** + * Test the property 'payloadProfile' + */ + @Test + public void payloadProfileTest() { + // TODO: test payloadProfile + } + + /** + * Test the property 'sourceGatewayDltSystem' + */ + @Test + public void sourceGatewayDltSystemTest() { + // TODO: test sourceGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayDltSystem' + */ + @Test + public void recipientGatewayDltSystemTest() { + // TODO: test recipientGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayPubkey' + */ + @Test + public void recipientGatewayPubkeyTest() { + // TODO: test recipientGatewayPubkey + } + + /** + * Test the property 'originatorPubkey' + */ + @Test + public void originatorPubkeyTest() { + // TODO: test originatorPubkey + } + + /** + * Test the property 'beneficiaryPubkey' + */ + @Test + public void beneficiaryPubkeyTest() { + // TODO: test beneficiaryPubkey + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'clientDltSystem' + */ + @Test + public void clientDltSystemTest() { + // TODO: test clientDltSystem + } + + /** + * Test the property 'serverDltSystem' + */ + @Test + public void serverDltSystemTest() { + // TODO: test serverDltSystem + } + + /** + * Test the property 'clientGatewayConfiguration' + */ + @Test + public void clientGatewayConfigurationTest() { + // TODO: test clientGatewayConfiguration + } + + /** + * Test the property 'serverGatewayConfiguration' + */ + @Test + public void serverGatewayConfigurationTest() { + // TODO: test serverGatewayConfiguration + } + + /** + * Test the property 'maxRetries' + */ + @Test + public void maxRetriesTest() { + // TODO: test maxRetries + } + + /** + * Test the property 'maxTimeout' + */ + @Test + public void maxTimeoutTest() { + // TODO: test maxTimeout + } + + /** + * Test the property 'sourceLedgerAssetID' + */ + @Test + public void sourceLedgerAssetIDTest() { + // TODO: test sourceLedgerAssetID + } + + /** + * Test the property 'recipientLedgerAssetID' + */ + @Test + public void recipientLedgerAssetIDTest() { + // TODO: test recipientLedgerAssetID + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java new file mode 100644 index 0000000000..8adf6d1777 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java @@ -0,0 +1,122 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitFinalV1Request + */ +public class CommitFinalV1RequestTest { + private final CommitFinalV1Request model = new CommitFinalV1Request(); + + /** + * Model tests for CommitFinalV1Request + */ + @Test + public void testCommitFinalV1Request() { + // TODO: test CommitFinalV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'commitFinalClaim' + */ + @Test + public void commitFinalClaimTest() { + // TODO: test commitFinalClaim + } + + /** + * Test the property 'commitFinalClaimFormat' + */ + @Test + public void commitFinalClaimFormatTest() { + // TODO: test commitFinalClaimFormat + } + + /** + * Test the property 'hashCommitPrepareAck' + */ + @Test + public void hashCommitPrepareAckTest() { + // TODO: test hashCommitPrepareAck + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java new file mode 100644 index 0000000000..b7ed58d4f2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java @@ -0,0 +1,121 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitFinalV1Response + */ +public class CommitFinalV1ResponseTest { + private final CommitFinalV1Response model = new CommitFinalV1Response(); + + /** + * Model tests for CommitFinalV1Response + */ + @Test + public void testCommitFinalV1Response() { + // TODO: test CommitFinalV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'commitAcknowledgementClaim' + */ + @Test + public void commitAcknowledgementClaimTest() { + // TODO: test commitAcknowledgementClaim + } + + /** + * Test the property 'commitAcknowledgementClaimFormat' + */ + @Test + public void commitAcknowledgementClaimFormatTest() { + // TODO: test commitAcknowledgementClaimFormat + } + + /** + * Test the property 'hashCommitFinal' + */ + @Test + public void hashCommitFinalTest() { + // TODO: test hashCommitFinal + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java new file mode 100644 index 0000000000..ef3f72d4e5 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java @@ -0,0 +1,105 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitPreparationV1Request + */ +public class CommitPreparationV1RequestTest { + private final CommitPreparationV1Request model = new CommitPreparationV1Request(); + + /** + * Model tests for CommitPreparationV1Request + */ + @Test + public void testCommitPreparationV1Request() { + // TODO: test CommitPreparationV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashLockEvidenceAck' + */ + @Test + public void hashLockEvidenceAckTest() { + // TODO: test hashLockEvidenceAck + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java new file mode 100644 index 0000000000..b530c7513d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java @@ -0,0 +1,105 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitPreparationV1Response + */ +public class CommitPreparationV1ResponseTest { + private final CommitPreparationV1Response model = new CommitPreparationV1Response(); + + /** + * Model tests for CommitPreparationV1Response + */ + @Test + public void testCommitPreparationV1Response() { + // TODO: test CommitPreparationV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashCommitPrep' + */ + @Test + public void hashCommitPrepTest() { + // TODO: test hashCommitPrep + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java new file mode 100644 index 0000000000..a574a58841 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CredentialProfile + */ +public class CredentialProfileTest { + /** + * Model tests for CredentialProfile + */ + @Test + public void testCredentialProfile() { + // TODO: test CredentialProfile + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java new file mode 100644 index 0000000000..9aed3770b6 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java @@ -0,0 +1,98 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for History + */ +public class HistoryTest { + private final History model = new History(); + + /** + * Model tests for History + */ + @Test + public void testHistory() { + // TODO: test History + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + + /** + * Test the property 'balance' + */ + @Test + public void balanceTest() { + // TODO: test balance + } + + /** + * Test the property 'currentStatus' + */ + @Test + public void currentStatusTest() { + // TODO: test currentStatus + } + + /** + * Test the property 'applicationSpecificParameters' + */ + @Test + public void applicationSpecificParametersTest() { + // TODO: test applicationSpecificParameters + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java new file mode 100644 index 0000000000..6108d10b20 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java @@ -0,0 +1,138 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for LockEvidenceV1Request + */ +public class LockEvidenceV1RequestTest { + private final LockEvidenceV1Request model = new LockEvidenceV1Request(); + + /** + * Model tests for LockEvidenceV1Request + */ + @Test + public void testLockEvidenceV1Request() { + // TODO: test LockEvidenceV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'lockEvidenceClaim' + */ + @Test + public void lockEvidenceClaimTest() { + // TODO: test lockEvidenceClaim + } + + /** + * Test the property 'lockEvidenceFormat' + */ + @Test + public void lockEvidenceFormatTest() { + // TODO: test lockEvidenceFormat + } + + /** + * Test the property 'lockEvidenceExpiration' + */ + @Test + public void lockEvidenceExpirationTest() { + // TODO: test lockEvidenceExpiration + } + + /** + * Test the property 'hashCommenceAckRequest' + */ + @Test + public void hashCommenceAckRequestTest() { + // TODO: test hashCommenceAckRequest + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'messageHash' + */ + @Test + public void messageHashTest() { + // TODO: test messageHash + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java new file mode 100644 index 0000000000..1251a34d06 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java @@ -0,0 +1,106 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for LockEvidenceV1Response + */ +public class LockEvidenceV1ResponseTest { + private final LockEvidenceV1Response model = new LockEvidenceV1Response(); + + /** + * Model tests for LockEvidenceV1Response + */ + @Test + public void testLockEvidenceV1Response() { + // TODO: test LockEvidenceV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashLockEvidenceRequest' + */ + @Test + public void hashLockEvidenceRequestTest() { + // TODO: test hashLockEvidenceRequest + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java new file mode 100644 index 0000000000..4f07f0a07e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java @@ -0,0 +1,88 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OdapLocalLog + */ +public class OdapLocalLogTest { + private final OdapLocalLog model = new OdapLocalLog(); + + /** + * Model tests for OdapLocalLog + */ + @Test + public void testOdapLocalLog() { + // TODO: test OdapLocalLog + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'operation' + */ + @Test + public void operationTest() { + // TODO: test operation + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java new file mode 100644 index 0000000000..cfde21b566 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OdapMessageActionResponse + */ +public class OdapMessageActionResponseTest { + private final OdapMessageActionResponse model = new OdapMessageActionResponse(); + + /** + * Model tests for OdapMessageActionResponse + */ + @Test + public void testOdapMessageActionResponse() { + // TODO: test OdapMessageActionResponse + } + + /** + * Test the property 'responseCode' + */ + @Test + public void responseCodeTest() { + // TODO: test responseCode + } + + /** + * Test the property 'arguments' + */ + @Test + public void argumentsTest() { + // TODO: test arguments + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java new file mode 100644 index 0000000000..4fcc519066 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java @@ -0,0 +1,141 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OdapMessageActionResponse; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OdapMessage + */ +public class OdapMessageTest { + private final OdapMessage model = new OdapMessage(); + + /** + * Model tests for OdapMessage + */ + @Test + public void testOdapMessage() { + // TODO: test OdapMessage + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'phase' + */ + @Test + public void phaseTest() { + // TODO: test phase + } + + /** + * Test the property 'resourceURL' + */ + @Test + public void resourceURLTest() { + // TODO: test resourceURL + } + + /** + * Test the property 'developerURN' + */ + @Test + public void developerURNTest() { + // TODO: test developerURN + } + + /** + * Test the property 'actionResponse' + */ + @Test + public void actionResponseTest() { + // TODO: test actionResponse + } + + /** + * Test the property 'credentialProfile' + */ + @Test + public void credentialProfileTest() { + // TODO: test credentialProfile + } + + /** + * Test the property 'credentialBlock' + */ + @Test + public void credentialBlockTest() { + // TODO: test credentialBlock + } + + /** + * Test the property 'credentialsProfile' + */ + @Test + public void credentialsProfileTest() { + // TODO: test credentialsProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'payloadHash' + */ + @Test + public void payloadHashTest() { + // TODO: test payloadHash + } + + /** + * Test the property 'messageSignature' + */ + @Test + public void messageSignatureTest() { + // TODO: test messageSignature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java new file mode 100644 index 0000000000..c7f4873616 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.AssetProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PayloadProfile + */ +public class PayloadProfileTest { + private final PayloadProfile model = new PayloadProfile(); + + /** + * Model tests for PayloadProfile + */ + @Test + public void testPayloadProfile() { + // TODO: test PayloadProfile + } + + /** + * Test the property 'assetProfile' + */ + @Test + public void assetProfileTest() { + // TODO: test assetProfile + } + + /** + * Test the property 'capabilities' + */ + @Test + public void capabilitiesTest() { + // TODO: test capabilities + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java new file mode 100644 index 0000000000..fb9781f923 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverSuccessV1Message + */ +public class RecoverSuccessV1MessageTest { + private final RecoverSuccessV1Message model = new RecoverSuccessV1Message(); + + /** + * Model tests for RecoverSuccessV1Message + */ + @Test + public void testRecoverSuccessV1Message() { + // TODO: test RecoverSuccessV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java new file mode 100644 index 0000000000..b4a5d7f0c1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverUpdateAckV1Message + */ +public class RecoverUpdateAckV1MessageTest { + private final RecoverUpdateAckV1Message model = new RecoverUpdateAckV1Message(); + + /** + * Model tests for RecoverUpdateAckV1Message + */ + @Test + public void testRecoverUpdateAckV1Message() { + // TODO: test RecoverUpdateAckV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'changedEntriesHash' + */ + @Test + public void changedEntriesHashTest() { + // TODO: test changedEntriesHash + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java new file mode 100644 index 0000000000..9826deea8d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OdapLocalLog; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverUpdateV1Message + */ +public class RecoverUpdateV1MessageTest { + private final RecoverUpdateV1Message model = new RecoverUpdateV1Message(); + + /** + * Model tests for RecoverUpdateV1Message + */ + @Test + public void testRecoverUpdateV1Message() { + // TODO: test RecoverUpdateV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'recoveredLogs' + */ + @Test + public void recoveredLogsTest() { + // TODO: test recoveredLogs + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java new file mode 100644 index 0000000000..d86a3c11a2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java @@ -0,0 +1,105 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverV1Message + */ +public class RecoverV1MessageTest { + private final RecoverV1Message model = new RecoverV1Message(); + + /** + * Model tests for RecoverV1Message + */ + @Test + public void testRecoverV1Message() { + // TODO: test RecoverV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'odapPhase' + */ + @Test + public void odapPhaseTest() { + // TODO: test odapPhase + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'lastLogEntryTimestamp' + */ + @Test + public void lastLogEntryTimestampTest() { + // TODO: test lastLogEntryTimestamp + } + + /** + * Test the property 'isBackup' + */ + @Test + public void isBackupTest() { + // TODO: test isBackup + } + + /** + * Test the property 'newBasePath' + */ + @Test + public void newBasePathTest() { + // TODO: test newBasePath + } + + /** + * Test the property 'newGatewayPubKey' + */ + @Test + public void newGatewayPubKeyTest() { + // TODO: test newGatewayPubKey + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java new file mode 100644 index 0000000000..6cd736754e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RollbackAckV1Message + */ +public class RollbackAckV1MessageTest { + private final RollbackAckV1Message model = new RollbackAckV1Message(); + + /** + * Model tests for RollbackAckV1Message + */ + @Test + public void testRollbackAckV1Message() { + // TODO: test RollbackAckV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java new file mode 100644 index 0000000000..013ef55b35 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RollbackV1Message + */ +public class RollbackV1MessageTest { + private final RollbackV1Message model = new RollbackV1Message(); + + /** + * Model tests for RollbackV1Message + */ + @Test + public void testRollbackV1Message() { + // TODO: test RollbackV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'actionPerformed' + */ + @Test + public void actionPerformedTest() { + // TODO: test actionPerformed + } + + /** + * Test the property 'proofs' + */ + @Test + public void proofsTest() { + // TODO: test proofs + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java new file mode 100644 index 0000000000..22b968480e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java @@ -0,0 +1,533 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SessionData + */ +public class SessionDataTest { + private final SessionData model = new SessionData(); + + /** + * Model tests for SessionData + */ + @Test + public void testSessionData() { + // TODO: test SessionData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'step' + */ + @Test + public void stepTest() { + // TODO: test step + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'lastSequenceNumber' + */ + @Test + public void lastSequenceNumberTest() { + // TODO: test lastSequenceNumber + } + + /** + * Test the property 'loggingProfile' + */ + @Test + public void loggingProfileTest() { + // TODO: test loggingProfile + } + + /** + * Test the property 'accessControlProfile' + */ + @Test + public void accessControlProfileTest() { + // TODO: test accessControlProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'payloadProfile' + */ + @Test + public void payloadProfileTest() { + // TODO: test payloadProfile + } + + /** + * Test the property 'assetProfile' + */ + @Test + public void assetProfileTest() { + // TODO: test assetProfile + } + + /** + * Test the property 'allowedSourceBackupGateways' + */ + @Test + public void allowedSourceBackupGatewaysTest() { + // TODO: test allowedSourceBackupGateways + } + + /** + * Test the property 'allowedRecipientBackupGateways' + */ + @Test + public void allowedRecipientBackupGatewaysTest() { + // TODO: test allowedRecipientBackupGateways + } + + /** + * Test the property 'sourceBasePath' + */ + @Test + public void sourceBasePathTest() { + // TODO: test sourceBasePath + } + + /** + * Test the property 'recipientBasePath' + */ + @Test + public void recipientBasePathTest() { + // TODO: test recipientBasePath + } + + /** + * Test the property 'originatorPubkey' + */ + @Test + public void originatorPubkeyTest() { + // TODO: test originatorPubkey + } + + /** + * Test the property 'beneficiaryPubkey' + */ + @Test + public void beneficiaryPubkeyTest() { + // TODO: test beneficiaryPubkey + } + + /** + * Test the property 'sourceGatewayPubkey' + */ + @Test + public void sourceGatewayPubkeyTest() { + // TODO: test sourceGatewayPubkey + } + + /** + * Test the property 'sourceGatewayDltSystem' + */ + @Test + public void sourceGatewayDltSystemTest() { + // TODO: test sourceGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayPubkey' + */ + @Test + public void recipientGatewayPubkeyTest() { + // TODO: test recipientGatewayPubkey + } + + /** + * Test the property 'recipientGatewayDltSystem' + */ + @Test + public void recipientGatewayDltSystemTest() { + // TODO: test recipientGatewayDltSystem + } + + /** + * Test the property 'initializationRequestMessageHash' + */ + @Test + public void initializationRequestMessageHashTest() { + // TODO: test initializationRequestMessageHash + } + + /** + * Test the property 'initializationResponseMessageHash' + */ + @Test + public void initializationResponseMessageHashTest() { + // TODO: test initializationResponseMessageHash + } + + /** + * Test the property 'initializationRequestMessageRcvTimeStamp' + */ + @Test + public void initializationRequestMessageRcvTimeStampTest() { + // TODO: test initializationRequestMessageRcvTimeStamp + } + + /** + * Test the property 'initializationRequestMessageProcessedTimeStamp' + */ + @Test + public void initializationRequestMessageProcessedTimeStampTest() { + // TODO: test initializationRequestMessageProcessedTimeStamp + } + + /** + * Test the property 'clientSignatureInitializationRequestMessage' + */ + @Test + public void clientSignatureInitializationRequestMessageTest() { + // TODO: test clientSignatureInitializationRequestMessage + } + + /** + * Test the property 'serverSignatureInitializationResponseMessage' + */ + @Test + public void serverSignatureInitializationResponseMessageTest() { + // TODO: test serverSignatureInitializationResponseMessage + } + + /** + * Test the property 'transferCommenceMessageRequestHash' + */ + @Test + public void transferCommenceMessageRequestHashTest() { + // TODO: test transferCommenceMessageRequestHash + } + + /** + * Test the property 'transferCommenceMessageResponseHash' + */ + @Test + public void transferCommenceMessageResponseHashTest() { + // TODO: test transferCommenceMessageResponseHash + } + + /** + * Test the property 'clientSignatureTransferCommenceRequestMessage' + */ + @Test + public void clientSignatureTransferCommenceRequestMessageTest() { + // TODO: test clientSignatureTransferCommenceRequestMessage + } + + /** + * Test the property 'serverSignatureTransferCommenceResponseMessage' + */ + @Test + public void serverSignatureTransferCommenceResponseMessageTest() { + // TODO: test serverSignatureTransferCommenceResponseMessage + } + + /** + * Test the property 'lockEvidenceRequestMessageHash' + */ + @Test + public void lockEvidenceRequestMessageHashTest() { + // TODO: test lockEvidenceRequestMessageHash + } + + /** + * Test the property 'lockEvidenceResponseMessageHash' + */ + @Test + public void lockEvidenceResponseMessageHashTest() { + // TODO: test lockEvidenceResponseMessageHash + } + + /** + * Test the property 'clientSignatureLockEvidenceRequestMessage' + */ + @Test + public void clientSignatureLockEvidenceRequestMessageTest() { + // TODO: test clientSignatureLockEvidenceRequestMessage + } + + /** + * Test the property 'serverSignatureLockEvidenceResponseMessage' + */ + @Test + public void serverSignatureLockEvidenceResponseMessageTest() { + // TODO: test serverSignatureLockEvidenceResponseMessage + } + + /** + * Test the property 'lockEvidenceClaim' + */ + @Test + public void lockEvidenceClaimTest() { + // TODO: test lockEvidenceClaim + } + + /** + * Test the property 'commitPrepareRequestMessageHash' + */ + @Test + public void commitPrepareRequestMessageHashTest() { + // TODO: test commitPrepareRequestMessageHash + } + + /** + * Test the property 'commitPrepareResponseMessageHash' + */ + @Test + public void commitPrepareResponseMessageHashTest() { + // TODO: test commitPrepareResponseMessageHash + } + + /** + * Test the property 'clientSignatureCommitPreparationRequestMessage' + */ + @Test + public void clientSignatureCommitPreparationRequestMessageTest() { + // TODO: test clientSignatureCommitPreparationRequestMessage + } + + /** + * Test the property 'serverSignatureCommitPreparationResponseMessage' + */ + @Test + public void serverSignatureCommitPreparationResponseMessageTest() { + // TODO: test serverSignatureCommitPreparationResponseMessage + } + + /** + * Test the property 'commitFinalRequestMessageHash' + */ + @Test + public void commitFinalRequestMessageHashTest() { + // TODO: test commitFinalRequestMessageHash + } + + /** + * Test the property 'commitFinalResponseMessageHash' + */ + @Test + public void commitFinalResponseMessageHashTest() { + // TODO: test commitFinalResponseMessageHash + } + + /** + * Test the property 'commitFinalClaim' + */ + @Test + public void commitFinalClaimTest() { + // TODO: test commitFinalClaim + } + + /** + * Test the property 'commitFinalClaimFormat' + */ + @Test + public void commitFinalClaimFormatTest() { + // TODO: test commitFinalClaimFormat + } + + /** + * Test the property 'commitAcknowledgementClaim' + */ + @Test + public void commitAcknowledgementClaimTest() { + // TODO: test commitAcknowledgementClaim + } + + /** + * Test the property 'commitAcknowledgementClaimFormat' + */ + @Test + public void commitAcknowledgementClaimFormatTest() { + // TODO: test commitAcknowledgementClaimFormat + } + + /** + * Test the property 'clientSignatureCommitFinalRequestMessage' + */ + @Test + public void clientSignatureCommitFinalRequestMessageTest() { + // TODO: test clientSignatureCommitFinalRequestMessage + } + + /** + * Test the property 'serverSignatureCommitFinalResponseMessage' + */ + @Test + public void serverSignatureCommitFinalResponseMessageTest() { + // TODO: test serverSignatureCommitFinalResponseMessage + } + + /** + * Test the property 'transferCompleteMessageHash' + */ + @Test + public void transferCompleteMessageHashTest() { + // TODO: test transferCompleteMessageHash + } + + /** + * Test the property 'clientSignatureTransferCompleteMessage' + */ + @Test + public void clientSignatureTransferCompleteMessageTest() { + // TODO: test clientSignatureTransferCompleteMessage + } + + /** + * Test the property 'maxRetries' + */ + @Test + public void maxRetriesTest() { + // TODO: test maxRetries + } + + /** + * Test the property 'recipientLedgerAssetID' + */ + @Test + public void recipientLedgerAssetIDTest() { + // TODO: test recipientLedgerAssetID + } + + /** + * Test the property 'sourceLedgerAssetID' + */ + @Test + public void sourceLedgerAssetIDTest() { + // TODO: test sourceLedgerAssetID + } + + /** + * Test the property 'maxTimeout' + */ + @Test + public void maxTimeoutTest() { + // TODO: test maxTimeout + } + + /** + * Test the property 'lastLogEntryTimestamp' + */ + @Test + public void lastLogEntryTimestampTest() { + // TODO: test lastLogEntryTimestamp + } + + /** + * Test the property 'unlockAssetClaim' + */ + @Test + public void unlockAssetClaimTest() { + // TODO: test unlockAssetClaim + } + + /** + * Test the property 'recreateAssetClaim' + */ + @Test + public void recreateAssetClaimTest() { + // TODO: test recreateAssetClaim + } + + /** + * Test the property 'deleteAssetClaim' + */ + @Test + public void deleteAssetClaimTest() { + // TODO: test deleteAssetClaim + } + + /** + * Test the property 'lastMessageReceivedTimestamp' + */ + @Test + public void lastMessageReceivedTimestampTest() { + // TODO: test lastMessageReceivedTimestamp + } + + /** + * Test the property 'rollback' + */ + @Test + public void rollbackTest() { + // TODO: test rollback + } + + /** + * Test the property 'rollbackMessageHash' + */ + @Test + public void rollbackMessageHashTest() { + // TODO: test rollbackMessageHash + } + + /** + * Test the property 'rollbackProofs' + */ + @Test + public void rollbackProofsTest() { + // TODO: test rollbackProofs + } + + /** + * Test the property 'rollbackActionsPerformed' + */ + @Test + public void rollbackActionsPerformedTest() { + // TODO: test rollbackActionsPerformed + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java new file mode 100644 index 0000000000..bc40126eab --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java @@ -0,0 +1,153 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferCommenceV1Request + */ +public class TransferCommenceV1RequestTest { + private final TransferCommenceV1Request model = new TransferCommenceV1Request(); + + /** + * Model tests for TransferCommenceV1Request + */ + @Test + public void testTransferCommenceV1Request() { + // TODO: test TransferCommenceV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'originatorPubkey' + */ + @Test + public void originatorPubkeyTest() { + // TODO: test originatorPubkey + } + + /** + * Test the property 'beneficiaryPubkey' + */ + @Test + public void beneficiaryPubkeyTest() { + // TODO: test beneficiaryPubkey + } + + /** + * Test the property 'senderDltSystem' + */ + @Test + public void senderDltSystemTest() { + // TODO: test senderDltSystem + } + + /** + * Test the property 'recipientDltSystem' + */ + @Test + public void recipientDltSystemTest() { + // TODO: test recipientDltSystem + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashAssetProfile' + */ + @Test + public void hashAssetProfileTest() { + // TODO: test hashAssetProfile + } + + /** + * Test the property 'assetUnit' + */ + @Test + public void assetUnitTest() { + // TODO: test assetUnit + } + + /** + * Test the property 'hashPrevMessage' + */ + @Test + public void hashPrevMessageTest() { + // TODO: test hashPrevMessage + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java new file mode 100644 index 0000000000..a241c9fb30 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferCommenceV1Response + */ +public class TransferCommenceV1ResponseTest { + private final TransferCommenceV1Response model = new TransferCommenceV1Response(); + + /** + * Model tests for TransferCommenceV1Response + */ + @Test + public void testTransferCommenceV1Response() { + // TODO: test TransferCommenceV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashCommenceRequest' + */ + @Test + public void hashCommenceRequestTest() { + // TODO: test hashCommenceRequest + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'messageHash' + */ + @Test + public void messageHashTest() { + // TODO: test messageHash + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java new file mode 100644 index 0000000000..82326459b4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferCompleteV1Request + */ +public class TransferCompleteV1RequestTest { + private final TransferCompleteV1Request model = new TransferCompleteV1Request(); + + /** + * Model tests for TransferCompleteV1Request + */ + @Test + public void testTransferCompleteV1Request() { + // TODO: test TransferCompleteV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashCommitFinalAck' + */ + @Test + public void hashCommitFinalAckTest() { + // TODO: test hashCommitFinalAck + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'hashTransferCommence' + */ + @Test + public void hashTransferCommenceTest() { + // TODO: test hashTransferCommence + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java new file mode 100644 index 0000000000..b96e652262 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java @@ -0,0 +1,294 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CredentialProfile; +import org.openapitools.client.model.History; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferInitializationV1Request + */ +public class TransferInitializationV1RequestTest { + private final TransferInitializationV1Request model = new TransferInitializationV1Request(); + + /** + * Model tests for TransferInitializationV1Request + */ + @Test + public void testTransferInitializationV1Request() { + // TODO: test TransferInitializationV1Request + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'developerURN' + */ + @Test + public void developerURNTest() { + // TODO: test developerURN + } + + /** + * Test the property 'credentialProfile' + */ + @Test + public void credentialProfileTest() { + // TODO: test credentialProfile + } + + /** + * Test the property 'payloadProfile' + */ + @Test + public void payloadProfileTest() { + // TODO: test payloadProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'loggingProfile' + */ + @Test + public void loggingProfileTest() { + // TODO: test loggingProfile + } + + /** + * Test the property 'accessControlProfile' + */ + @Test + public void accessControlProfileTest() { + // TODO: test accessControlProfile + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sourceGatewayPubkey' + */ + @Test + public void sourceGatewayPubkeyTest() { + // TODO: test sourceGatewayPubkey + } + + /** + * Test the property 'sourceGatewayDltSystem' + */ + @Test + public void sourceGatewayDltSystemTest() { + // TODO: test sourceGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayPubkey' + */ + @Test + public void recipientGatewayPubkeyTest() { + // TODO: test recipientGatewayPubkey + } + + /** + * Test the property 'recipientGatewayDltSystem' + */ + @Test + public void recipientGatewayDltSystemTest() { + // TODO: test recipientGatewayDltSystem + } + + /** + * Test the property 'escrowType' + */ + @Test + public void escrowTypeTest() { + // TODO: test escrowType + } + + /** + * Test the property 'expiryTime' + */ + @Test + public void expiryTimeTest() { + // TODO: test expiryTime + } + + /** + * Test the property 'multipleClaimsAllowed' + */ + @Test + public void multipleClaimsAllowedTest() { + // TODO: test multipleClaimsAllowed + } + + /** + * Test the property 'multipleCancelsAllowed' + */ + @Test + public void multipleCancelsAllowedTest() { + // TODO: test multipleCancelsAllowed + } + + /** + * Test the property 'permissions' + */ + @Test + public void permissionsTest() { + // TODO: test permissions + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + + /** + * Test the property 'subsequentCalls' + */ + @Test + public void subsequentCallsTest() { + // TODO: test subsequentCalls + } + + /** + * Test the property 'histories' + */ + @Test + public void historiesTest() { + // TODO: test histories + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'sourceBasePath' + */ + @Test + public void sourceBasePathTest() { + // TODO: test sourceBasePath + } + + /** + * Test the property 'recipientBasePath' + */ + @Test + public void recipientBasePathTest() { + // TODO: test recipientBasePath + } + + /** + * Test the property 'maxRetries' + */ + @Test + public void maxRetriesTest() { + // TODO: test maxRetries + } + + /** + * Test the property 'maxTimeout' + */ + @Test + public void maxTimeoutTest() { + // TODO: test maxTimeout + } + + /** + * Test the property 'backupGatewaysAllowed' + */ + @Test + public void backupGatewaysAllowedTest() { + // TODO: test backupGatewaysAllowed + } + + /** + * Test the property 'recipientLedgerAssetID' + */ + @Test + public void recipientLedgerAssetIDTest() { + // TODO: test recipientLedgerAssetID + } + + /** + * Test the property 'sourceLedgerAssetID' + */ + @Test + public void sourceLedgerAssetIDTest() { + // TODO: test sourceLedgerAssetID + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java new file mode 100644 index 0000000000..6dfef0e78f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java @@ -0,0 +1,131 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferInitializationV1Response + */ +public class TransferInitializationV1ResponseTest { + private final TransferInitializationV1Response model = new TransferInitializationV1Response(); + + /** + * Model tests for TransferInitializationV1Response + */ + @Test + public void testTransferInitializationV1Response() { + // TODO: test TransferInitializationV1Response + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'odapPhase' + */ + @Test + public void odapPhaseTest() { + // TODO: test odapPhase + } + + /** + * Test the property 'initialRequestMessageHash' + */ + @Test + public void initialRequestMessageHashTest() { + // TODO: test initialRequestMessageHash + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + + /** + * Test the property 'timeStamp' + */ + @Test + public void timeStampTest() { + // TODO: test timeStamp + } + + /** + * Test the property 'processedTimeStamp' + */ + @Test + public void processedTimeStampTest() { + // TODO: test processedTimeStamp + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'backupGatewaysAllowed' + */ + @Test + public void backupGatewaysAllowedTest() { + // TODO: test backupGatewaysAllowed + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/package.json b/packages/cactus-plugin-persistence-ethereum/package.json index 5be367856f..1315476874 100644 --- a/packages/cactus-plugin-persistence-ethereum/package.json +++ b/packages/cactus-plugin-persistence-ethereum/package.json @@ -54,7 +54,10 @@ "codegen:openapi": "npm run generate-sdk", "copy-sql": "cp -raf ./src/main/sql ./dist/lib/main/", "copy-yarn-lock": "cp -af ../../yarn.lock ./dist/yarn.lock", - "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore" + "generate-sdk": "run-p 'generate-sdk:*'", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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" }, "dependencies": { "@ethersproject/abi": "5.7.0", diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md 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 0000000000..1be8af3fa8 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +docs/DefaultApi.md +docs/ErrorExceptionResponseV1.md +docs/MonitoredToken.md +docs/StatusResponseV1.md +docs/TokenTypeV1.md +docs/TrackedOperationV1.md +git_push.sh +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 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..57f48c6775 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,116 @@ +# Go API client for cactus-plugin-persistence-ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-persistence-ethereum "github.com/hyperledger/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status | Get the status of persistence plugin for ethereum + + +## Documentation For Models + + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [MonitoredToken](docs/MonitoredToken.md) + - [StatusResponseV1](docs/StatusResponseV1.md) + - [TokenTypeV1](docs/TokenTypeV1.md) + - [TrackedOperationV1](docs/TrackedOperationV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..e2d6b4c939 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,148 @@ +openapi: 3.0.3 +info: + description: Synchronizes state of an ethereum ledger into a DB that can later be + viewed in GUI + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Persistence Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status: + get: + operationId: getStatusV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/StatusResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get the status of persistence plugin for ethereum + x-hyperledger-cactus: + 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 0000000000..156bc00da6 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,130 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetStatusV1Request) Execute() (*StatusResponseV1, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Get the status of persistence plugin for ethereum + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StatusResponseV1 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) (*StatusResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StatusResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..28629cf6ab --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Persistence Ethereum API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..2631a54947 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/DefaultApi.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/DefaultApi.md new file mode 100644 index 0000000000..fd6b51e46e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/DefaultApi.md @@ -0,0 +1,68 @@ +# \DefaultApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetStatusV1**](DefaultApi.md#GetStatusV1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status | Get the status of persistence plugin for ethereum + + + +## GetStatusV1 + +> StatusResponseV1 GetStatusV1(ctx).Execute() + +Get the status of persistence plugin for ethereum + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/hyperledger/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.GetStatusV1(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetStatusV1``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetStatusV1`: StatusResponseV1 + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetStatusV1`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetStatusV1Request struct via the builder pattern + + +### Return type + +[**StatusResponseV1**](StatusResponseV1.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/ErrorExceptionResponseV1.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/ErrorExceptionResponseV1.md new file mode 100644 index 0000000000..2757745a0d --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/ErrorExceptionResponseV1.md @@ -0,0 +1,72 @@ +# ErrorExceptionResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Error** | **string** | | + +## Methods + +### NewErrorExceptionResponseV1 + +`func NewErrorExceptionResponseV1(message string, error_ string, ) *ErrorExceptionResponseV1` + +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 + +### NewErrorExceptionResponseV1WithDefaults + +`func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1` + +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 + +### GetMessage + +`func (o *ErrorExceptionResponseV1) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ErrorExceptionResponseV1) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetError + +`func (o *ErrorExceptionResponseV1) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ErrorExceptionResponseV1) SetError(v string)` + +SetError sets Error field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/MonitoredToken.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/MonitoredToken.md new file mode 100644 index 0000000000..06c6a26522 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/MonitoredToken.md @@ -0,0 +1,93 @@ +# MonitoredToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**TokenTypeV1**](TokenTypeV1.md) | | +**Name** | **string** | Token name | +**Symbol** | **string** | Token symbol | + +## Methods + +### NewMonitoredToken + +`func NewMonitoredToken(type_ TokenTypeV1, name string, symbol string, ) *MonitoredToken` + +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 + +### NewMonitoredTokenWithDefaults + +`func NewMonitoredTokenWithDefaults() *MonitoredToken` + +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 + +### GetType + +`func (o *MonitoredToken) GetType() TokenTypeV1` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *MonitoredToken) GetTypeOk() (*TokenTypeV1, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *MonitoredToken) SetType(v TokenTypeV1)` + +SetType sets Type field to given value. + + +### GetName + +`func (o *MonitoredToken) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MonitoredToken) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MonitoredToken) SetName(v string)` + +SetName sets Name field to given value. + + +### GetSymbol + +`func (o *MonitoredToken) GetSymbol() string` + +GetSymbol returns the Symbol field if non-nil, zero value otherwise. + +### GetSymbolOk + +`func (o *MonitoredToken) GetSymbolOk() (*string, bool)` + +GetSymbolOk returns a tuple with the Symbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSymbol + +`func (o *MonitoredToken) SetSymbol(v string)` + +SetSymbol sets Symbol field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/StatusResponseV1.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/StatusResponseV1.md new file mode 100644 index 0000000000..c7939f1fd2 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/StatusResponseV1.md @@ -0,0 +1,177 @@ +# StatusResponseV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InstanceId** | **string** | Plugin instance id. | +**Connected** | **bool** | True if successfully connected to the database, false otherwise. | +**WebServicesRegistered** | **bool** | True if web services were correctly exported. | +**MonitoredTokensCount** | **float32** | Total number of tokens being monitored by the plugin. | +**OperationsRunning** | [**[]TrackedOperationV1**](TrackedOperationV1.md) | | +**MonitorRunning** | **bool** | True if block monitoring is running, false otherwise. | +**LastSeenBlock** | **float32** | Number of the last block seen by the block monitor. | + +## Methods + +### NewStatusResponseV1 + +`func NewStatusResponseV1(instanceId string, connected bool, webServicesRegistered bool, monitoredTokensCount float32, operationsRunning []TrackedOperationV1, monitorRunning bool, lastSeenBlock float32, ) *StatusResponseV1` + +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 + +### NewStatusResponseV1WithDefaults + +`func NewStatusResponseV1WithDefaults() *StatusResponseV1` + +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 + +### GetInstanceId + +`func (o *StatusResponseV1) GetInstanceId() string` + +GetInstanceId returns the InstanceId field if non-nil, zero value otherwise. + +### GetInstanceIdOk + +`func (o *StatusResponseV1) GetInstanceIdOk() (*string, bool)` + +GetInstanceIdOk returns a tuple with the InstanceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceId + +`func (o *StatusResponseV1) SetInstanceId(v string)` + +SetInstanceId sets InstanceId field to given value. + + +### GetConnected + +`func (o *StatusResponseV1) GetConnected() bool` + +GetConnected returns the Connected field if non-nil, zero value otherwise. + +### GetConnectedOk + +`func (o *StatusResponseV1) GetConnectedOk() (*bool, bool)` + +GetConnectedOk returns a tuple with the Connected field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnected + +`func (o *StatusResponseV1) SetConnected(v bool)` + +SetConnected sets Connected field to given value. + + +### GetWebServicesRegistered + +`func (o *StatusResponseV1) GetWebServicesRegistered() bool` + +GetWebServicesRegistered returns the WebServicesRegistered field if non-nil, zero value otherwise. + +### GetWebServicesRegisteredOk + +`func (o *StatusResponseV1) GetWebServicesRegisteredOk() (*bool, bool)` + +GetWebServicesRegisteredOk returns a tuple with the WebServicesRegistered field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebServicesRegistered + +`func (o *StatusResponseV1) SetWebServicesRegistered(v bool)` + +SetWebServicesRegistered sets WebServicesRegistered field to given value. + + +### GetMonitoredTokensCount + +`func (o *StatusResponseV1) GetMonitoredTokensCount() float32` + +GetMonitoredTokensCount returns the MonitoredTokensCount field if non-nil, zero value otherwise. + +### GetMonitoredTokensCountOk + +`func (o *StatusResponseV1) GetMonitoredTokensCountOk() (*float32, bool)` + +GetMonitoredTokensCountOk returns a tuple with the MonitoredTokensCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonitoredTokensCount + +`func (o *StatusResponseV1) SetMonitoredTokensCount(v float32)` + +SetMonitoredTokensCount sets MonitoredTokensCount field to given value. + + +### GetOperationsRunning + +`func (o *StatusResponseV1) GetOperationsRunning() []TrackedOperationV1` + +GetOperationsRunning returns the OperationsRunning field if non-nil, zero value otherwise. + +### GetOperationsRunningOk + +`func (o *StatusResponseV1) GetOperationsRunningOk() (*[]TrackedOperationV1, bool)` + +GetOperationsRunningOk returns a tuple with the OperationsRunning field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperationsRunning + +`func (o *StatusResponseV1) SetOperationsRunning(v []TrackedOperationV1)` + +SetOperationsRunning sets OperationsRunning field to given value. + + +### GetMonitorRunning + +`func (o *StatusResponseV1) GetMonitorRunning() bool` + +GetMonitorRunning returns the MonitorRunning field if non-nil, zero value otherwise. + +### GetMonitorRunningOk + +`func (o *StatusResponseV1) GetMonitorRunningOk() (*bool, bool)` + +GetMonitorRunningOk returns a tuple with the MonitorRunning field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonitorRunning + +`func (o *StatusResponseV1) SetMonitorRunning(v bool)` + +SetMonitorRunning sets MonitorRunning field to given value. + + +### GetLastSeenBlock + +`func (o *StatusResponseV1) GetLastSeenBlock() float32` + +GetLastSeenBlock returns the LastSeenBlock field if non-nil, zero value otherwise. + +### GetLastSeenBlockOk + +`func (o *StatusResponseV1) GetLastSeenBlockOk() (*float32, bool)` + +GetLastSeenBlockOk returns a tuple with the LastSeenBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastSeenBlock + +`func (o *StatusResponseV1) SetLastSeenBlock(v float32)` + +SetLastSeenBlock sets LastSeenBlock field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/TokenTypeV1.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/TokenTypeV1.md new file mode 100644 index 0000000000..dabd4fa56c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/TokenTypeV1.md @@ -0,0 +1,13 @@ +# TokenTypeV1 + +## Enum + + +* `ERC20` (value: `"erc20"`) + +* `ERC721` (value: `"erc721"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/TrackedOperationV1.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/TrackedOperationV1.md new file mode 100644 index 0000000000..b6d92a5624 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/docs/TrackedOperationV1.md @@ -0,0 +1,72 @@ +# TrackedOperationV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartAt** | **string** | Start time of the operation. | +**Operation** | **string** | Operation name. | + +## Methods + +### NewTrackedOperationV1 + +`func NewTrackedOperationV1(startAt string, operation string, ) *TrackedOperationV1` + +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 + +### NewTrackedOperationV1WithDefaults + +`func NewTrackedOperationV1WithDefaults() *TrackedOperationV1` + +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 + +### GetStartAt + +`func (o *TrackedOperationV1) GetStartAt() string` + +GetStartAt returns the StartAt field if non-nil, zero value otherwise. + +### GetStartAtOk + +`func (o *TrackedOperationV1) GetStartAtOk() (*string, bool)` + +GetStartAtOk returns a tuple with the StartAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartAt + +`func (o *TrackedOperationV1) SetStartAt(v string)` + +SetStartAt sets StartAt field to given value. + + +### GetOperation + +`func (o *TrackedOperationV1) GetOperation() string` + +GetOperation returns the Operation field if non-nil, zero value otherwise. + +### GetOperationOk + +`func (o *TrackedOperationV1) GetOperationOk() (*string, bool)` + +GetOperationOk returns a tuple with the Operation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperation + +`func (o *TrackedOperationV1) SetOperation(v string)` + +SetOperation sets Operation field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..78db7abeb2 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..7b679f4baa --- /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 0000000000..c966c8ddfd --- /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 0000000000..8cf28bb968 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go new file mode 100644 index 0000000000..e3eff3110c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the MonitoredToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MonitoredToken{} + +// MonitoredToken Ethereum tokens that are being monitored by the persistence plugin. +type MonitoredToken struct { + Type TokenTypeV1 `json:"type"` + // Token name + Name string `json:"name"` + // Token symbol + Symbol string `json:"symbol"` +} + +// NewMonitoredToken instantiates a new MonitoredToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMonitoredToken(type_ TokenTypeV1, name string, symbol string) *MonitoredToken { + this := MonitoredToken{} + this.Type = type_ + this.Name = name + this.Symbol = symbol + return &this +} + +// NewMonitoredTokenWithDefaults instantiates a new MonitoredToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMonitoredTokenWithDefaults() *MonitoredToken { + this := MonitoredToken{} + return &this +} + +// GetType returns the Type field value +func (o *MonitoredToken) GetType() TokenTypeV1 { + if o == nil { + var ret TokenTypeV1 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MonitoredToken) GetTypeOk() (*TokenTypeV1, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *MonitoredToken) SetType(v TokenTypeV1) { + o.Type = v +} + +// GetName returns the Name field value +func (o *MonitoredToken) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MonitoredToken) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MonitoredToken) SetName(v string) { + o.Name = v +} + +// GetSymbol returns the Symbol field value +func (o *MonitoredToken) GetSymbol() string { + if o == nil { + var ret string + return ret + } + + return o.Symbol +} + +// GetSymbolOk returns a tuple with the Symbol field value +// and a boolean to check if the value has been set. +func (o *MonitoredToken) GetSymbolOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Symbol, true +} + +// SetSymbol sets field value +func (o *MonitoredToken) SetSymbol(v string) { + o.Symbol = v +} + +func (o MonitoredToken) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MonitoredToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["name"] = o.Name + toSerialize["symbol"] = o.Symbol + return toSerialize, nil +} + +type NullableMonitoredToken struct { + value *MonitoredToken + isSet bool +} + +func (v NullableMonitoredToken) Get() *MonitoredToken { + return v.value +} + +func (v *NullableMonitoredToken) Set(val *MonitoredToken) { + v.value = val + v.isSet = true +} + +func (v NullableMonitoredToken) IsSet() bool { + return v.isSet +} + +func (v *NullableMonitoredToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMonitoredToken(val *MonitoredToken) *NullableMonitoredToken { + return &NullableMonitoredToken{value: val, isSet: true} +} + +func (v NullableMonitoredToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMonitoredToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go new file mode 100644 index 0000000000..c6562fc589 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go @@ -0,0 +1,285 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the StatusResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StatusResponseV1{} + +// StatusResponseV1 Response with plugin status report. +type StatusResponseV1 struct { + // Plugin instance id. + InstanceId string `json:"instanceId"` + // True if successfully connected to the database, false otherwise. + Connected bool `json:"connected"` + // True if web services were correctly exported. + WebServicesRegistered bool `json:"webServicesRegistered"` + // Total number of tokens being monitored by the plugin. + MonitoredTokensCount float32 `json:"monitoredTokensCount"` + OperationsRunning []TrackedOperationV1 `json:"operationsRunning"` + // True if block monitoring is running, false otherwise. + MonitorRunning bool `json:"monitorRunning"` + // Number of the last block seen by the block monitor. + LastSeenBlock float32 `json:"lastSeenBlock"` +} + +// NewStatusResponseV1 instantiates a new StatusResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStatusResponseV1(instanceId string, connected bool, webServicesRegistered bool, monitoredTokensCount float32, operationsRunning []TrackedOperationV1, monitorRunning bool, lastSeenBlock float32) *StatusResponseV1 { + this := StatusResponseV1{} + this.InstanceId = instanceId + this.Connected = connected + this.WebServicesRegistered = webServicesRegistered + this.MonitoredTokensCount = monitoredTokensCount + this.OperationsRunning = operationsRunning + this.MonitorRunning = monitorRunning + this.LastSeenBlock = lastSeenBlock + return &this +} + +// NewStatusResponseV1WithDefaults instantiates a new StatusResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatusResponseV1WithDefaults() *StatusResponseV1 { + this := StatusResponseV1{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *StatusResponseV1) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *StatusResponseV1) SetInstanceId(v string) { + o.InstanceId = v +} + +// GetConnected returns the Connected field value +func (o *StatusResponseV1) GetConnected() bool { + if o == nil { + var ret bool + return ret + } + + return o.Connected +} + +// GetConnectedOk returns a tuple with the Connected field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetConnectedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Connected, true +} + +// SetConnected sets field value +func (o *StatusResponseV1) SetConnected(v bool) { + o.Connected = v +} + +// GetWebServicesRegistered returns the WebServicesRegistered field value +func (o *StatusResponseV1) GetWebServicesRegistered() bool { + if o == nil { + var ret bool + return ret + } + + return o.WebServicesRegistered +} + +// GetWebServicesRegisteredOk returns a tuple with the WebServicesRegistered field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetWebServicesRegisteredOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.WebServicesRegistered, true +} + +// SetWebServicesRegistered sets field value +func (o *StatusResponseV1) SetWebServicesRegistered(v bool) { + o.WebServicesRegistered = v +} + +// GetMonitoredTokensCount returns the MonitoredTokensCount field value +func (o *StatusResponseV1) GetMonitoredTokensCount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonitoredTokensCount +} + +// GetMonitoredTokensCountOk returns a tuple with the MonitoredTokensCount field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetMonitoredTokensCountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonitoredTokensCount, true +} + +// SetMonitoredTokensCount sets field value +func (o *StatusResponseV1) SetMonitoredTokensCount(v float32) { + o.MonitoredTokensCount = v +} + +// GetOperationsRunning returns the OperationsRunning field value +func (o *StatusResponseV1) GetOperationsRunning() []TrackedOperationV1 { + if o == nil { + var ret []TrackedOperationV1 + return ret + } + + return o.OperationsRunning +} + +// GetOperationsRunningOk returns a tuple with the OperationsRunning field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetOperationsRunningOk() ([]TrackedOperationV1, bool) { + if o == nil { + return nil, false + } + return o.OperationsRunning, true +} + +// SetOperationsRunning sets field value +func (o *StatusResponseV1) SetOperationsRunning(v []TrackedOperationV1) { + o.OperationsRunning = v +} + +// GetMonitorRunning returns the MonitorRunning field value +func (o *StatusResponseV1) GetMonitorRunning() bool { + if o == nil { + var ret bool + return ret + } + + return o.MonitorRunning +} + +// GetMonitorRunningOk returns a tuple with the MonitorRunning field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetMonitorRunningOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.MonitorRunning, true +} + +// SetMonitorRunning sets field value +func (o *StatusResponseV1) SetMonitorRunning(v bool) { + o.MonitorRunning = v +} + +// GetLastSeenBlock returns the LastSeenBlock field value +func (o *StatusResponseV1) GetLastSeenBlock() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.LastSeenBlock +} + +// GetLastSeenBlockOk returns a tuple with the LastSeenBlock field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetLastSeenBlockOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.LastSeenBlock, true +} + +// SetLastSeenBlock sets field value +func (o *StatusResponseV1) SetLastSeenBlock(v float32) { + o.LastSeenBlock = v +} + +func (o StatusResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StatusResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + toSerialize["connected"] = o.Connected + toSerialize["webServicesRegistered"] = o.WebServicesRegistered + toSerialize["monitoredTokensCount"] = o.MonitoredTokensCount + toSerialize["operationsRunning"] = o.OperationsRunning + toSerialize["monitorRunning"] = o.MonitorRunning + toSerialize["lastSeenBlock"] = o.LastSeenBlock + return toSerialize, nil +} + +type NullableStatusResponseV1 struct { + value *StatusResponseV1 + isSet bool +} + +func (v NullableStatusResponseV1) Get() *StatusResponseV1 { + return v.value +} + +func (v *NullableStatusResponseV1) Set(val *StatusResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableStatusResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusResponseV1(val *StatusResponseV1) *NullableStatusResponseV1 { + return &NullableStatusResponseV1{value: val, isSet: true} +} + +func (v NullableStatusResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go new file mode 100644 index 0000000000..fb407dba8c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" + "fmt" +) + +// TokenTypeV1 the model 'TokenTypeV1' +type TokenTypeV1 string + +// List of TokenTypeV1 +const ( + ERC20 TokenTypeV1 = "erc20" + ERC721 TokenTypeV1 = "erc721" +) + +// All allowed values of TokenTypeV1 enum +var AllowedTokenTypeV1EnumValues = []TokenTypeV1{ + "erc20", + "erc721", +} + +func (v *TokenTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TokenTypeV1(value) + for _, existing := range AllowedTokenTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TokenTypeV1", value) +} + +// NewTokenTypeV1FromValue returns a pointer to a valid TokenTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTokenTypeV1FromValue(v string) (*TokenTypeV1, error) { + ev := TokenTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TokenTypeV1: valid values are %v", v, AllowedTokenTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TokenTypeV1) IsValid() bool { + for _, existing := range AllowedTokenTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TokenTypeV1 value +func (v TokenTypeV1) Ptr() *TokenTypeV1 { + return &v +} + +type NullableTokenTypeV1 struct { + value *TokenTypeV1 + isSet bool +} + +func (v NullableTokenTypeV1) Get() *TokenTypeV1 { + return v.value +} + +func (v *NullableTokenTypeV1) Set(val *TokenTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableTokenTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenTypeV1(val *TokenTypeV1) *NullableTokenTypeV1 { + return &NullableTokenTypeV1{value: val, isSet: true} +} + +func (v NullableTokenTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go new file mode 100644 index 0000000000..ea07dfae65 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the TrackedOperationV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TrackedOperationV1{} + +// TrackedOperationV1 Persistence plugin operation that is tracked and returned in status report. +type TrackedOperationV1 struct { + // Start time of the operation. + StartAt string `json:"startAt"` + // Operation name. + Operation string `json:"operation"` +} + +// NewTrackedOperationV1 instantiates a new TrackedOperationV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTrackedOperationV1(startAt string, operation string) *TrackedOperationV1 { + this := TrackedOperationV1{} + this.StartAt = startAt + this.Operation = operation + return &this +} + +// NewTrackedOperationV1WithDefaults instantiates a new TrackedOperationV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTrackedOperationV1WithDefaults() *TrackedOperationV1 { + this := TrackedOperationV1{} + return &this +} + +// GetStartAt returns the StartAt field value +func (o *TrackedOperationV1) GetStartAt() string { + if o == nil { + var ret string + return ret + } + + return o.StartAt +} + +// GetStartAtOk returns a tuple with the StartAt field value +// and a boolean to check if the value has been set. +func (o *TrackedOperationV1) GetStartAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartAt, true +} + +// SetStartAt sets field value +func (o *TrackedOperationV1) SetStartAt(v string) { + o.StartAt = v +} + +// GetOperation returns the Operation field value +func (o *TrackedOperationV1) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *TrackedOperationV1) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *TrackedOperationV1) SetOperation(v string) { + o.Operation = v +} + +func (o TrackedOperationV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TrackedOperationV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startAt"] = o.StartAt + toSerialize["operation"] = o.Operation + return toSerialize, nil +} + +type NullableTrackedOperationV1 struct { + value *TrackedOperationV1 + isSet bool +} + +func (v NullableTrackedOperationV1) Get() *TrackedOperationV1 { + return v.value +} + +func (v *NullableTrackedOperationV1) Set(val *TrackedOperationV1) { + v.value = val + v.isSet = true +} + +func (v NullableTrackedOperationV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTrackedOperationV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTrackedOperationV1(val *TrackedOperationV1) *NullableTrackedOperationV1 { + return &NullableTrackedOperationV1{value: val, isSet: true} +} + +func (v NullableTrackedOperationV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTrackedOperationV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..52f26e5d1f --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 0000000000..a44c39da81 --- /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 0000000000..b796a960e6 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..b97f81edc8 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Persistence Ethereum + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..90544820c4 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,26 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..1b8016e902 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/MonitoredToken.java +src/main/java/org/openapitools/client/model/StatusResponseV1.java +src/main/java/org/openapitools/client/model/TokenTypeV1.java +src/main/java/org/openapitools/client/model/TrackedOperationV1.java diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..024ebdceb5 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,140 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Persistence Ethereum +- API version: v2.0.0-alpha.2 + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + StatusResponseV1 result = apiInstance.getStatusV1(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status | Get the status of persistence plugin for ethereum + + +## Documentation for Models + + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [MonitoredToken](docs/MonitoredToken.md) + - [StatusResponseV1](docs/StatusResponseV1.md) + - [TokenTypeV1](docs/TokenTypeV1.md) + - [TrackedOperationV1](docs/TrackedOperationV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..3d0cdb2103 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,150 @@ +openapi: 3.0.3 +info: + description: Synchronizes state of an ethereum ledger into a DB that can later be + viewed in GUI + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Persistence Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status: + get: + operationId: getStatusV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/StatusResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get the status of persistence plugin for ethereum + x-hyperledger-cactus: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status + x-accepts: application/json +components: + schemas: + TokenTypeV1: + enum: + - erc20 + - erc721 + type: string + x-enum-descriptions: + - "EIP-20: Token Standard" + - "EIP-721: Non-Fungible Token Standard" + x-enum-varnames: + - ERC20 + - ERC721 + MonitoredToken: + description: Ethereum tokens that are being monitored by the persistence plugin. + properties: + type: + $ref: '#/components/schemas/TokenTypeV1' + name: + description: Token name + nullable: false + type: string + symbol: + description: Token symbol + nullable: false + type: string + required: + - name + - symbol + - type + type: object + TrackedOperationV1: + description: Persistence plugin operation that is tracked and returned in status + report. + example: + operation: operation + startAt: startAt + properties: + startAt: + description: Start time of the operation. + nullable: false + type: string + operation: + description: Operation name. + nullable: false + type: string + required: + - operation + - startAt + type: object + StatusResponseV1: + description: Response with plugin status report. + example: + connected: true + monitoredTokensCount: 0.8008281904610115 + instanceId: instanceId + lastSeenBlock: 6.027456183070403 + monitorRunning: true + webServicesRegistered: true + operationsRunning: + - operation: operation + startAt: startAt + - operation: operation + startAt: startAt + properties: + instanceId: + description: Plugin instance id. + nullable: false + type: string + connected: + description: "True if successfully connected to the database, false otherwise." + nullable: false + type: boolean + webServicesRegistered: + description: True if web services were correctly exported. + nullable: false + type: boolean + monitoredTokensCount: + description: Total number of tokens being monitored by the plugin. + nullable: false + type: number + operationsRunning: + items: + $ref: '#/components/schemas/TrackedOperationV1' + type: array + monitorRunning: + description: "True if block monitoring is running, false otherwise." + nullable: false + type: boolean + lastSeenBlock: + description: Number of the last block seen by the block monitor. + nullable: false + type: number + required: + - connected + - instanceId + - lastSeenBlock + - monitorRunning + - monitoredTokensCount + - operationsRunning + - webServicesRegistered + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..6c1e299176 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..0efcebdee7 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..6253efdb40 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..efb7f6aeee --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..ac18df91e5 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..6416999808 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,404 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MonitoredToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StatusResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TrackedOperationV1.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..0dc9f7565a --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..a651636fb4 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..aca5db1a1f --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..f319bff832 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..fab584e927 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,195 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.StatusResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getStatusV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getStatusV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getStatusV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getStatusV1Call(_callback); + + } + + /** + * Get the status of persistence plugin for ethereum + * + * @return StatusResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public StatusResponseV1 getStatusV1() throws ApiException { + ApiResponse localVarResp = getStatusV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the status of persistence plugin for ethereum + * + * @return ApiResponse<StatusResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse getStatusV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the status of persistence plugin for ethereum (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getStatusV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..871df0b1a7 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..371d725798 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..94acbd23cc --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..88eed38497 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..e4c0fa8948 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 0000000000..230d098dfb --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java new file mode 100644 index 0000000000..ede55b2a57 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.TokenTypeV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Ethereum tokens that are being monitored by the persistence plugin. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MonitoredToken { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TokenTypeV1 type; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + @SerializedName(SERIALIZED_NAME_SYMBOL) + private String symbol; + + public MonitoredToken() { + } + + public MonitoredToken type(TokenTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public TokenTypeV1 getType() { + return type; + } + + + public void setType(TokenTypeV1 type) { + this.type = type; + } + + + public MonitoredToken name(String name) { + + this.name = name; + return this; + } + + /** + * Token name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public MonitoredToken symbol(String symbol) { + + this.symbol = symbol; + return this; + } + + /** + * Token symbol + * @return symbol + **/ + @javax.annotation.Nonnull + public String getSymbol() { + return symbol; + } + + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitoredToken monitoredToken = (MonitoredToken) o; + return Objects.equals(this.type, monitoredToken.type) && + Objects.equals(this.name, monitoredToken.name) && + Objects.equals(this.symbol, monitoredToken.symbol); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, symbol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitoredToken {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("name"); + openapiFields.add("symbol"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("symbol"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MonitoredToken + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!MonitoredToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MonitoredToken is not found in the empty JSON string", MonitoredToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MonitoredToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MonitoredToken` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MonitoredToken.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("symbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MonitoredToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MonitoredToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MonitoredToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MonitoredToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MonitoredToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MonitoredToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of MonitoredToken + * @throws IOException if the JSON string is invalid with respect to MonitoredToken + */ + public static MonitoredToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MonitoredToken.class); + } + + /** + * Convert an instance of MonitoredToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java new file mode 100644 index 0000000000..a728261e26 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java @@ -0,0 +1,412 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.TrackedOperationV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response with plugin status report. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StatusResponseV1 { + public static final String SERIALIZED_NAME_INSTANCE_ID = "instanceId"; + @SerializedName(SERIALIZED_NAME_INSTANCE_ID) + private String instanceId; + + public static final String SERIALIZED_NAME_CONNECTED = "connected"; + @SerializedName(SERIALIZED_NAME_CONNECTED) + private Boolean connected; + + public static final String SERIALIZED_NAME_WEB_SERVICES_REGISTERED = "webServicesRegistered"; + @SerializedName(SERIALIZED_NAME_WEB_SERVICES_REGISTERED) + private Boolean webServicesRegistered; + + public static final String SERIALIZED_NAME_MONITORED_TOKENS_COUNT = "monitoredTokensCount"; + @SerializedName(SERIALIZED_NAME_MONITORED_TOKENS_COUNT) + private BigDecimal monitoredTokensCount; + + public static final String SERIALIZED_NAME_OPERATIONS_RUNNING = "operationsRunning"; + @SerializedName(SERIALIZED_NAME_OPERATIONS_RUNNING) + private List operationsRunning = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MONITOR_RUNNING = "monitorRunning"; + @SerializedName(SERIALIZED_NAME_MONITOR_RUNNING) + private Boolean monitorRunning; + + public static final String SERIALIZED_NAME_LAST_SEEN_BLOCK = "lastSeenBlock"; + @SerializedName(SERIALIZED_NAME_LAST_SEEN_BLOCK) + private BigDecimal lastSeenBlock; + + public StatusResponseV1() { + } + + public StatusResponseV1 instanceId(String instanceId) { + + this.instanceId = instanceId; + return this; + } + + /** + * Plugin instance id. + * @return instanceId + **/ + @javax.annotation.Nonnull + public String getInstanceId() { + return instanceId; + } + + + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + + public StatusResponseV1 connected(Boolean connected) { + + this.connected = connected; + return this; + } + + /** + * True if successfully connected to the database, false otherwise. + * @return connected + **/ + @javax.annotation.Nonnull + public Boolean getConnected() { + return connected; + } + + + public void setConnected(Boolean connected) { + this.connected = connected; + } + + + public StatusResponseV1 webServicesRegistered(Boolean webServicesRegistered) { + + this.webServicesRegistered = webServicesRegistered; + return this; + } + + /** + * True if web services were correctly exported. + * @return webServicesRegistered + **/ + @javax.annotation.Nonnull + public Boolean getWebServicesRegistered() { + return webServicesRegistered; + } + + + public void setWebServicesRegistered(Boolean webServicesRegistered) { + this.webServicesRegistered = webServicesRegistered; + } + + + public StatusResponseV1 monitoredTokensCount(BigDecimal monitoredTokensCount) { + + this.monitoredTokensCount = monitoredTokensCount; + return this; + } + + /** + * Total number of tokens being monitored by the plugin. + * @return monitoredTokensCount + **/ + @javax.annotation.Nonnull + public BigDecimal getMonitoredTokensCount() { + return monitoredTokensCount; + } + + + public void setMonitoredTokensCount(BigDecimal monitoredTokensCount) { + this.monitoredTokensCount = monitoredTokensCount; + } + + + public StatusResponseV1 operationsRunning(List operationsRunning) { + + this.operationsRunning = operationsRunning; + return this; + } + + public StatusResponseV1 addOperationsRunningItem(TrackedOperationV1 operationsRunningItem) { + if (this.operationsRunning == null) { + this.operationsRunning = new ArrayList<>(); + } + this.operationsRunning.add(operationsRunningItem); + return this; + } + + /** + * Get operationsRunning + * @return operationsRunning + **/ + @javax.annotation.Nonnull + public List getOperationsRunning() { + return operationsRunning; + } + + + public void setOperationsRunning(List operationsRunning) { + this.operationsRunning = operationsRunning; + } + + + public StatusResponseV1 monitorRunning(Boolean monitorRunning) { + + this.monitorRunning = monitorRunning; + return this; + } + + /** + * True if block monitoring is running, false otherwise. + * @return monitorRunning + **/ + @javax.annotation.Nonnull + public Boolean getMonitorRunning() { + return monitorRunning; + } + + + public void setMonitorRunning(Boolean monitorRunning) { + this.monitorRunning = monitorRunning; + } + + + public StatusResponseV1 lastSeenBlock(BigDecimal lastSeenBlock) { + + this.lastSeenBlock = lastSeenBlock; + return this; + } + + /** + * Number of the last block seen by the block monitor. + * @return lastSeenBlock + **/ + @javax.annotation.Nonnull + public BigDecimal getLastSeenBlock() { + return lastSeenBlock; + } + + + public void setLastSeenBlock(BigDecimal lastSeenBlock) { + this.lastSeenBlock = lastSeenBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatusResponseV1 statusResponseV1 = (StatusResponseV1) o; + return Objects.equals(this.instanceId, statusResponseV1.instanceId) && + Objects.equals(this.connected, statusResponseV1.connected) && + Objects.equals(this.webServicesRegistered, statusResponseV1.webServicesRegistered) && + Objects.equals(this.monitoredTokensCount, statusResponseV1.monitoredTokensCount) && + Objects.equals(this.operationsRunning, statusResponseV1.operationsRunning) && + Objects.equals(this.monitorRunning, statusResponseV1.monitorRunning) && + Objects.equals(this.lastSeenBlock, statusResponseV1.lastSeenBlock); + } + + @Override + public int hashCode() { + return Objects.hash(instanceId, connected, webServicesRegistered, monitoredTokensCount, operationsRunning, monitorRunning, lastSeenBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StatusResponseV1 {\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" connected: ").append(toIndentedString(connected)).append("\n"); + sb.append(" webServicesRegistered: ").append(toIndentedString(webServicesRegistered)).append("\n"); + sb.append(" monitoredTokensCount: ").append(toIndentedString(monitoredTokensCount)).append("\n"); + sb.append(" operationsRunning: ").append(toIndentedString(operationsRunning)).append("\n"); + sb.append(" monitorRunning: ").append(toIndentedString(monitorRunning)).append("\n"); + sb.append(" lastSeenBlock: ").append(toIndentedString(lastSeenBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instanceId"); + openapiFields.add("connected"); + openapiFields.add("webServicesRegistered"); + openapiFields.add("monitoredTokensCount"); + openapiFields.add("operationsRunning"); + openapiFields.add("monitorRunning"); + openapiFields.add("lastSeenBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instanceId"); + openapiRequiredFields.add("connected"); + openapiRequiredFields.add("webServicesRegistered"); + openapiRequiredFields.add("monitoredTokensCount"); + openapiRequiredFields.add("operationsRunning"); + openapiRequiredFields.add("monitorRunning"); + openapiRequiredFields.add("lastSeenBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StatusResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StatusResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StatusResponseV1 is not found in the empty JSON string", StatusResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StatusResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StatusResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StatusResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("instanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `instanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instanceId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("operationsRunning").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `operationsRunning` to be an array in the JSON string but got `%s`", jsonObj.get("operationsRunning").toString())); + } + + JsonArray jsonArrayoperationsRunning = jsonObj.getAsJsonArray("operationsRunning"); + // validate the required field `operationsRunning` (array) + for (int i = 0; i < jsonArrayoperationsRunning.size(); i++) { + TrackedOperationV1.validateJsonObject(jsonArrayoperationsRunning.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StatusResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatusResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StatusResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StatusResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StatusResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StatusResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatusResponseV1 + * @throws IOException if the JSON string is invalid with respect to StatusResponseV1 + */ + public static StatusResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatusResponseV1.class); + } + + /** + * Convert an instance of StatusResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java new file mode 100644 index 0000000000..98e8bb1f42 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets TokenTypeV1 + */ +@JsonAdapter(TokenTypeV1.Adapter.class) +public enum TokenTypeV1 { + + /** + * EIP-20: Token Standard + */ + ERC20("erc20"), + + /** + * EIP-721: Non-Fungible Token Standard + */ + ERC721("erc721"); + + private String value; + + TokenTypeV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenTypeV1 fromValue(String value) { + for (TokenTypeV1 b : TokenTypeV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TokenTypeV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenTypeV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenTypeV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java new file mode 100644 index 0000000000..d446448c78 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Persistence plugin operation that is tracked and returned in status report. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TrackedOperationV1 { + public static final String SERIALIZED_NAME_START_AT = "startAt"; + @SerializedName(SERIALIZED_NAME_START_AT) + private String startAt; + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + public TrackedOperationV1() { + } + + public TrackedOperationV1 startAt(String startAt) { + + this.startAt = startAt; + return this; + } + + /** + * Start time of the operation. + * @return startAt + **/ + @javax.annotation.Nonnull + public String getStartAt() { + return startAt; + } + + + public void setStartAt(String startAt) { + this.startAt = startAt; + } + + + public TrackedOperationV1 operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Operation name. + * @return operation + **/ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackedOperationV1 trackedOperationV1 = (TrackedOperationV1) o; + return Objects.equals(this.startAt, trackedOperationV1.startAt) && + Objects.equals(this.operation, trackedOperationV1.operation); + } + + @Override + public int hashCode() { + return Objects.hash(startAt, operation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackedOperationV1 {\n"); + sb.append(" startAt: ").append(toIndentedString(startAt)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("startAt"); + openapiFields.add("operation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("startAt"); + openapiRequiredFields.add("operation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TrackedOperationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TrackedOperationV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackedOperationV1 is not found in the empty JSON string", TrackedOperationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TrackedOperationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackedOperationV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackedOperationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("startAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startAt").toString())); + } + if (!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackedOperationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackedOperationV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackedOperationV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackedOperationV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackedOperationV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackedOperationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackedOperationV1 + * @throws IOException if the JSON string is invalid with respect to TrackedOperationV1 + */ + public static TrackedOperationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackedOperationV1.class); + } + + /** + * Convert an instance of TrackedOperationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..4c68c76f57 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,46 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.StatusResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Get the status of persistence plugin for ethereum + * + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + StatusResponseV1 response = api.getStatusV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 0000000000..70995679df --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java new file mode 100644 index 0000000000..c06fd55fe2 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.TokenTypeV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MonitoredToken + */ +public class MonitoredTokenTest { + private final MonitoredToken model = new MonitoredToken(); + + /** + * Model tests for MonitoredToken + */ + @Test + public void testMonitoredToken() { + // TODO: test MonitoredToken + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'symbol' + */ + @Test + public void symbolTest() { + // TODO: test symbol + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java new file mode 100644 index 0000000000..f138077b7a --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.TrackedOperationV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StatusResponseV1 + */ +public class StatusResponseV1Test { + private final StatusResponseV1 model = new StatusResponseV1(); + + /** + * Model tests for StatusResponseV1 + */ + @Test + public void testStatusResponseV1() { + // TODO: test StatusResponseV1 + } + + /** + * Test the property 'instanceId' + */ + @Test + public void instanceIdTest() { + // TODO: test instanceId + } + + /** + * Test the property 'connected' + */ + @Test + public void connectedTest() { + // TODO: test connected + } + + /** + * Test the property 'webServicesRegistered' + */ + @Test + public void webServicesRegisteredTest() { + // TODO: test webServicesRegistered + } + + /** + * Test the property 'monitoredTokensCount' + */ + @Test + public void monitoredTokensCountTest() { + // TODO: test monitoredTokensCount + } + + /** + * Test the property 'operationsRunning' + */ + @Test + public void operationsRunningTest() { + // TODO: test operationsRunning + } + + /** + * Test the property 'monitorRunning' + */ + @Test + public void monitorRunningTest() { + // TODO: test monitorRunning + } + + /** + * Test the property 'lastSeenBlock' + */ + @Test + public void lastSeenBlockTest() { + // TODO: test lastSeenBlock + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java new file mode 100644 index 0000000000..1fa8042bc5 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TokenTypeV1 + */ +public class TokenTypeV1Test { + /** + * Model tests for TokenTypeV1 + */ + @Test + public void testTokenTypeV1() { + // TODO: test TokenTypeV1 + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java new file mode 100644 index 0000000000..a6b2c7c9fd --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TrackedOperationV1 + */ +public class TrackedOperationV1Test { + private final TrackedOperationV1 model = new TrackedOperationV1(); + + /** + * Model tests for TrackedOperationV1 + */ + @Test + public void testTrackedOperationV1() { + // TODO: test TrackedOperationV1 + } + + /** + * Test the property 'startAt' + */ + @Test + public void startAtTest() { + // TODO: test startAt + } + + /** + * Test the property 'operation' + */ + @Test + public void operationTest() { + // TODO: test operation + } + +} diff --git a/packages/cactus-plugin-persistence-fabric/README.md b/packages/cactus-plugin-persistence-fabric/README.md index f6ef80ef5c..a31cace9ad 100644 --- a/packages/cactus-plugin-persistence-fabric/README.md +++ b/packages/cactus-plugin-persistence-fabric/README.md @@ -37,22 +37,6 @@ yarn run configure Instantiate a new `PluginPersistenceFabrickBlock` instance: -There is few ways to use this plugin: - -1. Using Watch block might cause infinite loop - and function migrateBlockNrWithTransactions -2. Individually using migrateBlockNrWithTransactions - if you know which exactly which blocks you want to analyze -3. Using plugin function continueBlocksSynchronization in some periodical calls -4. Using plugin function continuousBlocksSynchronization in some reasonable time with changeSynchronization - which should break flow - this function might continue work for long period - -5) Best to start synchronization with initialBlocksSynchronization , which will transfer and parse into database number of blocks equal to edgeOfLedger - -6) If there were some issues in network connection or you think that your database might be corrupted and lost some data you might use whichBlocksAreMissingInDdSimple - and then showHowManyBlocksMissing if more than 0 - then use synchronizeOnlyMissedBlocks - ```typescript import { PluginPersistenceFabric } from "../../../main/typescript/plugin-fabric-persistence-block"; import { v4 as uuidv4 } from "uuid"; diff --git a/packages/cactus-plugin-persistence-fabric/package.json b/packages/cactus-plugin-persistence-fabric/package.json index d26afea85f..84cd7ddfa7 100644 --- a/packages/cactus-plugin-persistence-fabric/package.json +++ b/packages/cactus-plugin-persistence-fabric/package.json @@ -59,7 +59,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "copy-yarn-lock": "cp -af ../../yarn.lock ./dist/yarn.lock", - "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk": "run-p 'generate-sdk:*'", + "generate-sdk: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", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1", + "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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.gitignore b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator-ignore b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator-ignore new file mode 100644 index 0000000000..b7091bcae2 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +docs/** \ No newline at end of file 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 0000000000..664f25337a --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,11 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +client.go +configuration.go +git_push.sh +go.mod +go.sum +response.go +utils.go diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /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 0000000000..f5cb2ce9a5 --- /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 0000000000..1071ac7355 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,109 @@ +# Go API client for cactus-plugin-persistence-fabric + +Scrap fabric ledger into database. Needs administrative privileges. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-persistence-fabric "github.com/hyperledger/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation For Models + + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 0000000000..89d1a3138d --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,13 @@ +openapi: 3.0.3 +info: + description: Scrap fabric ledger into database. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Block Fabrick PErsistance + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + schemas: {} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 0000000000..58bb7fa384 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,653 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Block Fabrick PErsistance API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 0000000000..1aee29d815 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/git_push.sh b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/git_push.sh new file mode 100644 index 0000000000..eea14f96ed --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="hyperledger" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' 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 0000000000..f02f97435b --- /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 0000000000..c966c8ddfd --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 0000000000..36dea73546 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 0000000000..24c64ec204 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 0000000000..d76fe98032 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Hyperledger Cactus Plugin - Block Fabrick PErsistance + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.gitignore b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator-ignore b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator-ignore new file mode 100644 index 0000000000..4731af7c21 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator-ignore @@ -0,0 +1,27 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + + +docs/** +gradle/** \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 0000000000..5796f87194 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,32 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 0000000000..1b6741c083 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 0000000000..eef130f8d4 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,107 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Block Fabrick PErsistance +- API version: v2.0.0-alpha.2 + +Scrap fabric ledger into database. Needs administrative privileges. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation for Models + + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 0000000000..22a61afe64 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.3 +info: + description: Scrap fabric ledger into database. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Block Fabrick PErsistance + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + schemas: {} + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 0000000000..5dc4412c31 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 0000000000..52a62bdcd1 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/git_push.sh b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 0000000000..a340857827 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 0000000000..005bcde042 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 0000000000..6a68175eb7 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 0000000000..0c56425534 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 0000000000..369ba54a9e --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 0000000000..b6a4c901b0 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..3ee98bec14 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +/** + *

ApiClient class.

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

Getter for the field keyManagers.

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

Getter for the field dateFormat.

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

Setter for the field dateFormat.

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

Set SqlDateFormat.

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

Set OffsetDateTimeFormat.

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

Set LocalDateFormat.

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

Set LenientOnJson.

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

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

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

Constructor for ApiException.

+ * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..d5ea165e41 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

Constructor for ApiResponse.

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

Constructor for ApiResponse.

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

Get the status code.

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

Get the headers.

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

Get the data.

+ * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..4e4cf4bc07 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000..b18a5ca23d --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..2531627922 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,400 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..e36d8c1359 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 0000000000..cd2fd4dec5 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 0000000000..c45581dc4f --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..59edc528a4 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..c1b6351c3c --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..f40ed5192e --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..e03641e376 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..b6cc3cb2cd --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..84ef8b9ddd --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..fd94b3eae3 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/typescript/plugin-persistence-fabric.ts b/packages/cactus-plugin-persistence-fabric/src/main/typescript/plugin-persistence-fabric.ts index 90b30f77e2..7aae96952e 100644 --- a/packages/cactus-plugin-persistence-fabric/src/main/typescript/plugin-persistence-fabric.ts +++ b/packages/cactus-plugin-persistence-fabric/src/main/typescript/plugin-persistence-fabric.ts @@ -58,8 +58,6 @@ export class PluginPersistenceFabric private isConnected = false; private isWebServicesRegistered = false; - private failedBlocks = new Set(); - // = > private lastSeenBlock = 0; private lastSeenBlock = 0; // Last Block in Ledger @@ -69,12 +67,11 @@ export class PluginPersistenceFabric private missedBlocks: string[] = []; private howManyBlocksMissing = 0; - public ledgerChannelName = "mychannel"; - public ledgerContractName = "basic"; + private ledgerChannelName = "mychannel"; // gateway options - public gatewayOptions: GatewayOptions; + private gatewayOptions: GatewayOptions; // synchronization ongoing - public synchronizationGo = true; + private synchronizationGo = true; constructor(public readonly options: IPluginPersistenceFabricOptions) { const level = this.options.logLevel || "INFO"; @@ -128,12 +125,6 @@ export class PluginPersistenceFabric public getInstanceId(): string { return this.instanceId; } - // this is just test function to check if you correctly created instance of plugin - public async helloWorldTest(): Promise { - return new Promise((resolve) => { - resolve("hello World test"); - }); - } public getPackageName(): string { return `@hyperledger/cactus-plugin-persistence-fabric`; @@ -154,6 +145,7 @@ export class PluginPersistenceFabric webServices.forEach((ws) => ws.registerExpress(app)); return webServices; } + // For future development public async getOrCreateWebServices(): Promise { const pkgName = this.getPackageName(); @@ -173,27 +165,11 @@ export class PluginPersistenceFabric return endpoints; } - // current last block from ledger ( not in database ) - public currentLastBlock(): number { - return this.lastBlock; - } - // this is greatest block number successfully migrated to database - public currentLastSeenBlock(): number { - return this.lastSeenBlock; - } - // Additional check if ledger is in synchronization - public isLastBlockGreatherThenLastSeen(): boolean { - if (this.lastSeenBlock >= this.lastBlock) { - return false; - } else { - return true; - } - } /** * lastBlockInLedger * @returns this.lastBlock which is last block in ledger assuming using getBlock and node js SDK */ - public async lastBlockInLedger( + private async lastBlockInLedger( signingCredentialInput: FabricSigningCredential, ): Promise { const lastBlockInChainTest = await this.apiClient.runTransactionV1({ @@ -216,12 +192,13 @@ export class PluginPersistenceFabric const lastBlock = lastBlockPreview.height; return lastBlock; } + //test /** * lastBlockInLedgerWithoutFabricProto * @returns this.lastBlock which is last block in ledger assuming using getBlock and node js SDK */ - public async lastBlockInLedgerWithoutFabricProto(): Promise { + private async lastBlockInLedgerWithoutFabricProto(): Promise { let tempBlockNumber = this.lastBlock; let blockNumber = tempBlockNumber.toString(); let block: AxiosResponse = @@ -254,6 +231,7 @@ export class PluginPersistenceFabric } while (moreBlocks); return this.lastBlock; } + /** Synchronization of blocks * - Synchronize entire first edgeOfLedger blocks of ledger state * @param edgeOfLedger defines which part of blockchain do we want to include in database @@ -262,7 +240,9 @@ export class PluginPersistenceFabric * // future changes - parameter to set which part of blokchain to move to database */ - async initialBlocksSynchronization(edgeOfLedger: number): Promise { + private async initialBlocksSynchronization( + edgeOfLedger: number, + ): Promise { let tempBlockNumber = 0; let blockNumber = tempBlockNumber.toString(); let block: AxiosResponse = @@ -312,10 +292,9 @@ export class PluginPersistenceFabric * @returns string promise lastBlock number after finishing the process * */ - - async continueBlocksSynchronization( + public async syncAll( signingCredential: FabricSigningCredential, - ): Promise { + ): Promise { this.lastSeenBlock = await this.dbClient.getMaxBlockNumber(); let tempBlockNumber = this.lastSeenBlock; let blockNumber = tempBlockNumber.toString(); @@ -351,7 +330,7 @@ export class PluginPersistenceFabric this.synchronizationGo = false; } } while (this.synchronizationGo); - return "done"; + return 1; } /** Synchronization of blocks @@ -362,8 +341,9 @@ export class PluginPersistenceFabric */ // NOTE: this function can loop into very long almost infinite loop or even // infinite loop - async continuousBlocksSynchronization( + public async startMonitor( signingCredential: FabricSigningCredential, + onError?: (err: unknown) => void, ): Promise { this.lastSeenBlock = await this.dbClient.getMaxBlockNumber(); this.synchronizationGo = true; @@ -384,7 +364,9 @@ export class PluginPersistenceFabric }, }); } catch (error) { - this.log.info("Last block in ledger", tempBlockNumber - 1); + if (onError) { + onError(error); + } } if (block?.status == 200) { @@ -417,7 +399,7 @@ export class PluginPersistenceFabric return "stopped"; } - async changeSynchronization(): Promise { + private async changeSynchronization(): Promise { if (this.synchronizationGo) { this.synchronizationGo = false; } else { @@ -426,7 +408,7 @@ export class PluginPersistenceFabric return this.synchronizationGo; } - async getBlockFromLedger(blockNumber: string): Promise { + private async getBlockFromLedger(blockNumber: string): Promise { const block: AxiosResponse = await this.apiClient.getBlockV1({ channelName: this.ledgerChannelName, @@ -450,7 +432,7 @@ export class PluginPersistenceFabric * block number to be moved from ledger to database * @returns true a boolean which indicates successfull migration */ - public async migrateBlockNrWithTransactions( + private async migrateBlockNrWithTransactions( blockNumber: string, ): Promise { const block: AxiosResponse = @@ -711,7 +693,7 @@ export class PluginPersistenceFabric If some blocks above this number are already in database they will not be removed. * @returns number which is this.lastBlock , artificially set lastBlock in ledger */ - public setLastBlockConsidered(limitLastBlockConsidered: number): number { + private setLastBlockConsidered(limitLastBlockConsidered: number): number { this.lastBlock = limitLastBlockConsidered; return this.lastBlock; } @@ -721,7 +703,7 @@ If some blocks above this number are already in database they will not be remove * @returns number blocks missing according to last run of function which checks missing blocks * whichBlocksAreMissingInDdSimple */ - public showHowManyBlocksMissing(): number { + private showHowManyBlocksMissing(): number { return this.howManyBlocksMissing; } @@ -730,7 +712,7 @@ If some blocks above this number are already in database they will not be remove * that could not be synchronized with the DB for some reasons and list them * @returns number of missing blocks */ - public async whichBlocksAreMissingInDdSimple(): Promise { + private async whichBlocksAreMissingInDdSimple(): Promise { this.howManyBlocksMissing = 0; for (let iterator: number = this.lastBlock; iterator >= 0; iterator--) { @@ -750,7 +732,7 @@ If some blocks above this number are already in database they will not be remove * run function whichBlocksAreMissingInDdSimple before using this one * @returns number of missing blocks if any , should return 0 */ - async synchronizeOnlyMissedBlocks(): Promise { + public async syncFailedBlocks(): Promise { if (this.howManyBlocksMissing > 0) { let missedIndex = 0; let blockNumber: string = this.missedBlocks[missedIndex]; @@ -791,7 +773,7 @@ If some blocks above this number are already in database they will not be remove /** migrateNextBlock * tries to migrate next block according to lastBlock information stored in plugin */ - public async migrateNextBlock(): Promise { + private async migrateNextBlock(): Promise { const toMigrate: number = this.lastBlock + 1; try { await this.migrateBlockNrWithTransactions(toMigrate.toString()); @@ -804,7 +786,7 @@ If some blocks above this number are already in database they will not be remove return 0; } - public async insertBlockDataEntry( + private async insertBlockDataEntry( data: InsertBlockDataEntryInterface, ): Promise { console.log("insert Block Data Entry"); diff --git a/packages/cactus-test-geth-ledger/src/test/solidity/hello-world-contract/HelloWorld.json b/packages/cactus-test-geth-ledger/src/test/solidity/hello-world-contract/HelloWorld.json new file mode 100644 index 0000000000..4cd84064e1 --- /dev/null +++ b/packages/cactus-test-geth-ledger/src/test/solidity/hello-world-contract/HelloWorld.json @@ -0,0 +1,409 @@ +{ + "contractName": "HelloWorld", + "abi": [ + { + "inputs": [], + "name": "getName", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sayHello", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.7.2+commit.51b20bc0\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"getName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sayHello\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newName\",\"type\":\"string\"}],\"name\":\"setName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/peter/a/blockchain/blockchain-integration-framework/packages/cactus-plugin-ledger-connector-quorum/src/test/solidity/hello-world-contract/HelloWorld.sol\":\"HelloWorld\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/peter/a/blockchain/blockchain-integration-framework/packages/cactus-plugin-ledger-connector-quorum/src/test/solidity/hello-world-contract/HelloWorld.sol\":{\"keccak256\":\"0x0b78fa11f33f7936a80da194c49f04198e38947e3f98f3a7b765b4adb4c455c1\",\"urls\":[\"bzz-raw://12697aa12341c70ed7a411a27a17398dcb2d4336a14dac51845e2123acf174c7\",\"dweb:/ipfs/QmPhH1UbHtUeeen9W2qMDwEVVWAtVJSMN29Nch5q8Gax1D\"]}},\"version\":1}", + "bytecode": "60c0604052600d60808190526c4361707461696e43616374757360981b60a090815261002e9160009190610041565b5034801561003b57600080fd5b506100d4565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061008257805160ff19168380011785556100af565b828001600101855582156100af579182015b828111156100af578251825591602001919060010190610094565b506100bb9291506100bf565b5090565b5b808211156100bb57600081556001016100c0565b61030f806100e36000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806317d7de7c14610046578063c47f0027146100c3578063ef5fb05b1461016b575b600080fd5b61004e610173565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610088578181015183820152602001610070565b50505050905090810190601f1680156100b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610169600480360360208110156100d957600080fd5b8101906020810181356401000000008111156100f457600080fd5b82018360208201111561010657600080fd5b8035906020019184600183028401116401000000008311171561012857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610209945050505050565b005b61004e610220565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156101ff5780601f106101d4576101008083540402835291602001916101ff565b820191906000526020600020905b8154815290600101906020018083116101e257829003601f168201915b5050505050905090565b805161021c906000906020840190610246565b5050565b60408051808201909152600c81526b48656c6c6f20576f726c642160a01b602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061028757805160ff19168380011785556102b4565b828001600101855582156102b4579182015b828111156102b4578251825591602001919060010190610299565b506102c09291506102c4565b5090565b5b808211156102c057600081556001016102c556fea2646970667358221220965216915797db694e698c024753d560e1989f2aebb14463f9225b2297003b2c64736f6c63430007020033", + "deployedBytecode": "608060405234801561001057600080fd5b50600436106100415760003560e01c806317d7de7c14610046578063c47f0027146100c3578063ef5fb05b1461016b575b600080fd5b61004e610173565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610088578181015183820152602001610070565b50505050905090810190601f1680156100b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610169600480360360208110156100d957600080fd5b8101906020810181356401000000008111156100f457600080fd5b82018360208201111561010657600080fd5b8035906020019184600183028401116401000000008311171561012857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610209945050505050565b005b61004e610220565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156101ff5780601f106101d4576101008083540402835291602001916101ff565b820191906000526020600020905b8154815290600101906020018083116101e257829003601f168201915b5050505050905090565b805161021c906000906020840190610246565b5050565b60408051808201909152600c81526b48656c6c6f20576f726c642160a01b602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061028757805160ff19168380011785556102b4565b828001600101855582156102b4579182015b828111156102b4578251825591602001919060010190610299565b506102c09291506102c4565b5090565b5b808211156102c057600081556001016102c556fea2646970667358221220965216915797db694e698c024753d560e1989f2aebb14463f9225b2297003b2c64736f6c63430007020033", + "sourceMap": "463:37:0:-:0;439:322;463:37;;439:322;463:37;;;-1:-1:-1;;;463:37:0;;;;;;-1:-1:-1;;463:37:0;;:::i;:::-;;439:322;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;439:322:0;;;-1:-1:-1;439:322:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;", + "deployedSourceMap": "439:322:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;598:81;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;683:76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;683:76:0;;-1:-1:-1;683:76:0;;-1:-1:-1;;;;;683:76:0:i;:::-;;505:89;;;:::i;598:81::-;670:4;663:11;;;;;;;;-1:-1:-1;;663:11:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;638:13;;663:11;;670:4;;663:11;;670:4;663:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;598:81;:::o;683:76::-;740:14;;;;:4;;:14;;;;;:::i;:::-;;683:76;:::o;505:89::-;568:21;;;;;;;;;;;;-1:-1:-1;;;568:21:0;;;;505:89;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;", + "sourcePath": "/home/peter/a/blockchain/blockchain-integration-framework/packages/cactus-plugin-ledger-connector-quorum/src/test/solidity/hello-world-contract/HelloWorld.sol", + "compiler": { + "name": "solc", + "version": "0.7.2+commit.51b20bc0" + }, + "networks": {}, + "ast": { + "absolutePath": "/home/peter/a/blockchain/blockchain-integration-framework/packages/cactus-plugin-ledger-connector-quorum/src/test/solidity/hello-world-contract/HelloWorld.sol", + "exportedSymbols": { + "HelloWorld": [31] + }, + "id": 32, + "nodeType": "SourceUnit", + "nodes": [ + { + "id": 1, + "literals": ["solidity", ">=", "0.7", ".0"], + "nodeType": "PragmaDirective", + "src": "413:24:0" + }, + { + "abstract": false, + "baseContracts": [], + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "id": 31, + "linearizedBaseContracts": [31], + "name": "HelloWorld", + "nodeType": "ContractDefinition", + "nodes": [ + { + "constant": false, + "id": 4, + "mutability": "mutable", + "name": "name", + "nodeType": "VariableDeclaration", + "scope": 31, + "src": "463:37:0", + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string" + }, + "typeName": { + "id": 2, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "463:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": { + "hexValue": "4361707461696e436163747573", + "id": 3, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "485:15:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_bdd2f21877c99489ddcc32737686677f40d460368c7982ce22ce4f72b41b0312", + "typeString": "literal_string \"CaptainCactus\"" + }, + "value": "CaptainCactus" + }, + "visibility": "private" + }, + { + "body": { + "id": 11, + "nodeType": "Block", + "src": "562:32:0", + "statements": [ + { + "expression": { + "hexValue": "48656c6c6f20576f726c6421", + "id": 9, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "575:14:0", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_3ea2f1d0abf3fc66cf29eebb70cbd4e7fe762ef8a09bcc06c8edf641230afec0", + "typeString": "literal_string \"Hello World!\"" + }, + "value": "Hello World!" + }, + "functionReturnParameters": 8, + "id": 10, + "nodeType": "Return", + "src": "568:21:0" + } + ] + }, + "functionSelector": "ef5fb05b", + "id": 12, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "sayHello", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 5, + "nodeType": "ParameterList", + "parameters": [], + "src": "523:2:0" + }, + "returnParameters": { + "id": 8, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 12, + "src": "547:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 6, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "547:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "546:15:0" + }, + "scope": 31, + "src": "505:89:0", + "stateMutability": "pure", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 19, + "nodeType": "Block", + "src": "655:24:0", + "statements": [ + { + "expression": { + "id": 17, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "670:4:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "functionReturnParameters": 16, + "id": 18, + "nodeType": "Return", + "src": "663:11:0" + } + ] + }, + "functionSelector": "17d7de7c", + "id": 20, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getName", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 13, + "nodeType": "ParameterList", + "parameters": [], + "src": "614:2:0" + }, + "returnParameters": { + "id": 16, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 15, + "mutability": "mutable", + "name": "", + "nodeType": "VariableDeclaration", + "scope": 20, + "src": "638:13:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 14, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "638:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "637:15:0" + }, + "scope": 31, + "src": "598:81:0", + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "body": { + "id": 29, + "nodeType": "Block", + "src": "732:27:0", + "statements": [ + { + "expression": { + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 25, + "name": "name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 4, + "src": "740:4:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "id": 26, + "name": "newName", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 22, + "src": "747:7:0", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "740:14:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 28, + "nodeType": "ExpressionStatement", + "src": "740:14:0" + } + ] + }, + "functionSelector": "c47f0027", + "id": 30, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "setName", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 23, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 22, + "mutability": "mutable", + "name": "newName", + "nodeType": "VariableDeclaration", + "scope": 30, + "src": "700:21:0", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 21, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "700:6:0", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "visibility": "internal" + } + ], + "src": "699:23:0" + }, + "returnParameters": { + "id": 24, + "nodeType": "ParameterList", + "parameters": [], + "src": "732:0:0" + }, + "scope": 31, + "src": "683:76:0", + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "scope": 32, + "src": "439:322:0" + } + ], + "src": "413:349:0" + }, + "functionHashes": { + "getName()": "17d7de7c", + "sayHello()": "ef5fb05b", + "setName(string)": "c47f0027" + }, + "gasEstimates": { + "creation": { + "codeDepositCost": "156600", + "executionCost": "infinite", + "totalCost": "infinite" + }, + "external": { + "getName()": "infinite", + "sayHello()": "infinite", + "setName(string)": "infinite" + } + } +} diff --git a/packages/cactus-test-geth-ledger/src/test/solidity/hello-world-contract/HelloWorld.sol b/packages/cactus-test-geth-ledger/src/test/solidity/hello-world-contract/HelloWorld.sol new file mode 100644 index 0000000000..201fddd6fc --- /dev/null +++ b/packages/cactus-test-geth-ledger/src/test/solidity/hello-world-contract/HelloWorld.sol @@ -0,0 +1,24 @@ +// ***************************************************************************** +// IMPORTANT: If you update this code then make sure to recompile +// it and update the .json file as well so that they +// remain in sync for consistent test executions. +// With that said, there shouldn't be any reason to recompile this, like ever... +// ***************************************************************************** + +pragma solidity >=0.7.0; + +contract HelloWorld { + string private name = "CaptainCactus"; + + function sayHello() public pure returns (string memory) { + return "Hello World!"; + } + + function getName() public view returns (string memory) { + return name; + } + + function setName(string memory newName) public { + name = newName; + } +} diff --git a/packages/cactus-test-geth-ledger/src/test/typescript/integration/geth-test-ledger.test.ts b/packages/cactus-test-geth-ledger/src/test/typescript/integration/geth-test-ledger.test.ts index 9cae4bb245..3289183a93 100644 --- a/packages/cactus-test-geth-ledger/src/test/typescript/integration/geth-test-ledger.test.ts +++ b/packages/cactus-test-geth-ledger/src/test/typescript/integration/geth-test-ledger.test.ts @@ -6,15 +6,11 @@ // Constants ////////////////////////////////// -// Ledger settings -// const containerImageName = "ghcr.io/hyperledger/cactus-geth-all-in-one"; -// const containerImageVersion = "2022-10-18-06770b6c"; -// const useRunningLedger = false; - // Log settings const testLogLevel: LogLevelDesc = "info"; import { GethTestLedger } from "../../../main/typescript/index"; +import contractData from "../../solidity/hello-world-contract/HelloWorld.json"; import { LogLevelDesc, @@ -37,6 +33,7 @@ const log: Logger = LoggerProvider.getOrCreate({ */ describe("Geth Test Ledger checks", () => { let ledger: GethTestLedger; + let web3Instance: Web3; ////////////////////////////////// // Environment Setup @@ -51,10 +48,12 @@ describe("Geth Test Ledger checks", () => { emitContainerLogs: true, logLevel: testLogLevel, }); - log.debug("Geth image:", ledger.fullContainerImageName); expect(ledger).toBeTruthy(); + log.debug("Geth image:", ledger.fullContainerImageName); await ledger.start(); + web3Instance = new Web3(await ledger.getRpcApiHttpHost()); + expect(web3Instance).toBeTruthy; }); afterAll(async () => { @@ -99,4 +98,78 @@ describe("Geth Test Ledger checks", () => { wsWeb3.provider?.disconnect(); } }); + + test("Class name is correct", async () => { + const className = ledger.className; + expect(className).toEqual("GethTestLedger"); + }); + + test("Method createEthTestAccount works", async () => { + const testEthAcc = await ledger.createEthTestAccount(); + + expect(testEthAcc).toBeTruthy(); + expect(testEthAcc.address).toHaveLength(42); + expect(testEthAcc.address).toStartWith("0x"); + }); + + test("Method newEthPersonalAccount works", async () => { + const testEthAccount = await ledger.newEthPersonalAccount(); + + expect(testEthAccount).toBeTruthy(); + expect(testEthAccount).toHaveLength(42); + expect(testEthAccount).toStartWith("0x"); + }); + + test("Method transferAssetFromCoinbase works", async () => { + const testEthAcc = await ledger.createEthTestAccount(); + + const txReceipt = await ledger.transferAssetFromCoinbase( + testEthAcc.address, + 1000, + ); + + expect(txReceipt).toBeTruthy(); + expect(web3Instance.utils.toChecksumAddress(txReceipt.to)).toEqual( + testEthAcc.address, + ); + expect(await web3Instance.eth.getBalance(testEthAcc.address)).toEqual( + BigInt("10000000000000001000"), + ); + }); + + test("Method deployContract works and returns contract address", async () => { + const deployedData = await ledger.deployContract( + contractData.abi, + contractData.bytecode, + [], + ); + expect(deployedData).toBeTruthy(); + expect(deployedData.contractAddress).toStartWith("0x"); + expect(deployedData.contractAddress).toHaveLength(42); + + const contract = new web3Instance.eth.Contract( + contractData.abi, + deployedData.contractAddress, + ); + expect(contract).toBeTruthy(); + + const contractCallResult = await contract.methods.sayHello().call(); + expect(contractCallResult).toEqual("Hello World!"); + }); + + test("Method getRpcApiHttpHost returns valid URL", async () => { + const httpHostAddress = await ledger.getRpcApiHttpHost(); + const httpPort = await ledger.getHostPortHttp(); + expect(httpHostAddress).toBeTruthy(); + expect(httpHostAddress).toStartWith("http://"); + expect(httpHostAddress).toContain(`${httpPort}`); + }); + + test("Method getRpcApiWebSocketHost returns valid URL", async () => { + const wsHostAddress = await ledger.getRpcApiWebSocketHost(); + const wsPort = await ledger.getHostPortWs(); + expect(wsHostAddress).toBeTruthy(); + expect(wsHostAddress).toStartWith("ws://"); + expect(wsHostAddress).toContain(`${wsPort}`); + }); }); diff --git a/packages/cactus-test-geth-ledger/tsconfig.json b/packages/cactus-test-geth-ledger/tsconfig.json index 95cf4429f7..ea14a1f425 100644 --- a/packages/cactus-test-geth-ledger/tsconfig.json +++ b/packages/cactus-test-geth-ledger/tsconfig.json @@ -7,9 +7,7 @@ "rootDir": "./src", "tsBuildInfoFile": "../../.build-cache/cactus-test-geth-ledger.tsbuildinfo" }, - "include": [ - "./src" - ], + "include": ["./src", "src/**/*.json"], "references": [ { "path": "../cactus-common/tsconfig.json" @@ -18,4 +16,4 @@ "path": "../cactus-test-tooling/tsconfig.json" } ] -} \ No newline at end of file +} diff --git a/packages/cactus-test-tooling/src/main/typescript/common/containers.ts b/packages/cactus-test-tooling/src/main/typescript/common/containers.ts index fbedd731ef..c8f2a86183 100644 --- a/packages/cactus-test-tooling/src/main/typescript/common/containers.ts +++ b/packages/cactus-test-tooling/src/main/typescript/common/containers.ts @@ -443,7 +443,7 @@ export class Containers { log.debug(JSON.stringify(msg.progress || msg.status)); }, 1000); - const pullStreamStartedHandler = (pullError: unknown, stream: Stream) => { + const pullStreamStartedHandler = (pullError: unknown, stream: NodeJS.ReadableStream) => { if (pullError) { log.error(`Could not even start ${imageFqn} pull:`, pullError); reject(pullError); diff --git a/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts b/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts index 75723d9304..0f9266254e 100644 --- a/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts +++ b/packages/cactus-test-tooling/src/main/typescript/http-echo/http-echo-container.ts @@ -211,7 +211,7 @@ export class HttpEchoContainer implements ITestLedger { private pullContainerImage(containerNameAndTag: string): Promise { return new Promise((resolve, reject) => { const docker = new Docker(); - docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => { + docker.pull(containerNameAndTag, (pullError: unknown, stream: NodeJS.ReadableStream) => { if (pullError) { reject(pullError); } else { diff --git a/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts b/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts index 9a203ba8e7..b05f18cfe8 100644 --- a/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts +++ b/packages/cactus-test-tooling/src/main/typescript/postgres/postgres-test-container.ts @@ -287,7 +287,7 @@ export class PostgresTestContainer implements ITestLedger { private pullContainerImage(containerNameAndTag: string): Promise { return new Promise((resolve, reject) => { const docker = new Docker(); - docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => { + docker.pull(containerNameAndTag, (pullError: unknown, stream: NodeJS.ReadableStream) => { if (pullError) { reject(pullError); } else { diff --git a/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts b/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts index 45b366d0b7..87af511a0b 100644 --- a/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts +++ b/packages/cactus-test-tooling/src/main/typescript/quorum/quorum-test-ledger.ts @@ -415,7 +415,7 @@ export class QuorumTestLedger implements ITestLedger { private pullContainerImage(containerNameAndTag: string): Promise { return new Promise((resolve, reject) => { const docker = new Docker(); - docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => { + docker.pull(containerNameAndTag, (pullError: unknown, stream: NodeJS.ReadableStream) => { if (pullError) { reject(pullError); } else { diff --git a/packages/cactus-test-tooling/src/main/typescript/socketio-test-setup-helpers/socketio-test-setup-helpers.ts b/packages/cactus-test-tooling/src/main/typescript/socketio-test-setup-helpers/socketio-test-setup-helpers.ts index d2483aa1e6..dfbb33ac09 100644 --- a/packages/cactus-test-tooling/src/main/typescript/socketio-test-setup-helpers/socketio-test-setup-helpers.ts +++ b/packages/cactus-test-tooling/src/main/typescript/socketio-test-setup-helpers/socketio-test-setup-helpers.ts @@ -7,12 +7,7 @@ import { ServerOptions as SocketServerOptions, Socket as ServerSocket, } from "socket.io"; -import { - io, - Socket as ClientSocket, - ManagerOptions, - SocketOptions, -} from "socket.io-client-fixed-types"; +import { io, Socket as ClientSocket } from "socket.io-client-fixed-types"; import { createServer } from "http"; export { Server, ServerSocket, ClientSocket }; @@ -53,13 +48,13 @@ export function createListeningMockServer(): Promise<[Server, string]> { * @port - Localhost port to connect to. */ export function createClientSocket(port: string): ClientSocket { - const clientSocketOpts: Partial = { + const clientSocketOpts = { reconnectionAttempts: 10, reconnectionDelay: 1000, transports: ["websocket"], }; - return io(`http://127.0.0.1:${port}`, clientSocketOpts as any); + return io(`http://127.0.0.1:${port}`, clientSocketOpts); } /** diff --git a/packages/cactus-test-verifier-client/package.json b/packages/cactus-test-verifier-client/package.json index 97cabe0e71..84c07e127a 100644 --- a/packages/cactus-test-verifier-client/package.json +++ b/packages/cactus-test-verifier-client/package.json @@ -62,6 +62,8 @@ "@types/body-parser": "1.19.4", "@types/express": "4.17.19", "@types/node": "14.18.54", + "@types/uuid": "9.0.6", + "uuid": "9.0.1", "web3-eth-accounts": "4.0.3" }, "engines": { diff --git a/packages/cactus-verifier-client/package.json b/packages/cactus-verifier-client/package.json index bef5a4ccd3..abaf84db67 100644 --- a/packages/cactus-verifier-client/package.json +++ b/packages/cactus-verifier-client/package.json @@ -96,7 +96,7 @@ } }, "engines": { - "node": ">=10", + "node": ">=18", "npm": ">=8" }, "publishConfig": { diff --git a/weaver/.github/workflows/deploy_docs.yml b/weaver/.github/workflows/deploy_docs.yml deleted file mode 100644 index 9eeaf8ad5f..0000000000 --- a/weaver/.github/workflows/deploy_docs.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Docs (Github Pages) - -on: - push: - branches: - - main - paths: - - 'docs/**' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-docs: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - - - name: Use Node.js 16.x - uses: actions/setup-node@v2 - with: - node-version: 16.x - - - name: NPM INSTALL - run: npm install - working-directory: weaver/docs - - - name: Build - run: npm run build - working-directory: weaver/docs - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.3.0 - with: - branch: gh-pages # The branch the action should deploy to. - folder: docs/build # The folder the action should deploy. - \ No newline at end of file diff --git a/weaver/.github/workflows/manual_deploy_go-pkgs.yml b/weaver/.github/workflows/manual_deploy_go-pkgs.yml deleted file mode 100644 index 39c2b052b5..0000000000 --- a/weaver/.github/workflows/manual_deploy_go-pkgs.yml +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy General Go Module - -on: - # Allows this to be a reusable workflow - workflow_call: - inputs: - module: - description: 'Go Module name' - required: true - type: string - version: - description: 'Version for Go Release' - required: true - type: string - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - inputs: - module: - description: 'Go Module name' - default: 'protos-go' - required: true - version: - description: 'Version for Go Release' - default: 'v0.0.0' - required: true - -jobs: - release: - runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3.1.0 - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Get Full path - run: | - if [ "${{ inputs.module }}" = "protos-go" ]; then - echo "MODULE_TAG=common/protos-go" >> $GITHUB_ENV - echo "MODULE_DESC=GO Weaver Protos" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "interop" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Interop Chaincode" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "utils" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Utils Library for Interoperation" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "assetexchange" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Library for Asset Exchange" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "asset-mgmt" ]; then - echo "MODULE_TAG=core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Asset Management Interface" >> $GITHUB_ENV - elif [ "${{ inputs.module }}" = "go-sdk" ]; then - echo "MODULE_TAG=sdks/fabric/go-sdk" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Weaver SDK" >> $GITHUB_ENV - else - echo "Module not known to the workflow. Exiting." - exit 1 - fi - - - name: Create GO Release - id: go-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ inputs.version }} - release_name: ${{ inputs.version }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/weaver-dlt-interoperability/${{ env.MODULE_TAG }}` - - Release: ${{ inputs.version }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/weaver-dlt-interoperability/blob/${{ env.MODULE_TAG }}/${{ inputs.version }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/weaver-dlt-interoperability/blob/${{ env.MODULE_TAG }}/${{ inputs.version }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false \ No newline at end of file diff --git a/weaver/common/protos-rs/Cargo.lock b/weaver/common/protos-rs/Cargo.lock index 0c3ba16c54..1f899ffa86 100644 --- a/weaver/common/protos-rs/Cargo.lock +++ b/weaver/common/protos-rs/Cargo.lock @@ -2,6 +2,30 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + [[package]] name = "anyhow" version = "1.0.70" @@ -38,7 +62,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.41", ] [[package]] @@ -93,10 +117,19 @@ dependencies = [ ] [[package]] -name = "base64" -version = "0.13.1" +name = "backtrace" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" @@ -243,6 +276,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "h2" version = "0.3.17" @@ -316,9 +355,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -331,7 +370,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -404,17 +443,11 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - [[package]] name = "libc" -version = "0.2.140" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "linux-raw-sys" @@ -449,16 +482,24 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" -version = "0.8.6" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -467,6 +508,15 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.17.1" @@ -511,9 +561,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -529,28 +579,28 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] name = "proc-macro2" -version = "1.0.55" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -558,53 +608,53 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", "prettyplease", "prost", "prost-types", "regex", - "syn 1.0.109", + "syn 2.0.41", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] name = "prost-types" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -650,18 +700,32 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "ring" @@ -692,6 +756,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" version = "0.37.6" @@ -708,14 +778,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.16.20", + "ring 0.17.2", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -724,7 +794,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.2", + "untrusted 0.9.0", ] [[package]] @@ -745,22 +825,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.159" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.41", ] [[package]] @@ -782,6 +862,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -807,9 +897,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" dependencies = [ "proc-macro2", "quote", @@ -837,18 +927,18 @@ dependencies = [ [[package]] name = "tokio" -version = "1.27.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -863,24 +953,23 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.41", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -910,17 +999,15 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.13.1", + "base64", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", @@ -929,30 +1016,28 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "prost-derive", + "rustls", "rustls-pemfile", "tokio", "tokio-rustls", "tokio-stream", - "tokio-util", "tower", "tower-layer", "tower-service", "tracing", - "tracing-futures", ] [[package]] name = "tonic-build" -version = "0.8.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "quote", - "syn 1.0.109", + "syn 2.0.41", ] [[package]] @@ -1019,16 +1104,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.4" @@ -1133,16 +1208,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.2", - "untrusted 0.9.0", -] - [[package]] name = "which" version = "4.4.0" diff --git a/weaver/common/protos-rs/Cargo.toml b/weaver/common/protos-rs/Cargo.toml index 2257963633..4424a3a0b6 100644 --- a/weaver/common/protos-rs/Cargo.toml +++ b/weaver/common/protos-rs/Cargo.toml @@ -3,17 +3,17 @@ name = "build-protos-rs" # Don't update this version, update the one in "pkg/Cargo.toml". version = "0.0.1" authors = ["Peter Somogyvari ", "Sandeep Nishad ", "Sandeep Nishad (dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -81,13 +77,29 @@ pub mod driver_communication_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Data Sharing /// the remote relay sends a RequestDriverState request to its driver with a /// query defining the data it wants to receive pub async fn request_driver_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -104,7 +116,15 @@ pub mod driver_communication_client { let path = http::uri::PathAndQuery::from_static( "/driver.driver.DriverCommunication/RequestDriverState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "driver.driver.DriverCommunication", + "RequestDriverState", + ), + ); + self.inner.unary(req, path, codec).await } /// Events Subscription /// the src-relay uses this endpoint to forward the event subscription request from dest-relay to driver @@ -113,7 +133,7 @@ pub mod driver_communication_client { request: impl tonic::IntoRequest< super::super::super::common::events::EventSubscription, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -130,7 +150,15 @@ pub mod driver_communication_client { let path = http::uri::PathAndQuery::from_static( "/driver.driver.DriverCommunication/SubscribeEvent", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "driver.driver.DriverCommunication", + "SubscribeEvent", + ), + ); + self.inner.unary(req, path, codec).await } /// Recommended to have TLS mode on for this unsafe endpoint /// Relay uses this to get Query.requestor_signature and @@ -140,7 +168,7 @@ pub mod driver_communication_client { request: impl tonic::IntoRequest< super::super::super::common::events::EventSubscription, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -157,14 +185,22 @@ pub mod driver_communication_client { let path = http::uri::PathAndQuery::from_static( "/driver.driver.DriverCommunication/RequestSignedEventSubscriptionQuery", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "driver.driver.DriverCommunication", + "RequestSignedEventSubscriptionQuery", + ), + ); + self.inner.unary(req, path, codec).await } /// Events Publication /// the dest-relay calls the dest-driver on this end point to write the remote network state to the local ledger pub async fn write_external_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -181,7 +217,15 @@ pub mod driver_communication_client { let path = http::uri::PathAndQuery::from_static( "/driver.driver.DriverCommunication/WriteExternalState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "driver.driver.DriverCommunication", + "WriteExternalState", + ), + ); + self.inner.unary(req, path, codec).await } } } @@ -198,7 +242,7 @@ pub mod driver_communication_server { async fn request_driver_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -209,7 +253,7 @@ pub mod driver_communication_server { request: tonic::Request< super::super::super::common::events::EventSubscription, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -221,7 +265,7 @@ pub mod driver_communication_server { request: tonic::Request< super::super::super::common::events::EventSubscription, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -230,7 +274,7 @@ pub mod driver_communication_server { async fn write_external_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -240,6 +284,8 @@ pub mod driver_communication_server { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl DriverCommunicationServer { @@ -252,6 +298,8 @@ pub mod driver_communication_server { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor( @@ -275,6 +323,22 @@ pub mod driver_communication_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for DriverCommunicationServer where @@ -288,7 +352,7 @@ pub mod driver_communication_server { fn poll_ready( &mut self, _cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -313,15 +377,21 @@ pub mod driver_communication_server { super::super::super::common::query::Query, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).request_driver_state(request).await + ::request_driver_state( + &inner, + request, + ) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -331,6 +401,10 @@ pub mod driver_communication_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -356,15 +430,18 @@ pub mod driver_communication_server { super::super::super::common::events::EventSubscription, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).subscribe_event(request).await + ::subscribe_event(&inner, request) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -374,6 +451,10 @@ pub mod driver_communication_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -403,10 +484,12 @@ pub mod driver_communication_server { super::super::super::common::events::EventSubscription, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner) - .request_signed_event_subscription_query(request) + ::request_signed_event_subscription_query( + &inner, + request, + ) .await }; Box::pin(fut) @@ -414,6 +497,8 @@ pub mod driver_communication_server { } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -423,6 +508,10 @@ pub mod driver_communication_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -445,15 +534,21 @@ pub mod driver_communication_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).write_external_state(request).await + ::write_external_state( + &inner, + request, + ) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -463,6 +558,10 @@ pub mod driver_communication_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -491,12 +590,14 @@ pub mod driver_communication_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { diff --git a/weaver/common/protos-rs/pkg/src/generated/networks.networks.rs b/weaver/common/protos-rs/pkg/src/generated/networks.networks.rs index 4abd732502..e79c120c46 100644 --- a/weaver/common/protos-rs/pkg/src/generated/networks.networks.rs +++ b/weaver/common/protos-rs/pkg/src/generated/networks.networks.rs @@ -1,7 +1,3 @@ -// Copyright IBM Corp. All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 - #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -89,7 +85,7 @@ pub mod network_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -145,12 +141,28 @@ pub mod network_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// Data Sharing endpoints /// endpoint for a network to request remote relay state via local relay pub async fn request_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -167,13 +179,16 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/RequestState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "RequestState")); + self.inner.unary(req, path, codec).await } /// This rpc endpoint is for polling the local relay for request state. pub async fn get_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -190,13 +205,16 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/GetState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "GetState")); + self.inner.unary(req, path, codec).await } /// NOTE: This rpc is just for debugging. pub async fn request_database( &mut self, request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { + ) -> std::result::Result, tonic::Status> { self.inner .ready() .await @@ -210,14 +228,17 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/RequestDatabase", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "RequestDatabase")); + self.inner.unary(req, path, codec).await } /// Event endpoints /// endpoint for a client to subscribe to event via local relay initiating subscription flow. pub async fn subscribe_event( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -234,13 +255,16 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/SubscribeEvent", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "SubscribeEvent")); + self.inner.unary(req, path, codec).await } /// This rpc endpoint is for polling the local relay for subscription state. pub async fn get_event_subscription_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -257,13 +281,21 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/GetEventSubscriptionState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "networks.networks.Network", + "GetEventSubscriptionState", + ), + ); + self.inner.unary(req, path, codec).await } /// endpoint for a client to subscribe to event via local relay initiating subscription flow. pub async fn unsubscribe_event( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -280,14 +312,19 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/UnsubscribeEvent", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("networks.networks.Network", "UnsubscribeEvent"), + ); + self.inner.unary(req, path, codec).await } /// endpoint for a client to fetch received events. /// Note: events are marked as deleted from relay database as soon as client fetches them. pub async fn get_event_states( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -304,7 +341,10 @@ pub mod network_client { let path = http::uri::PathAndQuery::from_static( "/networks.networks.Network/GetEventStates", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("networks.networks.Network", "GetEventStates")); + self.inner.unary(req, path, codec).await } } } @@ -320,7 +360,7 @@ pub mod network_server { async fn request_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -328,7 +368,7 @@ pub mod network_server { async fn get_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -336,13 +376,13 @@ pub mod network_server { async fn request_database( &self, request: tonic::Request, - ) -> Result, tonic::Status>; + ) -> std::result::Result, tonic::Status>; /// Event endpoints /// endpoint for a client to subscribe to event via local relay initiating subscription flow. async fn subscribe_event( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -350,7 +390,7 @@ pub mod network_server { async fn get_event_subscription_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -358,7 +398,7 @@ pub mod network_server { async fn unsubscribe_event( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -367,7 +407,7 @@ pub mod network_server { async fn get_event_states( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -379,6 +419,8 @@ pub mod network_server { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl NetworkServer { @@ -391,6 +433,8 @@ pub mod network_server { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor( @@ -414,6 +458,22 @@ pub mod network_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for NetworkServer where @@ -427,7 +487,7 @@ pub mod network_server { fn poll_ready( &mut self, _cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -447,15 +507,17 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).request_state(request).await + ::request_state(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -465,6 +527,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -485,13 +551,17 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).get_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -501,6 +571,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -521,15 +595,17 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).request_database(request).await + ::request_database(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -539,6 +615,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -561,15 +641,17 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).subscribe_event(request).await + ::subscribe_event(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -579,6 +661,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -599,15 +685,21 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_event_subscription_state(request).await + ::get_event_subscription_state( + &inner, + request, + ) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -617,6 +709,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -639,15 +735,17 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).unsubscribe_event(request).await + ::unsubscribe_event(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -657,6 +755,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -677,15 +779,17 @@ pub mod network_server { &mut self, request: tonic::Request, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).get_event_states(request).await + ::get_event_states(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -695,6 +799,10 @@ pub mod network_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -723,12 +831,14 @@ pub mod network_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { diff --git a/weaver/common/protos-rs/pkg/src/generated/relay.datatransfer.rs b/weaver/common/protos-rs/pkg/src/generated/relay.datatransfer.rs index a3d738d3f8..40cbb20690 100644 --- a/weaver/common/protos-rs/pkg/src/generated/relay.datatransfer.rs +++ b/weaver/common/protos-rs/pkg/src/generated/relay.datatransfer.rs @@ -1,7 +1,3 @@ -// Copyright IBM Corp. All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 - /// Generated client implementations. pub mod data_transfer_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] @@ -16,7 +12,7 @@ pub mod data_transfer_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -72,12 +68,28 @@ pub mod data_transfer_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// the requesting relay sends a RequestState request to the remote relay with a /// query defining the data it wants to receive pub async fn request_state( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -94,7 +106,12 @@ pub mod data_transfer_client { let path = http::uri::PathAndQuery::from_static( "/relay.datatransfer.DataTransfer/RequestState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("relay.datatransfer.DataTransfer", "RequestState"), + ); + self.inner.unary(req, path, codec).await } /// the remote relay asynchronously sends back the requested data with /// SendState @@ -103,7 +120,7 @@ pub mod data_transfer_client { request: impl tonic::IntoRequest< super::super::super::common::state::ViewPayload, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -120,7 +137,10 @@ pub mod data_transfer_client { let path = http::uri::PathAndQuery::from_static( "/relay.datatransfer.DataTransfer/SendState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("relay.datatransfer.DataTransfer", "SendState")); + self.inner.unary(req, path, codec).await } /// Handling state sent from the driver. pub async fn send_driver_state( @@ -128,7 +148,7 @@ pub mod data_transfer_client { request: impl tonic::IntoRequest< super::super::super::common::state::ViewPayload, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -145,7 +165,12 @@ pub mod data_transfer_client { let path = http::uri::PathAndQuery::from_static( "/relay.datatransfer.DataTransfer/SendDriverState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("relay.datatransfer.DataTransfer", "SendDriverState"), + ); + self.inner.unary(req, path, codec).await } } } @@ -161,7 +186,7 @@ pub mod data_transfer_server { async fn request_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -170,7 +195,7 @@ pub mod data_transfer_server { async fn send_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -178,7 +203,7 @@ pub mod data_transfer_server { async fn send_driver_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -189,6 +214,8 @@ pub mod data_transfer_server { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl DataTransferServer { @@ -201,6 +228,8 @@ pub mod data_transfer_server { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor( @@ -224,6 +253,22 @@ pub mod data_transfer_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for DataTransferServer where @@ -237,7 +282,7 @@ pub mod data_transfer_server { fn poll_ready( &mut self, _cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -262,15 +307,17 @@ pub mod data_transfer_server { super::super::super::common::query::Query, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).request_state(request).await + ::request_state(&inner, request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -280,6 +327,10 @@ pub mod data_transfer_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -305,13 +356,17 @@ pub mod data_transfer_server { super::super::super::common::state::ViewPayload, >, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).send_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::send_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -321,6 +376,10 @@ pub mod data_transfer_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -346,15 +405,18 @@ pub mod data_transfer_server { super::super::super::common::state::ViewPayload, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).send_driver_state(request).await + ::send_driver_state(&inner, request) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -364,6 +426,10 @@ pub mod data_transfer_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -392,12 +458,14 @@ pub mod data_transfer_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { diff --git a/weaver/common/protos-rs/pkg/src/generated/relay.events.rs b/weaver/common/protos-rs/pkg/src/generated/relay.events.rs index d8f258b622..5cac9d0dce 100644 --- a/weaver/common/protos-rs/pkg/src/generated/relay.events.rs +++ b/weaver/common/protos-rs/pkg/src/generated/relay.events.rs @@ -1,7 +1,3 @@ -// Copyright IBM Corp. All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 - /// Generated client implementations. pub mod event_subscribe_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] @@ -15,7 +11,7 @@ pub mod event_subscribe_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -71,13 +67,29 @@ pub mod event_subscribe_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// the dest-relay forwards the request from client as EventSubscription to the src-relay pub async fn subscribe_event( &mut self, request: impl tonic::IntoRequest< super::super::super::common::events::EventSubscription, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -94,14 +106,19 @@ pub mod event_subscribe_client { let path = http::uri::PathAndQuery::from_static( "/relay.events.EventSubscribe/SubscribeEvent", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("relay.events.EventSubscribe", "SubscribeEvent"), + ); + self.inner.unary(req, path, codec).await } /// Src-relay based upon query (EventSubscription) forwards the same response (Ack) /// from driver to the dest-relay by calling a new endpoint in dest-relay pub async fn send_subscription_status( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -118,14 +135,22 @@ pub mod event_subscribe_client { let path = http::uri::PathAndQuery::from_static( "/relay.events.EventSubscribe/SendSubscriptionStatus", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "relay.events.EventSubscribe", + "SendSubscriptionStatus", + ), + ); + self.inner.unary(req, path, codec).await } /// Src-driver status of event subscription (Ack) /// to the src-relay by calling a new endpoint in src-relay pub async fn send_driver_subscription_status( &mut self, request: impl tonic::IntoRequest, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -142,7 +167,15 @@ pub mod event_subscribe_client { let path = http::uri::PathAndQuery::from_static( "/relay.events.EventSubscribe/SendDriverSubscriptionStatus", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "relay.events.EventSubscribe", + "SendDriverSubscriptionStatus", + ), + ); + self.inner.unary(req, path, codec).await } } } @@ -159,7 +192,7 @@ pub mod event_publish_client { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where - D: std::convert::TryInto, + D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; @@ -215,13 +248,29 @@ pub mod event_publish_client { self.inner = self.inner.accept_compressed(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } /// src-driver forwards the state as part of event subscription to src-relay pub async fn send_driver_state( &mut self, request: impl tonic::IntoRequest< super::super::super::common::state::ViewPayload, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -238,7 +287,10 @@ pub mod event_publish_client { let path = http::uri::PathAndQuery::from_static( "/relay.events.EventPublish/SendDriverState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("relay.events.EventPublish", "SendDriverState")); + self.inner.unary(req, path, codec).await } /// src-relay will forward the state as part of event subscription to dest-relay pub async fn send_state( @@ -246,7 +298,7 @@ pub mod event_publish_client { request: impl tonic::IntoRequest< super::super::super::common::state::ViewPayload, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, > { @@ -263,7 +315,10 @@ pub mod event_publish_client { let path = http::uri::PathAndQuery::from_static( "/relay.events.EventPublish/SendState", ); - self.inner.unary(request.into_request(), path, codec).await + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("relay.events.EventPublish", "SendState")); + self.inner.unary(req, path, codec).await } } } @@ -280,7 +335,7 @@ pub mod event_subscribe_server { request: tonic::Request< super::super::super::common::events::EventSubscription, >, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -289,7 +344,7 @@ pub mod event_subscribe_server { async fn send_subscription_status( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -298,7 +353,7 @@ pub mod event_subscribe_server { async fn send_driver_subscription_status( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -308,6 +363,8 @@ pub mod event_subscribe_server { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl EventSubscribeServer { @@ -320,6 +377,8 @@ pub mod event_subscribe_server { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor( @@ -343,6 +402,22 @@ pub mod event_subscribe_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for EventSubscribeServer where @@ -356,7 +431,7 @@ pub mod event_subscribe_server { fn poll_ready( &mut self, _cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -381,15 +456,18 @@ pub mod event_subscribe_server { super::super::super::common::events::EventSubscription, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).subscribe_event(request).await + ::subscribe_event(&inner, request) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -399,6 +477,10 @@ pub mod event_subscribe_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -423,15 +505,21 @@ pub mod event_subscribe_server { super::super::super::common::ack::Ack, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).send_subscription_status(request).await + ::send_subscription_status( + &inner, + request, + ) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -441,6 +529,10 @@ pub mod event_subscribe_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -467,15 +559,21 @@ pub mod event_subscribe_server { super::super::super::common::ack::Ack, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).send_driver_subscription_status(request).await + ::send_driver_subscription_status( + &inner, + request, + ) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -485,6 +583,10 @@ pub mod event_subscribe_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -513,12 +615,14 @@ pub mod event_subscribe_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { @@ -541,7 +645,7 @@ pub mod event_publish_server { async fn send_driver_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -549,7 +653,7 @@ pub mod event_publish_server { async fn send_state( &self, request: tonic::Request, - ) -> Result< + ) -> std::result::Result< tonic::Response, tonic::Status, >; @@ -559,6 +663,8 @@ pub mod event_publish_server { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, } struct _Inner(Arc); impl EventPublishServer { @@ -571,6 +677,8 @@ pub mod event_publish_server { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, } } pub fn with_interceptor( @@ -594,6 +702,22 @@ pub mod event_publish_server { self.send_compression_encodings.enable(encoding); self } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } } impl tonic::codegen::Service> for EventPublishServer where @@ -607,7 +731,7 @@ pub mod event_publish_server { fn poll_ready( &mut self, _cx: &mut Context<'_>, - ) -> Poll> { + ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { @@ -632,15 +756,18 @@ pub mod event_publish_server { super::super::super::common::state::ViewPayload, >, ) -> Self::Future { - let inner = self.0.clone(); + let inner = Arc::clone(&self.0); let fut = async move { - (*inner).send_driver_state(request).await + ::send_driver_state(&inner, request) + .await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -650,6 +777,10 @@ pub mod event_publish_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -675,13 +806,17 @@ pub mod event_publish_server { super::super::super::common::state::ViewPayload, >, ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).send_state(request).await }; + let inner = Arc::clone(&self.0); + let fut = async move { + ::send_state(&inner, request).await + }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; @@ -691,6 +826,10 @@ pub mod event_publish_server { .apply_compression_config( accept_compression_encodings, send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, ); let res = grpc.unary(method, req).await; Ok(res) @@ -719,12 +858,14 @@ pub mod event_publish_server { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, } } } impl Clone for _Inner { fn clone(&self) -> Self { - Self(self.0.clone()) + Self(Arc::clone(&self.0)) } } impl std::fmt::Debug for _Inner { diff --git a/weaver/core/network/fabric-interop-cc/contracts/interop/membership.go b/weaver/core/network/fabric-interop-cc/contracts/interop/membership.go index 6ad8978f12..bae0ec6d87 100644 --- a/weaver/core/network/fabric-interop-cc/contracts/interop/membership.go +++ b/weaver/core/network/fabric-interop-cc/contracts/interop/membership.go @@ -183,7 +183,6 @@ func (s *SmartContract) CreateLocalMembership(ctx contractapi.TransactionContext if err != nil { return fmt.Errorf("Unmarshal error: %s", err) } - membership.SecurityDomain = membershipLocalSecurityDomain membershipLocalKey, err := ctx.GetStub().CreateCompositeKey(membershipObjectType, []string{membershipLocalSecurityDomain}) acp, getErr := ctx.GetStub().GetState(membershipLocalKey) @@ -221,7 +220,6 @@ func (s *SmartContract) UpdateLocalMembership(ctx contractapi.TransactionContext if err != nil { return fmt.Errorf("Unmarshal error: %s", err) } - membership.SecurityDomain = membershipLocalSecurityDomain membershipLocalKey, err := ctx.GetStub().CreateCompositeKey(membershipObjectType, []string{membershipLocalSecurityDomain}) _, getErr := s.GetMembershipBySecurityDomain(ctx, membershipLocalSecurityDomain) diff --git a/weaver/core/network/fabric-interop-cc/libs/utils/utils.go b/weaver/core/network/fabric-interop-cc/libs/utils/utils.go index 40e8655aa1..8d7eea2d93 100644 --- a/weaver/core/network/fabric-interop-cc/libs/utils/utils.go +++ b/weaver/core/network/fabric-interop-cc/libs/utils/utils.go @@ -459,10 +459,13 @@ func GetAssetPledgeStatus(ctx contractapi.TransactionContextInterface, pledgeId, if err != nil { return nil, pledgeBytes64, pledgeBytes64, err } - - // Match pledge with request parameters - if lookupPledge.Recipient != recipientCert || lookupPledge.RemoteNetworkID != recipientNetworkId { - return nil, pledgeBytes64, pledgeBytes64, nil // Return blank + + // Match claim with request parameters + if lookupPledge.RemoteNetworkID != recipientNetworkId { + return nil, pledgeBytes64, pledgeBytes64, fmt.Errorf("No Pledge exists for recipient network id: %s", recipientNetworkId) // Return blank + } + if lookupPledge.Recipient != recipientCert { + return nil, pledgeBytes64, pledgeBytes64, fmt.Errorf("No Pledge exists for recipient: %s", recipientCert) } lookupPledgeBytes64, err := marshalAssetPledge(lookupPledge) @@ -500,7 +503,7 @@ func GetAssetPledgeDetails(ctx contractapi.TransactionContextInterface, pledgeId } // GetAssetClaimStatus returns the asset claim status and present time (of invocation). -func GetAssetClaimStatus(ctx contractapi.TransactionContextInterface, pledgeId, recipientCert, pledger, pledgerNetworkId string, pledgeExpiryTimeSecs uint64, blankAssetJSON []byte) ([]byte, string, string, error) { +func GetAssetClaimStatus(ctx contractapi.TransactionContextInterface, pledgeId, recipientCert, pledgerNetworkId string, pledgeExpiryTimeSecs uint64, blankAssetJSON []byte) ([]byte, string, string, error) { // (Optional) Ensure that this function is being called by the relay via the Fabric Interop CC claimStatus := &common.AssetClaimStatus{ @@ -533,8 +536,11 @@ func GetAssetClaimStatus(ctx contractapi.TransactionContextInterface, pledgeId, } // Match claim with request parameters - if lookupClaim.RemoteNetworkID != pledgerNetworkId || lookupClaim.Recipient != recipientCert { - return nil, claimStatusBytes64, claimStatusBytes64, nil // Return blank + if lookupClaim.RemoteNetworkID != pledgerNetworkId { + return nil, claimStatusBytes64, claimStatusBytes64, fmt.Errorf("No claim exists for pledger network id: %s", pledgerNetworkId) // Return blank + } + if lookupClaim.Recipient != recipientCert { + return nil, claimStatusBytes64, claimStatusBytes64, fmt.Errorf("No claim exists for recipient: %s", recipientCert) } lookupClaim.ExpiryTimeSecs = claimStatus.ExpiryTimeSecs lookupClaim.ExpirationStatus = claimStatus.ExpirationStatus diff --git a/weaver/core/relay/Cargo.lock b/weaver/core/relay/Cargo.lock index 5c06fb99c3..3136ba7df1 100644 --- a/weaver/core/relay/Cargo.lock +++ b/weaver/core/relay/Cargo.lock @@ -2,11 +2,26 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -53,7 +68,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.39", ] [[package]] @@ -83,7 +98,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustversion", - "serde 1.0.159", + "serde 1.0.193", "sync_wrapper", "tower", "tower-layer", @@ -108,10 +123,19 @@ dependencies = [ ] [[package]] -name = "base64" -version = "0.13.1" +name = "backtrace" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" @@ -131,7 +155,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde 1.0.159", + "serde 1.0.193", ] [[package]] @@ -163,15 +187,18 @@ name = "cacti_weaver_protos_rs" version = "2.0.0-alpha.2" dependencies = [ "prost", - "serde 1.0.159", + "serde 1.0.193", "tonic", ] [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -188,7 +215,7 @@ dependencies = [ "lazy_static", "nom", "rust-ini", - "serde 1.0.159", + "serde 1.0.193", "serde-hjson", "serde_json", "toml", @@ -257,6 +284,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.0" @@ -389,7 +422,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.39", ] [[package]] @@ -433,20 +466,26 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "h2" -version = "0.3.16" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -454,7 +493,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -467,6 +506,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.4.1" @@ -524,9 +569,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -539,7 +584,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -588,7 +633,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", ] [[package]] @@ -662,9 +717,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.140" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "linked-hash-map" @@ -735,16 +790,24 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -810,6 +873,15 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.17.1" @@ -839,7 +911,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.39", ] [[package]] @@ -898,7 +970,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -923,9 +995,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -947,28 +1019,28 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "proc-macro2" -version = "1.0.55" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -976,53 +1048,53 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", "prettyplease", "prost", "prost-types", "regex", - "syn 1.0.109", + "syn 2.0.39", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "prost-types" -version = "0.11.8" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1077,9 +1149,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ "aho-corasick", "memchr", @@ -1088,9 +1172,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "relay" @@ -1103,7 +1187,7 @@ dependencies = [ "futures", "listenfd", "reqwest", - "serde 1.0.159", + "serde 1.0.193", "serde_json", "sled", "tokio", @@ -1136,7 +1220,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "serde 1.0.159", + "serde 1.0.193", "serde_json", "serde_urlencoded", "tokio", @@ -1158,18 +1242,38 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "rust-ini" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" version = "0.37.6" @@ -1186,14 +1290,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", - "ring", + "ring 0.17.7", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -1205,6 +1309,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.12" @@ -1238,8 +1352,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -1273,9 +1387,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] @@ -1294,24 +1408,24 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", - "serde 1.0.159", + "serde 1.0.193", ] [[package]] @@ -1323,7 +1437,7 @@ dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde 1.0.159", + "serde 1.0.193", ] [[package]] @@ -1367,12 +1481,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "static_assertions" version = "1.1.0" @@ -1392,9 +1522,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -1437,19 +1567,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1464,13 +1594,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.39", ] [[package]] @@ -1485,13 +1615,12 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -1525,22 +1654,20 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "serde 1.0.159", + "serde 1.0.193", ] [[package]] name = "tonic" -version = "0.8.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.13.1", + "base64 0.21.0", "bytes", - "futures-core", - "futures-util", "h2", "http", "http-body", @@ -1549,30 +1676,28 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "prost-derive", + "rustls", "rustls-pemfile", "tokio", "tokio-rustls", "tokio-stream", - "tokio-util", "tower", "tower-layer", "tower-service", "tracing", - "tracing-futures", ] [[package]] name = "tonic-build" -version = "0.8.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ "prettyplease", "proc-macro2", "prost-build", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -1583,7 +1708,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand", @@ -1639,16 +1764,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "try-lock" version = "0.2.4" @@ -1682,6 +1797,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.3.1" @@ -1806,16 +1927,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "which" version = "4.4.0" @@ -1855,13 +1966,13 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -1870,7 +1981,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", ] [[package]] @@ -1879,13 +1999,28 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1894,42 +2029,84 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "winreg" version = "0.10.1" diff --git a/weaver/core/relay/Cargo.toml b/weaver/core/relay/Cargo.toml index 7ee6eb001a..fe4457ea47 100644 --- a/weaver/core/relay/Cargo.toml +++ b/weaver/core/relay/Cargo.toml @@ -2,7 +2,7 @@ name = "relay" version = "2.0.0-alpha.2" authors = ["Antony Targett ", "Nick Waywood ", "Sandeep Nishad { @@ -121,9 +122,9 @@ impl DriverCommunication for DriverCommunicationService { let relay_hostname = uri.hostname.to_string(); let use_tls = uri.tls; let tlsca_cert_path = uri.tlsca_cert_path.to_string(); - let client_addr = format!("http://{}:{}", relay_hostname, relay_port); - println!("Remote relay... {:?}", client_addr.clone()); if use_tls { + let client_addr = format!("https://{}:{}", relay_hostname, relay_port); + println!("Remote relay... {:?}", client_addr.clone()); let pem = tokio::fs::read(tlsca_cert_path).await.unwrap(); let ca = Certificate::from_pem(pem); @@ -140,6 +141,8 @@ impl DriverCommunication for DriverCommunicationService { let client = EventSubscribeClient::new(channel); send_driver_mock_subscription_state_helper(client, request_id.to_string()); } else { + let client_addr = format!("http://{}:{}", relay_hostname, relay_port); + println!("Remote relay... {:?}", client_addr.clone()); let client_result = EventSubscribeClient::connect(client_addr).await; match client_result { Ok(client) => { diff --git a/weaver/core/relay/src/client_tls.rs b/weaver/core/relay/src/client_tls.rs index ec13e7746c..862fbb870d 100644 --- a/weaver/core/relay/src/client_tls.rs +++ b/weaver/core/relay/src/client_tls.rs @@ -36,13 +36,12 @@ async fn get_tls_channel(url: String) -> Result println!("View Meta: {:?}, View Data: {:?}", v.meta, base64::encode(&v.data)), view_payload::State::Error(e) => println!("Error: {:?}", e), } - let client_addr = format!("http://{}:{}", requestor_host, requester_port); if use_tls { + let client_addr = format!("https://{}:{}", requestor_host, requester_port); let pem = tokio::fs::read(tlsca_cert_path).await.unwrap(); let ca = Certificate::from_pem(pem); @@ -344,6 +344,7 @@ fn spawn_send_state(state: ViewPayload, requestor_host: String, requester_port: let response = client_result.send_state(state).await; println!("Response ACK from requesting relay={:?}\n", response); } else { + let client_addr = format!("http://{}:{}", requestor_host, requester_port); let client_result = DataTransferClient::connect(client_addr).await; match client_result { Ok(client) => { diff --git a/weaver/core/relay/src/services/event_publish_service.rs b/weaver/core/relay/src/services/event_publish_service.rs index df495a2d56..5ac929920f 100644 --- a/weaver/core/relay/src/services/event_publish_service.rs +++ b/weaver/core/relay/src/services/event_publish_service.rs @@ -163,8 +163,8 @@ fn spawn_send_state(state: ViewPayload, requestor_host: String, requester_port: view_payload::State::View(v) => println!("View Meta: {:?}, View Data: {:?}", v.meta, base64::encode(&v.data)), view_payload::State::Error(e) => println!("Error: {:?}", e), } - let client_addr = format!("http://{}:{}", requestor_host, requester_port); if use_tls { + let client_addr = format!("https://{}:{}", requestor_host, requester_port); let pem = tokio::fs::read(tlsca_cert_path).await.unwrap(); let ca = Certificate::from_pem(pem); @@ -182,6 +182,7 @@ fn spawn_send_state(state: ViewPayload, requestor_host: String, requester_port: let response = client_result.send_state(state).await; println!("Event Publish: Response ACK from requesting relay={:?}\n", response); } else { + let client_addr = format!("http://{}:{}", requestor_host, requester_port); let client_result = EventPublishClient::connect(client_addr).await; match client_result { Ok(client) => { diff --git a/weaver/core/relay/src/services/event_subscribe_service.rs b/weaver/core/relay/src/services/event_subscribe_service.rs index ad9c5fa52f..e27822e09a 100644 --- a/weaver/core/relay/src/services/event_subscribe_service.rs +++ b/weaver/core/relay/src/services/event_subscribe_service.rs @@ -297,9 +297,9 @@ fn spawn_send_subscription_status( tokio::spawn(async move { let request_id = ack.clone().request_id; println!("Sending Subscription Status back to requesting relay: Request ID = {:?}", request_id); - let client_addr = format!("http://{}:{}", requestor_host, requester_port); let mut response: Result, tonic::Status> = Err(tonic::Status::unimplemented("uninitialized")); if use_tls { + let client_addr = format!("https://{}:{}", requestor_host, requester_port); let pem = tokio::fs::read(tlsca_cert_path).await.unwrap(); let ca = Certificate::from_pem(pem); @@ -317,6 +317,7 @@ fn spawn_send_subscription_status( response = client_result.send_subscription_status(ack.clone()).await; println!("Response ACK from requesting relay={:?}\n", response); } else { + let client_addr = format!("http://{}:{}", requestor_host, requester_port); let client_result = EventSubscribeClient::connect(client_addr.clone()).await; match client_result { Ok(client) => { @@ -328,7 +329,7 @@ fn spawn_send_subscription_status( // TODO: Add better error handling (Attempt a few times?) println!( "Failed to connect to client: ${:?}. Error: {}\n", - requester_port, + client_addr, e.to_string() ); // TODO: Handle this error thorugh join handle after thread completes. @@ -365,7 +366,7 @@ fn spawn_send_subscription_status( } } Err(_e) => { - println!("Error: error connecting to relay at {}", client_addr); + println!("Error: error connecting to relay"); } } } diff --git a/weaver/core/relay/src/services/helpers.rs b/weaver/core/relay/src/services/helpers.rs index 606edcad65..aa4479ce51 100644 --- a/weaver/core/relay/src/services/helpers.rs +++ b/weaver/core/relay/src/services/helpers.rs @@ -229,9 +229,9 @@ pub async fn get_driver_client( let hostname = driver_info.hostname.to_string(); let use_tls = driver_info.tls; let tlsca_cert_path = driver_info.tlsca_cert_path.to_string(); - let driver_address = format!("http://{}:{}", hostname, port); let client; if use_tls { + let driver_address = format!("https://{}:{}", hostname, port); let pem = tokio::fs::read(tlsca_cert_path).await?; let ca = Certificate::from_pem(pem); @@ -247,6 +247,7 @@ pub async fn get_driver_client( client = DriverCommunicationClient::new(channel); } else { + let driver_address = format!("http://{}:{}", hostname, port); client = DriverCommunicationClient::connect(driver_address).await?; } return Ok(client) diff --git a/weaver/core/relay/src/services/network_service.rs b/weaver/core/relay/src/services/network_service.rs index bc24713dcd..d14dbeb59e 100644 --- a/weaver/core/relay/src/services/network_service.rs +++ b/weaver/core/relay/src/services/network_service.rs @@ -658,9 +658,9 @@ async fn data_transfer_call( use_tls: bool, tlsca_cert_path: String, ) -> Result, Box> { - let client_addr = format!("http://{}:{}", relay_host, relay_port); let mut client; if use_tls { + let client_addr = format!("https://{}:{}", relay_host, relay_port); let pem = tokio::fs::read(tlsca_cert_path).await?; let ca = Certificate::from_pem(pem); @@ -675,6 +675,7 @@ async fn data_transfer_call( client = DataTransferClient::new(channel); } else { + let client_addr = format!("http://{}:{}", relay_host, relay_port); client = DataTransferClient::connect(client_addr).await?; } let query_request = tonic::Request::new(Query { @@ -776,9 +777,9 @@ async fn suscribe_event_call( use_tls: bool, tlsca_cert_path: String, ) -> Result, Box> { - let client_addr = format!("http://{}:{}", relay_host, relay_port); let mut client; if use_tls { + let client_addr = format!("https://{}:{}", relay_host, relay_port); let pem = tokio::fs::read(tlsca_cert_path).await?; let ca = Certificate::from_pem(pem); @@ -793,6 +794,7 @@ async fn suscribe_event_call( client = EventSubscribeClient::new(channel); } else { + let client_addr = format!("http://{}:{}", relay_host, relay_port); client = EventSubscribeClient::connect(client_addr).await?; } diff --git a/weaver/samples/fabric/fabric-cli/src/helpers/interop-setup/configure-network.ts b/weaver/samples/fabric/fabric-cli/src/helpers/interop-setup/configure-network.ts index 3a33ad4ea5..282a8e1aee 100644 --- a/weaver/samples/fabric/fabric-cli/src/helpers/interop-setup/configure-network.ts +++ b/weaver/samples/fabric/fabric-cli/src/helpers/interop-setup/configure-network.ts @@ -142,12 +142,12 @@ const loadLocalHelper = async ( registerUser: false }) try { - const response = await MembershipManager.createLocalMembership(gateway, members, channelName, contractName) + const response = await MembershipManager.createLocalMembership(gateway, members, networkName, channelName, contractName) logger.info('CreateLocalMembership Successful.') } catch (e) { logger.error(e) logger.info('CreateLocalMembership attempting Update') - const response = await MembershipManager.updateLocalMembership(gateway, members, channelName, contractName) + const response = await MembershipManager.updateLocalMembership(gateway, members, networkName, channelName, contractName) logger.info('UpdateLocalMembership response: success: ', response) } } diff --git a/weaver/samples/fabric/simpleassettransfer/bondasset.go b/weaver/samples/fabric/simpleassettransfer/bondasset.go index b5d940c1b0..847874af51 100644 --- a/weaver/samples/fabric/simpleassettransfer/bondasset.go +++ b/weaver/samples/fabric/simpleassettransfer/bondasset.go @@ -368,7 +368,7 @@ func (s *SmartContract) GetAssetClaimStatus(ctx contractapi.TransactionContextIn } // Fetch asset claim details using common (library) logic - claimAssetDetails, claimBytes64, blankClaimBytes64, err := wutils.GetAssetClaimStatus(ctx, pledgeId, recipientCert, pledger, pledgerNetworkId, pledgeExpiryTimeSecs, blankAssetJSON) + claimAssetDetails, claimBytes64, blankClaimBytes64, err := wutils.GetAssetClaimStatus(ctx, pledgeId, recipientCert, pledgerNetworkId, pledgeExpiryTimeSecs, blankAssetJSON) if err != nil { return blankClaimBytes64, err } diff --git a/weaver/samples/fabric/simpleassettransfer/tokenasset.go b/weaver/samples/fabric/simpleassettransfer/tokenasset.go index 9b66ff284f..0dc62d0dde 100644 --- a/weaver/samples/fabric/simpleassettransfer/tokenasset.go +++ b/weaver/samples/fabric/simpleassettransfer/tokenasset.go @@ -374,7 +374,7 @@ func (s *SmartContract) GetTokenAssetClaimStatus(ctx contractapi.TransactionCont } // Fetch asset claim details using common (library) logic - claimAssetDetails, claimBytes64, blankClaimBytes64, err := wutils.GetAssetClaimStatus(ctx, pledgeId, recipientCert, pledger, pledgerNetworkId, pledgeExpiryTimeSecs, blankAssetJSON) + claimAssetDetails, claimBytes64, blankClaimBytes64, err := wutils.GetAssetClaimStatus(ctx, pledgeId, recipientCert, pledgerNetworkId, pledgeExpiryTimeSecs, blankAssetJSON) if err != nil { return blankClaimBytes64, err } diff --git a/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go b/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go index 654be316e5..e7c0bfdaaf 100644 --- a/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go +++ b/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go @@ -35,12 +35,12 @@ import ( ) -func CreateLocalMembership(walletPath, userName, connectionProfilePath, channelId, weaverCCId string, mspIds []string) error { +func CreateLocalMembership(walletPath, userName, connectionProfilePath, securityDomain, channelId, weaverCCId string, mspIds []string) error { membership, err := GetMSPConfigurations(walletPath, userName, connectionProfilePath, channelId, mspIds) if err != nil { return err } - membership.SecurityDomain = "" // We don't need this as the Weaver chaincode will internally use a designated keyword + membership.SecurityDomain = securityDomain membershipBytes, err := protoV2.Marshal(membership) if err != nil { return err @@ -55,12 +55,12 @@ func CreateLocalMembership(walletPath, userName, connectionProfilePath, channelI return nil } -func UpdateLocalMembership(walletPath, userName, connectionProfilePath, channelId, weaverCCId string, mspIds []string) error { +func UpdateLocalMembership(walletPath, userName, connectionProfilePath, securityDomain, channelId, weaverCCId string, mspIds []string) error { membership, err := GetMSPConfigurations(walletPath, userName, connectionProfilePath, channelId, mspIds) if err != nil { return err } - membership.SecurityDomain = "" // We don't need this as the Weaver chaincode will internally use a designated keyword + membership.SecurityDomain = securityDomain membershipBytes, err := protoV2.Marshal(membership) if err != nil { return err diff --git a/weaver/sdks/fabric/go-sdk/readme.md b/weaver/sdks/fabric/go-sdk/readme.md index 843cb54a69..2224bda5bb 100644 --- a/weaver/sdks/fabric/go-sdk/readme.md +++ b/weaver/sdks/fabric/go-sdk/readme.md @@ -45,11 +45,11 @@ The [membership manager functions](./membershipmanager) are currently not covere fmt.Printf("%+v\n", membership) fmt.Printf("Create Local Membership: ") - err := CreateLocalMembership(walletPath, userName, connectionProfilePath, "mychannel", "interop", []string{"Org1MSP"}) + err := CreateLocalMembership(walletPath, userName, connectionProfilePath, "network1", "mychannel", "interop", []string{"Org1MSP"}) fmt.Println(err) fmt.Printf("Update Local Membership: ") - err = UpdateLocalMembership(walletPath, userName, connectionProfilePath, "mychannel", "interop", []string{"Org1MSP"}) + err = UpdateLocalMembership(walletPath, userName, connectionProfilePath, "network1", "mychannel", "interop", []string{"Org1MSP"}) fmt.Println(err) fmt.Printf("Read Local Membership: ") diff --git a/weaver/sdks/fabric/interoperation-node-sdk/src/MembershipManager.ts b/weaver/sdks/fabric/interoperation-node-sdk/src/MembershipManager.ts index b0bf218d98..ca38534c82 100644 --- a/weaver/sdks/fabric/interoperation-node-sdk/src/MembershipManager.ts +++ b/weaver/sdks/fabric/interoperation-node-sdk/src/MembershipManager.ts @@ -22,12 +22,13 @@ import { handlePromise, promisifyAll } from './helpers' async function createLocalMembership( gateway: Gateway, memberMspIds: Array, + securityDomain: string, channelName: string, weaverCCId: string ): Promise { const network = await gateway.getNetwork(channelName) const membership = getMSPConfigurations(network, memberMspIds) - membership.setSecuritydomain('') + membership.setSecuritydomain(securityDomain) const membership64 = Buffer.from(membership.serializeBinary()).toString('base64') const contract = network.getContract(weaverCCId) return await contract.submitTransaction("CreateLocalMembership", membership64); @@ -36,12 +37,13 @@ async function createLocalMembership( async function updateLocalMembership( gateway: Gateway, memberMspIds: Array, + securityDomain: string, channelName: string, weaverCCId: string ): Promise { const network = await gateway.getNetwork(channelName) const membership = getMSPConfigurations(network, memberMspIds) - membership.setSecuritydomain('') + membership.setSecuritydomain(securityDomain) const membership64 = Buffer.from(membership.serializeBinary()).toString('base64') const contract = network.getContract(weaverCCId) return await contract.submitTransaction("UpdateLocalMembership", membership64); diff --git a/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js b/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js index 70496955eb..082084fcc1 100644 --- a/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js +++ b/weaver/sdks/fabric/interoperation-node-sdk/src/eciesCrypto.js @@ -61,7 +61,7 @@ const CURVE_P_384_Size = 384; * Comments below indicate a mapping between variables defined here and in the * 'Decrypt(...)' function implemented in 'ecies.go' in the Golang package */ -function eciesDecryptMessage(recipientPrivateKey, cipherText, options) { +function eciesDecryptMessage(recipientPrivateKey, cipherText, options, aesKeyLength = AESKeyLength) { const level = recipientPrivateKey.ecparams.keylen; options.securityLevel = level; processOption(options); @@ -96,8 +96,8 @@ function eciesDecryptMessage(recipientPrivateKey, cipherText, options) { const kdfOutput = hkdf(ZArray, ECIESKDFOutput, null, null, options); const kbuf = Buffer.from(kdfOutput); - const aesKey = kdfOutput.slice(0, AESKeyLength); // 'Ke' - const hmacKey = kdfOutput.slice(AESKeyLength, AESKeyLength + HMACKeyLength); + const aesKey = kdfOutput.slice(0, aesKeyLength); // 'Ke' + const hmacKey = kdfOutput.slice(aesKeyLength, aesKeyLength + HMACKeyLength); const hmacKeyHash = new options.hashFunctionKeyDerivation(); hmacKeyHash.update(bytesToBits(hmacKey)); @@ -108,7 +108,16 @@ function eciesDecryptMessage(recipientPrivateKey, cipherText, options) { throw new Error("HMAC verify failed"); } const iv = EM.slice(0, IVLength); - const cipher = crypto.createDecipheriv("aes-128-ctr", Buffer.from(aesKey), iv); // The Golang package implements AES-128-CTR + // The go-ethereum crypto/ecies package that encrypts/decrypts data uses AES-128-CTR by default for signing certs currently generated by Fabric + let aesAlgorithm; + if (aesKeyLength === 16) { + aesAlgorithm = "aes-128-ctr"; + } else if (aesKeyLength === 32) { + aesAlgorithm = "aes-256-ctr"; + } else { + throw new Error("Invalid AES key length supplied: " + aesKeyLength); + } + const cipher = crypto.createDecipheriv(aesAlgorithm, Buffer.from(aesKey), iv); const decryptedBytes = cipher.update(EM.slice(IVLength)); return decryptedBytes; } @@ -135,7 +144,7 @@ function eciesDecryptMessage(recipientPrivateKey, cipherText, options) { * @returns encrypted message as a Buffer. * */ -function eciesEncryptMessage(recipientPublicKey, msg, options) { +function eciesEncryptMessage(recipientPublicKey, msg, options, aesKeyLength = AESKeyLength) { const level = recipientPublicKey.ecparams.keylen; options.securityLevel = level; processOption(options); @@ -153,15 +162,24 @@ function eciesEncryptMessage(recipientPublicKey, msg, options) { const Z = ephPrivKey.derive(pubKey.pub); const kdfOutput = hkdf(Z.toArray(), ECIESKDFOutput, null, null, options); - const aesKey = kdfOutput.slice(0, AESKeyLength); - const hmacKey = kdfOutput.slice(AESKeyLength, AESKeyLength + HMACKeyLength); + const aesKey = kdfOutput.slice(0, aesKeyLength); + const hmacKey = kdfOutput.slice(aesKeyLength, aesKeyLength + HMACKeyLength); const hmacKeyHash = new options.hashFunctionKeyDerivation(); hmacKeyHash.update(bytesToBits(hmacKey)); const hKm = bitsToBytes(hmacKeyHash.finalize()); const iv = crypto.randomBytes(IVLength); - const cipher = crypto.createCipheriv("aes-256-ctr", Buffer.from(aesKey), iv); + // The go-ethereum crypto/ecies package that encrypts/decrypts data uses AES-128-CTR by default for signing certs currently generated by Fabric + let aesAlgorithm; + if (aesKeyLength === 16) { + aesAlgorithm = "aes-128-ctr"; + } else if (aesKeyLength === 32) { + aesAlgorithm = "aes-256-ctr"; + } else { + throw new Error("Invalid AES key length supplied: " + aesKeyLength); + } + const cipher = crypto.createCipheriv(aesAlgorithm, Buffer.from(aesKey), iv); const encryptedBytes = cipher.update(msg); const EM = Buffer.concat([iv, encryptedBytes]); const D = hmac(hKm, EM, options); diff --git a/weaver/sdks/fabric/interoperation-node-sdk/test/InteroperableHelper.js b/weaver/sdks/fabric/interoperation-node-sdk/test/InteroperableHelper.js index 8ebc612ca1..2b2f3a808b 100644 --- a/weaver/sdks/fabric/interoperation-node-sdk/test/InteroperableHelper.js +++ b/weaver/sdks/fabric/interoperation-node-sdk/test/InteroperableHelper.js @@ -107,7 +107,7 @@ describe("InteroperableHelper", () => { }); describe("cryptographic functions", () => { - it("encrypt and decrypt a message", () => { + it("encrypt and decrypt a message with default 128-bit AES key", () => { const data = '{ "data": "xyz" }'; const privKeyFile = `${__dirname}/data/privKey.pem`; const privKeyPEM = fs.readFileSync(privKeyFile).toString(); @@ -128,6 +128,28 @@ describe("InteroperableHelper", () => { }); }); + describe("cryptographic functions", () => { + it("encrypt and decrypt a message with 256-bit AES key", () => { + const data = '{ "data": "xyz" }'; + const privKeyFile = `${__dirname}/data/privKey.pem`; + const privKeyPEM = fs.readFileSync(privKeyFile).toString(); + const privKey = keyutil.getKeyFromPlainPrivatePKCS8PEM(privKeyPEM); + const signCertFile = `${__dirname}/data/signCert.pem`; + const signCertPEM = fs.readFileSync(signCertFile).toString(); + const pubKey = keyutil.getKey(signCertPEM); + const cryptoOptions = { hashAlgorithm: "SHA2" }; + expect(() => { + const encryptedData = ecies.eciesEncryptMessage(pubKey, Buffer.from(data), cryptoOptions, 32); // 32 * 8 == 256 + expect(encryptedData).to.be.a("Uint8Array"); + expect(() => { + const decryptedData = ecies.eciesDecryptMessage(privKey, encryptedData, cryptoOptions, 32); // 32 * 8 == 256 + expect(decryptedData).to.be.a("Uint8Array"); + expect(decryptedData.toString()).to.equal(data); + }).to.not.throw(); + }).to.not.throw(); + }); + }); + describe("decrypt remote proposal response", () => { it("decrypt proposal response using private key", () => { const samplePropJSON = JSON.parse(fs.readFileSync(`${__dirname}/data/prop.json`).toString()); diff --git a/weaver/tests/network-setups/besu/README.md b/weaver/tests/network-setups/besu/README.md index c704dffd81..7e19bbab97 100644 --- a/weaver/tests/network-setups/besu/README.md +++ b/weaver/tests/network-setups/besu/README.md @@ -10,7 +10,7 @@ - Besu: * Download and unpack the latest https://github.com/hyperledger/besu/releases/latest. You will find it in the link of the form: https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/x.y.z/besu-x.y.z.zip with x.y.z replaced with the version number. For instance, run the following command after updating version number accordingly. ``` -wget https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/21.7.0/besu-21.7.0.zip +wget https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.10.2/besu-23.10.2.zip ``` * Add the path to besu-x.y.z/bin to PATH - EthSigner: diff --git a/yarn.lock b/yarn.lock index 5caf879cb7..6a5626e5ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13,9 +13,9 @@ __metadata: linkType: hard "@adobe/css-tools@npm:^4.0.1": - version: 4.2.0 - resolution: "@adobe/css-tools@npm:4.2.0" - checksum: dc5cc92ba3d562e7ffddb79d6d222c7e00b65f255fd2725b3d71490ff268844be322f917415d8c4ab39eca646343b632058db8bd5b1d646193fcc94d1d3e420b + version: 4.3.2 + resolution: "@adobe/css-tools@npm:4.3.2" + checksum: 9667d61d55dc3b0a315c530ae84e016ce5267c4dd8ac00abb40108dc98e07b98e3090ce8b87acd51a41a68d9e84dcccb08cdf21c902572a9cf9dcaf830da4ae3 languageName: node linkType: hard @@ -27,9 +27,9 @@ __metadata: linkType: hard "@adraffy/ens-normalize@npm:^1.8.8": - version: 1.9.4 - resolution: "@adraffy/ens-normalize@npm:1.9.4" - checksum: 7d7fff58ebe2c4961f7e5e61dad123aa6a63fec0df5c84af1fa41079dc05d398599690be4427b3a94d2baa94084544bcfdf2d51cbed7504b9b0583b0960ad550 + version: 1.10.0 + resolution: "@adraffy/ens-normalize@npm:1.10.0" + checksum: af0540f963a2632da2bbc37e36ea6593dcfc607b937857133791781e246d47f870d5e3d21fa70d5cfe94e772c284588c81ea3f5b7f4ea8fbb824369444e4dbcb languageName: node linkType: hard @@ -50,15 +50,6 @@ __metadata: languageName: node linkType: hard -"@ampproject/remapping@npm:^2.1.0": - version: 2.1.2 - resolution: "@ampproject/remapping@npm:2.1.2" - dependencies: - "@jridgewell/trace-mapping": ^0.3.0 - checksum: e023f92cdd9723f3042cde3b4d922adfeef0e198aa73486b0b6c034ad36af5f96e5c0cc72b335b30b2eb9852d907efc92af6bfcd3f4b4d286177ee32a189cf92 - languageName: node - linkType: hard - "@angular-builders/custom-webpack@npm:16.0.1": version: 16.0.1 resolution: "@angular-builders/custom-webpack@npm:16.0.1" @@ -76,7 +67,7 @@ __metadata: languageName: node linkType: hard -"@angular-devkit/architect@npm:0.1602.1, @angular-devkit/architect@npm:>=0.1600.0 < 0.1700.0": +"@angular-devkit/architect@npm:0.1602.1": version: 0.1602.1 resolution: "@angular-devkit/architect@npm:0.1602.1" dependencies: @@ -86,7 +77,17 @@ __metadata: languageName: node linkType: hard -"@angular-devkit/build-angular@npm:16.2.1, @angular-devkit/build-angular@npm:^16.0.0": +"@angular-devkit/architect@npm:0.1602.11, @angular-devkit/architect@npm:>=0.1600.0 < 0.1700.0": + version: 0.1602.11 + resolution: "@angular-devkit/architect@npm:0.1602.11" + dependencies: + "@angular-devkit/core": 16.2.11 + rxjs: 7.8.1 + checksum: 8447a3e719be427deb4eecd344ebdf8b6cbbcf007eccd04d75073376f52d4958c1b594b224db4ffab84140bd241ab9f8123ba151f7a3fa7e378c50ec44a0feab + languageName: node + linkType: hard + +"@angular-devkit/build-angular@npm:16.2.1": version: 16.2.1 resolution: "@angular-devkit/build-angular@npm:16.2.1" dependencies: @@ -193,6 +194,113 @@ __metadata: languageName: node linkType: hard +"@angular-devkit/build-angular@npm:^16.0.0": + version: 16.2.11 + resolution: "@angular-devkit/build-angular@npm:16.2.11" + dependencies: + "@ampproject/remapping": 2.2.1 + "@angular-devkit/architect": 0.1602.11 + "@angular-devkit/build-webpack": 0.1602.11 + "@angular-devkit/core": 16.2.11 + "@babel/core": 7.22.9 + "@babel/generator": 7.22.9 + "@babel/helper-annotate-as-pure": 7.22.5 + "@babel/helper-split-export-declaration": 7.22.6 + "@babel/plugin-proposal-async-generator-functions": 7.20.7 + "@babel/plugin-transform-async-to-generator": 7.22.5 + "@babel/plugin-transform-runtime": 7.22.9 + "@babel/preset-env": 7.22.9 + "@babel/runtime": 7.22.6 + "@babel/template": 7.22.5 + "@discoveryjs/json-ext": 0.5.7 + "@ngtools/webpack": 16.2.11 + "@vitejs/plugin-basic-ssl": 1.0.1 + ansi-colors: 4.1.3 + autoprefixer: 10.4.14 + babel-loader: 9.1.3 + babel-plugin-istanbul: 6.1.1 + browserslist: ^4.21.5 + chokidar: 3.5.3 + copy-webpack-plugin: 11.0.0 + critters: 0.0.20 + css-loader: 6.8.1 + esbuild: 0.18.17 + esbuild-wasm: 0.18.17 + fast-glob: 3.3.1 + guess-parser: 0.4.22 + https-proxy-agent: 5.0.1 + inquirer: 8.2.4 + jsonc-parser: 3.2.0 + karma-source-map-support: 1.4.0 + less: 4.1.3 + less-loader: 11.1.0 + license-webpack-plugin: 4.0.2 + loader-utils: 3.2.1 + magic-string: 0.30.1 + mini-css-extract-plugin: 2.7.6 + mrmime: 1.0.1 + open: 8.4.2 + ora: 5.4.1 + parse5-html-rewriting-stream: 7.0.0 + picomatch: 2.3.1 + piscina: 4.0.0 + postcss: 8.4.31 + postcss-loader: 7.3.3 + resolve-url-loader: 5.0.0 + rxjs: 7.8.1 + sass: 1.64.1 + sass-loader: 13.3.2 + semver: 7.5.4 + source-map-loader: 4.0.1 + source-map-support: 0.5.21 + terser: 5.19.2 + text-table: 0.2.0 + tree-kill: 1.2.2 + tslib: 2.6.1 + vite: 4.5.1 + webpack: 5.88.2 + webpack-dev-middleware: 6.1.1 + webpack-dev-server: 4.15.1 + webpack-merge: 5.9.0 + webpack-subresource-integrity: 5.1.0 + peerDependencies: + "@angular/compiler-cli": ^16.0.0 + "@angular/localize": ^16.0.0 + "@angular/platform-server": ^16.0.0 + "@angular/service-worker": ^16.0.0 + jest: ^29.5.0 + jest-environment-jsdom: ^29.5.0 + karma: ^6.3.0 + ng-packagr: ^16.0.0 + protractor: ^7.0.0 + tailwindcss: ^2.0.0 || ^3.0.0 + typescript: ">=4.9.3 <5.2" + dependenciesMeta: + esbuild: + optional: true + peerDependenciesMeta: + "@angular/localize": + optional: true + "@angular/platform-server": + optional: true + "@angular/service-worker": + optional: true + jest: + optional: true + jest-environment-jsdom: + optional: true + karma: + optional: true + ng-packagr: + optional: true + protractor: + optional: true + tailwindcss: + optional: true + checksum: 5370e21a46f7d3c2d6906b8c196ff6d1420b5e9eb8faa40a53bed33ce36727adf622bbb4931c709f988f7f867b81946ce72ad0335728f73cdd47734ca9f232a9 + languageName: node + linkType: hard + "@angular-devkit/build-webpack@npm:0.1602.1": version: 0.1602.1 resolution: "@angular-devkit/build-webpack@npm:0.1602.1" @@ -206,7 +314,20 @@ __metadata: languageName: node linkType: hard -"@angular-devkit/core@npm:16.2.1, @angular-devkit/core@npm:^16.0.0": +"@angular-devkit/build-webpack@npm:0.1602.11": + version: 0.1602.11 + resolution: "@angular-devkit/build-webpack@npm:0.1602.11" + dependencies: + "@angular-devkit/architect": 0.1602.11 + rxjs: 7.8.1 + peerDependencies: + webpack: ^5.30.0 + webpack-dev-server: ^4.0.0 + checksum: 06462b8b10d6fff849c439d1c383f1ba6fc8ff99743f9758c769893498f11db57f1a234f96a472a9cfab3b2fb1af73b9bf2ee9e2cdb1ab93b51938dfcadf20b3 + languageName: node + linkType: hard + +"@angular-devkit/core@npm:16.2.1": version: 16.2.1 resolution: "@angular-devkit/core@npm:16.2.1" dependencies: @@ -225,7 +346,26 @@ __metadata: languageName: node linkType: hard -"@angular-devkit/schematics@npm:16.2.1, @angular-devkit/schematics@npm:^16.0.0": +"@angular-devkit/core@npm:16.2.11, @angular-devkit/core@npm:^16.0.0": + version: 16.2.11 + resolution: "@angular-devkit/core@npm:16.2.11" + dependencies: + ajv: 8.12.0 + ajv-formats: 2.1.1 + jsonc-parser: 3.2.0 + picomatch: 2.3.1 + rxjs: 7.8.1 + source-map: 0.7.4 + peerDependencies: + chokidar: ^3.5.2 + peerDependenciesMeta: + chokidar: + optional: true + checksum: abde80f6cae9e573c13b5f8e481d13e6fa6faf1832386962807e47860cefad36c4bf35f79835cb2b3887dc524d549e01c9e08a580471d114551d4f7d65086054 + languageName: node + linkType: hard + +"@angular-devkit/schematics@npm:16.2.1": version: 16.2.1 resolution: "@angular-devkit/schematics@npm:16.2.1" dependencies: @@ -238,6 +378,19 @@ __metadata: languageName: node linkType: hard +"@angular-devkit/schematics@npm:16.2.11, @angular-devkit/schematics@npm:^16.0.0": + version: 16.2.11 + resolution: "@angular-devkit/schematics@npm:16.2.11" + dependencies: + "@angular-devkit/core": 16.2.11 + jsonc-parser: 3.2.0 + magic-string: 0.30.1 + ora: 5.4.1 + rxjs: 7.8.1 + checksum: 62cf8e21d5a5a1488ba85f660a42a347404e8967871aeca95080d9dc0d649010f56d160b2ebeabdcc84380040f867bcdf003faf327827ef60cd2523ba70c969c + languageName: node + linkType: hard + "@angular/cli@npm:16.2.1": version: 16.2.1 resolution: "@angular/cli@npm:16.2.1" @@ -465,11 +618,11 @@ __metadata: linkType: hard "@apollo/usage-reporting-protobuf@npm:^4.0.0": - version: 4.1.0 - resolution: "@apollo/usage-reporting-protobuf@npm:4.1.0" + version: 4.1.1 + resolution: "@apollo/usage-reporting-protobuf@npm:4.1.1" dependencies: "@apollo/protobufjs": 1.2.7 - checksum: 442532d7077a728a499de6c2c2340d106b26f14695446361f947a14d3092e4109239a86cfb99e4bb795d913523c1f61a05bb799b45fc72615560693bbd62e645 + checksum: 899f13cfb57cfe4320e50fff84254604c25538620aa5a56bad06fb4fc929a8842237b376a5ab6d82800d9aceacc8e79ccae01a1c11e85456d4a9ed50a6fe40ee languageName: node linkType: hard @@ -578,33 +731,16 @@ __metadata: languageName: node linkType: hard -"@azure/abort-controller@npm:^1.0.0": - version: 1.0.4 - resolution: "@azure/abort-controller@npm:1.0.4" - dependencies: - tslib: ^2.0.0 - checksum: 3bdb4d13505e91813729f053b5e50573aabcbb88cd7b187e8fd09aaf7a3ea8e2907ab6d6ee9bbe016060d312aecf189b2e1273e9fcc15bd93699632dcebafc06 - languageName: node - linkType: hard - -"@azure/core-asynciterator-polyfill@npm:^1.0.0": - version: 1.0.2 - resolution: "@azure/core-asynciterator-polyfill@npm:1.0.2" - checksum: ccdad3bcf3f670e0b4f52e421cd1566368dce36ea4b3cb18a9b554c14ea0c1436868cb55e774b2377307dcb222e4eb3777b48e97249157c612e9c24654a56d16 - languageName: node - linkType: hard - -"@azure/core-auth@npm:^1.3.0": - version: 1.3.2 - resolution: "@azure/core-auth@npm:1.3.2" +"@azure/abort-controller@npm:^1.0.0, @azure/abort-controller@npm:^1.1.0": + version: 1.1.0 + resolution: "@azure/abort-controller@npm:1.1.0" dependencies: - "@azure/abort-controller": ^1.0.0 tslib: ^2.2.0 - checksum: 8b27de6f8a82a63643524757ef774b1637b0d5c7769b387c73bebeb918717e7193ad1d2413638fb02b28de8199f261c1a902e3d04f75d1ef684af33529d9e98d + checksum: 0f45e504d4aea799486867179afe7589255f6c111951279958e9d0aa5faebb2c96b8f88e3e3c958ce07b02bcba0b0cddb1bbec94705f573a48ecdb93eec1a92a languageName: node linkType: hard -"@azure/core-auth@npm:^1.4.0, @azure/core-auth@npm:^1.5.0": +"@azure/core-auth@npm:^1.3.0, @azure/core-auth@npm:^1.4.0, @azure/core-auth@npm:^1.5.0": version: 1.5.0 resolution: "@azure/core-auth@npm:1.5.0" dependencies: @@ -631,13 +767,13 @@ __metadata: linkType: hard "@azure/core-http@npm:^2.0.0": - version: 2.2.4 - resolution: "@azure/core-http@npm:2.2.4" + version: 2.3.2 + resolution: "@azure/core-http@npm:2.3.2" dependencies: "@azure/abort-controller": ^1.0.0 - "@azure/core-asynciterator-polyfill": ^1.0.0 "@azure/core-auth": ^1.3.0 "@azure/core-tracing": 1.0.0-preview.13 + "@azure/core-util": ^1.1.1 "@azure/logger": ^1.0.0 "@types/node-fetch": ^2.5.0 "@types/tunnel": ^0.0.3 @@ -648,64 +784,45 @@ __metadata: tslib: ^2.2.0 tunnel: ^0.0.6 uuid: ^8.3.0 - xml2js: ^0.4.19 - checksum: abda8c34c6d54f61b77080b1d4c01b3828cf9a344eb100346ebcc5ef9903d8f57651fbc73c0230afad5fe497c5c6da576a77cf43827f87417cecac7d7e612967 + xml2js: ^0.5.0 + checksum: c56f14e0ce23fbdc770445010e500f8a81bc6a37fd2b1aa63bb58bfc665ed1cdd4d19d48bf21b5c64c118eba937e4345c1da713fdcc2a1fb85dc6197f3bc1be7 languageName: node linkType: hard "@azure/core-lro@npm:^2.0.0": - version: 2.2.3 - resolution: "@azure/core-lro@npm:2.2.3" + version: 2.5.4 + resolution: "@azure/core-lro@npm:2.5.4" dependencies: "@azure/abort-controller": ^1.0.0 - "@azure/core-tracing": 1.0.0-preview.13 + "@azure/core-util": ^1.2.0 "@azure/logger": ^1.0.0 tslib: ^2.2.0 - checksum: fd856fd3bc273eafb0e891dcf87e9356d21108b0122aaa55f92a090e8a4b4c799a5369a9faefb25bfa87233d4186d1720f577c0f3af5a5253987721f18155fee + checksum: f048b99850e8497b557cf661c2f8a384ea1227de6ea0c0e1436653851c3932e28a05056a380f7c20ebc51e4c6d7bd15d7dfabc6ecca80eddb9dc3e3339df9519 languageName: node linkType: hard "@azure/core-paging@npm:^1.1.1": - version: 1.2.1 - resolution: "@azure/core-paging@npm:1.2.1" - dependencies: - "@azure/core-asynciterator-polyfill": ^1.0.0 - tslib: ^2.2.0 - checksum: b4e07b1d9eb986f902f4a4741aac7e31b96373e0611aea74771c1eb25e1d38e9047a88af2643a17413e0304139337a457f03a465f1666b9affc5510cdf20fa2e - languageName: node - linkType: hard - -"@azure/core-rest-pipeline@npm:^1.1.0": version: 1.5.0 - resolution: "@azure/core-rest-pipeline@npm:1.5.0" + resolution: "@azure/core-paging@npm:1.5.0" dependencies: - "@azure/abort-controller": ^1.0.0 - "@azure/core-auth": ^1.3.0 - "@azure/core-tracing": 1.0.0-preview.13 - "@azure/logger": ^1.0.0 - form-data: ^4.0.0 - http-proxy-agent: ^4.0.1 - https-proxy-agent: ^5.0.0 tslib: ^2.2.0 - uuid: ^8.3.0 - checksum: 1503305db569f4d66353d7a93630c9f87995620312f9f05c262102e40c0f929e134aa221b2bf8f8b49f259fb0119c84a07a6a5ef2ead7f37d213b1c3f164f7fa + checksum: 156230f0fdf757a0353a2aac6d012d385ed88f8ab5bccf00eee27d8d75843e681674b2d10ed43309669f9cb93bf8d9d000232896593b6fcf399fa391442a59c5 languageName: node linkType: hard -"@azure/core-rest-pipeline@npm:^1.9.1": - version: 1.12.1 - resolution: "@azure/core-rest-pipeline@npm:1.12.1" +"@azure/core-rest-pipeline@npm:^1.1.0, @azure/core-rest-pipeline@npm:^1.9.1": + version: 1.13.0 + resolution: "@azure/core-rest-pipeline@npm:1.13.0" dependencies: - "@azure/abort-controller": ^1.0.0 + "@azure/abort-controller": ^1.1.0 "@azure/core-auth": ^1.4.0 "@azure/core-tracing": ^1.0.1 "@azure/core-util": ^1.3.0 "@azure/logger": ^1.0.0 - form-data: ^4.0.0 http-proxy-agent: ^5.0.0 https-proxy-agent: ^5.0.0 tslib: ^2.2.0 - checksum: 21ffe73d6a3cef125be313d9259d2752902a065bd59ffcaaae79a99d2851959a8aa01c416a80c21e74240176bedc24e11a30390af3e11b5cad541893188c958e + checksum: 9fe889625756121ceff421805aa643fa6b29bf5fa3730111b0ec509aa08f84b04befd29532e9fa270a85435ed9d597aa777b96730968e425d1aedea256827e94 languageName: node linkType: hard @@ -728,13 +845,13 @@ __metadata: languageName: node linkType: hard -"@azure/core-util@npm:^1.0.0, @azure/core-util@npm:^1.1.0, @azure/core-util@npm:^1.3.0": - version: 1.5.0 - resolution: "@azure/core-util@npm:1.5.0" +"@azure/core-util@npm:^1.0.0, @azure/core-util@npm:^1.1.0, @azure/core-util@npm:^1.1.1, @azure/core-util@npm:^1.2.0, @azure/core-util@npm:^1.3.0": + version: 1.6.1 + resolution: "@azure/core-util@npm:1.6.1" dependencies: "@azure/abort-controller": ^1.0.0 tslib: ^2.2.0 - checksum: 75bfbce75fad0e6b79bc6ba64bc1dea60e4179db7fdc656ead7818f3b01bfb4d826a60bba9a6b00bbaeb1fe9707080e6c58ad8a2a307ddeef110a792df3ec298 + checksum: 1f8cd130993f161c98925070af863510cbcc79e0471864e4b16852afc2ee7413c9c7fabe72f20f3e521ee75c3cd7e3085661fdc8d5d0a643a6e1b1b7bf691ddd languageName: node linkType: hard @@ -778,38 +895,38 @@ __metadata: linkType: hard "@azure/logger@npm:^1.0.0": - version: 1.0.3 - resolution: "@azure/logger@npm:1.0.3" + version: 1.0.4 + resolution: "@azure/logger@npm:1.0.4" dependencies: tslib: ^2.2.0 - checksum: f3443c70c678a7449a5f3be09488a0a15711c506c9da6a81fa9e43178128ddf5db3abc02c99359d188e4ef47d703c5e5f206df71b0e01884245de3220ab1205b + checksum: 2c243d4c667bbc5cd3e60d4473d0f1169fcef2498a02138398af15547fe1b2870197bcb4c487327451488e4d71dee05244771d51328f03611e193b99fb9aa9af languageName: node linkType: hard "@azure/msal-browser@npm:^2.37.1": - version: 2.38.2 - resolution: "@azure/msal-browser@npm:2.38.2" + version: 2.38.3 + resolution: "@azure/msal-browser@npm:2.38.3" dependencies: - "@azure/msal-common": 13.3.0 - checksum: 78142f33971ed18110ede263f5bba37f7b9e81fb7f30c7feb28e6715bef15faf7e59e1b8fa1843e544dc86607aedf011d27f2e6867f16acb98d963a525186e5e + "@azure/msal-common": 13.3.1 + checksum: 633483cae20f41f0eeb06dae8c053f4981de06b9ac5af4d79f48d64ea66cb4eab1c5954ae108e6467f7a0e073cbbf0849c97a99385e9d9db2432cac4240e8dc6 languageName: node linkType: hard -"@azure/msal-common@npm:13.3.0, @azure/msal-common@npm:^13.1.0": - version: 13.3.0 - resolution: "@azure/msal-common@npm:13.3.0" - checksum: 334c2d4cee12064ef80ce949cc2c6e02ac54f5931b522e0592512ce12738206fd4558158205d6ed73a01a3227fd2e95965c1cb08bd302d5e3bf1099b81385b3d +"@azure/msal-common@npm:13.3.1, @azure/msal-common@npm:^13.1.0": + version: 13.3.1 + resolution: "@azure/msal-common@npm:13.3.1" + checksum: 59fff7d4b3b92f35b51014ce891e625a899116ee9d8496d985fd301eaa0d7084a3a3a3f35246fc56f27ce4ff6b2074027e1f0665e493b7057cbab001a161602b languageName: node linkType: hard "@azure/msal-node@npm:^1.17.3": - version: 1.18.3 - resolution: "@azure/msal-node@npm:1.18.3" + version: 1.18.4 + resolution: "@azure/msal-node@npm:1.18.4" dependencies: - "@azure/msal-common": 13.3.0 + "@azure/msal-common": 13.3.1 jsonwebtoken: ^9.0.0 uuid: ^8.3.0 - checksum: 77d8f16604874b2729f506015e557c28535d234fdad6029c32ef0fd3f3bda95169ffa0e59dbe25d1183503368afe1855cc31952705676595d73e8a7fbd3e4b98 + checksum: fecced6bf5ba45379146dc76aa29587640a4919ebeb4713070247b4235ec5abe7c21ef8d84dae4cc1c5584368fa4773f8347ebc60867f295a65a0ed2143339aa languageName: node linkType: hard @@ -831,78 +948,20 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/code-frame@npm:7.16.7" - dependencies: - "@babel/highlight": ^7.16.7 - checksum: db2f7faa31bc2c9cf63197b481b30ea57147a5fc1a6fab60e5d6c02cdfbf6de8e17b5121f99917b3dabb5eeb572da078312e70697415940383efc140d4e0808b - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.8.3": - version: 7.22.13 - resolution: "@babel/code-frame@npm:7.22.13" - dependencies: - "@babel/highlight": ^7.22.13 - chalk: ^2.4.2 - checksum: 22e342c8077c8b77eeb11f554ecca2ba14153f707b85294fcf6070b6f6150aae88a7b7436dd88d8c9289970585f3fe5b9b941c5aa3aa26a6d5a8ef3f292da058 - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/code-frame@npm:7.18.6" - dependencies: - "@babel/highlight": ^7.18.6 - checksum: 195e2be3172d7684bf95cff69ae3b7a15a9841ea9d27d3c843662d50cdd7d6470fd9c8e64be84d031117e4a4083486effba39f9aef6bbb2c89f7f21bcfba33ba - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/code-frame@npm:7.22.10" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.22.5, @babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.8.3": + version: 7.23.5 + resolution: "@babel/code-frame@npm:7.23.5" dependencies: - "@babel/highlight": ^7.22.10 + "@babel/highlight": ^7.23.4 chalk: ^2.4.2 - checksum: 89a06534ad19759da6203a71bad120b1d7b2ddc016c8e07d4c56b35dea25e7396c6da60a754e8532a86733092b131ae7f661dbe6ba5d165ea777555daa2ed3c9 - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/code-frame@npm:7.22.5" - dependencies: - "@babel/highlight": ^7.22.5 - checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.16.4, @babel/compat-data@npm:^7.17.0": - version: 7.17.0 - resolution: "@babel/compat-data@npm:7.17.0" - checksum: fe5afaf529d107a223cd5937dace248464b6df1e9f4ea4031a5723e9571b46a4db1c4ff226bac6351148b1bc02ba1b39cb142662cd235aa99c1dda77882f8c9d + checksum: d90981fdf56a2824a9b14d19a4c0e8db93633fd488c772624b4e83e0ceac6039a27cd298a247c3214faa952bf803ba23696172ae7e7235f3b97f43ba278c569a languageName: node linkType: hard -"@babel/compat-data@npm:^7.18.8": - version: 7.18.8 - resolution: "@babel/compat-data@npm:7.18.8" - checksum: 3096aafad74936477ebdd039bcf342fba84eb3100e608f3360850fb63e1efa1c66037c4824f814d62f439ab47d25164439343a6e92e9b4357024fdf571505eb9 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/compat-data@npm:7.22.5" - checksum: eb1a47ebf79ae268b4a16903e977be52629339806e248455eb9973897c503a04b701f36a9de64e19750d6e081d0561e77a514c8dc470babbeba59ae94298ed18 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/compat-data@npm:7.22.9" - checksum: bed77d9044ce948b4327b30dd0de0779fa9f3a7ed1f2d31638714ed00229fa71fc4d1617ae0eb1fad419338d3658d0e9a5a083297451e09e73e078d0347ff808 +"@babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9, @babel/compat-data@npm:^7.23.3, @babel/compat-data@npm:^7.23.5": + version: 7.23.5 + resolution: "@babel/compat-data@npm:7.23.5" + checksum: 06ce244cda5763295a0ea924728c09bae57d35713b675175227278896946f922a63edf803c322f855a3878323d48d0255a2a3023409d2a123483c8a69ebb4744 languageName: node linkType: hard @@ -929,7 +988,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.22.9, @babel/core@npm:^7.18.6": +"@babel/core@npm:7.22.9": version: 7.22.9 resolution: "@babel/core@npm:7.22.9" dependencies: @@ -952,101 +1011,32 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.1.0": - version: 7.23.2 - resolution: "@babel/core@npm:7.23.2" +"@babel/core@npm:^7.1.0, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.16.0, @babel/core@npm:^7.18.6, @babel/core@npm:^7.5.5, @babel/core@npm:^7.7.2, @babel/core@npm:^7.7.5, @babel/core@npm:^7.8.0": + version: 7.23.7 + resolution: "@babel/core@npm:7.23.7" dependencies: "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.22.13 - "@babel/generator": ^7.23.0 - "@babel/helper-compilation-targets": ^7.22.15 - "@babel/helper-module-transforms": ^7.23.0 - "@babel/helpers": ^7.23.2 - "@babel/parser": ^7.23.0 + "@babel/code-frame": ^7.23.5 + "@babel/generator": ^7.23.6 + "@babel/helper-compilation-targets": ^7.23.6 + "@babel/helper-module-transforms": ^7.23.3 + "@babel/helpers": ^7.23.7 + "@babel/parser": ^7.23.6 "@babel/template": ^7.22.15 - "@babel/traverse": ^7.23.2 - "@babel/types": ^7.23.0 + "@babel/traverse": ^7.23.7 + "@babel/types": ^7.23.6 convert-source-map: ^2.0.0 debug: ^4.1.0 gensync: ^1.0.0-beta.2 json5: ^2.2.3 semver: ^6.3.1 - checksum: 003897718ded16f3b75632d63cd49486bf67ff206cc7ebd1a10d49e2456f8d45740910d5ec7e42e3faf0deec7a2e96b1a02e766d19a67a8309053f0d4e57c0fe - languageName: node - linkType: hard - -"@babel/core@npm:^7.11.1, @babel/core@npm:^7.16.0, @babel/core@npm:^7.7.2, @babel/core@npm:^7.8.0": - version: 7.22.11 - resolution: "@babel/core@npm:7.22.11" - dependencies: - "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.22.10 - "@babel/generator": ^7.22.10 - "@babel/helper-compilation-targets": ^7.22.10 - "@babel/helper-module-transforms": ^7.22.9 - "@babel/helpers": ^7.22.11 - "@babel/parser": ^7.22.11 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.11 - "@babel/types": ^7.22.11 - convert-source-map: ^1.7.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.2.3 - semver: ^6.3.1 - checksum: f258b2539ea2e5bfe55a708c2f3e1093a1b4744f12becc35abeb896037b66210de9a8ad6296a706046d5dc3a24e564362b73a9b814e5bfe500c8baab60c22d2e - languageName: node - linkType: hard - -"@babel/core@npm:^7.11.6": - version: 7.18.9 - resolution: "@babel/core@npm:7.18.9" - dependencies: - "@ampproject/remapping": ^2.1.0 - "@babel/code-frame": ^7.18.6 - "@babel/generator": ^7.18.9 - "@babel/helper-compilation-targets": ^7.18.9 - "@babel/helper-module-transforms": ^7.18.9 - "@babel/helpers": ^7.18.9 - "@babel/parser": ^7.18.9 - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.9 - "@babel/types": ^7.18.9 - convert-source-map: ^1.7.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.2.1 - semver: ^6.3.0 - checksum: 64b9088b03fdf659b334864ef93bed85d60c17b27fcbd72970f8eb9e0d3266ffa5a1926960f648f2db36b0bafec615f947ea5117d200599a0661b9f0a9cdf323 - languageName: node - linkType: hard - -"@babel/core@npm:^7.12.3, @babel/core@npm:^7.5.5, @babel/core@npm:^7.7.5": - version: 7.17.5 - resolution: "@babel/core@npm:7.17.5" - dependencies: - "@ampproject/remapping": ^2.1.0 - "@babel/code-frame": ^7.16.7 - "@babel/generator": ^7.17.3 - "@babel/helper-compilation-targets": ^7.16.7 - "@babel/helper-module-transforms": ^7.16.7 - "@babel/helpers": ^7.17.2 - "@babel/parser": ^7.17.3 - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.17.3 - "@babel/types": ^7.17.0 - convert-source-map: ^1.7.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.1.2 - semver: ^6.3.0 - checksum: c5e7dddb4feaacb91175d22a6edc8e93804242328a82b80732c6e84a0647bc0a9c9d5b05f3ce13138b8e59bf7aba4ff9f7b7446302f141f243ba51df02c318a5 + checksum: 32d5bf73372a47429afaae9adb0af39e47bcea6a831c4b5dcbb4791380cda6949cb8cb1a2fea8b60bb1ebe189209c80e333903df1fa8e9dcb04798c0ce5bf59e languageName: node linkType: hard "@babel/eslint-parser@npm:^7.16.3": - version: 7.22.15 - resolution: "@babel/eslint-parser@npm:7.22.15" + version: 7.23.3 + resolution: "@babel/eslint-parser@npm:7.23.3" dependencies: "@nicolo-ribaudo/eslint-scope-5-internals": 5.1.1-v1 eslint-visitor-keys: ^2.1.0 @@ -1054,7 +1044,7 @@ __metadata: peerDependencies: "@babel/core": ^7.11.0 eslint: ^7.5.0 || ^8.0.0 - checksum: efdc749164a40de1b68e3ed395f441dfb7864c85d0a2ee3e4bc4f06dd0b7f675acb9be97cdc9025b88b3e80d38749a2b30e392ce7f6a79313c3aaf82ba8ccd68 + checksum: 9573daebe21af5123c302c307be80cacf1c2bf236a9497068a14726d3944ef55e1282519d0ccf51882dfc369359a3442299c98cb22a419e209924db39d4030fd languageName: node linkType: hard @@ -1071,7 +1061,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:7.22.9, @babel/generator@npm:^7.18.7, @babel/generator@npm:^7.22.9": +"@babel/generator@npm:7.22.9": version: 7.22.9 resolution: "@babel/generator@npm:7.22.9" dependencies: @@ -1083,61 +1073,15 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.17.3, @babel/generator@npm:^7.7.2": - version: 7.17.3 - resolution: "@babel/generator@npm:7.17.3" - dependencies: - "@babel/types": ^7.17.0 - jsesc: ^2.5.1 - source-map: ^0.5.0 - checksum: ddf70e3489976018dfc2da8b9f43ec8c582cac2da681ed4a6227c53b26a9626223e4dca90098b3d3afe43bc67f20160856240e826c56b48e577f34a5a7e22b9f - languageName: node - linkType: hard - -"@babel/generator@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/generator@npm:7.18.9" - dependencies: - "@babel/types": ^7.18.9 - "@jridgewell/gen-mapping": ^0.3.2 - jsesc: ^2.5.1 - checksum: 1c271e0c6f33e59f7845d88a1b0b9b0dce88164e80dec9274a716efa54c260e405e9462b160843e73f45382bf5b24d8e160e0121207e480c29b30e2ed0eb16d4 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.22.10, @babel/generator@npm:^7.4.0": - version: 7.22.10 - resolution: "@babel/generator@npm:7.22.10" - dependencies: - "@babel/types": ^7.22.10 - "@jridgewell/gen-mapping": ^0.3.2 - "@jridgewell/trace-mapping": ^0.3.17 - jsesc: ^2.5.1 - checksum: 59a79730abdff9070692834bd3af179e7a9413fa2ff7f83dff3eb888765aeaeb2bfc7b0238a49613ed56e1af05956eff303cc139f2407eda8df974813e486074 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/generator@npm:7.22.5" - dependencies: - "@babel/types": ^7.22.5 - "@jridgewell/gen-mapping": ^0.3.2 - "@jridgewell/trace-mapping": ^0.3.17 - jsesc: ^2.5.1 - checksum: efa64da70ca88fe69f05520cf5feed6eba6d30a85d32237671488cc355fdc379fe2c3246382a861d49574c4c2f82a317584f8811e95eb024e365faff3232b49d - languageName: node - linkType: hard - -"@babel/generator@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/generator@npm:7.23.0" +"@babel/generator@npm:^7.18.7, @babel/generator@npm:^7.22.5, @babel/generator@npm:^7.22.9, @babel/generator@npm:^7.23.6, @babel/generator@npm:^7.4.0, @babel/generator@npm:^7.7.2": + version: 7.23.6 + resolution: "@babel/generator@npm:7.23.6" dependencies: - "@babel/types": ^7.23.0 + "@babel/types": ^7.23.6 "@jridgewell/gen-mapping": ^0.3.2 "@jridgewell/trace-mapping": ^0.3.17 jsesc: ^2.5.1 - checksum: 8efe24adad34300f1f8ea2add420b28171a646edc70f2a1b3e1683842f23b8b7ffa7e35ef0119294e1901f45bfea5b3dc70abe1f10a1917ccdfb41bed69be5f1 + checksum: 1a1a1c4eac210f174cd108d479464d053930a812798e09fee069377de39a893422df5b5b146199ead7239ae6d3a04697b45fc9ac6e38e0f6b76374390f91fc6c languageName: node linkType: hard @@ -1150,208 +1094,63 @@ __metadata: languageName: node linkType: hard -"@babel/helper-annotate-as-pure@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-annotate-as-pure@npm:7.16.7" - dependencies: - "@babel/types": ^7.16.7 - checksum: d235be963fed5d48a8a4cfabc41c3f03fad6a947810dbcab9cebed7f819811457e10d99b4b2e942ad71baa7ee8e3cd3f5f38a4e4685639ddfddb7528d9a07179 - languageName: node - linkType: hard - -"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.22.5" - dependencies: - "@babel/types": ^7.22.5 - checksum: d753acac62399fc6dd354cf1b9441bde0c331c2fe792a4c14904c5e5eafc3cac79478f6aa038e8a51c1148b0af6710a2e619855e4b5d54497ac972eaffed5884 - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-compilation-targets@npm:7.16.7" - dependencies: - "@babel/compat-data": ^7.16.4 - "@babel/helper-validator-option": ^7.16.7 - browserslist: ^4.17.5 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 7238aaee78c011a42fb5ca92e5eff098752f7b314c2111d7bb9cdd58792fcab1b9c819b59f6a0851dc210dc09dc06b30d130a23982753e70eb3111bc65204842 - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helper-compilation-targets@npm:7.18.9" - dependencies: - "@babel/compat-data": ^7.18.8 - "@babel/helper-validator-option": ^7.18.6 - browserslist: ^4.20.2 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 2a9d71e124e098a9f45de4527ddd1982349d231827d341e00da9dfb967e260ecc7662c8b62abee4a010fb34d5f07a8d2155c974e0bc1928144cee5644910621d - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.22.10, @babel/helper-compilation-targets@npm:^7.22.6": - version: 7.22.10 - resolution: "@babel/helper-compilation-targets@npm:7.22.10" - dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-validator-option": ^7.22.5 - browserslist: ^4.21.9 - lru-cache: ^5.1.1 - semver: ^6.3.1 - checksum: f6f1896816392bcff671bbe6e277307729aee53befb4a66ea126e2a91eda78d819a70d06fa384c74ef46c1595544b94dca50bef6c78438d9ffd31776dafbd435 - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.22.15": +"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.22.15": version: 7.22.15 - resolution: "@babel/helper-compilation-targets@npm:7.22.15" - dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-validator-option": ^7.22.15 - browserslist: ^4.21.9 - lru-cache: ^5.1.1 - semver: ^6.3.1 - checksum: ce85196769e091ae54dd39e4a80c2a9df1793da8588e335c383d536d54f06baf648d0a08fc873044f226398c4ded15c4ae9120ee18e7dfd7c639a68e3cdc9980 - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-compilation-targets@npm:7.22.5" + resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.22.15" dependencies: - "@babel/compat-data": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - browserslist: ^4.21.3 - lru-cache: ^5.1.1 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: a479460615acffa0f4fd0a29b740eafb53a93694265207d23a6038ccd18d183a382cacca515e77b7c9b042c3ba80b0aca0da5f1f62215140e81660d2cf721b68 + "@babel/types": ^7.22.15 + checksum: 639c697a1c729f9fafa2dd4c9af2e18568190299b5907bd4c2d0bc818fcbd1e83ffeecc2af24327a7faa7ac4c34edd9d7940510a5e66296c19bad17001cf5c7a languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-compilation-targets@npm:7.22.9" +"@babel/helper-compilation-targets@npm:^7.20.7, @babel/helper-compilation-targets@npm:^7.22.15, @babel/helper-compilation-targets@npm:^7.22.5, @babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.22.9, @babel/helper-compilation-targets@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/helper-compilation-targets@npm:7.23.6" dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-validator-option": ^7.22.5 - browserslist: ^4.21.9 + "@babel/compat-data": ^7.23.5 + "@babel/helper-validator-option": ^7.23.5 + browserslist: ^4.22.2 lru-cache: ^5.1.1 semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: ea0006c6a93759025f4a35a25228ae260538c9f15023e8aac2a6d45ca68aef4cf86cfc429b19af9a402cbdd54d5de74ad3fbcf6baa7e48184dc079f1a791e178 + checksum: c630b98d4527ac8fe2c58d9a06e785dfb2b73ec71b7c4f2ddf90f814b5f75b547f3c015f110a010fd31f76e3864daaf09f3adcd2f6acdbfb18a8de3a48717590 languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/helper-create-class-features-plugin@npm:7.22.15" +"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.22.15, @babel/helper-create-class-features-plugin@npm:^7.23.6, @babel/helper-create-class-features-plugin@npm:^7.23.7": + version: 7.23.7 + resolution: "@babel/helper-create-class-features-plugin@npm:7.23.7" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.15 - "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.9 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 52c500d8d164abb3a360b1b7c4b8fff77bc4a5920d3a2b41ae6e1d30617b0dc0b972c1f5db35b1752007e04a748908b4a99bc872b73549ae837e87dcdde005a3 - languageName: node - linkType: hard - -"@babel/helper-create-class-features-plugin@npm:^7.22.11, @babel/helper-create-class-features-plugin@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/helper-create-class-features-plugin@npm:7.22.11" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 - "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.9 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: b7aeb22e29aba5327616328576363522b3b186918faeda605e300822af4a5f29416eb34b5bd825d07ab496550e271d02d7634f0022a62b5b8cbf0eb6389bc3fa - languageName: node - linkType: hard - -"@babel/helper-create-class-features-plugin@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-create-class-features-plugin@npm:7.22.9" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-function-name": ^7.23.0 + "@babel/helper-member-expression-to-functions": ^7.23.0 "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.9 + "@babel/helper-replace-supers": ^7.22.20 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 "@babel/helper-split-export-declaration": ^7.22.6 semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0 - checksum: 6c2436d1a5a3f1ff24628d78fa8c6d3120c40285aa3eda7815b1adbf8c5951e0dd73d368cf845825888fa3dc2f207dadce53309825598d7c67953e5ed9dd51d2 + checksum: 33e60714b856c3816a7965d4c76278cc8f430644a2dfc4eeafad2f7167c4fbd2becdb74cbfeb04b02efd6bbd07176ef53c6683262b588e65d378438e9c55c26b languageName: node linkType: hard -"@babel/helper-create-regexp-features-plugin@npm:^7.16.7": - version: 7.17.0 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.17.0" - dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - regexpu-core: ^5.0.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: eb66d9241544c705e9ce96d2d122b595ef52d926e6e031653e09af8a01050bd9d7e7fee168bf33a863342774d7d6a8cc7e8e9e5a45b955e9c01121c7a2d51708 - languageName: node - linkType: hard - -"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.22.5" +"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.22.15, @babel/helper-create-regexp-features-plugin@npm:^7.22.5": + version: 7.22.15 + resolution: "@babel/helper-create-regexp-features-plugin@npm:7.22.15" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 regexpu-core: ^5.3.1 - semver: ^6.3.0 + semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0 - checksum: 94932145beeb1f91856be25fea8de30b4b81b63fbc7c5a207ed97a5ddc34cd1e9b04041ed28bd24ec09cdcfbb62e8d66f820e4fe864672afe0aa2f357c784e11 + checksum: 0243b8d4854f1dc8861b1029a46d3f6393ad72f366a5a08e36a4648aa682044f06da4c6e87a456260e1e1b33c999f898ba591a0760842c1387bcc93fbf2151a6 languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.4.2": - version: 0.4.2 - resolution: "@babel/helper-define-polyfill-provider@npm:0.4.2" - dependencies: - "@babel/helper-compilation-targets": ^7.22.6 - "@babel/helper-plugin-utils": ^7.22.5 - debug: ^4.1.1 - lodash.debounce: ^4.0.8 - resolve: ^1.14.2 - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 1f6dec0c5d0876d278fe15b71238eccc5f74c4e2efa2c78aaafa8bc2cc96336b8e68d94cd1a78497356c96e8b91b8c1f4452179820624d1702aee2f9832e6569 - languageName: node - linkType: hard - -"@babel/helper-define-polyfill-provider@npm:^0.4.3": - version: 0.4.3 - resolution: "@babel/helper-define-polyfill-provider@npm:0.4.3" +"@babel/helper-define-polyfill-provider@npm:^0.4.4": + version: 0.4.4 + resolution: "@babel/helper-define-polyfill-provider@npm:0.4.4" dependencies: "@babel/helper-compilation-targets": ^7.22.6 "@babel/helper-plugin-utils": ^7.22.5 @@ -1360,51 +1159,18 @@ __metadata: resolve: ^1.14.2 peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 5d21e3f47b320e4b5b644195ec405e7ebc3739e48e65899efc808c5fa9c3bf5b06ce0d8ff5246ca99d1411e368f4557bc66730196c5781a5c4e986ee703bee79 + checksum: 2453cdd79f18a4cb8653d8a7e06b2eb0d8e31bae0d35070fc5abadbddca246a36d82b758064b421cca49b48d0e696d331d54520ba8582c1d61fb706d6d831817 languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-environment-visitor@npm:7.16.7" - dependencies: - "@babel/types": ^7.16.7 - checksum: c03a10105d9ebd1fe632a77356b2e6e2f3c44edba9a93b0dc3591b6a66bd7a2e323dd9502f9ce96fc6401234abff1907aa877b6674f7826b61c953f7c8204bbe - languageName: node - linkType: hard - -"@babel/helper-environment-visitor@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helper-environment-visitor@npm:7.18.9" - checksum: b25101f6162ddca2d12da73942c08ad203d7668e06663df685634a8fde54a98bc015f6f62938e8554457a592a024108d45b8f3e651fd6dcdb877275b73cc4420 - languageName: node - linkType: hard - -"@babel/helper-environment-visitor@npm:^7.22.20": +"@babel/helper-environment-visitor@npm:^7.18.9, @babel/helper-environment-visitor@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-environment-visitor@npm:7.22.20" checksum: d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69 languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-environment-visitor@npm:7.22.5" - checksum: 248532077d732a34cd0844eb7b078ff917c3a8ec81a7f133593f71a860a582f05b60f818dc5049c2212e5baa12289c27889a4b81d56ef409b4863db49646c4b1 - languageName: node - linkType: hard - -"@babel/helper-function-name@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-function-name@npm:7.22.5" - dependencies: - "@babel/template": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: 6b1f6ce1b1f4e513bf2c8385a557ea0dd7fa37971b9002ad19268ca4384bbe90c09681fe4c076013f33deabc63a53b341ed91e792de741b4b35e01c00238177a - languageName: node - linkType: hard - -"@babel/helper-function-name@npm:^7.23.0": +"@babel/helper-function-name@npm:^7.22.5, @babel/helper-function-name@npm:^7.23.0": version: 7.23.0 resolution: "@babel/helper-function-name@npm:7.23.0" dependencies: @@ -1423,25 +1189,16 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/helper-member-expression-to-functions@npm:7.22.15" - dependencies: - "@babel/types": ^7.22.15 - checksum: c7c5d01c402dd8902c2ec3093f203ed0fc3bc5f669328a084d2e663c4c06dd0415480ee8220c6f96ba9b2dc49545c0078f221fc3900ab1e65de69a12fe7b361f - languageName: node - linkType: hard - -"@babel/helper-member-expression-to-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-member-expression-to-functions@npm:7.22.5" +"@babel/helper-member-expression-to-functions@npm:^7.22.15, @babel/helper-member-expression-to-functions@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/helper-member-expression-to-functions@npm:7.23.0" dependencies: - "@babel/types": ^7.22.5 - checksum: 4bd5791529c280c00743e8bdc669ef0d4cd1620d6e3d35e0d42b862f8262bc2364973e5968007f960780344c539a4b9cf92ab41f5b4f94560a9620f536de2a39 + "@babel/types": ^7.23.0 + checksum: 494659361370c979ada711ca685e2efe9460683c36db1b283b446122596602c901e291e09f2f980ecedfe6e0f2bd5386cb59768285446530df10c14df1024e75 languageName: node linkType: hard -"@babel/helper-module-imports@npm:7.18.6, @babel/helper-module-imports@npm:^7.18.6": +"@babel/helper-module-imports@npm:7.18.6": version: 7.18.6 resolution: "@babel/helper-module-imports@npm:7.18.6" dependencies: @@ -1450,25 +1207,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.10.4, @babel/helper-module-imports@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-module-imports@npm:7.22.5" - dependencies: - "@babel/types": ^7.22.5 - checksum: 9ac2b0404fa38b80bdf2653fbeaf8e8a43ccb41bd505f9741d820ed95d3c4e037c62a1bcdcb6c9527d7798d2e595924c4d025daed73283badc180ada2c9c49ad - languageName: node - linkType: hard - -"@babel/helper-module-imports@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-module-imports@npm:7.16.7" - dependencies: - "@babel/types": ^7.16.7 - checksum: ddd2c4a600a2e9a4fee192ab92bf35a627c5461dbab4af31b903d9ba4d6b6e59e0ff3499fde4e2e9a0eebe24906f00b636f8b4d9bd72ff24d50e6618215c3212 - languageName: node - linkType: hard - -"@babel/helper-module-imports@npm:^7.22.15": +"@babel/helper-module-imports@npm:^7.10.4, @babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.22.5": version: 7.22.15 resolution: "@babel/helper-module-imports@npm:7.22.15" dependencies: @@ -1477,72 +1216,9 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.16.7": - version: 7.17.6 - resolution: "@babel/helper-module-transforms@npm:7.17.6" - dependencies: - "@babel/helper-environment-visitor": ^7.16.7 - "@babel/helper-module-imports": ^7.16.7 - "@babel/helper-simple-access": ^7.16.7 - "@babel/helper-split-export-declaration": ^7.16.7 - "@babel/helper-validator-identifier": ^7.16.7 - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.17.3 - "@babel/types": ^7.17.0 - checksum: f3722754411ec2fb7975dac4bc1843c2fcd59a7ffbbc78be9d403e13b0e3b07661813cdb96b322bb9560841b3b73a63616633d78667b3c23ab8ce43b25232804 - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helper-module-transforms@npm:7.18.9" - dependencies: - "@babel/helper-environment-visitor": ^7.18.9 - "@babel/helper-module-imports": ^7.18.6 - "@babel/helper-simple-access": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/helper-validator-identifier": ^7.18.6 - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.9 - "@babel/types": ^7.18.9 - checksum: af08c60ea239ff3d40eda542fceaab69de17e713f131e80ead08c975ba7a47dd55d439cb48cfb14ae7ec96704a10c989ff5a5240e52a39101cb44a49467ce058 - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-module-transforms@npm:7.22.5" - dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-module-imports": ^7.22.5 - "@babel/helper-simple-access": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: 8985dc0d971fd17c467e8b84fe0f50f3dd8610e33b6c86e5b3ca8e8859f9448bcc5c84e08a2a14285ef388351c0484797081c8f05a03770bf44fc27bf4900e68 - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-module-transforms@npm:7.22.9" - dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-module-imports": ^7.22.5 - "@babel/helper-simple-access": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/helper-validator-identifier": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 2751f77660518cf4ff027514d6f4794f04598c6393be7b04b8e46c6e21606e11c19f3f57ab6129a9c21bacdf8b3ffe3af87bb401d972f34af2d0ffde02ac3001 - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/helper-module-transforms@npm:7.23.0" +"@babel/helper-module-transforms@npm:^7.22.5, @babel/helper-module-transforms@npm:^7.22.9, @babel/helper-module-transforms@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/helper-module-transforms@npm:7.23.3" dependencies: "@babel/helper-environment-visitor": ^7.22.20 "@babel/helper-module-imports": ^7.22.15 @@ -1551,7 +1227,7 @@ __metadata: "@babel/helper-validator-identifier": ^7.22.20 peerDependencies: "@babel/core": ^7.0.0 - checksum: 6e2afffb058cf3f8ce92f5116f710dda4341c81cfcd872f9a0197ea594f7ce0ab3cb940b0590af2fe99e60d2e5448bfba6bca8156ed70a2ed4be2adc8586c891 + checksum: 5d0895cfba0e16ae16f3aa92fee108517023ad89a855289c4eb1d46f7aef4519adf8e6f971e1d55ac20c5461610e17213f1144097a8f932e768a9132e2278d71 languageName: node linkType: hard @@ -1564,42 +1240,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": - version: 7.16.7 - resolution: "@babel/helper-plugin-utils@npm:7.16.7" - checksum: d08dd86554a186c2538547cd537552e4029f704994a9201d41d82015c10ed7f58f9036e8d1527c3760f042409163269d308b0b3706589039c5f1884619c6d4ce - languageName: node - linkType: hard - -"@babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.22.5": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.22.5 resolution: "@babel/helper-plugin-utils@npm:7.22.5" checksum: c0fc7227076b6041acd2f0e818145d2e8c41968cc52fb5ca70eed48e21b8fe6dd88a0a91cbddf4951e33647336eb5ae184747ca706817ca3bef5e9e905151ff5 languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.20.2": - version: 7.20.2 - resolution: "@babel/helper-plugin-utils@npm:7.20.2" - checksum: f6cae53b7fdb1bf3abd50fa61b10b4470985b400cc794d92635da1e7077bb19729f626adc0741b69403d9b6e411cddddb9c0157a709cc7c4eeb41e663be5d74b - languageName: node - linkType: hard - -"@babel/helper-remap-async-to-generator@npm:^7.18.9, @babel/helper-remap-async-to-generator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-remap-async-to-generator@npm:7.22.5" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-wrap-function": ^7.22.5 - "@babel/types": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 1e51dcff1c22e97ea3d22034b77788048eb6d8c6860325bd7a1046b7a7135730cefd93b5c96fd9839d76031095d5ffb6f0cd6ee90a5d69a4c7de980d7f4623d9 - languageName: node - linkType: hard - -"@babel/helper-remap-async-to-generator@npm:^7.22.20": +"@babel/helper-remap-async-to-generator@npm:^7.18.9, @babel/helper-remap-async-to-generator@npm:^7.22.20, @babel/helper-remap-async-to-generator@npm:^7.22.5": version: 7.22.20 resolution: "@babel/helper-remap-async-to-generator@npm:7.22.20" dependencies: @@ -1612,19 +1260,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.22.9": - version: 7.22.17 - resolution: "@babel/helper-remap-async-to-generator@npm:7.22.17" - dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-wrap-function": ^7.22.17 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 59307e623d00b6f5fa7f974e29081b2243e3f7bc3a89df331e8c1f8815d83f97bd092404a28b8bef5299028e3259450b5a943f34e1b32c7c55350436d218ab13 - languageName: node - linkType: hard - "@babel/helper-replace-supers@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-replace-supers@npm:7.22.20" @@ -1638,51 +1273,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-replace-supers@npm:7.22.5" - dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 - "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: af29deff6c6dc3fa2d1a517390716aa3f4d329855e8689f1d5c3cb07c1b898e614a5e175f1826bb58e9ff1480e6552885a71a9a0ba5161787aaafa2c79b216cc - languageName: node - linkType: hard - -"@babel/helper-replace-supers@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-replace-supers@npm:7.22.9" - dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 - "@babel/helper-optimise-call-expression": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: d41471f56ff2616459d35a5df1900d5f0756ae78b1027040365325ef332d66e08e3be02a9489756d870887585ff222403a228546e93dd7019e19e59c0c0fe586 - languageName: node - linkType: hard - -"@babel/helper-simple-access@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-simple-access@npm:7.16.7" - dependencies: - "@babel/types": ^7.16.7 - checksum: 8d22c46c5ec2ead0686c4d5a3d1d12b5190c59be676bfe0d9d89df62b437b51d1a3df2ccfb8a77dded2e585176ebf12986accb6d45a18cff229eef3b10344f4b - languageName: node - linkType: hard - -"@babel/helper-simple-access@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-simple-access@npm:7.18.6" - dependencies: - "@babel/types": ^7.18.6 - checksum: 37cd36eef199e0517845763c1e6ff6ea5e7876d6d707a6f59c9267c547a50aa0e84260ba9285d49acfaf2cfa0a74a772d92967f32ac1024c961517d40b6c16a5 - languageName: node - linkType: hard - "@babel/helper-simple-access@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-simple-access@npm:7.22.5" @@ -1710,72 +1300,10 @@ __metadata: languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-split-export-declaration@npm:7.16.7" - dependencies: - "@babel/types": ^7.16.7 - checksum: e10aaf135465c55114627951b79115f24bc7af72ecbb58d541d66daf1edaee5dde7cae3ec8c3639afaf74526c03ae3ce723444e3b5b3dc77140c456cd84bcaa1 - languageName: node - linkType: hard - -"@babel/helper-split-export-declaration@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-split-export-declaration@npm:7.18.6" - dependencies: - "@babel/types": ^7.18.6 - checksum: c6d3dede53878f6be1d869e03e9ffbbb36f4897c7cc1527dc96c56d127d834ffe4520a6f7e467f5b6f3c2843ea0e81a7819d66ae02f707f6ac057f3d57943a2b - languageName: node - linkType: hard - -"@babel/helper-split-export-declaration@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-split-export-declaration@npm:7.22.5" - dependencies: - "@babel/types": ^7.22.5 - checksum: d10e05a02f49c1f7c578cea63d2ac55356501bbf58856d97ac9bfde4957faee21ae97c7f566aa309e38a256eef58b58e5b670a7f568b362c00e93dfffe072650 - languageName: node - linkType: hard - -"@babel/helper-string-parser@npm:^7.19.4": - version: 7.19.4 - resolution: "@babel/helper-string-parser@npm:7.19.4" - checksum: b2f8a3920b30dfac81ec282ac4ad9598ea170648f8254b10f475abe6d944808fb006aab325d3eb5a8ad3bea8dfa888cfa6ef471050dae5748497c110ec060943 - languageName: node - linkType: hard - -"@babel/helper-string-parser@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-string-parser@npm:7.22.5" - checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-validator-identifier@npm:7.16.7" - checksum: dbb3db9d184343152520a209b5684f5e0ed416109cde82b428ca9c759c29b10c7450657785a8b5c5256aa74acc6da491c1f0cf6b784939f7931ef82982051b69 - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-validator-identifier@npm:7.18.6" - checksum: e295254d616bbe26e48c196a198476ab4d42a73b90478c9842536cf910ead887f5af6b5c4df544d3052a25ccb3614866fa808dc1e3a5a4291acd444e243c0648 - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.19.1": - version: 7.19.1 - resolution: "@babel/helper-validator-identifier@npm:7.19.1" - checksum: 0eca5e86a729162af569b46c6c41a63e18b43dbe09fda1d2a3c8924f7d617116af39cac5e4cd5d431bb760b4dca3c0970e0c444789b1db42bcf1fa41fbad0a3a - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/helper-validator-identifier@npm:7.22.15" - checksum: eb0bee4bda664c0959924bc1ad5611eacfce806f46612202dd164fef1df8fef1a11682a1e7615288987100e9fb304982b6e2a4ff07ffe842ab8765b95ed1118c +"@babel/helper-string-parser@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/helper-string-parser@npm:7.23.4" + checksum: c0641144cf1a7e7dc93f3d5f16d5327465b6cf5d036b48be61ecba41e1eece161b48f46b7f960951b67f8c3533ce506b16dece576baef4d8b3b49f8c65410f90 languageName: node linkType: hard @@ -1786,49 +1314,10 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-validator-identifier@npm:7.22.5" - checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea - languageName: node - linkType: hard - -"@babel/helper-validator-option@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/helper-validator-option@npm:7.16.7" - checksum: c5ccc451911883cc9f12125d47be69434f28094475c1b9d2ada7c3452e6ac98a1ee8ddd364ca9e3f9855fcdee96cdeafa32543ebd9d17fee7a1062c202e80570 - languageName: node - linkType: hard - -"@babel/helper-validator-option@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-validator-option@npm:7.18.6" - checksum: f9cc6eb7cc5d759c5abf006402180f8d5e4251e9198197428a97e05d65eb2f8ae5a0ce73b1dfd2d35af41d0eb780627a64edf98a4e71f064eeeacef8de58f2cf - languageName: node - linkType: hard - -"@babel/helper-validator-option@npm:^7.22.15": - version: 7.22.15 - resolution: "@babel/helper-validator-option@npm:7.22.15" - checksum: 68da52b1e10002a543161494c4bc0f4d0398c8fdf361d5f7f4272e95c45d5b32d974896d44f6a0ea7378c9204988879d73613ca683e13bd1304e46d25ff67a8d - languageName: node - linkType: hard - -"@babel/helper-validator-option@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-validator-option@npm:7.22.5" - checksum: bbeca8a85ee86990215c0424997438b388b8d642d69b9f86c375a174d3cdeb270efafd1ff128bc7a1d370923d13b6e45829ba8581c027620e83e3a80c5c414b3 - languageName: node - linkType: hard - -"@babel/helper-wrap-function@npm:^7.22.17": - version: 7.22.17 - resolution: "@babel/helper-wrap-function@npm:7.22.17" - dependencies: - "@babel/helper-function-name": ^7.22.5 - "@babel/template": ^7.22.15 - "@babel/types": ^7.22.17 - checksum: 95328b508049b6edd9cadd2ac89b4d4812ebdfa54a2ae77791939d795d88d561b31fd3669eea5d13558372cf2422eda05177d7f742690b5023c712bc3f0aec8e +"@babel/helper-validator-option@npm:^7.22.15, @babel/helper-validator-option@npm:^7.22.5, @babel/helper-validator-option@npm:^7.23.5": + version: 7.23.5 + resolution: "@babel/helper-validator-option@npm:7.23.5" + checksum: 537cde2330a8aede223552510e8a13e9c1c8798afee3757995a7d4acae564124fe2bf7e7c3d90d62d3657434a74340a274b3b3b1c6f17e9a2be1f48af29cb09e languageName: node linkType: hard @@ -1843,81 +1332,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-wrap-function@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-wrap-function@npm:7.22.5" - dependencies: - "@babel/helper-function-name": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: a4ba2d7577ad3ce92fadaa341ffce3b0e4b389808099b07c80847f9be0852f4b42344612bc1b3d1b796ffb75be56d5957c5c56a1734f6aee5ccbb7cd9ab12691 - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.17.2": - version: 7.17.2 - resolution: "@babel/helpers@npm:7.17.2" - dependencies: - "@babel/template": ^7.16.7 - "@babel/traverse": ^7.17.0 - "@babel/types": ^7.17.0 - checksum: 5fa06bbf59636314fb4098bb2e70cf488e0fb6989553438abab90356357b79976102ac129fb16fc8186893c79e0809de1d90e3304426d6fcdb1750da2b6dff9d - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helpers@npm:7.18.9" - dependencies: - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.9 - "@babel/types": ^7.18.9 - checksum: d0bd8255d36bfc65dc52ce75f7fea778c70287da2d64981db4c84fbdf9581409ecbd6433deff1c81da3a5acf26d7e4c364b3a4445efacf88f4f48e77c5b34d8d - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.22.11": - version: 7.22.11 - resolution: "@babel/helpers@npm:7.22.11" - dependencies: - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.11 - "@babel/types": ^7.22.11 - checksum: 93186544228b5e371486466ec3b86a77cce91beeff24a5670ca8ec46d50328f7700dab82d532351286e9d68624dc51d6d71589b051dd9535e44be077a43ec013 - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/helpers@npm:7.22.15" +"@babel/helpers@npm:^7.22.5, @babel/helpers@npm:^7.22.6, @babel/helpers@npm:^7.23.7": + version: 7.23.7 + resolution: "@babel/helpers@npm:7.23.7" dependencies: "@babel/template": ^7.22.15 - "@babel/traverse": ^7.22.15 - "@babel/types": ^7.22.15 - checksum: 49f61a93cbae4df3328bda67af5db743fead659ae4242571226c3596b7df78546189cdf991fed1eca33b559de8abf396a90a001f474a1bab351418f07b7ae6ef - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/helpers@npm:7.22.6" - dependencies: - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.6 - "@babel/types": ^7.22.5 - checksum: 5c1f33241fe7bf7709868c2105134a0a86dca26a0fbd508af10a89312b1f77ca38ebae43e50be3b208613c5eacca1559618af4ca236f0abc55d294800faeff30 - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.23.2": - version: 7.23.2 - resolution: "@babel/helpers@npm:7.23.2" - dependencies: - "@babel/template": ^7.22.15 - "@babel/traverse": ^7.23.2 - "@babel/types": ^7.23.0 - checksum: aaf4828df75ec460eaa70e5c9f66e6dadc28dae3728ddb7f6c13187dbf38030e142194b83d81aa8a31bbc35a5529a5d7d3f3cf59d5d0b595f5dd7f9d8f1ced8e + "@babel/traverse": ^7.23.7 + "@babel/types": ^7.23.6 + checksum: 4f3bdf35fb54ff79107c6020ba1e36a38213a15b05ca0fa06c553b65f566e185fba6339fb3344be04593ebc244ed0bbb0c6087e73effe0d053a30bcd2db3a013 languageName: node linkType: hard @@ -1932,58 +1354,14 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.16.7": - version: 7.16.10 - resolution: "@babel/highlight@npm:7.16.10" - dependencies: - "@babel/helper-validator-identifier": ^7.16.7 - chalk: ^2.0.0 - js-tokens: ^4.0.0 - checksum: 1f1bdd752a90844f4efc22166a46303fb651ba0fd75a06daba3ebae2575ab3edc1da9827c279872a3aaf305f50a18473c5fa1966752726a2b253065fd4c0745e - languageName: node - linkType: hard - -"@babel/highlight@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/highlight@npm:7.18.6" - dependencies: - "@babel/helper-validator-identifier": ^7.18.6 - chalk: ^2.0.0 - js-tokens: ^4.0.0 - checksum: 92d8ee61549de5ff5120e945e774728e5ccd57fd3b2ed6eace020ec744823d4a98e242be1453d21764a30a14769ecd62170fba28539b211799bbaf232bbb2789 - languageName: node - linkType: hard - -"@babel/highlight@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/highlight@npm:7.22.10" +"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/highlight@npm:7.23.4" dependencies: - "@babel/helper-validator-identifier": ^7.22.5 - chalk: ^2.4.2 - js-tokens: ^4.0.0 - checksum: f714a1e1a72dd9d72f6383f4f30fd342e21a8df32d984a4ea8f5eab691bb6ba6db2f8823d4b4cf135d98869e7a98925b81306aa32ee3c429f8cfa52c75889e1b - languageName: node - linkType: hard - -"@babel/highlight@npm:^7.22.13": - version: 7.22.13 - resolution: "@babel/highlight@npm:7.22.13" - dependencies: - "@babel/helper-validator-identifier": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 chalk: ^2.4.2 js-tokens: ^4.0.0 - checksum: 7266d2bff8aa8fc78eb65b6e92a8211e12897a731126a282d2f9bb50d8fcaa4c1b02af2284f990ac7e3ab8d892d448a2cab8f5ed0ea8a90bce2c025b11ebe802 - languageName: node - linkType: hard - -"@babel/highlight@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/highlight@npm:7.22.5" - dependencies: - "@babel/helper-validator-identifier": ^7.22.5 - chalk: ^2.0.0 - js-tokens: ^4.0.0 - checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 + checksum: 643acecdc235f87d925979a979b539a5d7d1f31ae7db8d89047269082694122d11aa85351304c9c978ceeb6d250591ccadb06c366f358ccee08bb9c122476b89 languageName: node linkType: hard @@ -2005,81 +1383,48 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.16.7, @babel/parser@npm:^7.17.3": - version: 7.17.3 - resolution: "@babel/parser@npm:7.17.3" - bin: - parser: ./bin/babel-parser.js - checksum: 311869baef97c7630ac3b3c4600da18229b95aa2785b2daab2044384745fe0653070916ade28749fb003f7369a081111ada53e37284ba48d6b5858cbb9e411d1 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.18.6, @babel/parser@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/parser@npm:7.18.9" - bin: - parser: ./bin/babel-parser.js - checksum: 81a966b334e3ef397e883c64026265a5ae0ad435a86f52a84f60a5ee1efc0738c1f42c55e0dc5f191cc6a83ba0c61350433eee417bf1dff160ca5f3cfde244c6 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.11, @babel/parser@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/parser@npm:7.23.0" - bin: - parser: ./bin/babel-parser.js - checksum: 453fdf8b9e2c2b7d7b02139e0ce003d1af21947bbc03eb350fb248ee335c9b85e4ab41697ddbdd97079698de825a265e45a0846bb2ed47a2c7c1df833f42a354 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.22.15, @babel/parser@npm:^7.22.5": - version: 7.22.16 - resolution: "@babel/parser@npm:7.22.16" - bin: - parser: ./bin/babel-parser.js - checksum: 944c756b5bdeb07b9fec16ecef6b3c61aff9d4c4b924abadcf01afa1840a740b8e2357ae00482b5b37daad6d2bfd848c947f27ad65138d687b6fdc924bc59edd - languageName: node - linkType: hard - -"@babel/parser@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/parser@npm:7.22.7" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.22.7, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.4.3": + version: 7.23.6 + resolution: "@babel/parser@npm:7.23.6" bin: parser: ./bin/babel-parser.js - checksum: 02209ddbd445831ee8bf966fdf7c29d189ed4b14343a68eb2479d940e7e3846340d7cc6bd654a5f3d87d19dc84f49f50a58cf9363bee249dc5409ff3ba3dab54 + checksum: 140801c43731a6c41fd193f5c02bc71fd647a0360ca616b23d2db8be4b9739b9f951a03fc7c2db4f9b9214f4b27c1074db0f18bc3fa653783082d5af7c8860d5 languageName: node linkType: hard -"@babel/parser@npm:^7.4.3": - version: 7.22.10 - resolution: "@babel/parser@npm:7.22.10" - bin: - parser: ./bin/babel-parser.js - checksum: af51567b7d3cdf523bc608eae057397486c7fa6c2e5753027c01fe5c36f0767b2d01ce3049b222841326cc5b8c7fda1d810ac1a01af0a97bb04679e2ef9f7049 - languageName: node - linkType: hard - -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.15" +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.5, @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0 - checksum: 8910ca21a7ec7c06f7b247d4b86c97c5aa15ef321518f44f6f490c5912fdf82c605aaa02b90892e375d82ccbedeadfdeadd922c1b836c9dd4c596871bf654753 + checksum: ddbaf2c396b7780f15e80ee01d6dd790db076985f3dfeb6527d1a8d4cacf370e49250396a3aa005b2c40233cac214a106232f83703d5e8491848bde273938232 languageName: node linkType: hard -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.22.15" +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.22.5, @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.15 + "@babel/plugin-transform-optional-chaining": ^7.23.3 peerDependencies: "@babel/core": ^7.13.0 - checksum: fbefedc0da014c37f1a50a8094ce7dbbf2181ae93243f23d6ecba2499b5b20196c2124d6a4dfe3e9e0125798e80593103e456352a4beb4e5c6f7c75efb80fdac + checksum: 434b9d710ae856fa1a456678cc304fbc93915af86d581ee316e077af746a709a741ea39d7e1d4f5b98861b629cc7e87f002d3138f5e836775632466d4c74aef2 + languageName: node + linkType: hard + +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.23.7": + version: 7.23.7 + resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.23.7" + dependencies: + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-plugin-utils": ^7.22.5 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: f88e400b548202a6f8c5dfd25bc4949a13ea1ccb64a170d7dea4deaa655a0fcb001d3fd61c35e1ad9c09a3d5f0d43f783400425471fe6d660ccaf33dabea9aba languageName: node linkType: hard @@ -2110,17 +1455,15 @@ __metadata: linkType: hard "@babel/plugin-proposal-decorators@npm:^7.16.4": - version: 7.23.2 - resolution: "@babel/plugin-proposal-decorators@npm:7.23.2" + version: 7.23.7 + resolution: "@babel/plugin-proposal-decorators@npm:7.23.7" dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.15 + "@babel/helper-create-class-features-plugin": ^7.23.7 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.20 - "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/plugin-syntax-decorators": ^7.22.10 + "@babel/plugin-syntax-decorators": ^7.23.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: a8f63451c4678ce34268a0493aa4bc702d0ee164b39b53c12d33619ff3b47518c4369163ef49602cde7f0674db6e6e8584ee3d6a414ea0bbc3dc16c0304ef413 + checksum: 53c3d3af451ea75fa48cb26811dce8a9cdcc51ff4bd48fa037482a6527e0c3eec1737541ab0f7e7d5c210cbe81badda15cf043b21049e036ef376deabf176c06 languageName: node linkType: hard @@ -2149,17 +1492,17 @@ __metadata: linkType: hard "@babel/plugin-proposal-object-rest-spread@npm:^7.5.5": - version: 7.17.3 - resolution: "@babel/plugin-proposal-object-rest-spread@npm:7.17.3" + version: 7.20.7 + resolution: "@babel/plugin-proposal-object-rest-spread@npm:7.20.7" dependencies: - "@babel/compat-data": ^7.17.0 - "@babel/helper-compilation-targets": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/compat-data": ^7.20.5 + "@babel/helper-compilation-targets": ^7.20.7 + "@babel/helper-plugin-utils": ^7.20.2 "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-transform-parameters": ^7.16.7 + "@babel/plugin-transform-parameters": ^7.20.7 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 02810f158db4aaf6883131621b5d2c7d901ea3c034df2c2b78663f8b26813795d78a346c37e56770a720c54773732fd1d7fe40947dbf11d1d8de0e9a38e856d3 + checksum: 1329db17009964bc644484c660eab717cb3ca63ac0ab0f67c651a028d1bc2ead51dc4064caea283e46994f1b7221670a35cbc0b4beb6273f55e915494b5aa0b2 languageName: node linkType: hard @@ -2212,14 +1555,14 @@ __metadata: linkType: hard "@babel/plugin-proposal-unicode-property-regex@npm:^7.4.4": - version: 7.16.7 - resolution: "@babel/plugin-proposal-unicode-property-regex@npm:7.16.7" + version: 7.18.6 + resolution: "@babel/plugin-proposal-unicode-property-regex@npm:7.18.6" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 + "@babel/helper-create-regexp-features-plugin": ^7.18.6 + "@babel/helper-plugin-utils": ^7.18.6 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2b8a33713d456183f0b7d011011e7bd932c08cc06216399a7b2015ab39284b511993dc10a89bbb15d1d728e6a2ef42ca08c3202619aa148cbd48052422ea3995 + checksum: a8575ecb7ff24bf6c6e94808d5c84bb5a0c6dd7892b54f09f4646711ba0ee1e1668032b3c43e3e1dfec2c5716c302e851ac756c1645e15882d73df6ad21ae951 languageName: node linkType: hard @@ -2267,14 +1610,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-decorators@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/plugin-syntax-decorators@npm:7.22.10" +"@babel/plugin-syntax-decorators@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-syntax-decorators@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: baaa10fa52d76ee8b9447f7aedb1c8df7cf2ef83ae29c085c07444e691685aa8b1a326dfb7a3a0e3ae4d5f9fd083175e46ea5e2316d8200f0278f3fd54a58696 + checksum: 07f6e488df0a061428e02629af9a1908b2e8abdcac2e5cfaa267be66dc30897be6e29df7c7f952d33f3679f9585ac9fcf6318f9c827790ab0b0928d5514305cd languageName: node linkType: hard @@ -2300,36 +1643,36 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-flow@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-flow@npm:7.22.5" +"@babel/plugin-syntax-flow@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-syntax-flow@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 84c8c40fcfe8e78cecdd6fb90e8f97f419e3f3b27a33de8324ae97d5ce1b87cdd98a636fa21a68d4d2c37c7d63f3a279bb84b6956b849921affed6b806b6ffe7 + checksum: c6e6f355d6ace5f4a9e7bb19f1fed2398aeb9b62c4c671a189d81b124f9f5bb77c4225b6e85e19339268c60a021c1e49104e450375de5e6bb70612190d9678af languageName: node linkType: hard -"@babel/plugin-syntax-import-assertions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-import-assertions@npm:7.22.5" +"@babel/plugin-syntax-import-assertions@npm:^7.22.5, @babel/plugin-syntax-import-assertions@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-syntax-import-assertions@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2b8b5572db04a7bef1e6cd20debf447e4eef7cb012616f5eceb8fa3e23ce469b8f76ee74fd6d1e158ba17a8f58b0aec579d092fb67c5a30e83ccfbc5754916c1 + checksum: 883e6b35b2da205138caab832d54505271a3fee3fc1e8dc0894502434fc2b5d517cbe93bbfbfef8068a0fb6ec48ebc9eef3f605200a489065ba43d8cddc1c9a7 languageName: node linkType: hard -"@babel/plugin-syntax-import-attributes@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-import-attributes@npm:7.22.5" +"@babel/plugin-syntax-import-attributes@npm:^7.22.5, @babel/plugin-syntax-import-attributes@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-syntax-import-attributes@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 197b3c5ea2a9649347f033342cb222ab47f4645633695205c0250c6bf2af29e643753b8bb24a2db39948bef08e7c540babfd365591eb57fc110cb30b425ffc47 + checksum: 9aed7661ffb920ca75df9f494757466ca92744e43072e0848d87fa4aa61a3f2ee5a22198ac1959856c036434b5614a8f46f1fb70298835dbe28220cdd1d4c11e languageName: node linkType: hard @@ -2355,36 +1698,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-syntax-jsx@npm:7.16.7" - dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: cd9b0e53c50e8ddb0afaf0f42e0b221a94e4f59aee32a591364266a31195c48cac5fef288d02c1c935686bda982d2e0f1ed61cceb995fc9f6fb09ef5ebecdd2b - languageName: node - linkType: hard - -"@babel/plugin-syntax-jsx@npm:^7.18.6, @babel/plugin-syntax-jsx@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-jsx@npm:7.22.5" +"@babel/plugin-syntax-jsx@npm:^7.18.6, @babel/plugin-syntax-jsx@npm:^7.23.3, @babel/plugin-syntax-jsx@npm:^7.7.2": + version: 7.23.3 + resolution: "@babel/plugin-syntax-jsx@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 8829d30c2617ab31393d99cec2978e41f014f4ac6f01a1cecf4c4dd8320c3ec12fdc3ce121126b2d8d32f6887e99ca1a0bad53dedb1e6ad165640b92b24980ce - languageName: node - linkType: hard - -"@babel/plugin-syntax-jsx@npm:^7.7.2": - version: 7.21.4 - resolution: "@babel/plugin-syntax-jsx@npm:7.21.4" - dependencies: - "@babel/helper-plugin-utils": ^7.20.2 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: bb7309402a1d4e155f32aa0cf216e1fa8324d6c4cfd248b03280028a015a10e46b6efd6565f515f8913918a3602b39255999c06046f7d4b8a5106be2165d724a + checksum: 89037694314a74e7f0e7a9c8d3793af5bf6b23d80950c29b360db1c66859d67f60711ea437e70ad6b5b4b29affe17eababda841b6c01107c2b638e0493bafb4e languageName: node linkType: hard @@ -2476,25 +1797,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-syntax-typescript@npm:7.22.5" +"@babel/plugin-syntax-typescript@npm:^7.23.3, @babel/plugin-syntax-typescript@npm:^7.7.2": + version: 7.23.3 + resolution: "@babel/plugin-syntax-typescript@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 8ab7718fbb026d64da93681a57797d60326097fd7cb930380c8bffd9eb101689e90142c760a14b51e8e69c88a73ba3da956cb4520a3b0c65743aee5c71ef360a - languageName: node - linkType: hard - -"@babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.16.7 - resolution: "@babel/plugin-syntax-typescript@npm:7.16.7" - dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 661e636060609ede9a402e22603b01784c21fabb0a637e65f561c8159351fe0130bbc11fdefe31902107885e3332fc34d95eb652ac61d3f61f2d61f5da20609e + checksum: abfad3a19290d258b028e285a1f34c9b8a0cbe46ef79eafed4ed7ffce11b5d0720b5e536c82f91cbd8442cde35a3dd8e861fa70366d87ff06fdc0d4756e30876 languageName: node linkType: hard @@ -2510,20 +1820,20 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-arrow-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-arrow-functions@npm:7.22.5" +"@babel/plugin-transform-arrow-functions@npm:^7.22.5, @babel/plugin-transform-arrow-functions@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-arrow-functions@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 35abb6c57062802c7ce8bd96b2ef2883e3124370c688bbd67609f7d2453802fb73944df8808f893b6c67de978eb2bcf87bbfe325e46d6f39b5fcb09ece11d01a + checksum: 1e99118176e5366c2636064d09477016ab5272b2a92e78b8edb571d20bc3eaa881789a905b20042942c3c2d04efc530726cf703f937226db5ebc495f5d067e66 languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.22.10": - version: 7.23.2 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.23.2" +"@babel/plugin-transform-async-generator-functions@npm:^7.22.7, @babel/plugin-transform-async-generator-functions@npm:^7.23.7": + version: 7.23.7 + resolution: "@babel/plugin-transform-async-generator-functions@npm:7.23.7" dependencies: "@babel/helper-environment-visitor": ^7.22.20 "@babel/helper-plugin-utils": ^7.22.5 @@ -2531,25 +1841,11 @@ __metadata: "@babel/plugin-syntax-async-generators": ^7.8.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: e1abae0edcda7304d7c17702ac25a127578791b89c4f767d60589249fa3e50ec33f8c9ff39d3d8d41f00b29947654eaddd4fd586e04c4d598122db745fab2868 - languageName: node - linkType: hard - -"@babel/plugin-transform-async-generator-functions@npm:^7.22.7": - version: 7.22.15 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.15" - dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-remap-async-to-generator": ^7.22.9 - "@babel/plugin-syntax-async-generators": ^7.8.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: fad98786b446ce63bde0d14a221e2617eef5a7bbca62b49d96f16ab5e1694521234cfba6145b830fbf9af16d60a8a3dbf148e8694830bd91796fe333b0599e73 + checksum: b1f66b23423933c27336b1161ac92efef46683321caea97e2255a666f992979376f47a5559f64188d3831fa66a4b24c2a7a40838cc0e9737e90eebe20e8e6372 languageName: node linkType: hard -"@babel/plugin-transform-async-to-generator@npm:7.22.5, @babel/plugin-transform-async-to-generator@npm:^7.22.5": +"@babel/plugin-transform-async-to-generator@npm:7.22.5": version: 7.22.5 resolution: "@babel/plugin-transform-async-to-generator@npm:7.22.5" dependencies: @@ -2562,342 +1858,298 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoped-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.22.5" +"@babel/plugin-transform-async-to-generator@npm:^7.22.5, @babel/plugin-transform-async-to-generator@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-async-to-generator@npm:7.23.3" dependencies: + "@babel/helper-module-imports": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 + "@babel/helper-remap-async-to-generator": ^7.22.20 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 416b1341858e8ca4e524dee66044735956ced5f478b2c3b9bc11ec2285b0c25d7dbb96d79887169eb938084c95d0a89338c8b2fe70d473bd9dc92e5d9db1732c + checksum: 2e9d9795d4b3b3d8090332104e37061c677f29a1ce65bcbda4099a32d243e5d9520270a44bbabf0fb1fb40d463bd937685b1a1042e646979086c546d55319c3c languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.22.10": - version: 7.23.0 - resolution: "@babel/plugin-transform-block-scoping@npm:7.23.0" +"@babel/plugin-transform-block-scoped-functions@npm:^7.22.5, @babel/plugin-transform-block-scoped-functions@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 0cfe925cc3b5a3ad407e2253fab3ceeaa117a4b291c9cb245578880872999bca91bd83ffa0128ae9ca356330702e1ef1dcb26804f28d2cef678239caf629f73e + checksum: e63b16d94ee5f4d917e669da3db5ea53d1e7e79141a2ec873c1e644678cdafe98daa556d0d359963c827863d6b3665d23d4938a94a4c5053a1619c4ebd01d020 languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-transform-block-scoping@npm:7.22.15" +"@babel/plugin-transform-block-scoping@npm:^7.22.5, @babel/plugin-transform-block-scoping@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-block-scoping@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: c7091dc000b854ce0c471588ca0704ef1ce78cff954584a9f21c1668fd0669e7c8d5396fb72fe49a2216d9b96a400d435f424f27e41a097ef6c855f9c57df195 + checksum: fc4b2100dd9f2c47d694b4b35ae8153214ccb4e24ef545c259a9db17211b18b6a430f22799b56db8f6844deaeaa201af45a03331d0c80cc28b0c4e3c814570e4 languageName: node linkType: hard -"@babel/plugin-transform-class-properties@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-class-properties@npm:7.22.5" +"@babel/plugin-transform-class-properties@npm:^7.22.5, @babel/plugin-transform-class-properties@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-class-properties@npm:7.23.3" dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.5 + "@babel/helper-create-class-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b830152dfc2ff2f647f0abe76e6251babdfbef54d18c4b2c73a6bf76b1a00050a5d998dac80dc901a48514e95604324943a9dd39317073fe0928b559e0e0c579 + checksum: 9c6f8366f667897541d360246de176dd29efc7a13d80a5b48361882f7173d9173be4646c3b7d9b003ccc0e01e25df122330308f33db921fa553aa17ad544b3fc languageName: node linkType: hard -"@babel/plugin-transform-class-static-block@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-class-static-block@npm:7.22.11" +"@babel/plugin-transform-class-static-block@npm:^7.22.5, @babel/plugin-transform-class-static-block@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-class-static-block@npm:7.23.4" dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.11 + "@babel/helper-create-class-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-class-static-block": ^7.14.5 peerDependencies: "@babel/core": ^7.12.0 - checksum: 69f040506fad66f1c6918d288d0e0edbc5c8a07c8b4462c1184ad2f9f08995d68b057126c213871c0853ae0c72afc60ec87492049dfacb20902e32346a448bcb + checksum: c8bfaba19a674fc2eb54edad71e958647360474e3163e8226f1acd63e4e2dbec32a171a0af596c1dc5359aee402cc120fea7abd1fb0e0354b6527f0fc9e8aa1e languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.22.6": - version: 7.22.15 - resolution: "@babel/plugin-transform-classes@npm:7.22.15" +"@babel/plugin-transform-classes@npm:^7.22.6, @babel/plugin-transform-classes@npm:^7.23.5": + version: 7.23.5 + resolution: "@babel/plugin-transform-classes@npm:7.23.5" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 "@babel/helper-compilation-targets": ^7.22.15 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-function-name": ^7.23.0 "@babel/helper-optimise-call-expression": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.9 + "@babel/helper-replace-supers": ^7.22.20 "@babel/helper-split-export-declaration": ^7.22.6 globals: ^11.1.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d3f4d0c107dd8a3557ea3575cc777fab27efa92958b41e4a9822f7499725c1f554beae58855de16ddec0a7b694e45f59a26cea8fbde4275563f72f09c6e039a0 + checksum: 6d0dd3b0828e84a139a51b368f33f315edee5688ef72c68ba25e0175c68ea7357f9c8810b3f61713e368a3063cdcec94f3a2db952e453b0b14ef428a34aa8169 languageName: node linkType: hard -"@babel/plugin-transform-computed-properties@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-computed-properties@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/template": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: c2a77a0f94ec71efbc569109ec14ea2aa925b333289272ced8b33c6108bdbb02caf01830ffc7e49486b62dec51911924d13f3a76f1149f40daace1898009e131 - languageName: node - linkType: hard - -"@babel/plugin-transform-destructuring@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/plugin-transform-destructuring@npm:7.22.10" +"@babel/plugin-transform-computed-properties@npm:^7.22.5, @babel/plugin-transform-computed-properties@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-computed-properties@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 + "@babel/template": ^7.22.15 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 011707801bd0029fd4f0523d24d06fdc0cbe8c9da280d75728f76713d639c4dc976e1b56a1ba7bff25468f86867efb71c9b4cac81140adbdd0abf2324b19a8bb + checksum: 80452661dc25a0956f89fe98cb562e8637a9556fb6c00d312c57653ce7df8798f58d138603c7e1aad96614ee9ccd10c47e50ab9ded6b6eded5adeb230d2a982e languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-transform-destructuring@npm:7.22.15" +"@babel/plugin-transform-destructuring@npm:^7.22.5, @babel/plugin-transform-destructuring@npm:^7.23.3, @babel/plugin-transform-destructuring@npm:^7.5.0": + version: 7.23.3 + resolution: "@babel/plugin-transform-destructuring@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4bccb4765e5287f1d36119d930afb9941ea8f4f001bddb8febff716bac0e09dc58576624f3ec59470630513044dd342075fe11af16d8c1b234cb7406cffca9f0 + checksum: 9e015099877272501162419bfe781689aec5c462cd2aec752ee22288f209eec65969ff11b8fdadca2eaddea71d705d3bba5b9c60752fcc1be67874fcec687105 languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.5.0": - version: 7.17.3 - resolution: "@babel/plugin-transform-destructuring@npm:7.17.3" +"@babel/plugin-transform-dotall-regex@npm:^7.22.5, @babel/plugin-transform-dotall-regex@npm:^7.23.3, @babel/plugin-transform-dotall-regex@npm:^7.4.4": + version: 7.23.3 + resolution: "@babel/plugin-transform-dotall-regex@npm:7.23.3" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: af58115da1b5f1b7aa9c07af8fee53c1db05d2d68be3ba67aae162242d22e5ccd1bcd0fb149fced4618b31c0c6b4f99d32b472567c5f0807586b7fe5216ba7f0 - languageName: node - linkType: hard - -"@babel/plugin-transform-dotall-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-dotall-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 + "@babel/helper-create-regexp-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 409b658d11e3082c8f69e9cdef2d96e4d6d11256f005772425fb230cc48fd05945edbfbcb709dab293a1a2f01f9c8a5bb7b4131e632b23264039d9f95864b453 - languageName: node - linkType: hard - -"@babel/plugin-transform-dotall-regex@npm:^7.4.4": - version: 7.16.7 - resolution: "@babel/plugin-transform-dotall-regex@npm:7.16.7" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 554570dddfd5bfd87ab307be520f69a3d4ed2d2db677c165971b400d4c96656d0c165b318e69f1735612dcd12e04c0ee257697dc26800e8a572ca73bc05fa0f4 + checksum: a2dbbf7f1ea16a97948c37df925cb364337668c41a3948b8d91453f140507bd8a3429030c7ce66d09c299987b27746c19a2dd18b6f17dcb474854b14fd9159a3 languageName: node linkType: hard -"@babel/plugin-transform-duplicate-keys@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-duplicate-keys@npm:7.22.5" +"@babel/plugin-transform-duplicate-keys@npm:^7.22.5, @babel/plugin-transform-duplicate-keys@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-duplicate-keys@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: bb1280fbabaab6fab2ede585df34900712698210a3bd413f4df5bae6d8c24be36b496c92722ae676a7a67d060a4624f4d6c23b923485f906bfba8773c69f55b4 + checksum: c2a21c34dc0839590cd945192cbc46fde541a27e140c48fe1808315934664cdbf18db64889e23c4eeb6bad9d3e049482efdca91d29de5734ffc887c4fbabaa16 languageName: node linkType: hard -"@babel/plugin-transform-dynamic-import@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-dynamic-import@npm:7.22.11" +"@babel/plugin-transform-dynamic-import@npm:^7.22.5, @babel/plugin-transform-dynamic-import@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-dynamic-import@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-dynamic-import": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 78fc9c532210bf9e8f231747f542318568ac360ee6c27e80853962c984283c73da3f8f8aebe83c2096090a435b356b092ed85de617a156cbe0729d847632be45 + checksum: 57a722604c430d9f3dacff22001a5f31250e34785d4969527a2ae9160fa86858d0892c5b9ff7a06a04076f8c76c9e6862e0541aadca9c057849961343aab0845 languageName: node linkType: hard -"@babel/plugin-transform-exponentiation-operator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.22.5" +"@babel/plugin-transform-exponentiation-operator@npm:^7.22.5, @babel/plugin-transform-exponentiation-operator@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.23.3" dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor": ^7.22.5 + "@babel/helper-builder-binary-assignment-operator-visitor": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f2d660c1b1d51ad5fec1cd5ad426a52187204068c4158f8c4aa977b31535c61b66898d532603eef21c15756827be8277f724c869b888d560f26d7fe848bb5eae + checksum: 00d05ab14ad0f299160fcf9d8f55a1cc1b740e012ab0b5ce30207d2365f091665115557af7d989cd6260d075a252d9e4283de5f2b247dfbbe0e42ae586e6bf66 languageName: node linkType: hard -"@babel/plugin-transform-export-namespace-from@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-export-namespace-from@npm:7.22.11" +"@babel/plugin-transform-export-namespace-from@npm:^7.22.5, @babel/plugin-transform-export-namespace-from@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-export-namespace-from@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-export-namespace-from": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 73af5883a321ed56a4bfd43c8a7de0164faebe619287706896fc6ee2f7a4e69042adaa1338c0b8b4bdb9f7e5fdceb016fb1d40694cb43ca3b8827429e8aac4bf + checksum: 9f770a81bfd03b48d6ba155d452946fd56d6ffe5b7d871e9ec2a0b15e0f424273b632f3ed61838b90015b25bbda988896b7a46c7d964fbf8f6feb5820b309f93 languageName: node linkType: hard "@babel/plugin-transform-flow-strip-types@npm:^7.16.0": - version: 7.22.5 - resolution: "@babel/plugin-transform-flow-strip-types@npm:7.22.5" + version: 7.23.3 + resolution: "@babel/plugin-transform-flow-strip-types@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-flow": ^7.22.5 + "@babel/plugin-syntax-flow": ^7.23.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 1ba48187d6f33814be01c6870489f0b1858256cf2b9dd7e62f02af8b30049bf375112f1d44692c5fed3cb9cd26ee2fb32e358cd79b6ad2360a51e8f993e861bf + checksum: de38cc5cf948bc19405ea041292181527a36f59f08d787a590415fac36e9b0c7992f0d3e2fd3b9402089bafdaa1a893291a0edf15beebfd29bdedbbe582fee9b languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-transform-for-of@npm:7.22.15" +"@babel/plugin-transform-for-of@npm:^7.22.5, @babel/plugin-transform-for-of@npm:^7.23.6": + version: 7.23.6 + resolution: "@babel/plugin-transform-for-of@npm:7.23.6" dependencies: "@babel/helper-plugin-utils": ^7.22.5 + "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f395ae7bce31e14961460f56cf751b5d6e37dd27d7df5b1f4e49fec1c11b6f9cf71991c7ffbe6549878591e87df0d66af798cf26edfa4bfa6b4c3dba1fb2f73a + checksum: 228c060aa61f6aa89dc447170075f8214863b94f830624e74ade99c1a09316897c12d76e848460b0b506593e58dbc42739af6dc4cb0fe9b84dffe4a596050a36 languageName: node linkType: hard -"@babel/plugin-transform-function-name@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-function-name@npm:7.22.5" +"@babel/plugin-transform-function-name@npm:^7.22.5, @babel/plugin-transform-function-name@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-function-name@npm:7.23.3" dependencies: - "@babel/helper-compilation-targets": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 + "@babel/helper-compilation-targets": ^7.22.15 + "@babel/helper-function-name": ^7.23.0 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: cff3b876357999cb8ae30e439c3ec6b0491a53b0aa6f722920a4675a6dd5b53af97a833051df4b34791fe5b3dd326ccf769d5c8e45b322aa50ee11a660b17845 + checksum: 355c6dbe07c919575ad42b2f7e020f320866d72f8b79181a16f8e0cd424a2c761d979f03f47d583d9471b55dcd68a8a9d829b58e1eebcd572145b934b48975a6 languageName: node linkType: hard -"@babel/plugin-transform-json-strings@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-json-strings@npm:7.22.11" +"@babel/plugin-transform-json-strings@npm:^7.22.5, @babel/plugin-transform-json-strings@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-json-strings@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-json-strings": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 50665e5979e66358c50e90a26db53c55917f78175127ac2fa05c7888d156d418ffb930ec0a109353db0a7c5f57c756ce01bfc9825d24cbfd2b3ec453f2ed8cba + checksum: f9019820233cf8955d8ba346df709a0683c120fe86a24ed1c9f003f2db51197b979efc88f010d558a12e1491210fc195a43cd1c7fee5e23b92da38f793a875de languageName: node linkType: hard -"@babel/plugin-transform-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-literals@npm:7.22.5" +"@babel/plugin-transform-literals@npm:^7.22.5, @babel/plugin-transform-literals@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-literals@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: ec37cc2ffb32667af935ab32fe28f00920ec8a1eb999aa6dc6602f2bebd8ba205a558aeedcdccdebf334381d5c57106c61f52332045730393e73410892a9735b + checksum: 519a544cd58586b9001c4c9b18da25a62f17d23c48600ff7a685d75ca9eb18d2c5e8f5476f067f0a8f1fea2a31107eff950b9864833061e6076dcc4bdc3e71ed languageName: node linkType: hard -"@babel/plugin-transform-logical-assignment-operators@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.22.11" +"@babel/plugin-transform-logical-assignment-operators@npm:^7.22.5, @babel/plugin-transform-logical-assignment-operators@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: c664e9798e85afa7f92f07b867682dee7392046181d82f5d21bae6f2ca26dfe9c8375cdc52b7483c3fc09a983c1989f60eff9fbc4f373b0c0a74090553d05739 - languageName: node - linkType: hard - -"@babel/plugin-transform-member-expression-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-member-expression-literals@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: ec4b0e07915ddd4fda0142fd104ee61015c208608a84cfa13643a95d18760b1dc1ceb6c6e0548898b8c49e5959a994e46367260176dbabc4467f729b21868504 + checksum: 2ae1dc9b4ff3bf61a990ff3accdecb2afe3a0ca649b3e74c010078d1cdf29ea490f50ac0a905306a2bcf9ac177889a39ac79bdcc3a0fdf220b3b75fac18d39b5 languageName: node linkType: hard -"@babel/plugin-transform-modules-amd@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-amd@npm:7.22.5" +"@babel/plugin-transform-member-expression-literals@npm:^7.22.5, @babel/plugin-transform-member-expression-literals@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-member-expression-literals@npm:7.23.3" dependencies: - "@babel/helper-module-transforms": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 7da4c4ebbbcf7d182abb59b2046b22d86eee340caf8a22a39ef6a727da2d8acfec1f714fcdcd5054110b280e4934f735e80a6848d192b6834c5d4459a014f04d + checksum: 95cec13c36d447c5aa6b8e4c778b897eeba66dcb675edef01e0d2afcec9e8cb9726baf4f81b4bbae7a782595aed72e6a0d44ffb773272c3ca180fada99bf92db languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.22.11": - version: 7.23.0 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.23.0" +"@babel/plugin-transform-modules-amd@npm:^7.22.5, @babel/plugin-transform-modules-amd@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-modules-amd@npm:7.23.3" dependencies: - "@babel/helper-module-transforms": ^7.23.0 + "@babel/helper-module-transforms": ^7.23.3 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-simple-access": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 7fb25997194053e167c4207c319ff05362392da841bd9f42ddb3caf9c8798a5d203bd926d23ddf5830fdf05eddc82c2810f40d1287e3a4f80b07eff13d1024b5 + checksum: d163737b6a3d67ea579c9aa3b83d4df4b5c34d9dcdf25f415f027c0aa8cded7bac2750d2de5464081f67a042ad9e1c03930c2fab42acd79f9e57c00cf969ddff languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.22.5" +"@babel/plugin-transform-modules-commonjs@npm:^7.22.5, @babel/plugin-transform-modules-commonjs@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.23.3" dependencies: - "@babel/helper-module-transforms": ^7.22.5 + "@babel/helper-module-transforms": ^7.23.3 "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-simple-access": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2067aca8f6454d54ffcce69b02c457cfa61428e11372f6a1d99ff4fcfbb55c396ed2ca6ca886bf06c852e38c1a205b8095921b2364fd0243f3e66bc1dda61caa + checksum: 720a231ceade4ae4d2632478db4e7fecf21987d444942b72d523487ac8d715ca97de6c8f415c71e939595e1a4776403e7dc24ed68fe9125ad4acf57753c9bff7 languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.22.11" +"@babel/plugin-transform-modules-systemjs@npm:^7.22.5, @babel/plugin-transform-modules-systemjs@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.23.3" dependencies: "@babel/helper-hoist-variables": ^7.22.5 - "@babel/helper-module-transforms": ^7.22.9 + "@babel/helper-module-transforms": ^7.23.3 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d0991e4bdc3352b6a9f4d12b6662e3645d892cd5c3c005ba5f14e65f1e218c6a8f7f4497e64a51d82a046e507aaa7db3143b800b0270dca1824cbd214ff3363d + checksum: 0d2fdd993c785aecac9e0850cd5ed7f7d448f0fbb42992a950cc0590167144df25d82af5aac9a5c99ef913d2286782afa44e577af30c10901c5ee8984910fa1f languageName: node linkType: hard -"@babel/plugin-transform-modules-umd@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-umd@npm:7.22.5" +"@babel/plugin-transform-modules-umd@npm:^7.22.5, @babel/plugin-transform-modules-umd@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-modules-umd@npm:7.23.3" dependencies: - "@babel/helper-module-transforms": ^7.22.5 + "@babel/helper-module-transforms": ^7.23.3 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 46622834c54c551b231963b867adbc80854881b3e516ff29984a8da989bd81665bd70e8cba6710345248e97166689310f544aee1a5773e262845a8f1b3e5b8b4 + checksum: 586a7a2241e8b4e753a37af9466a9ffa8a67b4ba9aa756ad7500712c05d8fa9a8c1ed4f7bd25fae2a8265e6cf8fe781ec85a8ee885dd34cf50d8955ee65f12dc languageName: node linkType: hard @@ -2913,184 +2165,160 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-new-target@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-new-target@npm:7.22.5" +"@babel/plugin-transform-new-target@npm:^7.22.5, @babel/plugin-transform-new-target@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-new-target@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 6b72112773487a881a1d6ffa680afde08bad699252020e86122180ee7a88854d5da3f15d9bca3331cf2e025df045604494a8208a2e63b486266b07c14e2ffbf3 + checksum: e5053389316fce73ad5201b7777437164f333e24787fbcda4ae489cd2580dbbbdfb5694a7237bad91fabb46b591d771975d69beb1c740b82cb4761625379f00b languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.22.11" +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.5, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 167babecc8b8fe70796a7b7d34af667ebbf43da166c21689502e5e8cc93180b7a85979c77c9f64b7cce431b36718bd0a6df9e5e0ffea4ae22afb22cfef886372 + checksum: a27d73ea134d3d9560a6b2e26ab60012fba15f1db95865aa0153c18f5ec82cfef6a7b3d8df74e3c2fca81534fa5efeb6cacaf7b08bdb7d123e3dafdd079886a3 languageName: node linkType: hard -"@babel/plugin-transform-numeric-separator@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-numeric-separator@npm:7.22.11" +"@babel/plugin-transform-numeric-separator@npm:^7.22.5, @babel/plugin-transform-numeric-separator@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-numeric-separator@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-numeric-separator": ^7.10.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: af064d06a4a041767ec396a5f258103f64785df290e038bba9f0ef454e6c914f2ac45d862bbdad8fac2c7ad47fa4e95356f29053c60c100a0160b02a995fe2a3 + checksum: 6ba0e5db3c620a3ec81f9e94507c821f483c15f196868df13fa454cbac719a5449baf73840f5b6eb7d77311b24a2cf8e45db53700d41727f693d46f7caf3eec3 languageName: node linkType: hard -"@babel/plugin-transform-object-rest-spread@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-transform-object-rest-spread@npm:7.22.15" +"@babel/plugin-transform-object-rest-spread@npm:^7.22.5, @babel/plugin-transform-object-rest-spread@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-object-rest-spread@npm:7.23.4" dependencies: - "@babel/compat-data": ^7.22.9 + "@babel/compat-data": ^7.23.3 "@babel/helper-compilation-targets": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-transform-parameters": ^7.22.15 + "@babel/plugin-transform-parameters": ^7.23.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 62197a6f12289c1c1bd57f3bed9f0f765ca32390bfe91e0b5561dd94dd9770f4480c4162dec98da094bc0ba99d2c2ebba68de47c019454041b0b7a68ba2ec66d + checksum: 73fec495e327ca3959c1c03d07a621be09df00036c69fff0455af9a008291677ee9d368eec48adacdc6feac703269a649747568b4af4c4e9f134aa71cc5b378d languageName: node linkType: hard -"@babel/plugin-transform-object-super@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-object-super@npm:7.22.5" +"@babel/plugin-transform-object-super@npm:^7.22.5, @babel/plugin-transform-object-super@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-object-super@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 + "@babel/helper-replace-supers": ^7.22.20 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b71887877d74cb64dbccb5c0324fa67e31171e6a5311991f626650e44a4083e5436a1eaa89da78c0474fb095d4ec322d63ee778b202d33aa2e4194e1ed8e62d7 + checksum: e495497186f621fa79026e183b4f1fbb172fd9df812cbd2d7f02c05b08adbe58012b1a6eb6dd58d11a30343f6ec80d0f4074f9b501d70aa1c94df76d59164c53 languageName: node linkType: hard -"@babel/plugin-transform-optional-catch-binding@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.22.11" +"@babel/plugin-transform-optional-catch-binding@npm:^7.22.5, @babel/plugin-transform-optional-catch-binding@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f17abd90e1de67c84d63afea29c8021c74abb2794d3a6eeafb0bbe7372d3db32aefca386e392116ec63884537a4a2815d090d26264d259bacc08f6e3ed05294c + checksum: d50b5ee142cdb088d8b5de1ccf7cea85b18b85d85b52f86618f6e45226372f01ad4cdb29abd4fd35ea99a71fefb37009e0107db7a787dcc21d4d402f97470faf languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.22.10": - version: 7.23.0 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.23.0" +"@babel/plugin-transform-optional-chaining@npm:^7.22.6, @babel/plugin-transform-optional-chaining@npm:^7.23.3, @babel/plugin-transform-optional-chaining@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-optional-chaining@npm:7.23.4" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 "@babel/plugin-syntax-optional-chaining": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f702634f2b97e5260dbec0d4bde05ccb6f4d96d7bfa946481aeacfa205ca846cb6e096a38312f9d51fdbdac1f258f211138c5f7075952e46a5bf8574de6a1329 + checksum: e7a4c08038288057b7a08d68c4d55396ada9278095509ca51ed8dfb72a7f13f26bdd7c5185de21079fe0a9d60d22c227cb32e300d266c1bda40f70eee9f4bc1e languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.22.15, @babel/plugin-transform-optional-chaining@npm:^7.22.6": - version: 7.22.15 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.22.15" +"@babel/plugin-transform-parameters@npm:^7.20.7, @babel/plugin-transform-parameters@npm:^7.22.5, @babel/plugin-transform-parameters@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-parameters@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 6b97abe0e50ca2dd8684fcef2c8d12607637e707aa9d513b7035f5e812efbde9305736b438d422103a7844e04124cad5efa4ff0e6226a57afa1210a1c7485c8e + checksum: a735b3e85316d17ec102e3d3d1b6993b429bdb3b494651c9d754e3b7d270462ee1f1a126ccd5e3d871af5e683727e9ef98c9d34d4a42204fffaabff91052ed16 languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.16.7": - version: 7.16.7 - resolution: "@babel/plugin-transform-parameters@npm:7.16.7" +"@babel/plugin-transform-private-methods@npm:^7.22.5, @babel/plugin-transform-private-methods@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-private-methods@npm:7.23.3" dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 4d6904376db82d0b35f0a6cce08f630daf8608d94e903d6c7aff5bd742b251651bd1f88cdf9f16cad98aba5fc7c61da8635199364865fad6367d5ae37cf56cc1 - languageName: node - linkType: hard - -"@babel/plugin-transform-parameters@npm:^7.22.15, @babel/plugin-transform-parameters@npm:^7.22.5": - version: 7.22.15 - resolution: "@babel/plugin-transform-parameters@npm:7.22.15" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 541188bb7d1876cad87687b5c7daf90f63d8208ae83df24acb1e2b05020ad1c78786b2723ca4054a83fcb74fb6509f30c4cacc5b538ee684224261ad5fb047c1 - languageName: node - linkType: hard - -"@babel/plugin-transform-private-methods@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-private-methods@npm:7.22.5" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.5 + "@babel/helper-create-class-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 321479b4fcb6d3b3ef622ab22fd24001e43d46e680e8e41324c033d5810c84646e470f81b44cbcbef5c22e99030784f7cac92f1829974da7a47a60a7139082c3 + checksum: cedc1285c49b5a6d9a3d0e5e413b756ac40b3ac2f8f68bdfc3ae268bc8d27b00abd8bb0861c72756ff5dd8bf1eb77211b7feb5baf4fdae2ebbaabe49b9adc1d0 languageName: node linkType: hard -"@babel/plugin-transform-private-property-in-object@npm:^7.22.5": - version: 7.22.11 - resolution: "@babel/plugin-transform-private-property-in-object@npm:7.22.11" +"@babel/plugin-transform-private-property-in-object@npm:^7.22.5, @babel/plugin-transform-private-property-in-object@npm:^7.23.4": + version: 7.23.4 + resolution: "@babel/plugin-transform-private-property-in-object@npm:7.23.4" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-create-class-features-plugin": ^7.22.11 + "@babel/helper-create-class-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-private-property-in-object": ^7.14.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4d029d84901e53c46dead7a46e2990a7bc62470f4e4ca58a0d063394f86652fd58fe4eea1eb941da3669cd536b559b9d058b342b59300026346b7a2a51badac8 + checksum: fb7adfe94ea97542f250a70de32bddbc3e0b802381c92be947fec83ebffda57e68533c4d0697152719a3496fdd3ebf3798d451c024cd4ac848fc15ac26b70aa7 languageName: node linkType: hard -"@babel/plugin-transform-property-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-property-literals@npm:7.22.5" +"@babel/plugin-transform-property-literals@npm:^7.22.5, @babel/plugin-transform-property-literals@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-property-literals@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 796176a3176106f77fcb8cd04eb34a8475ce82d6d03a88db089531b8f0453a2fb8b0c6ec9a52c27948bc0ea478becec449893741fc546dfc3930ab927e3f9f2e + checksum: 16b048c8e87f25095f6d53634ab7912992f78e6997a6ff549edc3cf519db4fca01c7b4e0798530d7f6a05228ceee479251245cdd850a5531c6e6f404104d6cc9 languageName: node linkType: hard "@babel/plugin-transform-react-constant-elements@npm:^7.12.1": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-constant-elements@npm:7.22.5" + version: 7.23.3 + resolution: "@babel/plugin-transform-react-constant-elements@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 596db90e37174dd703f4859fef3c86156a7c8564d8351168ac6fdca79c912ef8b8746ae04516ac3909d2cc750702d58d451badacb3c54ea998938ad05d99f9d2 + checksum: f386fe59657910a00c5d276918765c6a74e52c9a223d79463a4eecd652b4da4a6c0a16710fcf5e17b838c336e0c46b552b79e47c1d6eeebc74a813788e0611f7 languageName: node linkType: hard -"@babel/plugin-transform-react-display-name@npm:^7.16.0, @babel/plugin-transform-react-display-name@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-display-name@npm:7.22.5" +"@babel/plugin-transform-react-display-name@npm:^7.16.0, @babel/plugin-transform-react-display-name@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-react-display-name@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: a12bfd1e4e93055efca3ace3c34722571bda59d9740dca364d225d9c6e3ca874f134694d21715c42cc63d79efd46db9665bd4a022998767f9245f1e29d5d204d + checksum: 7f86964e8434d3ddbd3c81d2690c9b66dbf1cd8bd9512e2e24500e9fa8cf378bc52c0853270b3b82143aba5965aec04721df7abdb768f952b44f5c6e0b198779 languageName: node linkType: hard @@ -3105,68 +2333,53 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-react-jsx@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-jsx@npm:7.22.5" +"@babel/plugin-transform-react-jsx@npm:^7.22.15, @babel/plugin-transform-react-jsx@npm:^7.22.5, @babel/plugin-transform-react-jsx@npm:^7.3.0": + version: 7.23.4 + resolution: "@babel/plugin-transform-react-jsx@npm:7.23.4" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-module-imports": ^7.22.5 + "@babel/helper-module-imports": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-jsx": ^7.22.5 - "@babel/types": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: c8f93f29f32cf79683ca2b8958fd62f38155674846ef27a7d4b6fbeb8713c37257418391731b58ff8024ec37b888bed5960e615a3f552e28245d2082e7f2a2df - languageName: node - linkType: hard - -"@babel/plugin-transform-react-jsx@npm:^7.3.0": - version: 7.17.3 - resolution: "@babel/plugin-transform-react-jsx@npm:7.17.3" - dependencies: - "@babel/helper-annotate-as-pure": ^7.16.7 - "@babel/helper-module-imports": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/plugin-syntax-jsx": ^7.16.7 - "@babel/types": ^7.17.0 + "@babel/plugin-syntax-jsx": ^7.23.3 + "@babel/types": ^7.23.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 7e33a3fb78a3b7352b56f48211160ae60dc3654bae314ea0352bfc179d10eaac789792ccb3701172388ec4e4dbdb94952cdf3386980f3af402d99ceadd91149b + checksum: d8b8c52e8e22e833bf77c8d1a53b0a57d1fd52ba9596a319d572de79446a8ed9d95521035bc1175c1589d1a6a34600d2e678fa81d81bac8fac121137097f1f0a languageName: node linkType: hard -"@babel/plugin-transform-react-pure-annotations@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.22.5" +"@babel/plugin-transform-react-pure-annotations@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.23.3" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 092021c4f404e267002099ec20b3f12dd730cb90b0d83c5feed3dc00dbe43b9c42c795a18e7c6c7d7bddea20c7dd56221b146aec81b37f2e7eb5137331c61120 + checksum: 9ea3698b1d422561d93c0187ac1ed8f2367e4250b10e259785ead5aa643c265830fd0f4cf5087a5bedbc4007444c06da2f2006686613220acf0949895f453666 languageName: node linkType: hard -"@babel/plugin-transform-regenerator@npm:^7.22.10, @babel/plugin-transform-regenerator@npm:^7.22.5": - version: 7.22.10 - resolution: "@babel/plugin-transform-regenerator@npm:7.22.10" +"@babel/plugin-transform-regenerator@npm:^7.22.5, @babel/plugin-transform-regenerator@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-regenerator@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 regenerator-transform: ^0.15.2 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: e13678d62d6fa96f11cb8b863f00e8693491e7adc88bfca3f2820f80cbac8336e7dec3a596eee6a1c4663b7ececc3564f2cd7fb44ed6d4ce84ac2bb7f39ecc6e + checksum: 7fdacc7b40008883871b519c9e5cdea493f75495118ccc56ac104b874983569a24edd024f0f5894ba1875c54ee2b442f295d6241c3280e61c725d0dd3317c8e6 languageName: node linkType: hard -"@babel/plugin-transform-reserved-words@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-reserved-words@npm:7.22.5" +"@babel/plugin-transform-reserved-words@npm:^7.22.5, @babel/plugin-transform-reserved-words@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-reserved-words@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 3ffd7dbc425fe8132bfec118b9817572799cab1473113a635d25ab606c1f5a2341a636c04cf6b22df3813320365ed5a965b5eeb3192320a10e4cc2c137bd8bfc + checksum: 298c4440ddc136784ff920127cea137168e068404e635dc946ddb5d7b2a27b66f1dd4c4acb01f7184478ff7d5c3e7177a127279479926519042948fb7fa0fa48 languageName: node linkType: hard @@ -3187,149 +2400,135 @@ __metadata: linkType: hard "@babel/plugin-transform-runtime@npm:^7.16.4": - version: 7.23.2 - resolution: "@babel/plugin-transform-runtime@npm:7.23.2" + version: 7.23.7 + resolution: "@babel/plugin-transform-runtime@npm:7.23.7" dependencies: "@babel/helper-module-imports": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 - babel-plugin-polyfill-corejs2: ^0.4.6 - babel-plugin-polyfill-corejs3: ^0.8.5 - babel-plugin-polyfill-regenerator: ^0.5.3 + babel-plugin-polyfill-corejs2: ^0.4.7 + babel-plugin-polyfill-corejs3: ^0.8.7 + babel-plugin-polyfill-regenerator: ^0.5.4 semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 09f4273bfe9600c67e72e26f853f11c24ee4c1cbb3935c4a28a94d388e7c0d8733479d868c333cb34e9c236f1765788c6daef7852331f5c70a3b5543fd0247a1 + checksum: b3cc760afbfdddac5fec3ba3a3916a448d152ada213dcb3ffe54115eaa09db1249f1661b7f271d79c8e6b03ebd5315c049800287cde372900f2557a6e2fe3333 languageName: node linkType: hard -"@babel/plugin-transform-shorthand-properties@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-shorthand-properties@npm:7.22.5" +"@babel/plugin-transform-shorthand-properties@npm:^7.22.5, @babel/plugin-transform-shorthand-properties@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-shorthand-properties@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: a5ac902c56ea8effa99f681340ee61bac21094588f7aef0bc01dff98246651702e677552fa6d10e548c4ac22a3ffad047dd2f8c8f0540b68316c2c203e56818b + checksum: 5d677a03676f9fff969b0246c423d64d77502e90a832665dc872a5a5e05e5708161ce1effd56bb3c0f2c20a1112fca874be57c8a759d8b08152755519281f326 languageName: node linkType: hard -"@babel/plugin-transform-spread@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-spread@npm:7.22.5" +"@babel/plugin-transform-spread@npm:^7.22.5, @babel/plugin-transform-spread@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-spread@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 5587f0deb60b3dfc9b274e269031cc45ec75facccf1933ea2ea71ced9fd3ce98ed91bb36d6cd26817c14474b90ed998c5078415f0eab531caf301496ce24c95c + checksum: 8fd5cac201e77a0b4825745f4e07a25f923842f282f006b3a79223c00f61075c8868d12eafec86b2642cd0b32077cdd32314e27bcb75ee5e6a68c0144140dcf2 languageName: node linkType: hard -"@babel/plugin-transform-sticky-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-sticky-regex@npm:7.22.5" +"@babel/plugin-transform-sticky-regex@npm:^7.22.5, @babel/plugin-transform-sticky-regex@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-sticky-regex@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 63b2c575e3e7f96c32d52ed45ee098fb7d354b35c2223b8c8e76840b32cc529ee0c0ceb5742fd082e56e91e3d82842a367ce177e82b05039af3d602c9627a729 + checksum: 53e55eb2575b7abfdb4af7e503a2bf7ef5faf8bf6b92d2cd2de0700bdd19e934e5517b23e6dfed94ba50ae516b62f3f916773ef7d9bc81f01503f585051e2949 languageName: node linkType: hard -"@babel/plugin-transform-template-literals@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-template-literals@npm:7.22.5" +"@babel/plugin-transform-template-literals@npm:^7.22.5, @babel/plugin-transform-template-literals@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-template-literals@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 27e9bb030654cb425381c69754be4abe6a7c75b45cd7f962cd8d604b841b2f0fb7b024f2efc1c25cc53f5b16d79d5e8cfc47cacbdaa983895b3aeefa3e7e24ff + checksum: b16c5cb0b8796be0118e9c144d15bdc0d20a7f3f59009c6303a6e9a8b74c146eceb3f05186f5b97afcba7cfa87e34c1585a22186e3d5b22f2fd3d27d959d92b2 languageName: node linkType: hard -"@babel/plugin-transform-typeof-symbol@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-typeof-symbol@npm:7.22.5" +"@babel/plugin-transform-typeof-symbol@npm:^7.22.5, @babel/plugin-transform-typeof-symbol@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-typeof-symbol@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 82a53a63ffc3010b689ca9a54e5f53b2718b9f4b4a9818f36f9b7dba234f38a01876680553d2716a645a61920b5e6e4aaf8d4a0064add379b27ca0b403049512 + checksum: 0af7184379d43afac7614fc89b1bdecce4e174d52f4efaeee8ec1a4f2c764356c6dba3525c0685231f1cbf435b6dd4ee9e738d7417f3b10ce8bbe869c32f4384 languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.22.11": - version: 7.22.11 - resolution: "@babel/plugin-transform-typescript@npm:7.22.11" +"@babel/plugin-transform-typescript@npm:^7.23.3": + version: 7.23.6 + resolution: "@babel/plugin-transform-typescript@npm:7.23.6" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-create-class-features-plugin": ^7.22.11 + "@babel/helper-create-class-features-plugin": ^7.23.6 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-typescript": ^7.22.5 + "@babel/plugin-syntax-typescript": ^7.23.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: a0dc3c2427b55602944705c9a91b4c074524badd5ea87edb603ddeabe7fae531bcbe68475106d7a00079b67bb422dbf2e9f50e15c25ac24d7e9fe77f37ebcfb4 + checksum: 0462241843d14dff9f1a4c49ab182a6f01a5f7679957c786b08165dac3e8d49184011f05ca204183d164c54b9d3496d1b3005f904fa8708e394e6f15bf5548e6 languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.22.5": - version: 7.22.9 - resolution: "@babel/plugin-transform-typescript@npm:7.22.9" +"@babel/plugin-transform-unicode-escapes@npm:^7.22.5, @babel/plugin-transform-unicode-escapes@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-unicode-escapes@npm:7.23.3" dependencies: - "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-create-class-features-plugin": ^7.22.9 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/plugin-syntax-typescript": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 6d1317a54d093b302599a4bee8ba9865d0de8b7b6ac1a0746c4316231d632f75b7f086e6e78acb9ac95ba12ba3b9da462dc9ca69370abb4603c4cc987f62e67e + checksum: 561c429183a54b9e4751519a3dfba6014431e9cdc1484fad03bdaf96582dfc72c76a4f8661df2aeeae7c34efd0fa4d02d3b83a2f63763ecf71ecc925f9cc1f60 languageName: node linkType: hard -"@babel/plugin-transform-unicode-escapes@npm:^7.22.10, @babel/plugin-transform-unicode-escapes@npm:^7.22.5": - version: 7.22.10 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.22.10" +"@babel/plugin-transform-unicode-property-regex@npm:^7.22.5, @babel/plugin-transform-unicode-property-regex@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.23.3" dependencies: + "@babel/helper-create-regexp-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 807f40ed1324c8cb107c45358f1903384ca3f0ef1d01c5a3c5c9b271c8d8eec66936a3dcc8d75ddfceea9421420368c2e77ae3adef0a50557e778dfe296bf382 + checksum: 2298461a194758086d17c23c26c7de37aa533af910f9ebf31ebd0893d4aa317468043d23f73edc782ec21151d3c46cf0ff8098a83b725c49a59de28a1d4d6225 languageName: node linkType: hard -"@babel/plugin-transform-unicode-property-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.22.5" +"@babel/plugin-transform-unicode-regex@npm:^7.22.5, @babel/plugin-transform-unicode-regex@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-unicode-regex@npm:7.23.3" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 + "@babel/helper-create-regexp-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2495e5f663cb388e3d888b4ba3df419ac436a5012144ac170b622ddfc221f9ea9bdba839fa2bc0185cb776b578030666406452ec7791cbf0e7a3d4c88ae9574c + checksum: c5f835d17483ba899787f92e313dfa5b0055e3deab332f1d254078a2bba27ede47574b6599fcf34d3763f0c048ae0779dc21d2d8db09295edb4057478dc80a9a languageName: node linkType: hard -"@babel/plugin-transform-unicode-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-regex@npm:7.22.5" +"@babel/plugin-transform-unicode-sets-regex@npm:^7.22.5, @babel/plugin-transform-unicode-sets-regex@npm:^7.23.3": + version: 7.23.3 + resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.23.3" dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 - "@babel/helper-plugin-utils": ^7.22.5 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 6b5d1404c8c623b0ec9bd436c00d885a17d6a34f3f2597996343ddb9d94f6379705b21582dfd4cec2c47fd34068872e74ab6b9580116c0566b3f9447e2a7fa06 - languageName: node - linkType: hard - -"@babel/plugin-transform-unicode-sets-regex@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.22.5" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.22.5 + "@babel/helper-create-regexp-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0 - checksum: c042070f980b139547f8b0179efbc049ac5930abec7fc26ed7a41d89a048d8ab17d362200e204b6f71c3c20d6991a0e74415e1a412a49adc8131c2a40c04822e + checksum: 79d0b4c951955ca68235c87b91ab2b393c96285f8aeaa34d6db416d2ddac90000c9bd6e8c4d82b60a2b484da69930507245035f28ba63c6cae341cf3ba68fdef languageName: node linkType: hard @@ -3434,23 +2633,24 @@ __metadata: linkType: hard "@babel/preset-env@npm:^7.11.0, @babel/preset-env@npm:^7.12.1, @babel/preset-env@npm:^7.16.4": - version: 7.22.10 - resolution: "@babel/preset-env@npm:7.22.10" + version: 7.23.7 + resolution: "@babel/preset-env@npm:7.23.7" dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-compilation-targets": ^7.22.10 + "@babel/compat-data": ^7.23.5 + "@babel/helper-compilation-targets": ^7.23.6 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.22.5 - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.22.5 + "@babel/helper-validator-option": ^7.23.5 + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.23.3 + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.23.3 + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": ^7.23.7 "@babel/plugin-proposal-private-property-in-object": 7.21.0-placeholder-for-preset-env.2 "@babel/plugin-syntax-async-generators": ^7.8.4 "@babel/plugin-syntax-class-properties": ^7.12.13 "@babel/plugin-syntax-class-static-block": ^7.14.5 "@babel/plugin-syntax-dynamic-import": ^7.8.3 "@babel/plugin-syntax-export-namespace-from": ^7.8.3 - "@babel/plugin-syntax-import-assertions": ^7.22.5 - "@babel/plugin-syntax-import-attributes": ^7.22.5 + "@babel/plugin-syntax-import-assertions": ^7.23.3 + "@babel/plugin-syntax-import-attributes": ^7.23.3 "@babel/plugin-syntax-import-meta": ^7.10.4 "@babel/plugin-syntax-json-strings": ^7.8.3 "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 @@ -3462,64 +2662,63 @@ __metadata: "@babel/plugin-syntax-private-property-in-object": ^7.14.5 "@babel/plugin-syntax-top-level-await": ^7.14.5 "@babel/plugin-syntax-unicode-sets-regex": ^7.18.6 - "@babel/plugin-transform-arrow-functions": ^7.22.5 - "@babel/plugin-transform-async-generator-functions": ^7.22.10 - "@babel/plugin-transform-async-to-generator": ^7.22.5 - "@babel/plugin-transform-block-scoped-functions": ^7.22.5 - "@babel/plugin-transform-block-scoping": ^7.22.10 - "@babel/plugin-transform-class-properties": ^7.22.5 - "@babel/plugin-transform-class-static-block": ^7.22.5 - "@babel/plugin-transform-classes": ^7.22.6 - "@babel/plugin-transform-computed-properties": ^7.22.5 - "@babel/plugin-transform-destructuring": ^7.22.10 - "@babel/plugin-transform-dotall-regex": ^7.22.5 - "@babel/plugin-transform-duplicate-keys": ^7.22.5 - "@babel/plugin-transform-dynamic-import": ^7.22.5 - "@babel/plugin-transform-exponentiation-operator": ^7.22.5 - "@babel/plugin-transform-export-namespace-from": ^7.22.5 - "@babel/plugin-transform-for-of": ^7.22.5 - "@babel/plugin-transform-function-name": ^7.22.5 - "@babel/plugin-transform-json-strings": ^7.22.5 - "@babel/plugin-transform-literals": ^7.22.5 - "@babel/plugin-transform-logical-assignment-operators": ^7.22.5 - "@babel/plugin-transform-member-expression-literals": ^7.22.5 - "@babel/plugin-transform-modules-amd": ^7.22.5 - "@babel/plugin-transform-modules-commonjs": ^7.22.5 - "@babel/plugin-transform-modules-systemjs": ^7.22.5 - "@babel/plugin-transform-modules-umd": ^7.22.5 + "@babel/plugin-transform-arrow-functions": ^7.23.3 + "@babel/plugin-transform-async-generator-functions": ^7.23.7 + "@babel/plugin-transform-async-to-generator": ^7.23.3 + "@babel/plugin-transform-block-scoped-functions": ^7.23.3 + "@babel/plugin-transform-block-scoping": ^7.23.4 + "@babel/plugin-transform-class-properties": ^7.23.3 + "@babel/plugin-transform-class-static-block": ^7.23.4 + "@babel/plugin-transform-classes": ^7.23.5 + "@babel/plugin-transform-computed-properties": ^7.23.3 + "@babel/plugin-transform-destructuring": ^7.23.3 + "@babel/plugin-transform-dotall-regex": ^7.23.3 + "@babel/plugin-transform-duplicate-keys": ^7.23.3 + "@babel/plugin-transform-dynamic-import": ^7.23.4 + "@babel/plugin-transform-exponentiation-operator": ^7.23.3 + "@babel/plugin-transform-export-namespace-from": ^7.23.4 + "@babel/plugin-transform-for-of": ^7.23.6 + "@babel/plugin-transform-function-name": ^7.23.3 + "@babel/plugin-transform-json-strings": ^7.23.4 + "@babel/plugin-transform-literals": ^7.23.3 + "@babel/plugin-transform-logical-assignment-operators": ^7.23.4 + "@babel/plugin-transform-member-expression-literals": ^7.23.3 + "@babel/plugin-transform-modules-amd": ^7.23.3 + "@babel/plugin-transform-modules-commonjs": ^7.23.3 + "@babel/plugin-transform-modules-systemjs": ^7.23.3 + "@babel/plugin-transform-modules-umd": ^7.23.3 "@babel/plugin-transform-named-capturing-groups-regex": ^7.22.5 - "@babel/plugin-transform-new-target": ^7.22.5 - "@babel/plugin-transform-nullish-coalescing-operator": ^7.22.5 - "@babel/plugin-transform-numeric-separator": ^7.22.5 - "@babel/plugin-transform-object-rest-spread": ^7.22.5 - "@babel/plugin-transform-object-super": ^7.22.5 - "@babel/plugin-transform-optional-catch-binding": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.10 - "@babel/plugin-transform-parameters": ^7.22.5 - "@babel/plugin-transform-private-methods": ^7.22.5 - "@babel/plugin-transform-private-property-in-object": ^7.22.5 - "@babel/plugin-transform-property-literals": ^7.22.5 - "@babel/plugin-transform-regenerator": ^7.22.10 - "@babel/plugin-transform-reserved-words": ^7.22.5 - "@babel/plugin-transform-shorthand-properties": ^7.22.5 - "@babel/plugin-transform-spread": ^7.22.5 - "@babel/plugin-transform-sticky-regex": ^7.22.5 - "@babel/plugin-transform-template-literals": ^7.22.5 - "@babel/plugin-transform-typeof-symbol": ^7.22.5 - "@babel/plugin-transform-unicode-escapes": ^7.22.10 - "@babel/plugin-transform-unicode-property-regex": ^7.22.5 - "@babel/plugin-transform-unicode-regex": ^7.22.5 - "@babel/plugin-transform-unicode-sets-regex": ^7.22.5 + "@babel/plugin-transform-new-target": ^7.23.3 + "@babel/plugin-transform-nullish-coalescing-operator": ^7.23.4 + "@babel/plugin-transform-numeric-separator": ^7.23.4 + "@babel/plugin-transform-object-rest-spread": ^7.23.4 + "@babel/plugin-transform-object-super": ^7.23.3 + "@babel/plugin-transform-optional-catch-binding": ^7.23.4 + "@babel/plugin-transform-optional-chaining": ^7.23.4 + "@babel/plugin-transform-parameters": ^7.23.3 + "@babel/plugin-transform-private-methods": ^7.23.3 + "@babel/plugin-transform-private-property-in-object": ^7.23.4 + "@babel/plugin-transform-property-literals": ^7.23.3 + "@babel/plugin-transform-regenerator": ^7.23.3 + "@babel/plugin-transform-reserved-words": ^7.23.3 + "@babel/plugin-transform-shorthand-properties": ^7.23.3 + "@babel/plugin-transform-spread": ^7.23.3 + "@babel/plugin-transform-sticky-regex": ^7.23.3 + "@babel/plugin-transform-template-literals": ^7.23.3 + "@babel/plugin-transform-typeof-symbol": ^7.23.3 + "@babel/plugin-transform-unicode-escapes": ^7.23.3 + "@babel/plugin-transform-unicode-property-regex": ^7.23.3 + "@babel/plugin-transform-unicode-regex": ^7.23.3 + "@babel/plugin-transform-unicode-sets-regex": ^7.23.3 "@babel/preset-modules": 0.1.6-no-external-plugins - "@babel/types": ^7.22.10 - babel-plugin-polyfill-corejs2: ^0.4.5 - babel-plugin-polyfill-corejs3: ^0.8.3 - babel-plugin-polyfill-regenerator: ^0.5.2 + babel-plugin-polyfill-corejs2: ^0.4.7 + babel-plugin-polyfill-corejs3: ^0.8.7 + babel-plugin-polyfill-regenerator: ^0.5.4 core-js-compat: ^3.31.0 semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4145a660a7b05e21e6d8b6cdf348c6931238abb15282a258bdb5e04cd3cca9356dc120ecfe0d1b977819ade4aac50163127c86db2300227ff60392d24daa0b7c + checksum: 4b5eb466d9d4beca56c6fdaac92e99d440dc5650fdfd6ebf0d2a07380ebb43b4dc9aedf93bb30d1d1cd56d9e264d3728df348159e18dd138729b249261be11bf languageName: node linkType: hard @@ -3537,8 +2736,8 @@ __metadata: linkType: hard "@babel/preset-modules@npm:^0.1.5": - version: 0.1.5 - resolution: "@babel/preset-modules@npm:0.1.5" + version: 0.1.6 + resolution: "@babel/preset-modules@npm:0.1.6" dependencies: "@babel/helper-plugin-utils": ^7.0.0 "@babel/plugin-proposal-unicode-property-regex": ^7.4.4 @@ -3546,54 +2745,39 @@ __metadata: "@babel/types": ^7.4.4 esutils: ^2.0.2 peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 8430e0e9e9d520b53e22e8c4c6a5a080a12b63af6eabe559c2310b187bd62ae113f3da82ba33e9d1d0f3230930ca702843aae9dd226dec51f7d7114dc1f51c10 + "@babel/core": ^7.0.0-0 || ^8.0.0-0 <8.0.0 + checksum: 9700992d2b9526e703ab49eb8c4cd0b26bec93594d57c6b808967619df1a387565e0e58829b65b5bd6d41049071ea0152c9195b39599515fddb3e52b09a55ff0 languageName: node linkType: hard "@babel/preset-react@npm:^7.12.5, @babel/preset-react@npm:^7.16.0": - version: 7.22.5 - resolution: "@babel/preset-react@npm:7.22.5" + version: 7.23.3 + resolution: "@babel/preset-react@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - "@babel/plugin-transform-react-display-name": ^7.22.5 - "@babel/plugin-transform-react-jsx": ^7.22.5 + "@babel/helper-validator-option": ^7.22.15 + "@babel/plugin-transform-react-display-name": ^7.23.3 + "@babel/plugin-transform-react-jsx": ^7.22.15 "@babel/plugin-transform-react-jsx-development": ^7.22.5 - "@babel/plugin-transform-react-pure-annotations": ^7.22.5 + "@babel/plugin-transform-react-pure-annotations": ^7.23.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b977c7ee83e93f62d77e61929ca3d97e5291e026e2f025a1b8b7ac9186486ed56c7d5bc36f0becabe0c24e8c42a4e4f2243a3cf841384cfafc3204c5d3e6c619 + checksum: 2d90961e7e627a74b44551e88ad36a440579e283e8dc27972bf2f50682152bbc77228673a3ea22c0e0d005b70cbc487eccd64897c5e5e0384e5ce18f300b21eb languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.16.0": - version: 7.22.11 - resolution: "@babel/preset-typescript@npm:7.22.11" +"@babel/preset-typescript@npm:^7.16.0, @babel/preset-typescript@npm:^7.18.6": + version: 7.23.3 + resolution: "@babel/preset-typescript@npm:7.23.3" dependencies: "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - "@babel/plugin-syntax-jsx": ^7.22.5 - "@babel/plugin-transform-modules-commonjs": ^7.22.11 - "@babel/plugin-transform-typescript": ^7.22.11 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 8ae7162c31db896f5eeecd6f67ab2e58555fdc06fe84e95fe4a3f60b64cd6f782d2d7dfbde0c0eac04b55dac18222752d91dd8786245cccedd7e42f080e07233 - languageName: node - linkType: hard - -"@babel/preset-typescript@npm:^7.18.6": - version: 7.22.5 - resolution: "@babel/preset-typescript@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - "@babel/plugin-syntax-jsx": ^7.22.5 - "@babel/plugin-transform-modules-commonjs": ^7.22.5 - "@babel/plugin-transform-typescript": ^7.22.5 + "@babel/helper-validator-option": ^7.22.15 + "@babel/plugin-syntax-jsx": ^7.23.3 + "@babel/plugin-transform-modules-commonjs": ^7.23.3 + "@babel/plugin-transform-typescript": ^7.23.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 7be1670cb4404797d3a473bd72d66eb2b3e0f2f8a672a5e40bdb0812cc66085ec84bcd7b896709764cabf042fdc6b7f2d4755ac7cce10515eb596ff61dab5154 + checksum: 105a2d39bbc464da0f7e1ad7f535c77c5f62d6b410219355b20e552e7d29933567a5c55339b5d0aec1a5c7a0a7dfdf1b54aae601a4fe15a157d54dcbfcb3e854 languageName: node linkType: hard @@ -3613,7 +2797,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:7.22.6, @babel/runtime@npm:^7.6.3, @babel/runtime@npm:^7.9.2": +"@babel/runtime@npm:7.22.6": version: 7.22.6 resolution: "@babel/runtime@npm:7.22.6" dependencies: @@ -3622,39 +2806,12 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.7": - version: 7.23.2 - resolution: "@babel/runtime@npm:7.23.2" - dependencies: - regenerator-runtime: ^0.14.0 - checksum: 6c4df4839ec75ca10175f636d6362f91df8a3137f86b38f6cd3a4c90668a0fe8e9281d320958f4fbd43b394988958585a17c3aab2a4ea6bf7316b22916a371fb - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.23.4": - version: 7.23.5 - resolution: "@babel/runtime@npm:7.23.5" - dependencies: - regenerator-runtime: ^0.14.0 - checksum: 164d9802424f06908e62d29b8fd3a87db55accf82f46f964ac481dcead11ff7df8391e3696e5fa91a8ca10ea8845bf650acd730fa88cf13f8026cd8d5eec6936 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.4.4": - version: 7.22.10 - resolution: "@babel/runtime@npm:7.22.10" +"@babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.23.6, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.3, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": + version: 7.23.7 + resolution: "@babel/runtime@npm:7.23.7" dependencies: regenerator-runtime: ^0.14.0 - checksum: 524d41517e68953dbc73a4f3616b8475e5813f64e28ba89ff5fca2c044d535c2ea1a3f310df1e5bb06162e1f0b401b5c4af73fe6e2519ca2450d9d8c44cf268d - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.8.4": - version: 7.17.2 - resolution: "@babel/runtime@npm:7.17.2" - dependencies: - regenerator-runtime: ^0.13.4 - checksum: a48702d271ecc59c09c397856407afa29ff980ab537b3da58eeee1aeaa0f545402d340a1680c9af58aec94dfdcbccfb6abb211991b74686a86d03d3f6956cacd + checksum: eba85bd24d250abb5ae19b16cffc15a54d3894d8228ace40fa4c0e2f1938f28b38ad3e3430ebff9a1ef511eeb8c527e36044ac19076d6deafa52cef35d8624b9 languageName: node linkType: hard @@ -3670,7 +2827,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:7.22.5, @babel/template@npm:^7.22.5, @babel/template@npm:^7.4.0": +"@babel/template@npm:7.22.5": version: 7.22.5 resolution: "@babel/template@npm:7.22.5" dependencies: @@ -3681,29 +2838,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.16.7, @babel/template@npm:^7.3.3": - version: 7.16.7 - resolution: "@babel/template@npm:7.16.7" - dependencies: - "@babel/code-frame": ^7.16.7 - "@babel/parser": ^7.16.7 - "@babel/types": ^7.16.7 - checksum: 10cd112e89276e00f8b11b55a51c8b2f1262c318283a980f4d6cdb0286dc05734b9aaeeb9f3ad3311900b09bc913e02343fcaa9d4a4f413964aaab04eb84ac4a - languageName: node - linkType: hard - -"@babel/template@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/template@npm:7.18.6" - dependencies: - "@babel/code-frame": ^7.18.6 - "@babel/parser": ^7.18.6 - "@babel/types": ^7.18.6 - checksum: cb02ed804b7b1938dbecef4e01562013b80681843dd391933315b3dd9880820def3b5b1bff6320d6e4c6a1d63d1d5799630d658ec6b0369c5505e7e4029c38fb - languageName: node - linkType: hard - -"@babel/template@npm:^7.22.15": +"@babel/template@npm:^7.22.15, @babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3, @babel/template@npm:^7.4.0": version: 7.22.15 resolution: "@babel/template@npm:7.22.15" dependencies: @@ -3715,20 +2850,20 @@ __metadata: linkType: hard "@babel/traverse@npm:>=7.23.2": - version: 7.23.2 - resolution: "@babel/traverse@npm:7.23.2" + version: 7.23.7 + resolution: "@babel/traverse@npm:7.23.7" dependencies: - "@babel/code-frame": ^7.22.13 - "@babel/generator": ^7.23.0 + "@babel/code-frame": ^7.23.5 + "@babel/generator": ^7.23.6 "@babel/helper-environment-visitor": ^7.22.20 "@babel/helper-function-name": ^7.23.0 "@babel/helper-hoist-variables": ^7.22.5 "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/parser": ^7.23.0 - "@babel/types": ^7.23.0 - debug: ^4.1.0 + "@babel/parser": ^7.23.6 + "@babel/types": ^7.23.6 + debug: ^4.3.1 globals: ^11.1.0 - checksum: 26a1eea0dde41ab99dde8b9773a013a0dc50324e5110a049f5d634e721ff08afffd54940b3974a20308d7952085ac769689369e9127dea655f868c0f6e1ab35d + checksum: d4a7afb922361f710efc97b1e25ec343fab8b2a4ddc81ca84f9a153f22d4482112cba8f263774be8d297918b6c4767c7a98988ab4e53ac73686c986711dd002e languageName: node linkType: hard @@ -3743,78 +2878,21 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.16.7, @babel/types@npm:^7.17.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": - version: 7.17.0 - resolution: "@babel/types@npm:7.17.0" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.6, @babel/types@npm:^7.18.4, @babel/types@npm:^7.18.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.19, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.6, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.0, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": + version: 7.23.6 + resolution: "@babel/types@npm:7.23.6" dependencies: - "@babel/helper-validator-identifier": ^7.16.7 - to-fast-properties: ^2.0.0 - checksum: 12e5a287986fe557188e87b2c5202223f1dc83d9239a196ab936fdb9f8c1eb0be717ff19f934b5fad4e29a75586d5798f74bed209bccea1c20376b9952056f0e - languageName: node - linkType: hard - -"@babel/types@npm:^7.12.6, @babel/types@npm:^7.22.11, @babel/types@npm:^7.22.19, @babel/types@npm:^7.23.0": - version: 7.23.0 - resolution: "@babel/types@npm:7.23.0" - dependencies: - "@babel/helper-string-parser": ^7.22.5 + "@babel/helper-string-parser": ^7.23.4 "@babel/helper-validator-identifier": ^7.22.20 to-fast-properties: ^2.0.0 - checksum: 215fe04bd7feef79eeb4d33374b39909ce9cad1611c4135a4f7fdf41fe3280594105af6d7094354751514625ea92d0875aba355f53e86a92600f290e77b0e604 - languageName: node - linkType: hard - -"@babel/types@npm:^7.18.4, @babel/types@npm:^7.22.5, @babel/types@npm:^7.8.3": - version: 7.22.5 - resolution: "@babel/types@npm:7.22.5" - dependencies: - "@babel/helper-string-parser": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 - to-fast-properties: ^2.0.0 - checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 - languageName: node - linkType: hard - -"@babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/types@npm:7.18.9" - dependencies: - "@babel/helper-validator-identifier": ^7.18.6 - to-fast-properties: ^2.0.0 - checksum: f0e0147267895fd8a5b82133e711ce7ce99941f3ce63647e0e3b00656a7afe48a8aa48edbae27543b701794d2b29a562a08f51f88f41df401abce7c3acc5e13a - languageName: node - linkType: hard - -"@babel/types@npm:^7.20.7": - version: 7.21.4 - resolution: "@babel/types@npm:7.21.4" - dependencies: - "@babel/helper-string-parser": ^7.19.4 - "@babel/helper-validator-identifier": ^7.19.1 - to-fast-properties: ^2.0.0 - checksum: 587bc55a91ce003b0f8aa10d70070f8006560d7dc0360dc0406d306a2cb2a10154e2f9080b9c37abec76907a90b330a536406cb75e6bdc905484f37b75c73219 + checksum: 68187dbec0d637f79bc96263ac95ec8b06d424396678e7e225492be866414ce28ebc918a75354d4c28659be6efe30020b4f0f6df81cc418a2d30645b690a8de0 languageName: node linkType: hard -"@babel/types@npm:^7.22.10, @babel/types@npm:^7.4.0": - version: 7.22.10 - resolution: "@babel/types@npm:7.22.10" - dependencies: - "@babel/helper-string-parser": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 - to-fast-properties: ^2.0.0 - checksum: 095c4f4b7503fa816e4094113f0ec2351ef96ff32012010b771693066ff628c7c664b21c6bd3fb93aeb46fe7c61f6b3a3c9e4ed0034d6a2481201c417371c8af - languageName: node - linkType: hard - -"@babel/types@npm:^7.22.15, @babel/types@npm:^7.22.17": - version: 7.22.17 - resolution: "@babel/types@npm:7.22.17" - dependencies: - "@babel/helper-string-parser": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.15 - to-fast-properties: ^2.0.0 - checksum: 7382220f6eb2548f2c867a98916c3aa8a6063498d5372e5d21d8d184ba354033defb72aeba5858c1b2b42177058b896a34a7dcbae5eccd47fb0104721efa909d +"@balena/dockerignore@npm:^1.0.2": + version: 1.0.2 + resolution: "@balena/dockerignore@npm:1.0.2" + checksum: 0d39f8fbcfd1a983a44bced54508471ab81aaaa40e2c62b46a9f97eac9d6b265790799f16919216db486331dedaacdde6ecbd6b7abe285d39bc50de111991699 languageName: node linkType: hard @@ -3894,6 +2972,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.6.0, @colors/colors@npm:^1.6.0": + version: 1.6.0 + resolution: "@colors/colors@npm:1.6.0" + checksum: aa209963e0c3218e80a4a20553ba8c0fbb6fa13140540b4e5f97923790be06801fc90172c1114fc8b7e888b3d012b67298cde6b9e81521361becfaee400c662f + languageName: node + linkType: hard + "@commitlint/cli@npm:17.7.1": version: 17.7.1 resolution: "@commitlint/cli@npm:17.7.1" @@ -3923,78 +3008,78 @@ __metadata: languageName: node linkType: hard -"@commitlint/config-validator@npm:^17.6.7": - version: 17.6.7 - resolution: "@commitlint/config-validator@npm:17.6.7" +"@commitlint/config-validator@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/config-validator@npm:17.8.1" dependencies: - "@commitlint/types": ^17.4.4 + "@commitlint/types": ^17.8.1 ajv: ^8.11.0 - checksum: e13e512ce9dc788f7ce1c84faf4d2e2d4d3b7c4dc18a7982ecbfc33faa5fe977793efdb868e228061d34ea8825cbbed5fc9e8e69fd5e4f0c0c08f60e21a9214e + checksum: 487051cc36a82ba50f217dfd26721f4fa26d8c4206ee5cb0debd2793aa950280f3ca5bd1a8738e9c71ca8508b58548918b43169c21219ca4cb67f5dcd1e49d9f languageName: node linkType: hard -"@commitlint/ensure@npm:^17.6.7": - version: 17.6.7 - resolution: "@commitlint/ensure@npm:17.6.7" +"@commitlint/ensure@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/ensure@npm:17.8.1" dependencies: - "@commitlint/types": ^17.4.4 + "@commitlint/types": ^17.8.1 lodash.camelcase: ^4.3.0 lodash.kebabcase: ^4.1.1 lodash.snakecase: ^4.1.1 lodash.startcase: ^4.4.0 lodash.upperfirst: ^4.3.1 - checksum: 1ffdce807dbb303e8fa215511a965375abeea2702f64b4f1c4d7823f1e231cb343e82c97633d12d3c89b4f71d2eaf28169db08b4f1d3b052c26c942f4b9d9380 + checksum: a4a5d3071df0e52dad0293c649c236f070c4fcd3380f11747a6f9b06b036adea281e557d117156e31313fbe18a7d71bf06e05e92776adbde7867190e1735bc43 languageName: node linkType: hard -"@commitlint/execute-rule@npm:^17.4.0": - version: 17.4.0 - resolution: "@commitlint/execute-rule@npm:17.4.0" - checksum: 17d8e56ab00bd45fdecb0ed33186d2020ce261250d6a516204b6509610b75af8c930e7226b1111af3de298db32a7e4d0ba2c9cc7ed67db5ba5159eeed634f067 +"@commitlint/execute-rule@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/execute-rule@npm:17.8.1" + checksum: 73354b5605931a71f727ee0262a5509277e92f134e2d704d44eafe4da7acb1cd2c7d084dcf8096cc0ac7ce83b023cc0ae8f79b17487b132ccc2e0b3920105a11 languageName: node linkType: hard "@commitlint/format@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/format@npm:17.4.4" + version: 17.8.1 + resolution: "@commitlint/format@npm:17.8.1" dependencies: - "@commitlint/types": ^17.4.4 + "@commitlint/types": ^17.8.1 chalk: ^4.1.0 - checksum: 832d9641129f2da8d32389b4a47db59d41eb1adfab742723972cad64b833c4af9e253f96757b27664fedae61644dd4c01d21f775773b45b604bd7f93b23a27d2 + checksum: 0481e4d49196c942d7723a1abd352c3c884ceb9f434fb4e64bfab71bc264e9b7c643a81069f20d2a035fca70261a472508d73b1a60fe378c60534ca6301408b6 languageName: node linkType: hard -"@commitlint/is-ignored@npm:^17.7.0": - version: 17.7.0 - resolution: "@commitlint/is-ignored@npm:17.7.0" +"@commitlint/is-ignored@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/is-ignored@npm:17.8.1" dependencies: - "@commitlint/types": ^17.4.4 + "@commitlint/types": ^17.8.1 semver: 7.5.4 - checksum: aa0b695d6e7bee5e732f96a2ff383347ff476eb48f9d3b4ed75b098cafa27e56da15563833d3cf4e1268fc26819180cd8b5bdc322b087073a63bc94f699944b2 + checksum: 26eb2f1a84a774625f3f6fe4fa978c57d81028ee6a6925ab3fb02981ac395f9584ab4a71af59c3f2ac84a06c775e3f52683c033c565d86271a7aa99c2eb6025c languageName: node linkType: hard "@commitlint/lint@npm:^17.7.0": - version: 17.7.0 - resolution: "@commitlint/lint@npm:17.7.0" + version: 17.8.1 + resolution: "@commitlint/lint@npm:17.8.1" dependencies: - "@commitlint/is-ignored": ^17.7.0 - "@commitlint/parse": ^17.7.0 - "@commitlint/rules": ^17.7.0 - "@commitlint/types": ^17.4.4 - checksum: 72765e0f2c6b78faa1c7ceb1050ef624d505deb0f95c5ac2ce1959c3ee8c2ce579d4f5aaf9434adf244727a97653be4d7fbc0d75cda2d8915e563ebeb7b886ae + "@commitlint/is-ignored": ^17.8.1 + "@commitlint/parse": ^17.8.1 + "@commitlint/rules": ^17.8.1 + "@commitlint/types": ^17.8.1 + checksum: 025712ad928098b3f94d8dc38566785f6c3eeba799725dbd935c5514141ea77b01e036fed1dbbf60cc954736f706ddbb85339751c43f16f5f3f94170d1decb2a languageName: node linkType: hard "@commitlint/load@npm:^17.7.1": - version: 17.7.1 - resolution: "@commitlint/load@npm:17.7.1" - dependencies: - "@commitlint/config-validator": ^17.6.7 - "@commitlint/execute-rule": ^17.4.0 - "@commitlint/resolve-extends": ^17.6.7 - "@commitlint/types": ^17.4.4 - "@types/node": 20.4.7 + version: 17.8.1 + resolution: "@commitlint/load@npm:17.8.1" + dependencies: + "@commitlint/config-validator": ^17.8.1 + "@commitlint/execute-rule": ^17.8.1 + "@commitlint/resolve-extends": ^17.8.1 + "@commitlint/types": ^17.8.1 + "@types/node": 20.5.1 chalk: ^4.1.0 cosmiconfig: ^8.0.0 cosmiconfig-typescript-loader: ^4.0.0 @@ -4003,91 +3088,91 @@ __metadata: lodash.uniq: ^4.5.0 resolve-from: ^5.0.0 ts-node: ^10.8.1 - typescript: ^4.6.4 || ^5.0.0 - checksum: 8d0e56b49a0e4dec7e8e28a2c6bc7ce985e6b8e10274aa20d0e3f6c2465fc9082d18f91bbe5c336594ebabcc4dc9668fdeaa039ef5bbfaf26ca0be423461ef61 + typescript: ^4.6.4 || ^5.2.2 + checksum: 5a9a9f0d4621a4cc61c965c3adc88d04ccac40640b022bb3bbad70ed4435bb0c103647a2e29e37fc3d68021dae041c937bee611fe2e5461bebe997640f4f626b languageName: node linkType: hard -"@commitlint/message@npm:^17.4.2": - version: 17.4.2 - resolution: "@commitlint/message@npm:17.4.2" - checksum: 55b6cfeb57f7c9f913e18821aa4d972a6b6faa78c62741390996151f99554396f6df68ccfee86c163d24d8c27a4dbbcb50ef03c2972ab0a7a21d89daa2f9a519 +"@commitlint/message@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/message@npm:17.8.1" + checksum: ee3ca9bf02828ea322becba47c67f7585aa3fd22b197eab69679961e67e3c7bdf56f6ef41cb3b831b521af7dabd305eb5d7ee053c8294531cc8ca64dbbff82fc languageName: node linkType: hard -"@commitlint/parse@npm:^17.7.0": - version: 17.7.0 - resolution: "@commitlint/parse@npm:17.7.0" +"@commitlint/parse@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/parse@npm:17.8.1" dependencies: - "@commitlint/types": ^17.4.4 + "@commitlint/types": ^17.8.1 conventional-changelog-angular: ^6.0.0 conventional-commits-parser: ^4.0.0 - checksum: d70d53932576fa30c078099fe9ab00190298ed6aec696648633ab16eb80386e0c1b407c44eb7c548b598573c260ed1bfa890dd8134166d28811f66ed436efbea + checksum: 5322ae049b43a329761063b6e698714593d84d874147ced6290c8d88a9ebea2ba8c660a5815392a731377ac26fbf6b215bb9b87d84d8b49cb47fa1c62d228b24 languageName: node linkType: hard "@commitlint/read@npm:^17.5.1": - version: 17.5.1 - resolution: "@commitlint/read@npm:17.5.1" + version: 17.8.1 + resolution: "@commitlint/read@npm:17.8.1" dependencies: - "@commitlint/top-level": ^17.4.0 - "@commitlint/types": ^17.4.4 + "@commitlint/top-level": ^17.8.1 + "@commitlint/types": ^17.8.1 fs-extra: ^11.0.0 git-raw-commits: ^2.0.11 minimist: ^1.2.6 - checksum: 62ee4f7a47b22a8571ae313bca36b418805a248f4986557f38f06317c44b6d18072889f95e7bc22bbb33a2f2b08236f74596ff28e3dbd0894249477a9df367c3 + checksum: 122f1842cb8b87b2c447383095420d077dcae6fbb4f871f8b05fa088f99d95d18a8c6675be2eb3e67bf7ff47a9990764261e3eebc5e474404f14e3379f48df42 languageName: node linkType: hard -"@commitlint/resolve-extends@npm:^17.6.7": - version: 17.6.7 - resolution: "@commitlint/resolve-extends@npm:17.6.7" +"@commitlint/resolve-extends@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/resolve-extends@npm:17.8.1" dependencies: - "@commitlint/config-validator": ^17.6.7 - "@commitlint/types": ^17.4.4 + "@commitlint/config-validator": ^17.8.1 + "@commitlint/types": ^17.8.1 import-fresh: ^3.0.0 lodash.mergewith: ^4.6.2 resolve-from: ^5.0.0 resolve-global: ^1.0.0 - checksum: 3717b4ccef6e46136f8d4a4b8d78d57184b4331401db07e27f89acb049a3903035bb2b0dbd4c07e3cdcc402cbe693b365c244a0da3df47e0f74cbf3ba76be9ec + checksum: c6fb7d3f263b876ff805396abad27bc514b1a69dcc634903c28782f4f3932eddc37221daa3264a45a5b82d28aa17a57c7bab4830c6efae741cc875f137366608 languageName: node linkType: hard -"@commitlint/rules@npm:^17.7.0": - version: 17.7.0 - resolution: "@commitlint/rules@npm:17.7.0" +"@commitlint/rules@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/rules@npm:17.8.1" dependencies: - "@commitlint/ensure": ^17.6.7 - "@commitlint/message": ^17.4.2 - "@commitlint/to-lines": ^17.4.0 - "@commitlint/types": ^17.4.4 + "@commitlint/ensure": ^17.8.1 + "@commitlint/message": ^17.8.1 + "@commitlint/to-lines": ^17.8.1 + "@commitlint/types": ^17.8.1 execa: ^5.0.0 - checksum: bc6af55cb8fab82baac450f87e02fa51d91f44855aadced92d74d05f9af99ccfd90b08c67355b53ca6b4b45f386854bcf52e1a4e5bc003665f4873e785eb7c70 + checksum: b284514a4b8dad6bcbbc91c7548d69d0bbe9fcbdb241c15f5f9da413e8577c19d11190f1d709b38487c49dc874359bd9d0b72ab39f91cce06191e4ddaf8ec84d languageName: node linkType: hard -"@commitlint/to-lines@npm:^17.4.0": - version: 17.4.0 - resolution: "@commitlint/to-lines@npm:17.4.0" - checksum: 841f90f606238e145ab4ba02940662d511fc04fe553619900152a8542170fe664031b95d820ffaeb8864d4851344278e662ef29637d763fc19fd828e0f8d139b +"@commitlint/to-lines@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/to-lines@npm:17.8.1" + checksum: ff175c202c89537301f32b6e13ebe6919ac782a6e109cb5f6136566d71555a54f6574caf4d674d3409d32fdea1b4a28518837632ca05c7557d4f18f339574e62 languageName: node linkType: hard -"@commitlint/top-level@npm:^17.4.0": - version: 17.4.0 - resolution: "@commitlint/top-level@npm:17.4.0" +"@commitlint/top-level@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/top-level@npm:17.8.1" dependencies: find-up: ^5.0.0 - checksum: 14cd77e982d2dd7989718dafdbf7a2168a5fb387005e0686c2dfa9ffc36bb9a749e5d80a151884459e4d8c88564339688dca26e9c711abe043beeb3f30c3dfd6 + checksum: 25c8a6f4026c705a5ad4d9358eae7558734f549623da1c5f44cba8d6bc495f20d3ad05418febb8dca4f6b63f40bf44763007a14ab7209c435566843be114e7fc languageName: node linkType: hard -"@commitlint/types@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/types@npm:17.4.4" +"@commitlint/types@npm:^17.4.4, @commitlint/types@npm:^17.8.1": + version: 17.8.1 + resolution: "@commitlint/types@npm:17.8.1" dependencies: chalk: ^4.1.0 - checksum: 03c52429052d161710896d198000196bd2e60be0fd71459b22133dd83dee43e8d05ea8ee703c8369823bc40f77a54881b80d8aa4368ac52aea7f30fb234b73d2 + checksum: a4cfa8c417aa0209694b96da04330282e41150caae1e1d0cec596ea34e3ce15afb84b3263abe5b89758ec1f3f71a9de0ee2d593df66db17b283127dd5e7cd6ac languageName: node linkType: hard @@ -4154,9 +3239,9 @@ __metadata: linkType: hard "@cspell/dict-ada@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-ada@npm:2.0.0" - checksum: 80dc84c2101d37f8ed84e26502374295bb8a3ed7bb907ff76405dc41f6e3017fe0465c0ffe0fd951a07db8388991303df175508d7620fcc2ecfb4bccbe5d1c2a + version: 2.0.1 + resolution: "@cspell/dict-ada@npm:2.0.1" + checksum: 3e29199a5c65cdc2e9e5bb812b4d11a65034d15e74485dd644eef5525e1ad839af3df583aac1097b8571740db5107a21697d46e5c49e4064c8988e537a849793 languageName: node linkType: hard @@ -4203,16 +3288,16 @@ __metadata: linkType: hard "@cspell/dict-css@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-css@npm:2.0.0" - checksum: 6397d14f7f867a960b8f55acb74e4957f4c74f276117076b9cd53cc91a672622a4affc68fec8281cda507b3d1746ba021be8c27dabecff1c744430bb19d92cd5 + version: 2.1.0 + resolution: "@cspell/dict-css@npm:2.1.0" + checksum: 7cf5ada8e72c3bfa12192b1d5d34d23eb3711b5d374cd8653007af157640cd0610f3760821f6a4f29cec82197450563303c5829c2b38400eb0373b87a2dbda7b languageName: node linkType: hard "@cspell/dict-dart@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-dart@npm:1.1.0" - checksum: fce2a3a7c2566346d3658a3531237e78bacb7873a9a85944bba6f57aa8af9525ad278a498ba80424642493071985eb63db0409beec2976aacf88582a874e7d61 + version: 1.1.1 + resolution: "@cspell/dict-dart@npm:1.1.1" + checksum: 94594c6605225b516d325b9b13459344f1c95281d539e11fe9b002af04750b6d2f7c191caffa396cb6d3b9dd97954f1d17efcc2b8d4dd2163f9f26d50cb89b73 languageName: node linkType: hard @@ -4252,16 +3337,16 @@ __metadata: linkType: hard "@cspell/dict-filetypes@npm:^2.0.1": - version: 2.0.1 - resolution: "@cspell/dict-filetypes@npm:2.0.1" - checksum: d787ada0d08fd659b65c0310993973695834b23d8ca53845ec726bd517973f84b14a9e38d38886c821a9fbf010faf1681f157df506934769df813c22b45d06d7 + version: 2.1.1 + resolution: "@cspell/dict-filetypes@npm:2.1.1" + checksum: 37f03c40f4c2472c73ea734741303d3914ec4234eee08136b86b9224bb91234778d49a068c00303ed8f221dc042a9245e6d80adebd0ce8d173e256fa8484b935 languageName: node linkType: hard "@cspell/dict-fonts@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-fonts@npm:2.0.0" - checksum: d6336490137f8dbb7166ae3642348176dd5b8c81d01216931dc617cd0e9f78466dbed19c49b714fedf697417a5c4e9f6fbe92ca2131fa38c360890171927df72 + version: 2.1.0 + resolution: "@cspell/dict-fonts@npm:2.1.0" + checksum: 121eaab7406af7aa07de6052d0dbc277279e35da6720a14979009af71d9de393cc5c3f7359f7288c73eced8caef6fdd06e5bad9bbf650d107a21746fb6dd1591 languageName: node linkType: hard @@ -4287,9 +3372,9 @@ __metadata: linkType: hard "@cspell/dict-haskell@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-haskell@npm:2.0.0" - checksum: 973f3c7908d727cc5f231b15ce534f93fea208a58d3f1b1f1dadc2cae32a0d5ed4528f03c6c0efdebe3decab0c0d00f1c5143612c711cdc063eaac249d78e85e + version: 2.0.1 + resolution: "@cspell/dict-haskell@npm:2.0.1" + checksum: 7f960b16822804a4ab2be6482083a6dc2ecfc8ff32f3be630aa57cdf979c884f005a97fe8042c02f5b8ec90a89e7b80c3508535d8f5558e6b6fc435e95f0b957 languageName: node linkType: hard @@ -4322,9 +3407,9 @@ __metadata: linkType: hard "@cspell/dict-lorem-ipsum@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-lorem-ipsum@npm:2.0.0" - checksum: 5d6f2ed5db1436fa34cb6e44195d6ef4bd2cddea449cdcd92598e236fc0a35f12edc45ed7b653dc1eaf46e54a9f8b41f3269bf2530b530b0805b0867cfed60e9 + version: 2.0.1 + resolution: "@cspell/dict-lorem-ipsum@npm:2.0.1" + checksum: 7f50518a48b809f7c2b70c2bcd01d2a3cb2d89288497dbe9df3c7fc91ee8d8ec62ec3ac8adfa8191d8a4f8a0e7a51bc40333f40b8dcc1661c09c5d320b38b2ed languageName: node linkType: hard @@ -4364,9 +3449,9 @@ __metadata: linkType: hard "@cspell/dict-public-licenses@npm:^1.0.4": - version: 1.0.4 - resolution: "@cspell/dict-public-licenses@npm:1.0.4" - checksum: fdd0418b396c4df89d5527cb5f3c534dc404e8b979ebb8f628ef665a551bf9618ddcb589a365bbaa000655dd90b683b11899240b010b4475e288f96492bc56c3 + version: 1.0.6 + resolution: "@cspell/dict-public-licenses@npm:1.0.6" + checksum: e679c6151623b174cc88c855a9bff3b5d5fff7956d919b72a0a3f7c71aed2a90fbea06d0afd3b79ab78ca308b3ef33051a640dab77891c27a36665fc441bd73e languageName: node linkType: hard @@ -4378,9 +3463,9 @@ __metadata: linkType: hard "@cspell/dict-r@npm:^1.0.2": - version: 1.0.2 - resolution: "@cspell/dict-r@npm:1.0.2" - checksum: b5c0425d496ba8d07b53dda3702490a1d4866b897c45e53f6586bf2d40870004497c5a0cf3b463d7837a2347784264e24ff1fa6c2a78049dc616d6e6cf8ed4ee + version: 1.0.3 + resolution: "@cspell/dict-r@npm:1.0.3" + checksum: 47fe5d64ba36328c580ada9f2f8e5b34f3ee6ca03065da8b355b7aa7a6a364e276f39ea2103eae3f22bf95335490181e4425b42e2d8f51b3224a80b48f36feb1 languageName: node linkType: hard @@ -4392,9 +3477,9 @@ __metadata: linkType: hard "@cspell/dict-rust@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-rust@npm:2.0.0" - checksum: 1ae8f6a8cb0c3bac78fd8c7a7d6f3410ea7f20a13ceae456cacaa30fabb3d51b14a88d296a9b4f4479797815a82ad60df7b4f5d59169a389952bdb96e6c25f81 + version: 2.0.1 + resolution: "@cspell/dict-rust@npm:2.0.1" + checksum: b1b866869a4ba950e688d8676308acd49b469e648a9bd7804f7932a1bf666556ddc814b661826369a79305719e21e37e9902c4100c427abf91cd98006ec6da03 languageName: node linkType: hard @@ -4413,16 +3498,16 @@ __metadata: linkType: hard "@cspell/dict-swift@npm:^1.0.2": - version: 1.0.2 - resolution: "@cspell/dict-swift@npm:1.0.2" - checksum: afbf6da336d1cdd60b0781f1a9266d634bbefabfec0a7b9dfd5b52110855c9b21f04ceaba90c9acda50a2ddc905efa1c79895299d205223a1e77f99efbde7162 + version: 1.0.3 + resolution: "@cspell/dict-swift@npm:1.0.3" + checksum: 030e91f3315bc834a968fe0a5a7007e4229535fa541689661917698c18c7e76b35d3a247a8ef6467b012666bdddd19e40dc325664bf29891eabf7cad7636f0bc languageName: node linkType: hard "@cspell/dict-typescript@npm:^2.0.0": - version: 2.0.0 - resolution: "@cspell/dict-typescript@npm:2.0.0" - checksum: 00a862d11dd0beb9b4725ba0326383445d31083942e4640174e0e9639fcfd153bfd9b6e2e2499f816e3c52e7bd2b15f0071a8198a83820c9469a81c38fbeb629 + version: 2.0.2 + resolution: "@cspell/dict-typescript@npm:2.0.2" + checksum: 68575d5ea31563109d7c3d121bdd31367e9b982b7c68f378fb3d1364a0a435f175bba217b4e3dcd51413b8bfb2ff2b1e950dc5c2a63889406f3a3fdffff8882b languageName: node linkType: hard @@ -4433,22 +3518,6 @@ __metadata: languageName: node linkType: hard -"@cspotcode/source-map-consumer@npm:0.8.0": - version: 0.8.0 - resolution: "@cspotcode/source-map-consumer@npm:0.8.0" - checksum: c0c16ca3d2f58898f1bd74c4f41a189dbcc202e642e60e489cbcc2e52419c4e89bdead02c886a12fb13ea37798ede9e562b2321df997ebc210ae9bd881561b4e - languageName: node - linkType: hard - -"@cspotcode/source-map-support@npm:0.7.0": - version: 0.7.0 - resolution: "@cspotcode/source-map-support@npm:0.7.0" - dependencies: - "@cspotcode/source-map-consumer": 0.8.0 - checksum: 9faddda7757cd778b5fd6812137b2cc265810043680d6399acc20441668fafcdc874053be9dccd0d9110087287bfad27eb3bf342f72bceca9aa9059f5d0c4be8 - languageName: node - linkType: hard - "@cspotcode/source-map-support@npm:^0.8.0": version: 0.8.1 resolution: "@cspotcode/source-map-support@npm:0.8.1" @@ -4459,9 +3528,9 @@ __metadata: linkType: hard "@csstools/normalize.css@npm:*": - version: 12.0.0 - resolution: "@csstools/normalize.css@npm:12.0.0" - checksum: fbef0f7fe4edbc3ce31b41257f0fa06e0442f11260e41c082a98de9b824997786a16900e7a5c0f4ca8f736dcd25dfd01c153d1c994a07d42c93c0a526ce0774d + version: 12.1.1 + resolution: "@csstools/normalize.css@npm:12.1.1" + checksum: a356ee0fcb922f3e0bc23df4468bb4f27fc26c767e25359c079455fe30301d253d8a60c443859b04350c8174393edbb11bad2a9ef2f8cce0e371f6abf6c7ef36 languageName: node linkType: hard @@ -4642,20 +3711,13 @@ __metadata: languageName: node linkType: hard -"@discoveryjs/json-ext@npm:0.5.7": +"@discoveryjs/json-ext@npm:0.5.7, @discoveryjs/json-ext@npm:^0.5.0": version: 0.5.7 resolution: "@discoveryjs/json-ext@npm:0.5.7" checksum: 2176d301cc258ea5c2324402997cf8134ebb212469c0d397591636cea8d3c02f2b3cf9fd58dcb748c7a0dade77ebdc1b10284fa63e608c033a1db52fddc69918 languageName: node linkType: hard -"@discoveryjs/json-ext@npm:^0.5.0": - version: 0.5.6 - resolution: "@discoveryjs/json-ext@npm:0.5.6" - checksum: e97df618511fb202dffa2eb0d23e17dfb02943a70e5bc38f6b9603ad1cb1d6b525aa2b07ff9fb00b041abe425b341146ddd9e487f1e35ddadc8c6b8c56358ae0 - languageName: node - linkType: hard - "@emotion/babel-plugin@npm:^11.11.0": version: 11.11.0 resolution: "@emotion/babel-plugin@npm:11.11.0" @@ -4712,13 +3774,13 @@ __metadata: linkType: hard "@emotion/react@npm:^11.11.1": - version: 11.11.1 - resolution: "@emotion/react@npm:11.11.1" + version: 11.11.3 + resolution: "@emotion/react@npm:11.11.3" dependencies: "@babel/runtime": ^7.18.3 "@emotion/babel-plugin": ^11.11.0 "@emotion/cache": ^11.11.0 - "@emotion/serialize": ^1.1.2 + "@emotion/serialize": ^1.1.3 "@emotion/use-insertion-effect-with-fallbacks": ^1.0.1 "@emotion/utils": ^1.2.1 "@emotion/weak-memoize": ^0.3.1 @@ -4728,20 +3790,20 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: aec3c36650f5f0d3d4445ff44d73dd88712b1609645b6af3e6d08049cfbc51f1785fe13dea1a1d4ab1b0800d68f2339ab11e459687180362b1ef98863155aae5 + checksum: 2e4b223591569f0a41686d5bd72dc8778629b7be33267e4a09582979e6faee4d7218de84e76294ed827058d4384d75557b5d71724756539c1f235e9a69e62b2e languageName: node linkType: hard -"@emotion/serialize@npm:^1.1.2": - version: 1.1.2 - resolution: "@emotion/serialize@npm:1.1.2" +"@emotion/serialize@npm:^1.1.2, @emotion/serialize@npm:^1.1.3": + version: 1.1.3 + resolution: "@emotion/serialize@npm:1.1.3" dependencies: "@emotion/hash": ^0.9.1 "@emotion/memoize": ^0.8.1 "@emotion/unitless": ^0.8.1 "@emotion/utils": ^1.2.1 csstype: ^3.0.2 - checksum: 413c352e657f1b5e27ea6437b3ef7dcc3860669b7ae17fd5c18bfbd44e033af1acc56b64d252284a813ca4f3b3e1b0841c42d3fb08e02d2df56fd3cd63d72986 + checksum: 5a756ce7e2692322683978d8ed2e84eadd60bd6f629618a82c5018c84d98684b117e57fad0174f68ec2ec0ac089bb2e0bcc8ea8c2798eb904b6d3236aa046063 languageName: node linkType: hard @@ -5179,17 +4241,10 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.5.1": - version: 4.6.2 - resolution: "@eslint-community/regexpp@npm:4.6.2" - checksum: a3c341377b46b54fa228f455771b901d1a2717f95d47dcdf40199df30abc000ba020f747f114f08560d119e979d882a94cf46cfc51744544d54b00319c0f2724 - languageName: node - linkType: hard - -"@eslint-community/regexpp@npm:^4.6.1": - version: 4.9.1 - resolution: "@eslint-community/regexpp@npm:4.9.1" - checksum: 06fb839e9c756f6375cc545c2f2e05a0a64576bd6370e8e3c07983fd29a3d6e164ef4aa48a361f7d27e6713ab79c83053ff6a2ccb78748bc955e344279c4a3b6 +"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.5.1, @eslint-community/regexpp@npm:^4.6.1": + version: 4.10.0 + resolution: "@eslint-community/regexpp@npm:4.10.0" + checksum: 2a6e345429ea8382aaaf3a61f865cae16ed44d31ca917910033c02dc00d505d939f10b81e079fa14d43b51499c640138e153b7e40743c4c094d9df97d4e56f7b languageName: node linkType: hard @@ -5210,9 +4265,9 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.2": - version: 2.1.2 - resolution: "@eslint/eslintrc@npm:2.1.2" +"@eslint/eslintrc@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/eslintrc@npm:2.1.4" dependencies: ajv: ^6.12.4 debug: ^4.3.2 @@ -5223,14 +4278,14 @@ __metadata: js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: bc742a1e3b361f06fedb4afb6bf32cbd27171292ef7924f61c62f2aed73048367bcc7ac68f98c06d4245cd3fabc43270f844e3c1699936d4734b3ac5398814a7 + checksum: 10957c7592b20ca0089262d8c2a8accbad14b4f6507e35416c32ee6b4dbf9cad67dfb77096bbd405405e9ada2b107f3797fe94362e1c55e0b09d6e90dd149127 languageName: node linkType: hard -"@eslint/js@npm:8.48.0": - version: 8.48.0 - resolution: "@eslint/js@npm:8.48.0" - checksum: b2755f9c0ee810c886eba3c50dcacb184ba5a5cd1cbc01988ee506ad7340653cae0bd55f1d95c64b56dfc6d25c2caa7825335ffd2c50165bae9996fe0f396851 +"@eslint/js@npm:8.56.0": + version: 8.56.0 + resolution: "@eslint/js@npm:8.56.0" + checksum: 5804130574ef810207bdf321c265437814e7a26f4e6fac9b496de3206afd52f533e09ec002a3be06cd9adcc9da63e727f1883938e663c4e4751c007d5b58e539 languageName: node linkType: hard @@ -5244,43 +4299,33 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/common@npm:4.0.0, @ethereumjs/common@npm:^4.0.0": - version: 4.0.0 - resolution: "@ethereumjs/common@npm:4.0.0" - dependencies: - "@ethereumjs/util": ^9.0.0 - crc: ^4.3.2 - checksum: 3fa2f6a55ff5a2406241fc1ffbdc6f60cfa139edaf9afac2164d25ca35e31a0d2901de40a517f42e5a466aab316f9187c5b787f33f3260e746b13209c910c67f - languageName: node - linkType: hard - -"@ethereumjs/common@npm:^2.4.0": - version: 2.6.2 - resolution: "@ethereumjs/common@npm:2.6.2" +"@ethereumjs/common@npm:2.6.5, @ethereumjs/common@npm:^2.4.0, @ethereumjs/common@npm:^2.5.0, @ethereumjs/common@npm:^2.6.4": + version: 2.6.5 + resolution: "@ethereumjs/common@npm:2.6.5" dependencies: crc-32: ^1.2.0 - ethereumjs-util: ^7.1.4 - checksum: caa087115b5c113f6c024a5a191877ce2372edbd548ba38560505cd00165d0979c512eef9ed8242fb10f1f3391c8ac838ddc178c67008876e7192841843a84c4 + ethereumjs-util: ^7.1.5 + checksum: 0143386f267ef01b7a8bb1847596f964ad58643c084e5fd8e3a0271a7bf8428605dbf38cbb92c84f6622080ad095abeb765f178c02d86ec52abf9e8a4c0e4ecf languageName: node linkType: hard -"@ethereumjs/common@npm:^2.5.0": - version: 2.6.4 - resolution: "@ethereumjs/common@npm:2.6.4" +"@ethereumjs/common@npm:4.0.0": + version: 4.0.0 + resolution: "@ethereumjs/common@npm:4.0.0" dependencies: - crc-32: ^1.2.0 - ethereumjs-util: ^7.1.4 - checksum: 2d3ef9e76c2dfb9fd1fc390834107ffd49e7074b893f3985f3d5996e217064cfe3617b16aff42fb7e8631a21ae32286ddf8ec21251589c4ac43d5b3c03217f9f + "@ethereumjs/util": ^9.0.0 + crc: ^4.3.2 + checksum: 3fa2f6a55ff5a2406241fc1ffbdc6f60cfa139edaf9afac2164d25ca35e31a0d2901de40a517f42e5a466aab316f9187c5b787f33f3260e746b13209c910c67f languageName: node linkType: hard -"@ethereumjs/common@npm:^2.6.4": - version: 2.6.5 - resolution: "@ethereumjs/common@npm:2.6.5" +"@ethereumjs/common@npm:^4.0.0": + version: 4.1.0 + resolution: "@ethereumjs/common@npm:4.1.0" dependencies: - crc-32: ^1.2.0 - ethereumjs-util: ^7.1.5 - checksum: 0143386f267ef01b7a8bb1847596f964ad58643c084e5fd8e3a0271a7bf8428605dbf38cbb92c84f6622080ad095abeb765f178c02d86ec52abf9e8a4c0e4ecf + "@ethereumjs/util": ^9.0.1 + crc: ^4.3.2 + checksum: 8494e6d179fe3949d8d8285badfb7be9ade71864e477da5dbf432ecc8046a58a0db73e99b5543c807fdc1b3f5959ed9c85ba99536b2f4753e08eaeb096af4beb languageName: node linkType: hard @@ -5293,12 +4338,12 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/rlp@npm:^5.0.0": - version: 5.0.0 - resolution: "@ethereumjs/rlp@npm:5.0.0" +"@ethereumjs/rlp@npm:^5.0.0, @ethereumjs/rlp@npm:^5.0.1": + version: 5.0.1 + resolution: "@ethereumjs/rlp@npm:5.0.1" bin: - rlp: bin/rlp - checksum: 86d42f88945f25fc2874f80efc4d4c37cc85fc375920134392b658c0140346fb22b815e73680b87d1fea3ae55ad6ca42ea9fec7150583be496577b01bffb9e58 + rlp: bin/rlp.cjs + checksum: eddff08718c3b8312007ef51a951dff6b2c1152f9f9ea6fb9eec65d50caf3fa53f5894d79d6d450eef70a5ef3b0688be044912096aa8d263345a0d9debb4d477 languageName: node linkType: hard @@ -5312,6 +4357,16 @@ __metadata: languageName: node linkType: hard +"@ethereumjs/tx@npm:3.5.2, @ethereumjs/tx@npm:^3.3.2": + version: 3.5.2 + resolution: "@ethereumjs/tx@npm:3.5.2" + dependencies: + "@ethereumjs/common": ^2.6.4 + ethereumjs-util: ^7.1.5 + checksum: a34a7228a623b40300484d15875b9f31f0a612cfeab64a845f6866cf0bfe439519e9455ac6396149f29bc527cf0ee277ace082ae013a1075dcbf7193220a0146 + languageName: node + linkType: hard + "@ethereumjs/tx@npm:5.0.0": version: 5.0.0 resolution: "@ethereumjs/tx@npm:5.0.0" @@ -5329,16 +4384,6 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/tx@npm:^3.3.2": - version: 3.5.2 - resolution: "@ethereumjs/tx@npm:3.5.2" - dependencies: - "@ethereumjs/common": ^2.6.4 - ethereumjs-util: ^7.1.5 - checksum: a34a7228a623b40300484d15875b9f31f0a612cfeab64a845f6866cf0bfe439519e9455ac6396149f29bc527cf0ee277ace082ae013a1075dcbf7193220a0146 - languageName: node - linkType: hard - "@ethereumjs/util@npm:^8.1.0": version: 8.1.0 resolution: "@ethereumjs/util@npm:8.1.0" @@ -5350,18 +4395,18 @@ __metadata: languageName: node linkType: hard -"@ethereumjs/util@npm:^9.0.0": - version: 9.0.0 - resolution: "@ethereumjs/util@npm:9.0.0" +"@ethereumjs/util@npm:^9.0.0, @ethereumjs/util@npm:^9.0.1": + version: 9.0.1 + resolution: "@ethereumjs/util@npm:9.0.1" dependencies: - "@ethereumjs/rlp": ^5.0.0 + "@ethereumjs/rlp": ^5.0.1 ethereum-cryptography: ^2.1.2 peerDependencies: - c-kzg: ^2.1.0 + c-kzg: ^2.1.2 peerDependenciesMeta: c-kzg: optional: true - checksum: c0e2a50aac614a8167df060f0fe6d7b9805adebd83df81a26b596c92eb76454e2e6f25d8f5b9e49cb629355020a8a07feb4d6c1b8238990dcf82e256153bf328 + checksum: 3569dcc0106f5e962e62811be66b5f49529c9d1a29671908568528b2b45d6cae03cb497fc755a1ae4144170f749133308494be42255ac98b61c930d143ed26f4 languageName: node linkType: hard @@ -5382,7 +4427,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.6.3, @ethersproject/abi@npm:^5.7.0": +"@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.1.2, @ethersproject/abi@npm:^5.6.3, @ethersproject/abi@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/abi@npm:5.7.0" dependencies: @@ -5399,23 +4444,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abi@npm:^5.1.2": - version: 5.5.0 - resolution: "@ethersproject/abi@npm:5.5.0" - dependencies: - "@ethersproject/address": ^5.5.0 - "@ethersproject/bignumber": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/constants": ^5.5.0 - "@ethersproject/hash": ^5.5.0 - "@ethersproject/keccak256": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - "@ethersproject/strings": ^5.5.0 - checksum: cb539220c64cb5a095cfd75a7e5a5c101759644af566dbf1b2a028a9609643d1eaa8fcff720adfb7f2b5527864be787be90d4df4f2c0c385a84b3215522bb61b - languageName: node - linkType: hard - "@ethersproject/abstract-provider@npm:5.7.0, @ethersproject/abstract-provider@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/abstract-provider@npm:5.7.0" @@ -5431,21 +4459,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abstract-provider@npm:^5.5.0": - version: 5.5.1 - resolution: "@ethersproject/abstract-provider@npm:5.5.1" - dependencies: - "@ethersproject/bignumber": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/networks": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - "@ethersproject/transactions": ^5.5.0 - "@ethersproject/web": ^5.5.0 - checksum: 73ee68b2320cd436b57a67051606b6d062ddebed6fd4c52b30c02134b81e43aca9bb1815c0956f3c8f519ddbaf9710f349021d1f054f11a88361e0c3f1a9b9f2 - languageName: node - linkType: hard - "@ethersproject/abstract-signer@npm:5.7.0, @ethersproject/abstract-signer@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/abstract-signer@npm:5.7.0" @@ -5459,20 +4472,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abstract-signer@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/abstract-signer@npm:5.5.0" - dependencies: - "@ethersproject/abstract-provider": ^5.5.0 - "@ethersproject/bignumber": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - checksum: d0de55b8b49b43de9976cc2fd73deff33700cea088e50ae46aa71cc0962d5f770f782be584541230253ecc125e238e2123abf11f692d7b019a1e43e6526b2197 - languageName: node - linkType: hard - -"@ethersproject/address@npm:5.7.0, @ethersproject/address@npm:^5.7.0": +"@ethersproject/address@npm:5.7.0, @ethersproject/address@npm:^5.0.4, @ethersproject/address@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/address@npm:5.7.0" dependencies: @@ -5485,19 +4485,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/address@npm:^5.0.4, @ethersproject/address@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/address@npm:5.5.0" - dependencies: - "@ethersproject/bignumber": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/keccak256": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/rlp": ^5.5.0 - checksum: fa4d2b7ad67d1f1bffc017ccf99274fc455d0afae25ab718c822aa4472fbbf544d1a7bf87c1e75b1f97f9018564a02fd05332dd6daab48dd1efc00b6fe12d45e - languageName: node - linkType: hard - "@ethersproject/base64@npm:5.7.0, @ethersproject/base64@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/base64@npm:5.7.0" @@ -5507,15 +4494,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/base64@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/base64@npm:5.5.0" - dependencies: - "@ethersproject/bytes": ^5.5.0 - checksum: 2d0904093b8e552e201c1b0f1f28ba1b0c950ee4969d626f795241349e4d50cdefd4accf66da50c31a82d625c9b52d839411fb2ed731ede3f8c8dbe8bfee61b9 - languageName: node - linkType: hard - "@ethersproject/basex@npm:5.7.0, @ethersproject/basex@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/basex@npm:5.7.0" @@ -5526,7 +4504,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/bignumber@npm:5.7.0, @ethersproject/bignumber@npm:^5.7.0": +"@ethersproject/bignumber@npm:5.7.0, @ethersproject/bignumber@npm:^5.0.7, @ethersproject/bignumber@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/bignumber@npm:5.7.0" dependencies: @@ -5537,18 +4515,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/bignumber@npm:^5.0.7, @ethersproject/bignumber@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/bignumber@npm:5.5.0" - dependencies: - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - bn.js: ^4.11.9 - checksum: b18aa583130a9f66d13a998e13f06d6bbd039ae222208c92b7e3836831678b67d8deb07754c221f0102ad7418929f97a5e54fe37400215cbfc012dda2ca0fcff - languageName: node - linkType: hard - -"@ethersproject/bytes@npm:5.7.0, @ethersproject/bytes@npm:^5.7.0": +"@ethersproject/bytes@npm:5.7.0, @ethersproject/bytes@npm:^5.0.4, @ethersproject/bytes@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/bytes@npm:5.7.0" dependencies: @@ -5557,16 +4524,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/bytes@npm:^5.0.4, @ethersproject/bytes@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/bytes@npm:5.5.0" - dependencies: - "@ethersproject/logger": ^5.5.0 - checksum: ca55e208ccf4bf5d9a7a1fd9e39035c328a3e5b549657ef58530def787ed750d74d91eeb2ed7cd4bfdb8b1a2a319d6e48abb1d7b3b48a1f59a5ab33adbbc8176 - languageName: node - linkType: hard - -"@ethersproject/constants@npm:5.7.0, @ethersproject/constants@npm:^5.7.0": +"@ethersproject/constants@npm:5.7.0, @ethersproject/constants@npm:^5.0.4, @ethersproject/constants@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/constants@npm:5.7.0" dependencies: @@ -5575,15 +4533,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/constants@npm:^5.0.4, @ethersproject/constants@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/constants@npm:5.5.0" - dependencies: - "@ethersproject/bignumber": ^5.5.0 - checksum: 20519ec5abcbff6d2a7f1260f58b33e1c472abdfb2ee3d5428d08091484fed572f8f873b1cb0410f9248f92512016bbf680324f9f2a537b5f65413a6a1359fd3 - languageName: node - linkType: hard - "@ethersproject/contracts@npm:5.7.0": version: 5.7.0 resolution: "@ethersproject/contracts@npm:5.7.0" @@ -5602,7 +4551,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/hash@npm:5.7.0, @ethersproject/hash@npm:^5.7.0": +"@ethersproject/hash@npm:5.7.0, @ethersproject/hash@npm:^5.0.4, @ethersproject/hash@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/hash@npm:5.7.0" dependencies: @@ -5619,22 +4568,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/hash@npm:^5.0.4, @ethersproject/hash@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/hash@npm:5.5.0" - dependencies: - "@ethersproject/abstract-signer": ^5.5.0 - "@ethersproject/address": ^5.5.0 - "@ethersproject/bignumber": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/keccak256": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - "@ethersproject/strings": ^5.5.0 - checksum: 38e8801553a45eeabb4aa72f5a6eeb9dd7a9c5bb44b1691b6630ca2e991e0319871d7d17ffbcdfdca921f9e8240ee915de548bce1527738b6dc76231cbb52044 - languageName: node - linkType: hard - "@ethersproject/hdnode@npm:5.7.0, @ethersproject/hdnode@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/hdnode@npm:5.7.0" @@ -5676,7 +4609,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/keccak256@npm:5.7.0, @ethersproject/keccak256@npm:^5.7.0": +"@ethersproject/keccak256@npm:5.7.0, @ethersproject/keccak256@npm:^5.0.3, @ethersproject/keccak256@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/keccak256@npm:5.7.0" dependencies: @@ -5686,30 +4619,13 @@ __metadata: languageName: node linkType: hard -"@ethersproject/keccak256@npm:^5.0.3, @ethersproject/keccak256@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/keccak256@npm:5.5.0" - dependencies: - "@ethersproject/bytes": ^5.5.0 - js-sha3: 0.8.0 - checksum: 587590c8448f3e1db52320d4fecc807d94a8ee83253110c076c7f8ce3b3127f7fd56c302f1ee80e6bc2764a4949a490ee5143344fabfad2a65020dc2f5896a85 - languageName: node - linkType: hard - -"@ethersproject/logger@npm:5.7.0, @ethersproject/logger@npm:^5.7.0": +"@ethersproject/logger@npm:5.7.0, @ethersproject/logger@npm:^5.0.5, @ethersproject/logger@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/logger@npm:5.7.0" checksum: 075ab2f605f1fd0813f2e39c3308f77b44a67732b36e712d9bc085f22a84aac4da4f71b39bee50fe78da3e1c812673fadc41180c9970fe5e486e91ea17befe0d languageName: node linkType: hard -"@ethersproject/logger@npm:^5.0.5, @ethersproject/logger@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/logger@npm:5.5.0" - checksum: 61d813ef8b9049e406f0b0b095f40a3809f8097dab4aaac980d91866a0e2718582d8e9d68b4280c7935546d3116cbc93a635d8f82e2a7963d6e2a1d43f29eb9a - languageName: node - linkType: hard - "@ethersproject/networks@npm:5.7.1, @ethersproject/networks@npm:^5.7.0": version: 5.7.1 resolution: "@ethersproject/networks@npm:5.7.1" @@ -5719,15 +4635,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/networks@npm:^5.5.0": - version: 5.5.2 - resolution: "@ethersproject/networks@npm:5.5.2" - dependencies: - "@ethersproject/logger": ^5.5.0 - checksum: d6768591ac792daf328d68f3f161d8be6d71b71495698c8d1b9fe6155ae460c9ce97a5003c7799efe89d17ede117a86153313fda4a8a1bd97eda2be6aa646923 - languageName: node - linkType: hard - "@ethersproject/pbkdf2@npm:5.7.0, @ethersproject/pbkdf2@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/pbkdf2@npm:5.7.0" @@ -5738,7 +4645,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/properties@npm:5.7.0, @ethersproject/properties@npm:^5.7.0": +"@ethersproject/properties@npm:5.7.0, @ethersproject/properties@npm:^5.0.3, @ethersproject/properties@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/properties@npm:5.7.0" dependencies: @@ -5747,15 +4654,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/properties@npm:^5.0.3, @ethersproject/properties@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/properties@npm:5.5.0" - dependencies: - "@ethersproject/logger": ^5.5.0 - checksum: 1e71a13291e87c3be5fc0fa5e96a1e6043fd6bc3c3507f2cdd21f76ce73a7c05a973d6f63934943227c806a6b4bdeb1a719a6a12b79529ab002a0c0bf509363d - languageName: node - linkType: hard - "@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.7.1, @ethersproject/providers@npm:^5.7.2": version: 5.7.2 resolution: "@ethersproject/providers@npm:5.7.2" @@ -5804,16 +4702,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/rlp@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/rlp@npm:5.5.0" - dependencies: - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - checksum: 6ffb619b1a3d3ca5cb8cb52ee586bb16061a083d77751b98b3b822a7af170344034bcc819f78d1cb4f4ea80bd9a504cb6d55cdb1356b5a14af24bacfb74f837d - languageName: node - linkType: hard - "@ethersproject/sha2@npm:5.7.0, @ethersproject/sha2@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/sha2@npm:5.7.0" @@ -5839,20 +4727,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/signing-key@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/signing-key@npm:5.5.0" - dependencies: - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - bn.js: ^4.11.9 - elliptic: 6.5.4 - hash.js: 1.1.7 - checksum: 28ba124eaff7fb69f256950957e9562781c060a7f998750cce003819bed25018cbc4cde052d93913bbfa419ce905b1c89a326dac90a96cf00a97924e163c116b - languageName: node - linkType: hard - "@ethersproject/solidity@npm:5.7.0": version: 5.7.0 resolution: "@ethersproject/solidity@npm:5.7.0" @@ -5867,7 +4741,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/strings@npm:5.7.0, @ethersproject/strings@npm:^5.7.0": +"@ethersproject/strings@npm:5.7.0, @ethersproject/strings@npm:^5.0.4, @ethersproject/strings@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/strings@npm:5.7.0" dependencies: @@ -5878,18 +4752,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/strings@npm:^5.0.4, @ethersproject/strings@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/strings@npm:5.5.0" - dependencies: - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/constants": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - checksum: b17c0a3488b7a829317f6fb842af4f848f183083741846a3e05cd79fd8b76979e0211a060f03e9a528f79af7a4b077ac4421ed03194a73b738b2804969acd202 - languageName: node - linkType: hard - -"@ethersproject/transactions@npm:5.7.0, @ethersproject/transactions@npm:^5.6.2, @ethersproject/transactions@npm:^5.7.0": +"@ethersproject/transactions@npm:5.7.0, @ethersproject/transactions@npm:^5.0.0-beta.135, @ethersproject/transactions@npm:^5.6.2, @ethersproject/transactions@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/transactions@npm:5.7.0" dependencies: @@ -5906,23 +4769,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/transactions@npm:^5.0.0-beta.135, @ethersproject/transactions@npm:^5.5.0": - version: 5.5.0 - resolution: "@ethersproject/transactions@npm:5.5.0" - dependencies: - "@ethersproject/address": ^5.5.0 - "@ethersproject/bignumber": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/constants": ^5.5.0 - "@ethersproject/keccak256": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - "@ethersproject/rlp": ^5.5.0 - "@ethersproject/signing-key": ^5.5.0 - checksum: 2de8ddb08927cbdec73de588e0ee1a9eb8f28a7f580deccc8bf51501c371ceaab252cc3339bdca620d94541c1fd214f58d279b50e2c27abe206a892fe917cf55 - languageName: node - linkType: hard - "@ethersproject/units@npm:5.7.0": version: 5.7.0 resolution: "@ethersproject/units@npm:5.7.0" @@ -5970,19 +4816,6 @@ __metadata: languageName: node linkType: hard -"@ethersproject/web@npm:^5.5.0": - version: 5.5.1 - resolution: "@ethersproject/web@npm:5.5.1" - dependencies: - "@ethersproject/base64": ^5.5.0 - "@ethersproject/bytes": ^5.5.0 - "@ethersproject/logger": ^5.5.0 - "@ethersproject/properties": ^5.5.0 - "@ethersproject/strings": ^5.5.0 - checksum: 4718efd7e78f69ccd069309d7d46de562a988ab3e01089e047259b714bbf958d917e86c57c1a6ec99724c4dfd0338bb6b3dc990597a1326f7199039e450bc73c - languageName: node - linkType: hard - "@ethersproject/wordlists@npm:5.7.0, @ethersproject/wordlists@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/wordlists@npm:5.7.0" @@ -5997,9 +4830,9 @@ __metadata: linkType: hard "@fastify/busboy@npm:^2.0.0": - version: 2.0.0 - resolution: "@fastify/busboy@npm:2.0.0" - checksum: 41879937ce1dee6421ef9cd4da53239830617e1f0bb7a0e843940772cd72827205d05e518af6adabe6e1ea19301285fff432b9d11bad01a531e698bea95c781b + version: 2.1.0 + resolution: "@fastify/busboy@npm:2.1.0" + checksum: 3233abd10f73e50668cb4bb278a79b7b3fadd30215ac6458299b0e5a09a29c3586ec07597aae6bd93f5cbedfcef43a8aeea51829cd28fc13850cdbcd324c28d5 languageName: node linkType: hard @@ -6020,22 +4853,22 @@ __metadata: languageName: node linkType: hard -"@floating-ui/core@npm:^1.4.1": - version: 1.4.1 - resolution: "@floating-ui/core@npm:1.4.1" +"@floating-ui/core@npm:^1.4.2": + version: 1.5.2 + resolution: "@floating-ui/core@npm:1.5.2" dependencies: - "@floating-ui/utils": ^0.1.1 - checksum: be4ab864fe17eeba5e205bd554c264b9a4895a57c573661bbf638357fa3108677fed7ba3269ec15b4da90e29274c9b626d5a15414e8d1fe691e210d02a03695c + "@floating-ui/utils": ^0.1.3 + checksum: e22de0a5e8a703fe14d9cfb72aeb67c0056c4ae6aa241539934ecb2af56448534b434a7587ecb5de154c21c3c73e44c19249b05c6b67a58eae7861188c8e69ac languageName: node linkType: hard "@floating-ui/dom@npm:^1.5.1": - version: 1.5.1 - resolution: "@floating-ui/dom@npm:1.5.1" + version: 1.5.3 + resolution: "@floating-ui/dom@npm:1.5.3" dependencies: - "@floating-ui/core": ^1.4.1 - "@floating-ui/utils": ^0.1.1 - checksum: ddb509030978536ba7b321cf8c764ae9d0142a3b1fefb7e6bc050a5de7e825e12131fa5089009edabf7c125fb274886da211a5220fe17a71d875a7a96eb1386c + "@floating-ui/core": ^1.4.2 + "@floating-ui/utils": ^0.1.3 + checksum: 00053742064aac70957f0bd5c1542caafb3bfe9716588bfe1d409fef72a67ed5e60450d08eb492a77f78c22ed1ce4f7955873cc72bf9f9caf2b0f43ae3561c21 languageName: node linkType: hard @@ -6051,10 +4884,10 @@ __metadata: languageName: node linkType: hard -"@floating-ui/utils@npm:^0.1.1": - version: 0.1.1 - resolution: "@floating-ui/utils@npm:0.1.1" - checksum: 548acdda7902f45b0afbe34e2e7f4cbff0696b95bad8c039f80936519de24ef2ec20e79902825b7815294b37f51a7c52ee86288b0688869a57cc229a164d86b4 +"@floating-ui/utils@npm:^0.1.3": + version: 0.1.6 + resolution: "@floating-ui/utils@npm:0.1.6" + checksum: b34d4b5470869727f52e312e08272edef985ba5a450a76de0917ba0a9c6f5df2bdbeb99448e2c60f39b177fb8981c772ff1831424e75123471a27ebd5b52c1eb languageName: node linkType: hard @@ -6222,23 +5055,13 @@ __metadata: languageName: node linkType: hard -"@grpc/grpc-js@npm:~1.9.0": - version: 1.9.6 - resolution: "@grpc/grpc-js@npm:1.9.6" - dependencies: - "@grpc/proto-loader": ^0.7.8 - "@types/node": ">=12.12.47" - checksum: c02981af11e9749bb8f9a71f5f7e125740da9e6addb13b65d006d41d4d7a80d94b6daa45426c6832a2accfd6f9a925d45a4660a88bd908684446ffaf4fe76c68 - languageName: node - linkType: hard - -"@grpc/grpc-js@npm:~1.9.6": - version: 1.9.9 - resolution: "@grpc/grpc-js@npm:1.9.9" +"@grpc/grpc-js@npm:~1.9.0, @grpc/grpc-js@npm:~1.9.6": + version: 1.9.13 + resolution: "@grpc/grpc-js@npm:1.9.13" dependencies: "@grpc/proto-loader": ^0.7.8 "@types/node": ">=12.12.47" - checksum: 71183a483b4a302f6c09b81db282c2d58f2a10624f22f7891b8039f0cd18a65d0c55b729e2ec76beba6daccc9bcf905cf63e9d0959dfe62da456c6b7b731424c + checksum: 0d11fefb5208576ee2ba177f76b088e7563dbd0e723423ca637a2819ba32648f98b67dbca2fd2e3db089777b35bcf0d78ccfca26329afc6bc804d7f46d56dc36 languageName: node linkType: hard @@ -6257,22 +5080,7 @@ __metadata: languageName: node linkType: hard -"@grpc/proto-loader@npm:^0.7.0": - version: 0.7.7 - resolution: "@grpc/proto-loader@npm:0.7.7" - dependencies: - "@types/long": ^4.0.1 - lodash.camelcase: ^4.3.0 - long: ^4.0.0 - protobufjs: ^7.0.0 - yargs: ^17.7.2 - bin: - proto-loader-gen-types: build/bin/proto-loader-gen-types.js - checksum: 6015d99d36d0451075a53e5c5842e8912235973a515677afca038269969ad84f22a4c9fbc9badf52f034736b3f1bf864739f7c4238ba8a7e6fd3bba75cfce0ee - languageName: node - linkType: hard - -"@grpc/proto-loader@npm:^0.7.8": +"@grpc/proto-loader@npm:^0.7.0, @grpc/proto-loader@npm:^0.7.8": version: 0.7.10 resolution: "@grpc/proto-loader@npm:0.7.10" dependencies: @@ -6287,9 +5095,9 @@ __metadata: linkType: hard "@hapi/hoek@npm:^9.0.0": - version: 9.2.1 - resolution: "@hapi/hoek@npm:9.2.1" - checksum: 6a439f672df5f12f1d08d56967b4cb364ce05d81e95e3c3c1b88c5a98b917ca91c70e78cc0b2b4219a760cceec1f22d6658bfc93a83670cecc1ce9ca2247ebd8 + version: 9.3.0 + resolution: "@hapi/hoek@npm:9.3.0" + checksum: 4771c7a776242c3c022b168046af4e324d116a9d2e1d60631ee64f474c6e38d1bb07092d898bf95c7bc5d334c5582798a1456321b2e53ca817d4e7c88bc25b43 languageName: node linkType: hard @@ -6302,14 +5110,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.10": - version: 0.11.11 - resolution: "@humanwhocodes/config-array@npm:0.11.11" +"@humanwhocodes/config-array@npm:^0.11.13": + version: 0.11.13 + resolution: "@humanwhocodes/config-array@npm:0.11.13" dependencies: - "@humanwhocodes/object-schema": ^1.2.1 + "@humanwhocodes/object-schema": ^2.0.1 debug: ^4.1.1 minimatch: ^3.0.5 - checksum: db84507375ab77b8ffdd24f498a5b49ad6b64391d30dd2ac56885501d03964d29637e05b1ed5aefa09d57ac667e28028bc22d2da872bfcd619652fbdb5f4ca19 + checksum: f8ea57b0d7ed7f2d64cd3944654976829d9da91c04d9c860e18804729a33f7681f78166ef4c761850b8c324d362f7d53f14c5c44907a6b38b32c703ff85e4805 languageName: node linkType: hard @@ -6331,13 +5139,20 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^1.2.0, @humanwhocodes/object-schema@npm:^1.2.1": +"@humanwhocodes/object-schema@npm:^1.2.0": version: 1.2.1 resolution: "@humanwhocodes/object-schema@npm:1.2.1" checksum: a824a1ec31591231e4bad5787641f59e9633827d0a2eaae131a288d33c9ef0290bd16fda8da6f7c0fcb014147865d12118df10db57f27f41e20da92369fcb3f1 languageName: node linkType: hard +"@humanwhocodes/object-schema@npm:^2.0.1": + version: 2.0.1 + resolution: "@humanwhocodes/object-schema@npm:2.0.1" + checksum: 24929487b1ed48795d2f08346a0116cc5ee4634848bce64161fb947109352c562310fd159fc64dda0e8b853307f5794605191a9547f7341158559ca3c8262a45 + languageName: node + linkType: hard + "@hutson/parse-repository-url@npm:^5.0.0": version: 5.0.0 resolution: "@hutson/parse-repository-url@npm:5.0.0" @@ -8259,10 +7074,12 @@ __metadata: "@types/body-parser": 1.19.4 "@types/express": 4.17.19 "@types/node": 14.18.54 + "@types/uuid": 9.0.6 body-parser: 1.20.2 express: 4.18.2 log4js: 6.4.1 socket.io: 4.5.4 + uuid: 9.0.1 web3-eth-accounts: 4.0.3 languageName: unknown linkType: soft @@ -8392,6 +7209,7 @@ __metadata: openapi-types: 12.1.3 prettier: 3.0.3 protoc-gen-ts: 0.8.6 + replace: 1.2.2 run-time-error: 1.4.0 run-time-error-cjs: 1.4.0 secp256k1: 4.0.3 @@ -8568,31 +7386,31 @@ __metadata: linkType: hard "@ipld/dag-cbor@npm:^9.0.0": - version: 9.0.6 - resolution: "@ipld/dag-cbor@npm:9.0.6" + version: 9.0.7 + resolution: "@ipld/dag-cbor@npm:9.0.7" dependencies: cborg: ^4.0.0 - multiformats: ^12.0.1 - checksum: 4c6f1ef0d91e8cf98bf7df3b029bc7f69d9e8e97fe2a60f80d27734f4be764691b8d63c3b1ed2d9cd0c5ea62c1bcc834a102e166299ea6472cbae4cb36a9c348 + multiformats: ^13.0.0 + checksum: 92eaa4a83b667026a3eb71096e2986dba9c13d0ae11c541df0fe734e514d373a256981b1a23534d014bd7d91f3c308beacfba2f0e5ca73d0ffac3df2f357d57d languageName: node linkType: hard "@ipld/dag-json@npm:^10.0.0": - version: 10.1.5 - resolution: "@ipld/dag-json@npm:10.1.5" + version: 10.1.6 + resolution: "@ipld/dag-json@npm:10.1.6" dependencies: cborg: ^4.0.0 - multiformats: ^12.0.1 - checksum: b619ec7ed5506f80acd5ed0f6fddf8d9a7d67b72efb4f0f1d467e3bc432f268f075970f2f839dff8310f0f7265d0e3eff28129550c799a1e9cfe82b76f5132bb + multiformats: ^13.0.0 + checksum: 8e502c2000b776a62d967a727e69cc687a106f93e3c6a0a25334ed536aa0e68309b515509b4d1a8faa3a30f81c9d1b9cdf109e2d54f1232d52867f78d2d8518a languageName: node linkType: hard "@ipld/dag-pb@npm:^4.0.0": - version: 4.0.6 - resolution: "@ipld/dag-pb@npm:4.0.6" + version: 4.0.7 + resolution: "@ipld/dag-pb@npm:4.0.7" dependencies: - multiformats: ^12.0.1 - checksum: 4b773a7ef47a87cce623449d83c0886f296e41b1c89c6888026d0ccff4a4a33c742ab6fad7fafee0575a738659a2b205124d484574e43ddedc3e4c8aeb572a77 + multiformats: ^13.0.0 + checksum: 1c8e1ec6ec7107d68bc5939467e46e8decedfd99128e729f8d0b531a1914cf59ffc5d7a3b1005c5ba2456a37fa8a38a985dc3ba180ed1b99e25a37bf1e65af3c languageName: node linkType: hard @@ -8732,17 +7550,17 @@ __metadata: languageName: node linkType: hard -"@jest/console@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/console@npm:29.6.2" +"@jest/console@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/console@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@types/node": "*" chalk: ^4.0.0 - jest-message-util: ^29.6.2 - jest-util: ^29.6.2 + jest-message-util: ^29.7.0 + jest-util: ^29.7.0 slash: ^3.0.0 - checksum: 1198667bda0430770c3e9b92681c0ee9f8346394574071c633f306192ac5f08e12972d6a5fdf03eb0d441051c8439bce0f6f9f355dc60d98777a35328331ba2e + checksum: 0e3624e32c5a8e7361e889db70b170876401b7d70f509a2538c31d5cd50deb0c1ae4b92dc63fe18a0902e0a48c590c21d53787a0df41a52b34fa7cab96c384d6 languageName: node linkType: hard @@ -8787,36 +7605,36 @@ __metadata: languageName: node linkType: hard -"@jest/core@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/core@npm:29.6.2" +"@jest/core@npm:^29.6.2, @jest/core@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/core@npm:29.7.0" dependencies: - "@jest/console": ^29.6.2 - "@jest/reporters": ^29.6.2 - "@jest/test-result": ^29.6.2 - "@jest/transform": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/console": ^29.7.0 + "@jest/reporters": ^29.7.0 + "@jest/test-result": ^29.7.0 + "@jest/transform": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" ansi-escapes: ^4.2.1 chalk: ^4.0.0 ci-info: ^3.2.0 exit: ^0.1.2 graceful-fs: ^4.2.9 - jest-changed-files: ^29.5.0 - jest-config: ^29.6.2 - jest-haste-map: ^29.6.2 - jest-message-util: ^29.6.2 - jest-regex-util: ^29.4.3 - jest-resolve: ^29.6.2 - jest-resolve-dependencies: ^29.6.2 - jest-runner: ^29.6.2 - jest-runtime: ^29.6.2 - jest-snapshot: ^29.6.2 - jest-util: ^29.6.2 - jest-validate: ^29.6.2 - jest-watcher: ^29.6.2 + jest-changed-files: ^29.7.0 + jest-config: ^29.7.0 + jest-haste-map: ^29.7.0 + jest-message-util: ^29.7.0 + jest-regex-util: ^29.6.3 + jest-resolve: ^29.7.0 + jest-resolve-dependencies: ^29.7.0 + jest-runner: ^29.7.0 + jest-runtime: ^29.7.0 + jest-snapshot: ^29.7.0 + jest-util: ^29.7.0 + jest-validate: ^29.7.0 + jest-watcher: ^29.7.0 micromatch: ^4.0.4 - pretty-format: ^29.6.2 + pretty-format: ^29.7.0 slash: ^3.0.0 strip-ansi: ^6.0.0 peerDependencies: @@ -8824,7 +7642,7 @@ __metadata: peerDependenciesMeta: node-notifier: optional: true - checksum: 6bbb3886430248c0092f275b1b946a701406732f7442c04e63e4ee2297c2ec02d8ceeec508a202e08128197699b2bcddbae2c2f74adb2cf30f2f0d7d94a7c2dc + checksum: af759c9781cfc914553320446ce4e47775ae42779e73621c438feb1e4231a5d4862f84b1d8565926f2d1aab29b3ec3dcfdc84db28608bdf5f29867124ebcfc0d languageName: node linkType: hard @@ -8840,34 +7658,34 @@ __metadata: languageName: node linkType: hard -"@jest/environment@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/environment@npm:29.6.2" +"@jest/environment@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/environment@npm:29.7.0" dependencies: - "@jest/fake-timers": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/fake-timers": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" - jest-mock: ^29.6.2 - checksum: c7de0e4c0d9166e02d0eb166574e05ec460e1db3b69d6476e63244edd52d7c917e6876af55fe723ff3086f52c0b1869dec60654054735a7a48c9d4ac43af2a25 + jest-mock: ^29.7.0 + checksum: 6fb398143b2543d4b9b8d1c6dbce83fa5247f84f550330604be744e24c2bd2178bb893657d62d1b97cf2f24baf85c450223f8237cccb71192c36a38ea2272934 languageName: node linkType: hard -"@jest/expect-utils@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/expect-utils@npm:29.6.2" +"@jest/expect-utils@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/expect-utils@npm:29.7.0" dependencies: - jest-get-type: ^29.4.3 - checksum: 0decf2009aa3735f9df469e78ce1721c2815e4278439887e0cf0321ca8979541a22515d114a59b2445a6cd70a074b09dc9c00b5e7b3b3feac5174b9c4a78b2e1 + jest-get-type: ^29.6.3 + checksum: 75eb177f3d00b6331bcaa057e07c0ccb0733a1d0a1943e1d8db346779039cb7f103789f16e502f888a3096fb58c2300c38d1f3748b36a7fa762eb6f6d1b160ed languageName: node linkType: hard -"@jest/expect@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/expect@npm:29.6.2" +"@jest/expect@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/expect@npm:29.7.0" dependencies: - expect: ^29.6.2 - jest-snapshot: ^29.6.2 - checksum: bd2d88a4e7c5420079c239afef341ec53dc7e353816cd13acbb42631a31fd321fe58677bb43a4dba851028f4c7e31da7980314e9094cd5b348896cb6cd3d42b2 + expect: ^29.7.0 + jest-snapshot: ^29.7.0 + checksum: a01cb85fd9401bab3370618f4b9013b90c93536562222d920e702a0b575d239d74cecfe98010aaec7ad464f67cf534a353d92d181646a4b792acaa7e912ae55e languageName: node linkType: hard @@ -8885,17 +7703,17 @@ __metadata: languageName: node linkType: hard -"@jest/fake-timers@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/fake-timers@npm:29.6.2" +"@jest/fake-timers@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/fake-timers@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@sinonjs/fake-timers": ^10.0.2 "@types/node": "*" - jest-message-util: ^29.6.2 - jest-mock: ^29.6.2 - jest-util: ^29.6.2 - checksum: 1abcda02f22d2ba32e178b7ab80a9180235a6c75ec9faef33324627b19a70dad64889a9ea49b8f07230e14a6e683b9120542c6d1d6b2ecaf937f4efde32dad88 + jest-message-util: ^29.7.0 + jest-mock: ^29.7.0 + jest-util: ^29.7.0 + checksum: caf2bbd11f71c9241b458d1b5a66cbe95debc5a15d96442444b5d5c7ba774f523c76627c6931cca5e10e76f0d08761f6f1f01a608898f4751a0eee54fc3d8d00 languageName: node linkType: hard @@ -8910,15 +7728,15 @@ __metadata: languageName: node linkType: hard -"@jest/globals@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/globals@npm:29.6.2" +"@jest/globals@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/globals@npm:29.7.0" dependencies: - "@jest/environment": ^29.6.2 - "@jest/expect": ^29.6.2 - "@jest/types": ^29.6.1 - jest-mock: ^29.6.2 - checksum: aa4a54f19cc025205bc696546940e1fe9c752c2d4d825852088aa76d44677ebba1ec66fabb78e615480cff23a06a70b5a3f893ab5163d901cdfa0d2267870b10 + "@jest/environment": ^29.7.0 + "@jest/expect": ^29.7.0 + "@jest/types": ^29.6.3 + jest-mock: ^29.7.0 + checksum: 97dbb9459135693ad3a422e65ca1c250f03d82b2a77f6207e7fa0edd2c9d2015fbe4346f3dc9ebff1678b9d8da74754d4d440b7837497f8927059c0642a22123 languageName: node linkType: hard @@ -8960,15 +7778,15 @@ __metadata: languageName: node linkType: hard -"@jest/reporters@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/reporters@npm:29.6.2" +"@jest/reporters@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/reporters@npm:29.7.0" dependencies: "@bcoe/v8-coverage": ^0.2.3 - "@jest/console": ^29.6.2 - "@jest/test-result": ^29.6.2 - "@jest/transform": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/console": ^29.7.0 + "@jest/test-result": ^29.7.0 + "@jest/transform": ^29.7.0 + "@jest/types": ^29.6.3 "@jridgewell/trace-mapping": ^0.3.18 "@types/node": "*" chalk: ^4.0.0 @@ -8977,13 +7795,13 @@ __metadata: glob: ^7.1.3 graceful-fs: ^4.2.9 istanbul-lib-coverage: ^3.0.0 - istanbul-lib-instrument: ^5.1.0 + istanbul-lib-instrument: ^6.0.0 istanbul-lib-report: ^3.0.0 istanbul-lib-source-maps: ^4.0.0 istanbul-reports: ^3.1.3 - jest-message-util: ^29.6.2 - jest-util: ^29.6.2 - jest-worker: ^29.6.2 + jest-message-util: ^29.7.0 + jest-util: ^29.7.0 + jest-worker: ^29.7.0 slash: ^3.0.0 string-length: ^4.0.1 strip-ansi: ^6.0.0 @@ -8993,7 +7811,7 @@ __metadata: peerDependenciesMeta: node-notifier: optional: true - checksum: 7cf880d0730cee7d24ee96928003ef6946bf93423b0ae9a2edb53cae2c231b8ac50ec264f48a73744e3f11ca319cd414edacf99b2e7bf37cd72fe0b362090dd1 + checksum: 7eadabd62cc344f629024b8a268ecc8367dba756152b761bdcb7b7e570a3864fc51b2a9810cd310d85e0a0173ef002ba4528d5ea0329fbf66ee2a3ada9c40455 languageName: node linkType: hard @@ -9006,24 +7824,6 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^29.4.3": - version: 29.4.3 - resolution: "@jest/schemas@npm:29.4.3" - dependencies: - "@sinclair/typebox": ^0.25.16 - checksum: ac754e245c19dc39e10ebd41dce09040214c96a4cd8efa143b82148e383e45128f24599195ab4f01433adae4ccfbe2db6574c90db2862ccd8551a86704b5bebd - languageName: node - linkType: hard - -"@jest/schemas@npm:^29.6.0": - version: 29.6.0 - resolution: "@jest/schemas@npm:29.6.0" - dependencies: - "@sinclair/typebox": ^0.27.8 - checksum: c00511c69cf89138a7d974404d3a5060af375b5a52b9c87215d91873129b382ca11c1ff25bd6d605951404bb381ddce5f8091004a61e76457da35db1f5c51365 - languageName: node - linkType: hard - "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -9044,14 +7844,14 @@ __metadata: languageName: node linkType: hard -"@jest/source-map@npm:^29.6.0": - version: 29.6.0 - resolution: "@jest/source-map@npm:29.6.0" +"@jest/source-map@npm:^29.6.3": + version: 29.6.3 + resolution: "@jest/source-map@npm:29.6.3" dependencies: "@jridgewell/trace-mapping": ^0.3.18 callsites: ^3.0.0 graceful-fs: ^4.2.9 - checksum: 9c6c40387410bb70b2fae8124287fc28f6bdd1b2d7f24348e8611e1bb638b404518228a4ce64a582365b589c536ae8e7ebab0126cef59a87874b71061d19783b + checksum: bcc5a8697d471396c0003b0bfa09722c3cd879ad697eb9c431e6164e2ea7008238a01a07193dfe3cbb48b1d258eb7251f6efcea36f64e1ebc464ea3c03ae2deb languageName: node linkType: hard @@ -9079,15 +7879,15 @@ __metadata: languageName: node linkType: hard -"@jest/test-result@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/test-result@npm:29.6.2" +"@jest/test-result@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/test-result@npm:29.7.0" dependencies: - "@jest/console": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/console": ^29.7.0 + "@jest/types": ^29.6.3 "@types/istanbul-lib-coverage": ^2.0.0 collect-v8-coverage: ^1.0.0 - checksum: 8aff37f18c8d2df4d9f453d57ec018a6479eb697fabcf74b1ca06e34553da1d7a2b85580a290408ba0b02e58543263244a2cb065c7c7180c8d8180cc78444fbd + checksum: 67b6317d526e335212e5da0e768e3b8ab8a53df110361b80761353ad23b6aea4432b7c5665bdeb87658ea373b90fb1afe02ed3611ef6c858c7fba377505057fa languageName: node linkType: hard @@ -9103,15 +7903,15 @@ __metadata: languageName: node linkType: hard -"@jest/test-sequencer@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/test-sequencer@npm:29.6.2" +"@jest/test-sequencer@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/test-sequencer@npm:29.7.0" dependencies: - "@jest/test-result": ^29.6.2 + "@jest/test-result": ^29.7.0 graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.2 + jest-haste-map: ^29.7.0 slash: ^3.0.0 - checksum: 12dc2577e45eeb98b85d1769846b7d6effa536907986ad3c4cbd014df9e24431a564cc8cd94603332e4b1f9bfb421371883efc6a5085b361a52425ffc2a52dc6 + checksum: 73f43599017946be85c0b6357993b038f875b796e2f0950487a82f4ebcb115fa12131932dd9904026b4ad8be131fe6e28bd8d0aa93b1563705185f9804bff8bd languageName: node linkType: hard @@ -9138,26 +7938,26 @@ __metadata: languageName: node linkType: hard -"@jest/transform@npm:^29.6.2": - version: 29.6.2 - resolution: "@jest/transform@npm:29.6.2" +"@jest/transform@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/transform@npm:29.7.0" dependencies: "@babel/core": ^7.11.6 - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@jridgewell/trace-mapping": ^0.3.18 babel-plugin-istanbul: ^6.1.1 chalk: ^4.0.0 convert-source-map: ^2.0.0 fast-json-stable-stringify: ^2.1.0 graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.2 - jest-regex-util: ^29.4.3 - jest-util: ^29.6.2 + jest-haste-map: ^29.7.0 + jest-regex-util: ^29.6.3 + jest-util: ^29.7.0 micromatch: ^4.0.4 pirates: ^4.0.4 slash: ^3.0.0 write-file-atomic: ^4.0.2 - checksum: ffb8c3c344cd48bedadec295d9c436737eccc39c1f0868aa9753b76397b33b2e5b121058af6f287ba6f2036181137e37df1212334bfa9d9a712986a4518cdc18 + checksum: 0f8ac9f413903b3cb6d240102db848f2a354f63971ab885833799a9964999dd51c388162106a807f810071f864302cdd8e3f0c241c29ce02d85a36f18f3f40ab languageName: node linkType: hard @@ -9188,31 +7988,17 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/types@npm:29.5.0" - dependencies: - "@jest/schemas": ^29.4.3 - "@types/istanbul-lib-coverage": ^2.0.0 - "@types/istanbul-reports": ^3.0.0 - "@types/node": "*" - "@types/yargs": ^17.0.8 - chalk: ^4.0.0 - checksum: 1811f94b19cf8a9460a289c4f056796cfc373480e0492692a6125a553cd1a63824bd846d7bb78820b7b6f758f6dd3c2d4558293bb676d541b2fa59c70fdf9d39 - languageName: node - linkType: hard - -"@jest/types@npm:^29.6.1": - version: 29.6.1 - resolution: "@jest/types@npm:29.6.1" +"@jest/types@npm:^29.6.1, @jest/types@npm:^29.6.3": + version: 29.6.3 + resolution: "@jest/types@npm:29.6.3" dependencies: - "@jest/schemas": ^29.6.0 + "@jest/schemas": ^29.6.3 "@types/istanbul-lib-coverage": ^2.0.0 "@types/istanbul-reports": ^3.0.0 "@types/node": "*" "@types/yargs": ^17.0.8 chalk: ^4.0.0 - checksum: 89fc1ccf71a84fe0da643e0675b1cfe6a6f19ea72e935b2ab1dbdb56ec547e94433fb59b3536d3832a6e156c077865b7176fe9dae707dab9c3d2f9405ba6233c + checksum: a0bcf15dbb0eca6bdd8ce61a3fb055349d40268622a7670a3b2eb3c3dbafe9eb26af59938366d520b86907b9505b0f9b29b85cec11579a9e580694b87cd90fcc languageName: node linkType: hard @@ -9223,7 +8009,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.0": +"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.2": version: 0.3.3 resolution: "@jridgewell/gen-mapping@npm:0.3.3" dependencies: @@ -9234,28 +8020,10 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.2": - version: 0.3.2 - resolution: "@jridgewell/gen-mapping@npm:0.3.2" - dependencies: - "@jridgewell/set-array": ^1.0.1 - "@jridgewell/sourcemap-codec": ^1.4.10 - "@jridgewell/trace-mapping": ^0.3.9 - checksum: 1832707a1c476afebe4d0fbbd4b9434fdb51a4c3e009ab1e9938648e21b7a97049fa6009393bdf05cab7504108413441df26d8a3c12193996e65493a4efb6882 - languageName: node - linkType: hard - -"@jridgewell/resolve-uri@npm:3.1.0": - version: 3.1.0 - resolution: "@jridgewell/resolve-uri@npm:3.1.0" - checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267 - languageName: node - linkType: hard - -"@jridgewell/resolve-uri@npm:^3.0.3": - version: 3.0.5 - resolution: "@jridgewell/resolve-uri@npm:3.0.5" - checksum: 1ee652b693da7979ac4007926cc3f0a32b657ffeb913e111f44e5b67153d94a2f28a1d560101cc0cf8087625468293a69a00f634a2914e1a6d0817ba2039a913 +"@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.1 + resolution: "@jridgewell/resolve-uri@npm:3.1.1" + checksum: f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 languageName: node linkType: hard @@ -9276,21 +8044,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:1.4.14": - version: 1.4.14 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" - checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.4.10": - version: 1.4.11 - resolution: "@jridgewell/sourcemap-codec@npm:1.4.11" - checksum: 3b2afaf8400fb07a36db60e901fcce6a746cdec587310ee9035939d89878e57b2dec8173b0b8f63176f647efa352294049a53c49739098eb907ff81fec2547c8 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": version: 1.4.15 resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" checksum: b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 @@ -9307,43 +8061,13 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.0": - version: 0.3.4 - resolution: "@jridgewell/trace-mapping@npm:0.3.4" +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.20, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.20 + resolution: "@jridgewell/trace-mapping@npm:0.3.20" dependencies: - "@jridgewell/resolve-uri": ^3.0.3 - "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: ab8bce84bbbc8c34f3ba8325ed926f8f2d3098983c10442a80c55764c4eb6e47d5b92d8ff20a0dd868c3e76a3535651fd8a0138182c290dbfc8396195685c37b - languageName: node - linkType: hard - -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18": - version: 0.3.18 - resolution: "@jridgewell/trace-mapping@npm:0.3.18" - dependencies: - "@jridgewell/resolve-uri": 3.1.0 - "@jridgewell/sourcemap-codec": 1.4.14 - checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02 - languageName: node - linkType: hard - -"@jridgewell/trace-mapping@npm:^0.3.17": - version: 0.3.17 - resolution: "@jridgewell/trace-mapping@npm:0.3.17" - dependencies: - "@jridgewell/resolve-uri": 3.1.0 - "@jridgewell/sourcemap-codec": 1.4.14 - checksum: 9d703b859cff5cd83b7308fd457a431387db5db96bd781a63bf48e183418dd9d3d44e76b9e4ae13237f6abeeb25d739ec9215c1d5bfdd08f66f750a50074a339 - languageName: node - linkType: hard - -"@jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.13 - resolution: "@jridgewell/trace-mapping@npm:0.3.13" - dependencies: - "@jridgewell/resolve-uri": ^3.0.3 - "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: e38254e830472248ca10a6ed1ae75af5e8514f0680245a5e7b53bc3c030fd8691d4d3115d80595b45d3badead68269769ed47ecbbdd67db1343a11f05700e75a + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: cd1a7353135f385909468ff0cf20bdd37e59f2ee49a13a966dedf921943e222082c583ade2b579ff6cd0d8faafcb5461f253e1bf2a9f48fec439211fdbe788f5 languageName: node linkType: hard @@ -9699,19 +8423,17 @@ __metadata: languageName: node linkType: hard -"@libp2p/interface@npm:^0.1.1": - version: 0.1.3 - resolution: "@libp2p/interface@npm:0.1.3" +"@libp2p/interface@npm:^1.0.0": + version: 1.1.0 + resolution: "@libp2p/interface@npm:1.1.0" dependencies: - "@multiformats/multiaddr": ^12.1.5 - abortable-iterator: ^5.0.1 - it-pushable: ^3.2.0 + "@multiformats/multiaddr": ^12.1.10 + it-pushable: ^3.2.1 it-stream-types: ^2.0.1 - multiformats: ^12.0.1 - p-defer: ^4.0.0 - race-signal: ^1.0.0 + multiformats: ^13.0.0 + progress-events: ^1.0.0 uint8arraylist: ^2.4.3 - checksum: 4d6e25e38fd0908fe78a6c3793946f2ecf069e41727be483f630adccbe7fbdceec1df43caec37170dcac2bde6cc05e4d274fea4747de84effb108fbb8e59fdc7 + checksum: 1df4c19c53e8485ec6f2abdd14be463f7a843c826e379ce5f3cef7c1cd1f1d5645fb9bfa81af82e91982e530f023383d899b91105b7c96666ce58d51c1f625a9 languageName: node linkType: hard @@ -9756,7 +8478,7 @@ __metadata: languageName: node linkType: hard -"@ljharb/through@npm:^2.3.11": +"@ljharb/through@npm:^2.3.11, @ljharb/through@npm:^2.3.9": version: 2.3.11 resolution: "@ljharb/through@npm:2.3.11" dependencies: @@ -9765,13 +8487,6 @@ __metadata: languageName: node linkType: hard -"@ljharb/through@npm:^2.3.9": - version: 2.3.9 - resolution: "@ljharb/through@npm:2.3.9" - checksum: a47ffed12ef4b08d07458db8bff5f7a13a7030fddf7dbfa947a765581a634d42ee90f7b8c249315aad122c21ad061e97a74f65aef3c03d2c09291d11312f0bfb - languageName: node - linkType: hard - "@lukeed/csprng@npm:^1.0.0": version: 1.1.0 resolution: "@lukeed/csprng@npm:1.1.0" @@ -9811,14 +8526,14 @@ __metadata: languageName: node linkType: hard -"@mui/base@npm:5.0.0-beta.25": - version: 5.0.0-beta.25 - resolution: "@mui/base@npm:5.0.0-beta.25" +"@mui/base@npm:5.0.0-beta.29": + version: 5.0.0-beta.29 + resolution: "@mui/base@npm:5.0.0-beta.29" dependencies: - "@babel/runtime": ^7.23.4 + "@babel/runtime": ^7.23.6 "@floating-ui/react-dom": ^2.0.4 - "@mui/types": ^7.2.10 - "@mui/utils": ^5.14.19 + "@mui/types": ^7.2.11 + "@mui/utils": ^5.15.2 "@popperjs/core": ^2.11.8 clsx: ^2.0.0 prop-types: ^15.8.1 @@ -9829,22 +8544,22 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: ce22c38593db1bbbb162574bd297bc3f2f5040ed6e304965e17aff55e4d15782e813196bd67c9b82757ee67675ad6d557e22541f84e4d7a4b6f3349dc83741f3 + checksum: 40481f18d5b4c560e0f9868876727203af76954b5b8b208bfc01da666229f8eef45852b5d87403aa42b4c8515a5b9d2e99d4ae40446289d7456c56310fce72c7 languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/core-downloads-tracker@npm:5.14.19" - checksum: e71c886f12bbd83791638545017c0b8439c3c6b51125979fea105f938f2f5b109629d4deddd38448c05b8be10b3249334324f1505c1306c52a2b8d315a1005c3 +"@mui/core-downloads-tracker@npm:^5.15.2": + version: 5.15.2 + resolution: "@mui/core-downloads-tracker@npm:5.15.2" + checksum: 8c88ac73a1d87c8ce565f6295dcd084c643580848e8f59159402e9db89975263da06305a0e605d3744479e917c2d297319496534bca9df8338e203162f1e7c33 languageName: node linkType: hard "@mui/icons-material@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/icons-material@npm:5.14.19" + version: 5.15.2 + resolution: "@mui/icons-material@npm:5.15.2" dependencies: - "@babel/runtime": ^7.23.4 + "@babel/runtime": ^7.23.6 peerDependencies: "@mui/material": ^5.0.0 "@types/react": ^17.0.0 || ^18.0.0 @@ -9852,21 +8567,21 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 31182d4c3416e76c868544d3f604b7d2ef32b59e0445e0b3a794118c55be1e62a24c2f7ed3ae6f46356bd21b913e01a5b0a46d23a897ea7646fb0ee36134dee0 + checksum: f1ff774daaa12b7a2ab7d007bff740a1b936d00cc549fe6ee66e3ff8678ea982d57863a44509446c76b2f1eddb7a5041e27a38ae332045b4fd98f2b39887815c languageName: node linkType: hard "@mui/material@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/material@npm:5.14.19" - dependencies: - "@babel/runtime": ^7.23.4 - "@mui/base": 5.0.0-beta.25 - "@mui/core-downloads-tracker": ^5.14.19 - "@mui/system": ^5.14.19 - "@mui/types": ^7.2.10 - "@mui/utils": ^5.14.19 - "@types/react-transition-group": ^4.4.9 + version: 5.15.2 + resolution: "@mui/material@npm:5.15.2" + dependencies: + "@babel/runtime": ^7.23.6 + "@mui/base": 5.0.0-beta.29 + "@mui/core-downloads-tracker": ^5.15.2 + "@mui/system": ^5.15.2 + "@mui/types": ^7.2.11 + "@mui/utils": ^5.15.2 + "@types/react-transition-group": ^4.4.10 clsx: ^2.0.0 csstype: ^3.1.2 prop-types: ^15.8.1 @@ -9885,16 +8600,16 @@ __metadata: optional: true "@types/react": optional: true - checksum: 8fc63b7ecb98c5eb8f67190cde096f83100af9271fe2113e1d3edb13a08650f611e7ff186b04c66695958cc88480011ab31dc950cf0fd6e0fbb6c727ec834cbd + checksum: 7586b0160c686214c4d3a6f8af76306413bfe13286a4679ca7696b764615f511b5d5b27a8129e15ae81856492317e7f139f4bd075f6b2dfe6e60de46755d7dbc languageName: node linkType: hard -"@mui/private-theming@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/private-theming@npm:5.14.19" +"@mui/private-theming@npm:^5.15.2": + version: 5.15.2 + resolution: "@mui/private-theming@npm:5.15.2" dependencies: - "@babel/runtime": ^7.23.4 - "@mui/utils": ^5.14.19 + "@babel/runtime": ^7.23.6 + "@mui/utils": ^5.15.2 prop-types: ^15.8.1 peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 @@ -9902,15 +8617,15 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: ee17fa123ae671fcfb6e59787e9a5b6d650d4a53ea575f5d5519dd187c9b04fbb50f12f2da5a663d3ba3a82d503086faa18bf3b68923237de78f44e401e04935 + checksum: 63cc69adc3eca03533dd72296aac6449abe133522f6f5c62c8497e57dbd092c131cba3488ee8d97dfb76c31a194df014f4da3b2d30027614e987ed72581a4acf languageName: node linkType: hard -"@mui/styled-engine@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/styled-engine@npm:5.14.19" +"@mui/styled-engine@npm:^5.15.2": + version: 5.15.2 + resolution: "@mui/styled-engine@npm:5.15.2" dependencies: - "@babel/runtime": ^7.23.4 + "@babel/runtime": ^7.23.6 "@emotion/cache": ^11.11.0 csstype: ^3.1.2 prop-types: ^15.8.1 @@ -9923,19 +8638,19 @@ __metadata: optional: true "@emotion/styled": optional: true - checksum: 2b8dc8e08e47e18ad6345d25539d5978ef153cb23abff3d98c3cf2795f836e446279021392c2071142ffbae17e19906235acfb3e73dc0f14440b138f919a26a4 + checksum: daa15b61be2e785c9719e091047a5900aa5aa0b6a9dfbc2ea373f6718f6ec3485f44e05596cd9506a90a7c55d8d372233a80cbeca4d81ceb8d5e6a10ce0f8292 languageName: node linkType: hard -"@mui/system@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/system@npm:5.14.19" +"@mui/system@npm:^5.15.2": + version: 5.15.2 + resolution: "@mui/system@npm:5.15.2" dependencies: - "@babel/runtime": ^7.23.4 - "@mui/private-theming": ^5.14.19 - "@mui/styled-engine": ^5.14.19 - "@mui/types": ^7.2.10 - "@mui/utils": ^5.14.19 + "@babel/runtime": ^7.23.6 + "@mui/private-theming": ^5.15.2 + "@mui/styled-engine": ^5.15.2 + "@mui/types": ^7.2.11 + "@mui/utils": ^5.15.2 clsx: ^2.0.0 csstype: ^3.1.2 prop-types: ^15.8.1 @@ -9951,27 +8666,27 @@ __metadata: optional: true "@types/react": optional: true - checksum: aea4935cf72a7c4fe3d03eb040491204b0c20fbae19fc73173ec925c9025375601f6b7007e53b5ab6ea44a4dd74b94e9acc9ada85461db1deae9062f8506a99a + checksum: ce6297a4cfa6f91891fa84679e05e40e12c4a27fe4fb34d78cbcbae172da293c05fa6f07c24fec66c864eac64179aeec1f7a70358e376b8c16ffc8e91f93a904 languageName: node linkType: hard -"@mui/types@npm:^7.2.10": - version: 7.2.10 - resolution: "@mui/types@npm:7.2.10" +"@mui/types@npm:^7.2.11": + version: 7.2.11 + resolution: "@mui/types@npm:7.2.11" peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 peerDependenciesMeta: "@types/react": optional: true - checksum: b9c4629929450e243015d79cf6b102824336db07b852e55f114aca85dbad0b39f831e9c65ad94b028a65c08d33be9f7de1afb530a4e6a80be5702b396ccb90b1 + checksum: ce6bbe8ba963af218bf86797f4c8adbf0f294047adeaf6596d3bb4a96f1b01701f1b1ae7dcfe2f7972f6e23c85eee4187e496fb481541713ed8bf12e96f3c34f languageName: node linkType: hard -"@mui/utils@npm:^5.14.19": - version: 5.14.19 - resolution: "@mui/utils@npm:5.14.19" +"@mui/utils@npm:^5.15.2": + version: 5.15.2 + resolution: "@mui/utils@npm:5.15.2" dependencies: - "@babel/runtime": ^7.23.4 + "@babel/runtime": ^7.23.6 "@types/prop-types": ^15.7.11 prop-types: ^15.8.1 react-is: ^18.2.0 @@ -9981,7 +8696,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: f53f746eb33bc5d700b9f2b454e211ca17f5aa320cd30f54a82a347e4da0c61b872f323f01ff4b5247d3f992ac4f72a69ac79974300a6dedf01ff6b8f6d75b49 + checksum: c78ad9fb1a5fa1dc5955cada77227c605f1e5bf45503bf2bb0080bc92cf28bdcf1cbb83322d19162c5424ec245a66cef849603c7681fa1ec89093e0b1922dc58 languageName: node linkType: hard @@ -10008,18 +8723,18 @@ __metadata: languageName: node linkType: hard -"@multiformats/multiaddr@npm:^12.0.0, @multiformats/multiaddr@npm:^12.1.3, @multiformats/multiaddr@npm:^12.1.5": - version: 12.1.7 - resolution: "@multiformats/multiaddr@npm:12.1.7" +"@multiformats/multiaddr@npm:^12.0.0, @multiformats/multiaddr@npm:^12.1.10, @multiformats/multiaddr@npm:^12.1.3": + version: 12.1.12 + resolution: "@multiformats/multiaddr@npm:12.1.12" dependencies: "@chainsafe/is-ip": ^2.0.1 "@chainsafe/netmask": ^2.0.0 - "@libp2p/interface": ^0.1.1 - dns-over-http-resolver: ^2.1.0 - multiformats: ^12.0.1 + "@libp2p/interface": ^1.0.0 + dns-over-http-resolver: 3.0.0 + multiformats: ^13.0.0 uint8-varint: ^2.0.1 - uint8arrays: ^4.0.2 - checksum: 96b83208b7bd3e9387f2fdac20fc554d962395c02661e9c1da819646d2f3129e1a76e5abc6a0c8d386c7126a7678e58d05b08dc812260b7cad2488533cbe44b0 + uint8arrays: ^5.0.0 + checksum: a50d62aeb330ef9df0d5b9a36980eba28dc619fce9adba9a5d5da4344091c42457501969cbc15e1d705dbf90513fb4730f91eabe1b68ceada56e3e721ebb3249 languageName: node linkType: hard @@ -10099,6 +8814,17 @@ __metadata: languageName: node linkType: hard +"@ngtools/webpack@npm:16.2.11": + version: 16.2.11 + resolution: "@ngtools/webpack@npm:16.2.11" + peerDependencies: + "@angular/compiler-cli": ^16.0.0 + typescript: ">=4.9.3 <5.2" + webpack: ^5.54.0 + checksum: e36d18c91f8342f74971cd596f54dba5894263a2c9340a9127fcd3241f3ab9a001b129f9f510967f0735f3ffa8fb3636f3fe19817930e7aa5c897e972fbac9b7 + languageName: node + linkType: hard + "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1": version: 5.1.1-v1 resolution: "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1" @@ -10138,13 +8864,20 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.1, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1": +"@noble/hashes@npm:1.3.1": version: 1.3.1 resolution: "@noble/hashes@npm:1.3.1" checksum: 7fdefc0f7a0c1ec27acc6ff88841793e3f93ec4ce6b8a6a12bfc0dd70ae6b7c4c82fe305fdfeda1735d5ad4a9eebe761e6693b3d355689c559e91242f4bc95b1 languageName: node linkType: hard +"@noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.1": + version: 1.3.3 + resolution: "@noble/hashes@npm:1.3.3" + checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b + languageName: node + linkType: hard + "@noble/secp256k1@npm:1.7.1, @noble/secp256k1@npm:^1.5.4, @noble/secp256k1@npm:~1.7.0": version: 1.7.1 resolution: "@noble/secp256k1@npm:1.7.1" @@ -10447,14 +9180,15 @@ __metadata: linkType: hard "@npmcli/agent@npm:^2.0.0": - version: 2.1.1 - resolution: "@npmcli/agent@npm:2.1.1" + version: 2.2.0 + resolution: "@npmcli/agent@npm:2.2.0" dependencies: + agent-base: ^7.1.0 http-proxy-agent: ^7.0.0 https-proxy-agent: ^7.0.1 lru-cache: ^10.0.1 socks-proxy-agent: ^8.0.1 - checksum: d66ffc5a1e6266da122384e9f7cd0dcbb534eea142705f1e2aed866aa14e418f96358cccb5102c0703c9ff65cb10dbac4c8696af6498ad95b4cf634af757942c + checksum: 3b25312edbdfaa4089af28e2d423b6f19838b945e47765b0c8174c1395c79d43c3ad6d23cb364b43f59fd3acb02c93e3b493f72ddbe3dfea04c86843a7311fc4 languageName: node linkType: hard @@ -10512,12 +9246,12 @@ __metadata: linkType: hard "@npmcli/fs@npm:^2.1.0": - version: 2.1.0 - resolution: "@npmcli/fs@npm:2.1.0" + version: 2.1.2 + resolution: "@npmcli/fs@npm:2.1.2" dependencies: "@gar/promisify": ^1.1.3 semver: ^7.3.5 - checksum: 6ec6d678af6da49f9dac50cd882d7f661934dd278972ffbaacde40d9eaa2871292d634000a0cca9510f6fc29855fbd4af433e1adbff90a524ec3eaf140f1219b + checksum: 405074965e72d4c9d728931b64d2d38e6ea12066d4fad651ac253d175e413c06fe4350970c783db0d749181da8fe49c42d3880bd1cbc12cd68e3a7964d820225 languageName: node linkType: hard @@ -10531,8 +9265,8 @@ __metadata: linkType: hard "@npmcli/git@npm:^4.0.0": - version: 4.0.4 - resolution: "@npmcli/git@npm:4.0.4" + version: 4.1.0 + resolution: "@npmcli/git@npm:4.1.0" dependencies: "@npmcli/promise-spawn": ^6.0.0 lru-cache: ^7.4.4 @@ -10542,7 +9276,7 @@ __metadata: promise-retry: ^2.0.1 semver: ^7.3.5 which: ^3.0.0 - checksum: fd8ad331138c906e090a0f0d3c1662be140fbb39f0dcf4259ee69e8dcb1a939385996dd003d7abb9ce61739e4119e2ea26b2be7ad396988ec1c1ed83179af032 + checksum: 37efb926593f294eb263297cdfffec9141234f977b89a7a6b95ff7a72576c1d7f053f4961bc4b5e79dea6476fe08e0f3c1ed9e4aeb84169e357ff757a6a70073 languageName: node linkType: hard @@ -10575,14 +9309,14 @@ __metadata: linkType: hard "@npmcli/map-workspaces@npm:^3.0.2": - version: 3.0.3 - resolution: "@npmcli/map-workspaces@npm:3.0.3" + version: 3.0.4 + resolution: "@npmcli/map-workspaces@npm:3.0.4" dependencies: "@npmcli/name-from-folder": ^2.0.0 - glob: ^9.3.1 - minimatch: ^7.4.2 + glob: ^10.2.2 + minimatch: ^9.0.0 read-package-json-fast: ^3.0.0 - checksum: d61d152b5c3fbe56c467d447877220be4ee147a64904300adbbdfe33074b37bcb15d96d395a1292e46392766e6d1c6eae43d9daa81ae03c84561eadf333f0bc8 + checksum: 99607dbc502b16d0ce7a47a81ccc496b3f5ed10df4e61e61a505929de12c356092996044174ae0cfd6d8cc177ef3b597eef4987b674fc0c5a306d3a8cc1fe91a languageName: node linkType: hard @@ -10609,12 +9343,12 @@ __metadata: linkType: hard "@npmcli/move-file@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/move-file@npm:2.0.0" + version: 2.0.1 + resolution: "@npmcli/move-file@npm:2.0.1" dependencies: mkdirp: ^1.0.4 rimraf: ^3.0.2 - checksum: 1388777b507b0c592d53f41b9d182e1a8de7763bc625fc07999b8edbc22325f074e5b3ec90af79c89d6987fdb2325bc66d59f483258543c14a43661621f841b0 + checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 languageName: node linkType: hard @@ -10675,32 +9409,19 @@ __metadata: linkType: hard "@npmcli/run-script@npm:^6.0.0": - version: 6.0.0 - resolution: "@npmcli/run-script@npm:6.0.0" + version: 6.0.2 + resolution: "@npmcli/run-script@npm:6.0.2" dependencies: "@npmcli/node-gyp": ^3.0.0 "@npmcli/promise-spawn": ^6.0.0 node-gyp: ^9.0.0 read-package-json-fast: ^3.0.0 which: ^3.0.0 - checksum: 9fc387f7c405ae4948921764b8b970c12ae07df22bacc242b0f68709c99a83b9d12f411ebd7e60c85a933e2d7be42c70e243ebd71a8d3f6e783e1aab5ccbb2f5 - languageName: node - linkType: hard - -"@npmcli/run-script@npm:^7.0.0": - version: 7.0.1 - resolution: "@npmcli/run-script@npm:7.0.1" - dependencies: - "@npmcli/node-gyp": ^3.0.0 - "@npmcli/promise-spawn": ^7.0.0 - node-gyp: ^9.0.0 - read-package-json-fast: ^3.0.0 - which: ^4.0.0 - checksum: 1713dda8bfe8e6ed0c82ca1f061d4deea5e87f4de5595e109d12d3fc1a0a9ada71d42ee5fc436d72c59d6ab3503ef8178a84a425edd355e4cc9c839d095554b8 + checksum: 7a671d7dbeae376496e1c6242f02384928617dc66cd22881b2387272205c3668f8490ec2da4ad63e1abf979efdd2bdf4ea0926601d78578e07d83cfb233b3a1a languageName: node linkType: hard -"@npmcli/run-script@npm:^7.0.2": +"@npmcli/run-script@npm:^7.0.0, @npmcli/run-script@npm:^7.0.2": version: 7.0.2 resolution: "@npmcli/run-script@npm:7.0.2" dependencies: @@ -10885,9 +9606,9 @@ __metadata: linkType: hard "@opentelemetry/api@npm:^1.0.1": - version: 1.0.4 - resolution: "@opentelemetry/api@npm:1.0.4" - checksum: 793e9b5c21666b647a60c58c46c3e00ad1dac38505102b026ad0ef617571d637aca54a18533a73c1e288c95b5ac77e2db17f96467f11833ac1165338e1184260 + version: 1.7.0 + resolution: "@opentelemetry/api@npm:1.7.0" + checksum: 2398cbe65f199c3a7050125b3ad9c835f789bb0a616665e9c7f4475a29ac8334b6a3c15f38db48d345b522180c41c00b04cc174cd0eeffba98eb4874a565fa7e languageName: node linkType: hard @@ -10912,17 +9633,10 @@ __metadata: languageName: node linkType: hard -"@pkgr/utils@npm:^2.3.1": - version: 2.4.2 - resolution: "@pkgr/utils@npm:2.4.2" - dependencies: - cross-spawn: ^7.0.3 - fast-glob: ^3.3.0 - is-glob: ^4.0.3 - open: ^9.1.0 - picocolors: ^1.0.0 - tslib: ^2.6.0 - checksum: 24e04c121269317d259614cd32beea3af38277151c4002df5883c4be920b8e3490bb897748e844f9d46bf68230f86dabd4e8f093773130e7e60529a769a132fc +"@pkgr/core@npm:^0.1.0": + version: 0.1.0 + resolution: "@pkgr/core@npm:0.1.0" + checksum: eeff0e0e517b1ed10eb4c1a8971413a8349bbfdab727dbe7d4085fd94eab95f0c3beb51b9245fef30562849d2a7a119e07ca48c343c8c4ec4e64ee289f50fe5e languageName: node linkType: hard @@ -10966,9 +9680,9 @@ __metadata: linkType: hard "@polka/url@npm:^1.0.0-next.20": - version: 1.0.0-next.21 - resolution: "@polka/url@npm:1.0.0-next.21" - checksum: c7654046d38984257dd639eab3dc770d1b0340916097b2fac03ce5d23506ada684e05574a69b255c32ea6a144a957c8cd84264159b545fca031c772289d88788 + version: 1.0.0-next.24 + resolution: "@polka/url@npm:1.0.0-next.24" + checksum: 00baec4458ac86ca27edf7ce807ccfad97cd1d4b67bdedaf3401a9e755757588f3331e891290d1deea52d88df2bf2387caf8d94a6835b614d5b37b638a688273 languageName: node linkType: hard @@ -11167,9 +9881,9 @@ __metadata: linkType: hard "@rushstack/eslint-patch@npm:^1.1.0": - version: 1.3.3 - resolution: "@rushstack/eslint-patch@npm:1.3.3" - checksum: fd8a19ec5842634da8e4c2c479a4d13ecbefa4f212e42c7f9c39e8706f9eeef7a50db8d6ea939884ac0ff36bb21930c9642068cf68e8309ad491c54f2fc30c01 + version: 1.6.1 + resolution: "@rushstack/eslint-patch@npm:1.6.1" + checksum: d0c0fcc430dae71d9d929e593844aeaec8d326b1d6c27f18059e22dad486d8df43d6f0206b2021a0df789baf514642355bd86eae7a42c457b7b2f48a29bb0f53 languageName: node linkType: hard @@ -11203,13 +9917,13 @@ __metadata: linkType: hard "@scale-codec/util@npm:^1.1.1": - version: 1.1.1 - resolution: "@scale-codec/util@npm:1.1.1" - checksum: 30e7b7be72ab748ffabcd92f26a6d10374297e9c1cbc9eea21f3eea793385135bcce6f3dc8d14b7e88655ff261db116c330f0fff19f56fc0e8b1bf28843cb05e + version: 1.1.2 + resolution: "@scale-codec/util@npm:1.1.2" + checksum: a76a092899cfb96e4c3b883d02f6de72a36533f7110178aab5fffc4b6d04c3d6c5b0245560230dffd4c97f322b264541e03801c9bf9af6c3b95558932053e06a languageName: node linkType: hard -"@schematics/angular@npm:16.2.1, @schematics/angular@npm:^16.0.0": +"@schematics/angular@npm:16.2.1": version: 16.2.1 resolution: "@schematics/angular@npm:16.2.1" dependencies: @@ -11220,10 +9934,21 @@ __metadata: languageName: node linkType: hard +"@schematics/angular@npm:^16.0.0": + version: 16.2.11 + resolution: "@schematics/angular@npm:16.2.11" + dependencies: + "@angular-devkit/core": 16.2.11 + "@angular-devkit/schematics": 16.2.11 + jsonc-parser: 3.2.0 + checksum: 51a222990d522f43a5c053ab411aba71ae7f6bbd7708c05cdd27438ac037d5758e671b48da61b9ecd989592644e0525f0bace84ba633577e9c21a566d121b335 + languageName: node + linkType: hard + "@scure/base@npm:~1.1.0": - version: 1.1.1 - resolution: "@scure/base@npm:1.1.1" - checksum: b4fc810b492693e7e8d0107313ac74c3646970c198bbe26d7332820886fa4f09441991023ec9aa3a2a51246b74409ab5ebae2e8ef148bbc253da79ac49130309 + version: 1.1.5 + resolution: "@scure/base@npm:1.1.5" + checksum: 9e9ee6088cb3aa0fb91f5a48497d26682c7829df3019b1251d088d166d7a8c0f941c68aaa8e7b96bbad20c71eb210397cb1099062cde3e29d4bad6b975c18519 languageName: node linkType: hard @@ -11411,13 +10136,13 @@ __metadata: linkType: hard "@sigstore/sign@npm:^2.1.0": - version: 2.1.0 - resolution: "@sigstore/sign@npm:2.1.0" + version: 2.2.0 + resolution: "@sigstore/sign@npm:2.2.0" dependencies: "@sigstore/bundle": ^2.1.0 "@sigstore/protobuf-specs": ^0.2.1 make-fetch-happen: ^13.0.0 - checksum: da138d82fd34cb3b44ce78cfb30f6107b467b7f72d79b7ef1d9112a7f49a950d8bd10814760183affd25096dc5972c3b3a7ab4e00e6aa46e123bc19cbaad653c + checksum: 185f930ef4cd9ceb33a8814ade44ca58a9fffb82af13ac6040e37ba3326bca7d58e345e09c74605fe2143262b818758e908de80791a69074880e334d136a6fb8 languageName: node linkType: hard @@ -11448,13 +10173,6 @@ __metadata: languageName: node linkType: hard -"@sinclair/typebox@npm:^0.25.16": - version: 0.25.24 - resolution: "@sinclair/typebox@npm:0.25.24" - checksum: 10219c58f40b8414c50b483b0550445e9710d4fe7b2c4dccb9b66533dd90ba8e024acc776026cebe81e87f06fa24b07fdd7bc30dd277eb9cc386ec50151a3026 - languageName: node - linkType: hard - "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -11469,7 +10187,7 @@ __metadata: languageName: node linkType: hard -"@sindresorhus/is@npm:^4.6.0": +"@sindresorhus/is@npm:^4.0.0, @sindresorhus/is@npm:^4.6.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" checksum: 83839f13da2c29d55c97abc3bc2c55b250d33a0447554997a85c539e058e57b8da092da396e252b11ec24a0279a0bed1f537fa26302209327060643e327f81d2 @@ -11477,9 +10195,9 @@ __metadata: linkType: hard "@sindresorhus/is@npm:^5.2.0": - version: 5.5.2 - resolution: "@sindresorhus/is@npm:5.5.2" - checksum: 609a38ed040ed4c13560862aa0fcc67452bea6928edc60600cd78fb84f2f6e335148e0a8b2ca27ba70fabb102c1fbeab860579b24a505b7ab71ba900ac8642c6 + version: 5.6.0 + resolution: "@sindresorhus/is@npm:5.6.0" + checksum: 2e6e0c3acf188dcd9aea0f324ac1b6ad04c9fc672392a7b5a1218512fcde066965797eba8b9fe2108657a504388bd4a6664e6e6602555168e828a6df08b9f10e languageName: node linkType: hard @@ -11490,7 +10208,7 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^1, @sinonjs/commons@npm:^1.0.2, @sinonjs/commons@npm:^1.3.0": +"@sinonjs/commons@npm:^1, @sinonjs/commons@npm:^1.0.2, @sinonjs/commons@npm:^1.3.0, @sinonjs/commons@npm:^1.7.0": version: 1.8.6 resolution: "@sinonjs/commons@npm:1.8.6" dependencies: @@ -11499,30 +10217,21 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^1.7.0": - version: 1.8.3 - resolution: "@sinonjs/commons@npm:1.8.3" - dependencies: - type-detect: 4.0.8 - checksum: 6159726db5ce6bf9f2297f8427f7ca5b3dff45b31e5cee23496f1fa6ef0bb4eab878b23fb2c5e6446381f6a66aba4968ef2fc255c1180d753d4b8c271636a2e5 - languageName: node - linkType: hard - -"@sinonjs/commons@npm:^2.0.0": - version: 2.0.0 - resolution: "@sinonjs/commons@npm:2.0.0" +"@sinonjs/commons@npm:^3.0.0": + version: 3.0.0 + resolution: "@sinonjs/commons@npm:3.0.0" dependencies: type-detect: 4.0.8 - checksum: 5023ba17edf2b85ed58262313b8e9b59e23c6860681a9af0200f239fe939e2b79736d04a260e8270ddd57196851dde3ba754d7230be5c5234e777ae2ca8af137 + checksum: b4b5b73d4df4560fb8c0c7b38c7ad4aeabedd362f3373859d804c988c725889cde33550e4bcc7cd316a30f5152a2d1d43db71b6d0c38f5feef71fd8d016763f8 languageName: node linkType: hard "@sinonjs/fake-timers@npm:^10.0.2": - version: 10.0.2 - resolution: "@sinonjs/fake-timers@npm:10.0.2" + version: 10.3.0 + resolution: "@sinonjs/fake-timers@npm:10.3.0" dependencies: - "@sinonjs/commons": ^2.0.0 - checksum: c62aa98e7cefda8dedc101ce227abc888dc46b8ff9706c5f0a8dfd9c3ada97d0a5611384738d9ba0b26b59f99c2ba24efece8e779bb08329e9e87358fa309824 + "@sinonjs/commons": ^3.0.0 + checksum: 614d30cb4d5201550c940945d44c9e0b6d64a888ff2cd5b357f95ad6721070d6b8839cd10e15b76bf5e14af0bcc1d8f9ec00d49a46318f1f669a4bec1d7f3148 languageName: node linkType: hard @@ -11570,13 +10279,6 @@ __metadata: languageName: node linkType: hard -"@socket.io/base64-arraybuffer@npm:~1.0.2": - version: 1.0.2 - resolution: "@socket.io/base64-arraybuffer@npm:1.0.2" - checksum: fa3e58c7581643d0557969cd3bece20e198596df77968ff29ede6be329d488e65104bef900e68a67f39d8855abfa59baa2b08d96fb856504bd01cbdd8f52249c - languageName: node - linkType: hard - "@socket.io/component-emitter@npm:~3.1.0": version: 3.1.0 resolution: "@socket.io/component-emitter@npm:3.1.0" @@ -11611,12 +10313,12 @@ __metadata: languageName: node linkType: hard -"@stencil/core@npm:^4.1.0": - version: 4.2.0 - resolution: "@stencil/core@npm:4.2.0" +"@stencil/core@npm:^4.0.3, @stencil/core@npm:^4.1.0": + version: 4.9.0 + resolution: "@stencil/core@npm:4.9.0" bin: stencil: bin/stencil - checksum: fc96d1a96aab495919c702d2b91f33e420733032af7e283724810920d5949d7d7ab76625ac5d5a8b0a79917b9cd931a180fd7eff95c992791916f303d2ab3559 + checksum: 441e0131f9f4b54ec760018ba1dc0f9c81227b1b011c84a75a80e4e2bd16a6d2eb5db6a0293928fd7f20e3733d9503eaf07fe7566862751dcb440928ae35738b languageName: node linkType: hard @@ -11831,6 +10533,15 @@ __metadata: languageName: node linkType: hard +"@szmarczak/http-timer@npm:^4.0.5": + version: 4.0.6 + resolution: "@szmarczak/http-timer@npm:4.0.6" + dependencies: + defer-to-connect: ^2.0.0 + checksum: c29df3bcec6fc3bdec2b17981d89d9c9fc9bd7d0c9bcfe92821dc533f4440bc890ccde79971838b4ceed1921d456973c4180d7175ee1d0023ad0562240a58d95 + languageName: node + linkType: hard + "@szmarczak/http-timer@npm:^5.0.1": version: 5.0.1 resolution: "@szmarczak/http-timer@npm:5.0.1" @@ -11923,84 +10634,84 @@ __metadata: languageName: node linkType: hard -"@truffle/abi-utils@npm:^1.0.2": - version: 1.0.2 - resolution: "@truffle/abi-utils@npm:1.0.2" +"@truffle/abi-utils@npm:^1.0.3": + version: 1.0.3 + resolution: "@truffle/abi-utils@npm:1.0.3" dependencies: change-case: 3.0.2 fast-check: 3.1.1 web3-utils: 1.10.0 - checksum: 535472496e7e7bf97b8f2fd75b9ba9a2e4a21bed6dc1061ce2567dffd299a1ca6be85705fcfd2b2f1edf327d6376f03e7c688cbe79418fcb33e0821870ba4b9d + checksum: 25c08724e519594fb766091f243dcb7a6cbc260d8a245cc209b812f8bccf483a0c23e9f04d61e50c802189cd2c50004f50fc3129192e9368bccfc54c3c47933d languageName: node linkType: hard "@truffle/blockchain-utils@npm:^0.1.8": - version: 0.1.8 - resolution: "@truffle/blockchain-utils@npm:0.1.8" - checksum: 094070d27d68ab63f4fe1bdc61917089f6a5a8ba6e1f92330b0684c38410aea907a3781aaada26d0c283cef7b32812ae690e89a696c98ede0624d86f3d993b5e + version: 0.1.9 + resolution: "@truffle/blockchain-utils@npm:0.1.9" + checksum: 4f7acfc00b29ae6830eb60563e58e1fef3d2480fc4bf426781b3cf40e1a6387bf05fef15e0ac851f7c10e586515db0fa370ac2dbeffa396e735d665738831663 languageName: node linkType: hard -"@truffle/code-utils@npm:^3.0.3": - version: 3.0.3 - resolution: "@truffle/code-utils@npm:3.0.3" +"@truffle/code-utils@npm:^3.0.4": + version: 3.0.4 + resolution: "@truffle/code-utils@npm:3.0.4" dependencies: cbor: ^5.2.0 - checksum: 1559d95b6393ecd222debaa082bf5f3fdc65ca608c7a4d32b151b93fa35fd135478bff7db27be76ad60840e75c985c7fab86d2c8550ca461c215f1524802f8f9 + checksum: fab3c7b0bf85b1e6ac15439a537035b6d2fd7ba433528cac46930fe73ee94908a746928b93338d9eb42f3366c499335776e535d7164ccf2822f697e81bf6c3c6 languageName: node linkType: hard -"@truffle/codec@npm:^0.17.2": - version: 0.17.2 - resolution: "@truffle/codec@npm:0.17.2" +"@truffle/codec@npm:^0.17.3": + version: 0.17.3 + resolution: "@truffle/codec@npm:0.17.3" dependencies: - "@truffle/abi-utils": ^1.0.2 - "@truffle/compile-common": ^0.9.7 + "@truffle/abi-utils": ^1.0.3 + "@truffle/compile-common": ^0.9.8 big.js: ^6.0.3 bn.js: ^5.1.3 cbor: ^5.2.0 debug: ^4.3.1 lodash: ^4.17.21 - semver: 7.5.2 + semver: ^7.5.4 utf8: ^3.0.0 web3-utils: 1.10.0 - checksum: 77869141c166e579a75292357a4ceae5869727ba7704dbe3a044ecb46a957ffcf25a14fce5e37f84cecb74662c71f8d20c1f84e88a0adf6daca10d405182943f + checksum: ff6472e5db9b433c3a31a00bf0c52aa5f4640a86f4822080e8ccb140f23c16a1f62a8ff7a5c089e23e98f4bc430064c0ffceace4419dd8a85ef7d88ef3177363 languageName: node linkType: hard -"@truffle/compile-common@npm:^0.9.7": - version: 0.9.7 - resolution: "@truffle/compile-common@npm:0.9.7" +"@truffle/compile-common@npm:^0.9.8": + version: 0.9.8 + resolution: "@truffle/compile-common@npm:0.9.8" dependencies: - "@truffle/error": ^0.2.1 + "@truffle/error": ^0.2.2 colors: 1.4.0 - checksum: b431344c1d162275264c3b7333d9591fdfda829e866266145265a6ca5814ffb446c657fc1dab1c4487290b087d06daa95459344dad0b84bd375ad7a9971aad6e + checksum: 94663efa1751a2fbaf2accd341486c2ad98a57695ad0ae8108de2fe0ac82200facdb4a187fc80ebcb6293a025b586a181f59deae0a424b419b7f6177e8add42e languageName: node linkType: hard -"@truffle/config@npm:^1.3.59": - version: 1.3.59 - resolution: "@truffle/config@npm:1.3.59" +"@truffle/config@npm:^1.3.61": + version: 1.3.61 + resolution: "@truffle/config@npm:1.3.61" dependencies: - "@truffle/error": ^0.2.1 - "@truffle/events": ^0.1.24 - "@truffle/provider": ^0.3.11 + "@truffle/error": ^0.2.2 + "@truffle/events": ^0.1.25 + "@truffle/provider": ^0.3.13 conf: ^10.1.2 debug: ^4.3.1 find-up: ^2.1.0 lodash: ^4.17.21 original-require: ^1.0.1 - checksum: 31692af692b4c02dc552d72c17dc1f259b3617fda55963397fd8a65eec4b11fc90ff8230b7cc42961b5971bb93f5875cd99eb9c5da9d7842570dd635d1724ba2 + checksum: c33347a616a132811b1e53ff9d44f43c257f6332552d971e09dd9826c24d7a5f92f99761d8b6d3e9bfdf71cb273cf4ad257cd8686989c864d93965f5c399fe71 languageName: node linkType: hard "@truffle/contract-schema@npm:^3.4.15": - version: 3.4.15 - resolution: "@truffle/contract-schema@npm:3.4.15" + version: 3.4.16 + resolution: "@truffle/contract-schema@npm:3.4.16" dependencies: ajv: ^6.10.0 debug: ^4.3.1 - checksum: 022443122552749f56e2472ac40f23ac3fcd74de3f4825894425cd209091125a0d87597224a5167ea36e612cf99645370b3f1c06592def270a26b1ab0f22da4e + checksum: e8ccd920c3ca62843f93c75119a94cce3ba434dd08cd6f2ef75ed25a7cddf1617c441e32fb74efcf6124183b1fcc254b6d96d5ab3a7f967ed070df8a262d607b languageName: node linkType: hard @@ -12026,51 +10737,51 @@ __metadata: languageName: node linkType: hard -"@truffle/dashboard-message-bus-client@npm:^0.1.11": - version: 0.1.11 - resolution: "@truffle/dashboard-message-bus-client@npm:0.1.11" +"@truffle/dashboard-message-bus-client@npm:^0.1.12": + version: 0.1.12 + resolution: "@truffle/dashboard-message-bus-client@npm:0.1.12" dependencies: - "@truffle/dashboard-message-bus-common": ^0.1.6 - "@truffle/promise-tracker": ^0.1.6 - axios: 1.2.4 + "@truffle/dashboard-message-bus-common": ^0.1.7 + "@truffle/promise-tracker": ^0.1.7 + axios: 1.5.0 debug: ^4.3.1 delay: ^5.0.0 isomorphic-ws: ^4.0.1 node-abort-controller: ^3.0.1 tiny-typed-emitter: ^2.1.0 ws: ^7.2.0 - checksum: 0163cf04e6c692d2c699e9f6219b64f460b04395c3eb7c84773219341dbefe4082b1e35a1a6f972ee475ad2ed810cc641831f33019cb6b2c4ff4afc63949d5fa + checksum: 7b1446d5498bab3dd8d389f51cdcc01bdd0cfabf50938fcb3bbb615a896be2da18aff59133f3a78bfe8c7a9a453a41e1a03e5a2fce9615b3596bdc5d462dfc94 languageName: node linkType: hard -"@truffle/dashboard-message-bus-common@npm:^0.1.6": - version: 0.1.6 - resolution: "@truffle/dashboard-message-bus-common@npm:0.1.6" - checksum: e985217d874754d1ede8bc16df797d3caac83287c7a1d6ce3a44e78740ed30c0718b807dd8c31ad002a2b413e24eeb320d53cd3faf23af6a136d7e2ab945bc5b +"@truffle/dashboard-message-bus-common@npm:^0.1.7": + version: 0.1.7 + resolution: "@truffle/dashboard-message-bus-common@npm:0.1.7" + checksum: f1adcbd542f4b3c25c920ae4dabd694870c0754469e6a309bacc035aa23d242c542eda33bac8250121c457fdf38b35396d0bf9730e7cc8f132b80ca460adf425 languageName: node linkType: hard "@truffle/db-loader@npm:^0.2.33": - version: 0.2.33 - resolution: "@truffle/db-loader@npm:0.2.33" + version: 0.2.36 + resolution: "@truffle/db-loader@npm:0.2.36" dependencies: - "@truffle/db": ^2.0.33 + "@truffle/db": ^2.0.36 dependenciesMeta: "@truffle/db": optional: true - checksum: 90863196d2cd5273c4b8f709049dda69dc4302496dcd576f678e8b924519202429414f8df7eb7c7a4a17ffdc936561d070a187ca8f0192e96bd6a41c09aa1380 + checksum: a39fb6c454d192590227b94d4a23a03b55133edb2e86ce17b19c27aa8b834252544225be0e9f1f99c4b246ab20eaeec27ebf71ce8ef1549fdffb315ab60fdb16 languageName: node linkType: hard -"@truffle/db@npm:^2.0.33": - version: 2.0.33 - resolution: "@truffle/db@npm:2.0.33" +"@truffle/db@npm:^2.0.33, @truffle/db@npm:^2.0.36": + version: 2.0.36 + resolution: "@truffle/db@npm:2.0.36" dependencies: "@graphql-tools/delegate": ^8.4.3 "@graphql-tools/schema": ^8.3.1 - "@truffle/abi-utils": ^1.0.2 - "@truffle/code-utils": ^3.0.3 - "@truffle/config": ^1.3.59 + "@truffle/abi-utils": ^1.0.3 + "@truffle/code-utils": ^3.0.4 + "@truffle/config": ^1.3.61 abstract-leveldown: ^7.2.0 apollo-server: ^3.11.0 debug: ^4.3.1 @@ -12085,32 +10796,32 @@ __metadata: pouchdb-debug: ^7.1.1 pouchdb-find: ^7.0.0 web3-utils: 1.10.0 - checksum: b7f0be6c6d505e76c0bbc21dea2dc27cb54d734c1c2fd33007f7db01cca2b21a043737a6e730b471cf7dfe3d20b07c617edd7b5e542c84c59412ad0226414204 + checksum: c5109cda3b810488ca4a9afdba3b5db6fd420c403fc46cd7d9c2791f4338b66ad9512940c26c476d209f0a4790239c93102c3a2159e3441fa0e232baadae95e2 languageName: node linkType: hard "@truffle/debug-utils@npm:^6.0.56": - version: 6.0.56 - resolution: "@truffle/debug-utils@npm:6.0.56" + version: 6.0.57 + resolution: "@truffle/debug-utils@npm:6.0.57" dependencies: - "@truffle/codec": ^0.17.2 + "@truffle/codec": ^0.17.3 "@trufflesuite/chromafi": ^3.0.0 bn.js: ^5.1.3 chalk: ^2.4.2 debug: ^4.3.1 highlightjs-solidity: ^2.0.6 - checksum: e8cbe5c1c0bc246a42816361a86b21896ecf4fe3dae1ea6f92c702330377a5867470661b24869323da8b76d0c397c03ff34893193c5ed752bf5fc164a9a9c876 + checksum: 5112cc2f78da1aaab48a6d0fc9a40cd810a373940707d8e6170f5d2c1da41ddacdda8af611a11f5288f98789111332b9a14d7b759584e9c8b90d6bbfef9cec7c languageName: node linkType: hard "@truffle/debugger@npm:^12.1.2": - version: 12.1.2 - resolution: "@truffle/debugger@npm:12.1.2" + version: 12.1.5 + resolution: "@truffle/debugger@npm:12.1.5" dependencies: "@ensdomains/ensjs": ^2.1.0 - "@truffle/abi-utils": ^1.0.2 - "@truffle/codec": ^0.17.2 - "@truffle/source-map-utils": ^1.3.118 + "@truffle/abi-utils": ^1.0.3 + "@truffle/codec": ^0.17.3 + "@truffle/source-map-utils": ^1.3.119 bn.js: ^5.1.3 debug: ^4.3.1 json-pointer: ^0.6.1 @@ -12119,83 +10830,83 @@ __metadata: redux: ^3.7.2 redux-saga: 1.0.0 reselect-tree: ^1.3.7 - semver: 7.5.2 + semver: ^7.5.4 web3: 1.10.0 web3-eth-abi: 1.10.0 - checksum: f097cd4a486ca37bf03ffbc7ed03d25022ca4789be8bc76c55941184a7d3d8a4a1148d289f77b70cd62755aed41b6684e23d529a3c6f54216920629f37fd334c + checksum: 92d04211bb0e22155e1dccd1b6f358cc777b524111af12ddabbd4986e747b923928dc3c8ba3203387ec9df64b05976aaea4efbd697008ad8ffbbfd171e472d63 languageName: node linkType: hard -"@truffle/error@npm:^0.2.1": - version: 0.2.1 - resolution: "@truffle/error@npm:0.2.1" - checksum: 2a7967786fc30aac4b18522f64295511358e952759314c766e5722fc21b3561b0a9177d0346ebca83e9c8d454950aa48b4efe6dffef7b9219ba2d2f1b09de0e8 +"@truffle/error@npm:^0.2.1, @truffle/error@npm:^0.2.2": + version: 0.2.2 + resolution: "@truffle/error@npm:0.2.2" + checksum: 1f2b982e58ee84510b59dd5bba8cbb21a42cb24a58ef46334f43433f3c3586ade5575846965f6fe069b0bf59f3a36134f8792f3b78eb0f4e72b8cb2ad8e323e2 languageName: node linkType: hard -"@truffle/events@npm:^0.1.24": - version: 0.1.24 - resolution: "@truffle/events@npm:0.1.24" +"@truffle/events@npm:^0.1.25": + version: 0.1.25 + resolution: "@truffle/events@npm:0.1.25" dependencies: - "@truffle/dashboard-message-bus-client": ^0.1.11 - "@truffle/spinners": ^0.2.4 + "@truffle/dashboard-message-bus-client": ^0.1.12 + "@truffle/spinners": ^0.2.5 debug: ^4.3.1 emittery: ^0.4.1 web3-utils: 1.10.0 - checksum: 8e487dc123c2c333beb677de492d2dec18127837a63da1a26218656035c4ae42c9ba5c547be6d0407f750e97812828898982410109be2b103877ab96b94da53c + checksum: aa45d25c797ce0d9def5cf396684b0f5b207a210c350281175a5e77e7a41ea30208ee8b221f4dfaa617141fe724d5d96d241c6d7e1746351851e258bd53ccb9e languageName: node linkType: hard -"@truffle/interface-adapter@npm:^0.5.35": - version: 0.5.35 - resolution: "@truffle/interface-adapter@npm:0.5.35" +"@truffle/interface-adapter@npm:^0.5.35, @truffle/interface-adapter@npm:^0.5.37": + version: 0.5.37 + resolution: "@truffle/interface-adapter@npm:0.5.37" dependencies: bn.js: ^5.1.3 ethers: ^4.0.32 web3: 1.10.0 - checksum: 9b58701d48b91178ab0ceff6970ba6cc109c08782e553a65ebfb30b29406f4363344576d0696f3e83e508110c78c34caf27ef6708817c334899c98c1f8369a07 + checksum: 96e8cd17fdf5561df04d2aad2943e7b0f599afb07c0ba750c26e5db0c069cbd2e4a545f2185f5362ccd9b0a46f936dd5b96b879a9fc51b73a5b6d0919c99e5cf languageName: node linkType: hard -"@truffle/promise-tracker@npm:^0.1.6": - version: 0.1.6 - resolution: "@truffle/promise-tracker@npm:0.1.6" - checksum: 63c98bbd25c96ebb09d453960534ada50c04a21723cd1ded59cd8ea41f67b26fde5c5b66f31110ef3d94774973bfb3f276fc71c214c8d4f56c2a49918ffba27d +"@truffle/promise-tracker@npm:^0.1.7": + version: 0.1.7 + resolution: "@truffle/promise-tracker@npm:0.1.7" + checksum: 992b049bec33a21b57109b63abfeeedcf0e5d19634a1ab16805f76aa86d8b89098b0cf772a70c530147b87b7315243b844143cf26ccc7e8c484995434a3ea5e8 languageName: node linkType: hard -"@truffle/provider@npm:^0.3.11": - version: 0.3.11 - resolution: "@truffle/provider@npm:0.3.11" +"@truffle/provider@npm:^0.3.13": + version: 0.3.13 + resolution: "@truffle/provider@npm:0.3.13" dependencies: - "@truffle/error": ^0.2.1 - "@truffle/interface-adapter": ^0.5.35 + "@truffle/error": ^0.2.2 + "@truffle/interface-adapter": ^0.5.37 debug: ^4.3.1 web3: 1.10.0 - checksum: fb43675fcf2d185194fea84bd07587417429ee1e8410a69299f0f664d3ccf614c5c44337c452cc6b72ed42811b5b39c2a73cb6551a164728b34faeb91be613d3 + checksum: efd5c2dfb1d3e8efd037d031a640bcfbdb2e12a4e832c6e3ba0ac5240334cd1b4a6755638c82575e7d79b05698a36fce4a83486b5556008d93cd66ff0c2c7a2f languageName: node linkType: hard -"@truffle/source-map-utils@npm:^1.3.118": - version: 1.3.118 - resolution: "@truffle/source-map-utils@npm:1.3.118" +"@truffle/source-map-utils@npm:^1.3.119": + version: 1.3.119 + resolution: "@truffle/source-map-utils@npm:1.3.119" dependencies: - "@truffle/code-utils": ^3.0.3 - "@truffle/codec": ^0.17.2 + "@truffle/code-utils": ^3.0.4 + "@truffle/codec": ^0.17.3 debug: ^4.3.1 json-pointer: ^0.6.1 node-interval-tree: ^1.3.3 web3-utils: 1.10.0 - checksum: e4970ded6aa1561dcef2f823ce858d9f530fcfe6ae787c8318f4f5dfffab25b86dc3c6bedadd9438440fb0f31c9ce20a6a31a8fbd0a9ff02615a316f3b427c64 + checksum: 55e9718bf7a147615ba30479214e68762f205b01a9ac5a30a8a6c307e680bf21af2bec5b14454f02f41eb85f441bba45c744bbf66e49132b3528e66c0c2baa09 languageName: node linkType: hard -"@truffle/spinners@npm:^0.2.4": - version: 0.2.4 - resolution: "@truffle/spinners@npm:0.2.4" +"@truffle/spinners@npm:^0.2.5": + version: 0.2.5 + resolution: "@truffle/spinners@npm:0.2.5" dependencies: "@trufflesuite/spinnies": ^0.1.1 - checksum: 567d7d1e2dd23f43bd3cb58c8f00c153d35c684558d0d40d1a7b23b4da15149f511fcd9b1e9bdecd6da63d434deefaf4d28e444b098df79bd1cac17000e3f24c + checksum: 3cdb53975a3c84cdae2c8176e5736c1a9abe575b7f8ac7df906f6f141f02f9dc038c9fbaaed6175d3f2fe170b9046c722fc1f454a35f790074f15805486b7ccc languageName: node linkType: hard @@ -12260,30 +10971,30 @@ __metadata: linkType: hard "@tsconfig/node10@npm:^1.0.7": - version: 1.0.8 - resolution: "@tsconfig/node10@npm:1.0.8" - checksum: b8d5fffbc6b17ef64ef74f7fdbccee02a809a063ade785c3648dae59406bc207f70ea2c4296f92749b33019fa36a5ae716e42e49cc7f1bbf0fd147be0d6b970a + version: 1.0.9 + resolution: "@tsconfig/node10@npm:1.0.9" + checksum: a33ae4dc2a621c0678ac8ac4bceb8e512ae75dac65417a2ad9b022d9b5411e863c4c198b6ba9ef659e14b9fb609bbec680841a2e84c1172df7a5ffcf076539df languageName: node linkType: hard "@tsconfig/node12@npm:^1.0.7": - version: 1.0.9 - resolution: "@tsconfig/node12@npm:1.0.9" - checksum: a01b2400ab3582b86b589c6d31dcd0c0656f333adecde85d6d7d4086adb059808b82692380bb169546d189bf771ae21d02544a75b57bd6da4a5dd95f8567bec9 + version: 1.0.11 + resolution: "@tsconfig/node12@npm:1.0.11" + checksum: 5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a languageName: node linkType: hard "@tsconfig/node14@npm:^1.0.0": - version: 1.0.1 - resolution: "@tsconfig/node14@npm:1.0.1" - checksum: 976345e896c0f059867f94f8d0f6ddb8b1844fb62bf36b727de8a9a68f024857e5db97ed51d3325e23e0616a5e48c034ff51a8d595b3fe7e955f3587540489be + version: 1.0.3 + resolution: "@tsconfig/node14@npm:1.0.3" + checksum: 19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d languageName: node linkType: hard "@tsconfig/node16@npm:^1.0.2": - version: 1.0.2 - resolution: "@tsconfig/node16@npm:1.0.2" - checksum: ca94d3639714672bbfd55f03521d3f56bb6a25479bd425da81faf21f13e1e9d15f40f97377dedbbf477a5841c5b0c8f4cd1b391f33553d750b9202c54c2c07aa + version: 1.0.4 + resolution: "@tsconfig/node16@npm:1.0.4" + checksum: 202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff languageName: node linkType: hard @@ -12322,11 +11033,11 @@ __metadata: linkType: hard "@types/accepts@npm:^1.3.5": - version: 1.3.5 - resolution: "@types/accepts@npm:1.3.5" + version: 1.3.7 + resolution: "@types/accepts@npm:1.3.7" dependencies: "@types/node": "*" - checksum: 590b7580570534a640510c071e09074cf63b5958b237a728f94322567350aea4d239f8a9d897a12b15c856b992ee4d7907e9812bb079886af2c00714e7fb3f60 + checksum: 7678cf74976e16093aff6e6f9755826faf069ac1e30179276158ce46ea246348ff22ca6bdd46cef08428881337d9ceefbf00bab08a7731646eb9fc9449d6a1e7 languageName: node linkType: hard @@ -12346,70 +11057,57 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.0.0": - version: 7.20.2 - resolution: "@types/babel__core@npm:7.20.2" +"@types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14": + version: 7.20.5 + resolution: "@types/babel__core@npm:7.20.5" dependencies: "@babel/parser": ^7.20.7 "@babel/types": ^7.20.7 "@types/babel__generator": "*" "@types/babel__template": "*" "@types/babel__traverse": "*" - checksum: 564fbaa8ff1305d50807ada0ec227c3e7528bebb2f8fe6b2ed88db0735a31511a74ad18729679c43eeed8025ed29d408f53059289719e95ab1352ed559a100bd - languageName: node - linkType: hard - -"@types/babel__core@npm:^7.1.14": - version: 7.1.18 - resolution: "@types/babel__core@npm:7.1.18" - dependencies: - "@babel/parser": ^7.1.0 - "@babel/types": ^7.0.0 - "@types/babel__generator": "*" - "@types/babel__template": "*" - "@types/babel__traverse": "*" - checksum: 2e5b5d7c84f347d3789575486e58b0df5c91613abc3d27e716274aba3048518e07e1f068250ba829e2ed58532ccc88da595ce95ba2688e7bbcd7c25a3c6627ed + checksum: a3226f7930b635ee7a5e72c8d51a357e799d19cbf9d445710fa39ab13804f79ab1a54b72ea7d8e504659c7dfc50675db974b526142c754398d7413aa4bc30845 languageName: node linkType: hard "@types/babel__generator@npm:*": - version: 7.6.4 - resolution: "@types/babel__generator@npm:7.6.4" + version: 7.6.8 + resolution: "@types/babel__generator@npm:7.6.8" dependencies: "@babel/types": ^7.0.0 - checksum: 20effbbb5f8a3a0211e95959d06ae70c097fb6191011b73b38fe86deebefad8e09ee014605e0fd3cdaedc73d158be555866810e9166e1f09e4cfd880b874dcb0 + checksum: 5b332ea336a2efffbdeedb92b6781949b73498606ddd4205462f7d96dafd45ff3618770b41de04c4881e333dd84388bfb8afbdf6f2764cbd98be550d85c6bb48 languageName: node linkType: hard "@types/babel__template@npm:*": - version: 7.4.1 - resolution: "@types/babel__template@npm:7.4.1" + version: 7.4.4 + resolution: "@types/babel__template@npm:7.4.4" dependencies: "@babel/parser": ^7.1.0 "@babel/types": ^7.0.0 - checksum: 649fe8b42c2876be1fd28c6ed9b276f78152d5904ec290b6c861d9ef324206e0a5c242e8305c421ac52ecf6358fa7e32ab7a692f55370484825c1df29b1596ee + checksum: d7a02d2a9b67e822694d8e6a7ddb8f2b71a1d6962dfd266554d2513eefbb205b33ca71a0d163b1caea3981ccf849211f9964d8bd0727124d18ace45aa6c9ae29 languageName: node linkType: hard -"@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.6": - version: 7.14.2 - resolution: "@types/babel__traverse@npm:7.14.2" +"@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.4, @types/babel__traverse@npm:^7.0.6": + version: 7.20.5 + resolution: "@types/babel__traverse@npm:7.20.5" dependencies: - "@babel/types": ^7.3.0 - checksum: a797ea09c72307569e3ee08aa3900ca744ce3091114084f2dc59b67a45ee7d01df7865252790dbfa787a7915ce892cdc820c9b920f3683292765fc656b08dc63 + "@babel/types": ^7.20.7 + checksum: 608e0ab4fc31cd47011d98942e6241b34d461608c0c0e153377c5fd822c436c475f1ded76a56bfa76a1adf8d9266b727bbf9bfac90c4cb152c97f30dadc5b7e8 languageName: node linkType: hard -"@types/babel__traverse@npm:^7.0.4": - version: 7.20.1 - resolution: "@types/babel__traverse@npm:7.20.1" +"@types/bn.js@npm:*, @types/bn.js@npm:^5.1.0, @types/bn.js@npm:^5.1.1": + version: 5.1.5 + resolution: "@types/bn.js@npm:5.1.5" dependencies: - "@babel/types": ^7.20.7 - checksum: 58341e23c649c0eba134a1682d4f20d027fad290d92e5740faa1279978f6ed476fc467ae51ce17a877e2566d805aeac64eae541168994367761ec883a4150221 + "@types/node": "*" + checksum: c87b28c4af74545624f8a3dae5294b16aa190c222626e8d4b2e327b33b1a3f1eeb43e7a24d914a9774bca43d8cd6e1cb0325c1f4b3a244af6693a024e1d918e6 languageName: node linkType: hard -"@types/bn.js@npm:*, @types/bn.js@npm:5.1.0, @types/bn.js@npm:^5.1.0": +"@types/bn.js@npm:5.1.0": version: 5.1.0 resolution: "@types/bn.js@npm:5.1.0" dependencies: @@ -12427,16 +11125,17 @@ __metadata: languageName: node linkType: hard -"@types/bn.js@npm:^5.1.1": - version: 5.1.1 - resolution: "@types/bn.js@npm:5.1.1" +"@types/body-parser@npm:*": + version: 1.19.5 + resolution: "@types/body-parser@npm:1.19.5" dependencies: + "@types/connect": "*" "@types/node": "*" - checksum: e50ed2dd3abe997e047caf90e0352c71e54fc388679735217978b4ceb7e336e51477791b715f49fd77195ac26dd296c7bad08a3be9750e235f9b2e1edb1b51c2 + checksum: 1e251118c4b2f61029cc43b0dc028495f2d1957fe8ee49a707fb940f86a9bd2f9754230805598278fe99958b49e9b7e66eec8ef6a50ab5c1f6b93e1ba2aaba82 languageName: node linkType: hard -"@types/body-parser@npm:*, @types/body-parser@npm:1.19.2": +"@types/body-parser@npm:1.19.2": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" dependencies: @@ -12467,15 +11166,15 @@ __metadata: linkType: hard "@types/bonjour@npm:^3.5.9": - version: 3.5.10 - resolution: "@types/bonjour@npm:3.5.10" + version: 3.5.13 + resolution: "@types/bonjour@npm:3.5.13" dependencies: "@types/node": "*" - checksum: bfcadb042a41b124c4e3de4925e3be6d35b78f93f27c4535d5ff86980dc0f8bc407ed99b9b54528952dc62834d5a779392f7a12c2947dd19330eb05a6bcae15a + checksum: e827570e097bd7d625a673c9c208af2d1a22fa3885c0a1646533cf24394c839c3e5f60ac1bc60c0ddcc69c0615078c9fb2c01b42596c7c582d895d974f2409ee languageName: node linkType: hard -"@types/cacheable-request@npm:^6.0.2": +"@types/cacheable-request@npm:^6.0.1, @types/cacheable-request@npm:^6.0.2": version: 6.0.3 resolution: "@types/cacheable-request@npm:6.0.3" dependencies: @@ -12488,16 +11187,16 @@ __metadata: linkType: hard "@types/caseless@npm:*": - version: 0.12.2 - resolution: "@types/caseless@npm:0.12.2" - checksum: 430d15911184ad11e0a8aa21d1ec15fcc93b90b63570c37bf16ebd34457482bfc8de3f5eb6771e0ef986ce183270d4297823b0f492c346255967e78f7292388b + version: 0.12.5 + resolution: "@types/caseless@npm:0.12.5" + checksum: f6a3628add76d27005495914c9c3873a93536957edaa5b69c63b46fe10b4649a6fecf16b676c1695f46aab851da47ec6047dcf3570fa8d9b6883492ff6d074e0 languageName: node linkType: hard "@types/chai@npm:^4.3.1": - version: 4.3.5 - resolution: "@types/chai@npm:4.3.5" - checksum: c8f26a88c6b5b53a3275c7f5ff8f107028e3cbb9ff26795fff5f3d9dea07106a54ce9e2dce5e40347f7c4cc35657900aaf0c83934a25a1ae12e61e0f5516e431 + version: 4.3.11 + resolution: "@types/chai@npm:4.3.11" + checksum: d0c05fe5d02b2e6bbca2bd4866a2ab20a59cf729bc04af0060e7a3277eaf2fb65651b90d4c74b0ebf1d152b4b1d49fa8e44143acef276a2bbaa7785fbe5642d3 languageName: node linkType: hard @@ -12532,21 +11231,21 @@ __metadata: linkType: hard "@types/connect-history-api-fallback@npm:^1.3.5": - version: 1.3.5 - resolution: "@types/connect-history-api-fallback@npm:1.3.5" + version: 1.5.4 + resolution: "@types/connect-history-api-fallback@npm:1.5.4" dependencies: "@types/express-serve-static-core": "*" "@types/node": "*" - checksum: 464d06e5ab00f113fa89978633d5eb00d225aeb4ebbadc07f6f3bc337aa7cbfcd74957b2a539d6d47f2e128e956a17819973ec7ae62ade2e16e367a6c38b8d3a + checksum: e1dee43b8570ffac02d2d47a2b4ba80d3ca0dd1840632dafb221da199e59dbe3778d3d7303c9e23c6b401f37c076935a5bc2aeae1c4e5feaefe1c371fe2073fd languageName: node linkType: hard "@types/connect@npm:*": - version: 3.4.35 - resolution: "@types/connect@npm:3.4.35" + version: 3.4.38 + resolution: "@types/connect@npm:3.4.38" dependencies: "@types/node": "*" - checksum: fe81351470f2d3165e8b12ce33542eef89ea893e36dd62e8f7d72566dfb7e448376ae962f9f3ea888547ce8b55a40020ca0e01d637fab5d99567673084542641 + checksum: 7eb1bc5342a9604facd57598a6c62621e244822442976c443efb84ff745246b10d06e8b309b6e80130026a396f19bf6793b7cecd7380169f369dac3bfc46fb99 languageName: node linkType: hard @@ -12593,20 +11292,29 @@ __metadata: languageName: node linkType: hard -"@types/cordova@latest": - version: 0.0.34 - resolution: "@types/cordova@npm:0.0.34" - checksum: 6dfce96c95276fdc35997d73c1fd33482ef6602217edf187ea97de8fcdc668646e6f80b4ed1f3e2926cffeca5958eab8ff258093040f65d803a6364f9134a234 +"@types/cordova@npm:latest": + version: 11.0.3 + resolution: "@types/cordova@npm:11.0.3" + checksum: fb0eb0c614bb83ce886050f84feb1ae47efc469d4c091c74a64c7f99f65f75973ab4055328dacdaccb3fefed8ff57b95a9c220536418e71f1fe961bf6b5e68a1 languageName: node linkType: hard -"@types/cors@npm:2.8.12, @types/cors@npm:^2.8.12": +"@types/cors@npm:2.8.12": version: 2.8.12 resolution: "@types/cors@npm:2.8.12" checksum: 8c45f112c7d1d2d831b4b266f2e6ed33a1887a35dcbfe2a18b28370751fababb7cd045e745ef84a523c33a25932678097bf79afaa367c6cb3fa0daa7a6438257 languageName: node linkType: hard +"@types/cors@npm:^2.8.12": + version: 2.8.17 + resolution: "@types/cors@npm:2.8.17" + dependencies: + "@types/node": "*" + checksum: 469bd85e29a35977099a3745c78e489916011169a664e97c4c3d6538143b0a16e4cc72b05b407dc008df3892ed7bf595f9b7c0f1f4680e169565ee9d64966bde + languageName: node + linkType: hard + "@types/crypto-js@npm:4.0.1": version: 4.0.1 resolution: "@types/crypto-js@npm:4.0.1" @@ -12638,21 +11346,21 @@ __metadata: linkType: hard "@types/debug@npm:^4.1.7": - version: 4.1.7 - resolution: "@types/debug@npm:4.1.7" + version: 4.1.12 + resolution: "@types/debug@npm:4.1.12" dependencies: "@types/ms": "*" - checksum: 0a7b89d8ed72526858f0b61c6fd81f477853e8c4415bb97f48b1b5545248d2ae389931680b94b393b993a7cfe893537a200647d93defe6d87159b96812305adc + checksum: 47876a852de8240bfdaf7481357af2b88cb660d30c72e73789abf00c499d6bc7cd5e52f41c915d1b9cd8ec9fef5b05688d7b7aef17f7f272c2d04679508d1053 languageName: node linkType: hard "@types/docker-modem@npm:*": - version: 3.0.2 - resolution: "@types/docker-modem@npm:3.0.2" + version: 3.0.6 + resolution: "@types/docker-modem@npm:3.0.6" dependencies: "@types/node": "*" "@types/ssh2": "*" - checksum: 1f23db30e6e9bdd4c6d6e43572fb7ac7251d106a1906a9f3faabac393897712a5a9cd5a471baedc0ac8055dab3f48eda331f41a1e2c7c6bbe3c7f433e039151c + checksum: cc58e8189f6ec5a2b8ca890207402178a97ddac8c80d125dc65d8ab29034b5db736de15e99b91b2d74e66d14e26e73b6b8b33216613dd15fd3aa6b82c11a83ed languageName: node linkType: hard @@ -12666,7 +11374,7 @@ __metadata: languageName: node linkType: hard -"@types/elliptic@npm:6.4.14, @types/elliptic@npm:^6.4.9": +"@types/elliptic@npm:6.4.14": version: 6.4.14 resolution: "@types/elliptic@npm:6.4.14" dependencies: @@ -12684,6 +11392,15 @@ __metadata: languageName: node linkType: hard +"@types/elliptic@npm:^6.4.9": + version: 6.4.18 + resolution: "@types/elliptic@npm:6.4.18" + dependencies: + "@types/bn.js": "*" + checksum: c27613c530fb95441e5e6b456c8c9bc26568ca14c546aae6d7c1d8d46869f79a2272feaef266ac00bdb68b2671e6351ed01b91b82266eac30ca9092720825d16 + languageName: node + linkType: hard + "@types/escape-html@npm:1.0.1": version: 1.0.1 resolution: "@types/escape-html@npm:1.0.1" @@ -12692,12 +11409,12 @@ __metadata: linkType: hard "@types/eslint-scope@npm:^3.7.3": - version: 3.7.3 - resolution: "@types/eslint-scope@npm:3.7.3" + version: 3.7.7 + resolution: "@types/eslint-scope@npm:3.7.7" dependencies: "@types/eslint": "*" "@types/estree": "*" - checksum: 6772b05e1b92003d1f295e81bc847a61f4fbe8ddab77ffa49e84ed3f9552513bdde677eb53ef167753901282857dd1d604d9f82eddb34a233495932b2dc3dc17 + checksum: e2889a124aaab0b89af1bab5959847c5bec09809209255de0e63b9f54c629a94781daa04adb66bffcdd742f5e25a17614fb933965093c0eea64aacda4309380e languageName: node linkType: hard @@ -12708,23 +11425,13 @@ __metadata: languageName: node linkType: hard -"@types/eslint@npm:*": - version: 8.4.1 - resolution: "@types/eslint@npm:8.4.1" +"@types/eslint@npm:*, @types/eslint@npm:^7.29.0 || ^8.4.1": + version: 8.56.0 + resolution: "@types/eslint@npm:8.56.0" dependencies: "@types/estree": "*" "@types/json-schema": "*" - checksum: b5790997ee9d3820d16350192d41849b0e2448c9e93650acac672ddf502e35c0a5a25547172a9eec840a96687cd94ba1cee672cbd86640f8f4ff1b65960d2ab9 - languageName: node - linkType: hard - -"@types/eslint@npm:^7.29.0 || ^8.4.1": - version: 8.44.2 - resolution: "@types/eslint@npm:8.44.2" - dependencies: - "@types/estree": "*" - "@types/json-schema": "*" - checksum: 25b3ef61bae96350026593c9914c8a61ee02fde48ab8d568a73ee45032f13c0028c62e47a5ff78715af488dfe8e8bba913f7d30f859f60c7f9e639d328e80482 + checksum: 8eca14c1ca8a4dbbcbf6bed67775db9dd2f9947802d6da39fa0c4c297a1e5465e898332232bb51980586a9a45b1b21bc13fd79fcc81adcd4c86062372e9bab6d languageName: node linkType: hard @@ -12737,10 +11444,10 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*": - version: 0.0.51 - resolution: "@types/estree@npm:0.0.51" - checksum: e56a3bcf759fd9185e992e7fdb3c6a5f81e8ff120e871641607581fb3728d16c811702a7d40fa5f869b7f7b4437ab6a87eb8d98ffafeee51e85bbe955932a189 +"@types/estree@npm:*, @types/estree@npm:^1.0.0": + version: 1.0.5 + resolution: "@types/estree@npm:1.0.5" + checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a languageName: node linkType: hard @@ -12751,13 +11458,6 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:^1.0.0": - version: 1.0.1 - resolution: "@types/estree@npm:1.0.1" - checksum: e9aa175eacb797216fafce4d41e8202c7a75555bc55232dee0f9903d7171f8f19f0ae7d5191bb1a88cb90e65468be508c0df850a9fb81b4433b293a5a749899d - languageName: node - linkType: hard - "@types/express-http-proxy@npm:1.6.2": version: 1.6.2 resolution: "@types/express-http-proxy@npm:1.6.2" @@ -12777,14 +11477,15 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.18": - version: 4.17.28 - resolution: "@types/express-serve-static-core@npm:4.17.28" +"@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.18, @types/express-serve-static-core@npm:^4.17.33": + version: 4.17.41 + resolution: "@types/express-serve-static-core@npm:4.17.41" dependencies: "@types/node": "*" "@types/qs": "*" "@types/range-parser": "*" - checksum: 826489811a5b371c10f02443b4ca894ffc05813bfdf2b60c224f5c18ac9a30a2e518cb9ef9fdfcaa2a1bb17f8bfa4ed1859ccdb252e879c9276271b4ee2df5a9 + "@types/send": "*" + checksum: 12750f6511dd870bbaccfb8208ad1e79361cf197b147f62a3bedc19ec642f3a0f9926ace96705f4bc88ec2ae56f61f7ca8c2438e6b22f5540842b5569c28a121 languageName: node linkType: hard @@ -12799,17 +11500,6 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:^4.17.33": - version: 4.17.33 - resolution: "@types/express-serve-static-core@npm:4.17.33" - dependencies: - "@types/node": "*" - "@types/qs": "*" - "@types/range-parser": "*" - checksum: dce580d16b85f207445af9d4053d66942b27d0c72e86153089fa00feee3e96ae336b7bedb31ed4eea9e553c99d6dd356ed6e0928f135375d9f862a1a8015adf2 - languageName: node - linkType: hard - "@types/express-unless@npm:*": version: 0.5.3 resolution: "@types/express-unless@npm:0.5.3" @@ -12819,15 +11509,15 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:*": - version: 4.17.13 - resolution: "@types/express@npm:4.17.13" +"@types/express@npm:*, @types/express@npm:^4.17.13": + version: 4.17.21 + resolution: "@types/express@npm:4.17.21" dependencies: "@types/body-parser": "*" - "@types/express-serve-static-core": ^4.17.18 + "@types/express-serve-static-core": ^4.17.33 "@types/qs": "*" "@types/serve-static": "*" - checksum: 12a2a0e6c4b993fc0854bec665906788aea0d8ee4392389d7a98a5de1eefdd33c9e1e40a91f3afd274011119c506f7b4126acb97fae62ae20b654974d44cba12 + checksum: fb238298630370a7392c7abdc80f495ae6c716723e114705d7e3fb67e3850b3859bbfd29391463a3fb8c0b32051847935933d99e719c0478710f8098ee7091c5 languageName: node linkType: hard @@ -12867,18 +11557,6 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:^4.17.13": - version: 4.17.17 - resolution: "@types/express@npm:4.17.17" - dependencies: - "@types/body-parser": "*" - "@types/express-serve-static-core": ^4.17.33 - "@types/qs": "*" - "@types/serve-static": "*" - checksum: 0196dacc275ac3ce89d7364885cb08e7fb61f53ca101f65886dbf1daf9b7eb05c0943e2e4bbd01b0cc5e50f37e0eea7e4cbe97d0304094411ac73e1b7998f4da - languageName: node - linkType: hard - "@types/fs-extra@npm:11.0.3": version: 11.0.3 resolution: "@types/fs-extra@npm:11.0.3" @@ -12898,7 +11576,17 @@ __metadata: languageName: node linkType: hard -"@types/glob@npm:*, @types/glob@npm:^7.1.1, @types/glob@npm:~7.2.0": +"@types/glob@npm:*": + version: 8.1.0 + resolution: "@types/glob@npm:8.1.0" + dependencies: + "@types/minimatch": ^5.1.2 + "@types/node": "*" + checksum: 9101f3a9061e40137190f70626aa0e202369b5ec4012c3fabe6f5d229cce04772db9a94fa5a0eb39655e2e4ad105c38afbb4af56a56c0996a8c7d4fc72350e3d + languageName: node + linkType: hard + +"@types/glob@npm:^7.1.1, @types/glob@npm:~7.2.0": version: 7.2.0 resolution: "@types/glob@npm:7.2.0" dependencies: @@ -12915,21 +11603,12 @@ __metadata: languageName: node linkType: hard -"@types/graceful-fs@npm:^4.1.2": - version: 4.1.6 - resolution: "@types/graceful-fs@npm:4.1.6" - dependencies: - "@types/node": "*" - checksum: c3070ccdc9ca0f40df747bced1c96c71a61992d6f7c767e8fd24bb6a3c2de26e8b84135ede000b7e79db530a23e7e88dcd9db60eee6395d0f4ce1dae91369dd4 - languageName: node - linkType: hard - -"@types/graceful-fs@npm:^4.1.3": - version: 4.1.5 - resolution: "@types/graceful-fs@npm:4.1.5" +"@types/graceful-fs@npm:^4.1.2, @types/graceful-fs@npm:^4.1.3": + version: 4.1.9 + resolution: "@types/graceful-fs@npm:4.1.9" dependencies: "@types/node": "*" - checksum: d076bb61f45d0fc42dee496ef8b1c2f8742e15d5e47e90e20d0243386e426c04d4efd408a48875ab432f7960b4ce3414db20ed0fbbfc7bcc89d84e574f6e045a + checksum: 79d746a8f053954bba36bd3d94a90c78de995d126289d656fb3271dd9f1229d33f678da04d10bce6be440494a5a73438e2e363e92802d16b8315b051036c5256 languageName: node linkType: hard @@ -12940,24 +11619,17 @@ __metadata: languageName: node linkType: hard -"@types/http-cache-semantics@npm:*": - version: 4.0.3 - resolution: "@types/http-cache-semantics@npm:4.0.3" - checksum: 8a672e545fd01ba3a9f16000639ac687bdbbc6bc37e534fbcf55ac9036a168c96f953c79e063d67e937d9fc0be41734d8af378f75bf1ecb7a24e499001486053 - languageName: node - linkType: hard - -"@types/http-cache-semantics@npm:^4.0.1": - version: 4.0.1 - resolution: "@types/http-cache-semantics@npm:4.0.1" - checksum: 1048aacf627829f0d5f00184e16548205cd9f964bf0841c29b36bc504509230c40bc57c39778703a1c965a6f5b416ae2cbf4c1d4589c889d2838dd9dbfccf6e9 +"@types/http-cache-semantics@npm:*, @types/http-cache-semantics@npm:^4.0.2": + version: 4.0.4 + resolution: "@types/http-cache-semantics@npm:4.0.4" + checksum: 7f4dd832e618bc1e271be49717d7b4066d77c2d4eed5b81198eb987e532bb3e1c7e02f45d77918185bad936f884b700c10cebe06305f50400f382ab75055f9e8 languageName: node linkType: hard -"@types/http-errors@npm:*, @types/http-errors@npm:2.0.1": - version: 2.0.1 - resolution: "@types/http-errors@npm:2.0.1" - checksum: 3bb0c50b0a652e679a84c30cd0340d696c32ef6558518268c238840346c077f899315daaf1c26c09c57ddd5dc80510f2a7f46acd52bf949e339e35ed3ee9654f +"@types/http-errors@npm:*, @types/http-errors@npm:2.0.4": + version: 2.0.4 + resolution: "@types/http-errors@npm:2.0.4" + checksum: 1f3d7c3b32c7524811a45690881736b3ef741bf9849ae03d32ad1ab7062608454b150a4e7f1351f83d26a418b2d65af9bdc06198f1c079d75578282884c4e8e3 languageName: node linkType: hard @@ -12968,6 +11640,13 @@ __metadata: languageName: node linkType: hard +"@types/http-errors@npm:2.0.1": + version: 2.0.1 + resolution: "@types/http-errors@npm:2.0.1" + checksum: 3bb0c50b0a652e679a84c30cd0340d696c32ef6558518268c238840346c077f899315daaf1c26c09c57ddd5dc80510f2a7f46acd52bf949e339e35ed3ee9654f + languageName: node + linkType: hard + "@types/http-errors@npm:2.0.2": version: 2.0.2 resolution: "@types/http-errors@npm:2.0.2" @@ -12975,19 +11654,12 @@ __metadata: languageName: node linkType: hard -"@types/http-errors@npm:2.0.4": - version: 2.0.4 - resolution: "@types/http-errors@npm:2.0.4" - checksum: 1f3d7c3b32c7524811a45690881736b3ef741bf9849ae03d32ad1ab7062608454b150a4e7f1351f83d26a418b2d65af9bdc06198f1c079d75578282884c4e8e3 - languageName: node - linkType: hard - "@types/http-proxy@npm:^1.17.8": - version: 1.17.9 - resolution: "@types/http-proxy@npm:1.17.9" + version: 1.17.14 + resolution: "@types/http-proxy@npm:1.17.14" dependencies: "@types/node": "*" - checksum: 7a6746d00729b2a9fe9f9dd3453430b099931df879ec8f7a7b5f07b1795f6d99b0512640c45a67390b1e4bacb9401e36824952aeeaf089feba8627a063cf8e00 + checksum: 491320bce3565bbb6c7d39d25b54bce626237cfb6b09e60ee7f77b56ae7c6cbad76f08d47fe01eaa706781124ee3dfad9bb737049254491efd98ed1f014c4e83 languageName: node linkType: hard @@ -13010,37 +11682,37 @@ __metadata: linkType: hard "@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": - version: 2.0.4 - resolution: "@types/istanbul-lib-coverage@npm:2.0.4" - checksum: a25d7589ee65c94d31464c16b72a9dc81dfa0bea9d3e105ae03882d616e2a0712a9c101a599ec482d297c3591e16336962878cb3eb1a0a62d5b76d277a890ce7 + version: 2.0.6 + resolution: "@types/istanbul-lib-coverage@npm:2.0.6" + checksum: 3feac423fd3e5449485afac999dcfcb3d44a37c830af898b689fadc65d26526460bedb889db278e0d4d815a670331796494d073a10ee6e3a6526301fe7415778 languageName: node linkType: hard "@types/istanbul-lib-report@npm:*": - version: 3.0.0 - resolution: "@types/istanbul-lib-report@npm:3.0.0" + version: 3.0.3 + resolution: "@types/istanbul-lib-report@npm:3.0.3" dependencies: "@types/istanbul-lib-coverage": "*" - checksum: 656398b62dc288e1b5226f8880af98087233cdb90100655c989a09f3052b5775bf98ba58a16c5ae642fb66c61aba402e07a9f2bff1d1569e3b306026c59f3f36 + checksum: b91e9b60f865ff08cb35667a427b70f6c2c63e88105eadd29a112582942af47ed99c60610180aa8dcc22382fa405033f141c119c69b95db78c4c709fbadfeeb4 languageName: node linkType: hard "@types/istanbul-reports@npm:^3.0.0": - version: 3.0.1 - resolution: "@types/istanbul-reports@npm:3.0.1" + version: 3.0.4 + resolution: "@types/istanbul-reports@npm:3.0.4" dependencies: "@types/istanbul-lib-report": "*" - checksum: f1ad54bc68f37f60b30c7915886b92f86b847033e597f9b34f2415acdbe5ed742fa559a0a40050d74cdba3b6a63c342cac1f3a64dba5b68b66a6941f4abd7903 + checksum: 93eb18835770b3431f68ae9ac1ca91741ab85f7606f310a34b3586b5a34450ec038c3eed7ab19266635499594de52ff73723a54a72a75b9f7d6a956f01edee95 languageName: node linkType: hard "@types/jest@npm:*": - version: 29.5.10 - resolution: "@types/jest@npm:29.5.10" + version: 29.5.11 + resolution: "@types/jest@npm:29.5.11" dependencies: expect: ^29.0.0 pretty-format: ^29.0.0 - checksum: ef385905787db528de9b6beb2688865c0bb276e64256ed60b9a1a6ffc0b75737456cb5e27e952a3241c5845b6a1da487470010dd30f3ca59c8581624c564a823 + checksum: f892a06ec9f0afa9a61cd7fa316ec614e21d4df1ad301b5a837787e046fcb40dfdf7f264a55e813ac6b9b633cb9d366bd5b8d1cea725e84102477b366df23fdd languageName: node linkType: hard @@ -13085,31 +11757,10 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.6, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8": - version: 7.0.9 - resolution: "@types/json-schema@npm:7.0.9" - checksum: 259d0e25f11a21ba5c708f7ea47196bd396e379fddb79c76f9f4f62c945879dc21657904914313ec2754e443c5018ea8372362f323f30e0792897fdb2098a705 - languageName: node - linkType: hard - -"@types/json-schema@npm:^7.0.12": - version: 7.0.12 - resolution: "@types/json-schema@npm:7.0.12" - checksum: 00239e97234eeb5ceefb0c1875d98ade6e922bfec39dd365ec6bd360b5c2f825e612ac4f6e5f1d13601b8b30f378f15e6faa805a3a732f4a1bbe61915163d293 - languageName: node - linkType: hard - -"@types/json-schema@npm:^7.0.3, @types/json-schema@npm:^7.0.9": - version: 7.0.11 - resolution: "@types/json-schema@npm:7.0.11" - checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d - languageName: node - linkType: hard - -"@types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5": - version: 7.0.13 - resolution: "@types/json-schema@npm:7.0.13" - checksum: 345df21a678fa72fb389f35f33de77833d09d4a142bb2bcb27c18690efa4cf70fc2876e43843cefb3fbdb9fcb12cd3e970a90936df30f53bbee899865ff605ab +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.12, @types/json-schema@npm:^7.0.3, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.6, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": + version: 7.0.15 + resolution: "@types/json-schema@npm:7.0.15" + checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98 languageName: node linkType: hard @@ -13135,11 +11786,11 @@ __metadata: linkType: hard "@types/jsonfile@npm:*": - version: 6.1.3 - resolution: "@types/jsonfile@npm:6.1.3" + version: 6.1.4 + resolution: "@types/jsonfile@npm:6.1.4" dependencies: "@types/node": "*" - checksum: 3f2d0060a567f78b5d666971d5371e72f37294cbfc19069912c76ba9585d209ceb5aac421658f2b3ab922f96b8df53081e9f51d09aef34f2b4882b813a0e0c38 + checksum: 309fda20eb5f1cf68f2df28931afdf189c5e7e6bec64ac783ce737bb98908d57f6f58757ad5da9be37b815645a6f914e2d4f3ac66c574b8fe1ba6616284d0e97 languageName: node linkType: hard @@ -13171,11 +11822,11 @@ __metadata: linkType: hard "@types/jsonwebtoken@npm:^9": - version: 9.0.1 - resolution: "@types/jsonwebtoken@npm:9.0.1" + version: 9.0.5 + resolution: "@types/jsonwebtoken@npm:9.0.5" dependencies: "@types/node": "*" - checksum: a7f0925e9a42ad3ae970364c63c5986d40da5c83d51d3f4e624eb0f064a380376f9e3fb3f2f837390a9ab80143f5d75fd51866da30e110f6b486a3379e1c768f + checksum: 07ab6fee602e5bd3fb5c6dfe4ec400769dc20f1d7fce901feecb4c3af5f5f08323b03ea55de3e49b1aa41e171a59008f6f4318738a735588c5268a63eba25337 languageName: node linkType: hard @@ -13224,9 +11875,9 @@ __metadata: linkType: hard "@types/long@npm:^4.0.0, @types/long@npm:^4.0.1": - version: 4.0.1 - resolution: "@types/long@npm:4.0.1" - checksum: ff9653c33f5000d0f131fd98a950a0343e2e33107dd067a97ac4a3b9678e1a2e39ea44772ad920f54ef6e8f107f76bc92c2584ba905a0dc4253282a4101166d0 + version: 4.0.2 + resolution: "@types/long@npm:4.0.2" + checksum: d16cde7240d834cf44ba1eaec49e78ae3180e724cd667052b194a372f350d024cba8dd3f37b0864931683dab09ca935d52f0c4c1687178af5ada9fc85b0635f4 languageName: node linkType: hard @@ -13238,33 +11889,47 @@ __metadata: linkType: hard "@types/mime@npm:*": - version: 3.0.1 - resolution: "@types/mime@npm:3.0.1" - checksum: 4040fac73fd0cea2460e29b348c1a6173da747f3a87da0dbce80dd7a9355a3d0e51d6d9a401654f3e5550620e3718b5a899b2ec1debf18424e298a2c605346e7 + version: 3.0.4 + resolution: "@types/mime@npm:3.0.4" + checksum: a6139c8e1f705ef2b064d072f6edc01f3c099023ad7c4fce2afc6c2bf0231888202adadbdb48643e8e20da0ce409481a49922e737eca52871b3dc08017455843 languageName: node linkType: hard "@types/mime@npm:^1": - version: 1.3.2 - resolution: "@types/mime@npm:1.3.2" - checksum: 0493368244cced1a69cb791b485a260a422e6fcc857782e1178d1e6f219f1b161793e9f87f5fae1b219af0f50bee24fcbe733a18b4be8fdd07a38a8fb91146fd + version: 1.3.5 + resolution: "@types/mime@npm:1.3.5" + checksum: e29a5f9c4776f5229d84e525b7cd7dd960b51c30a0fb9a028c0821790b82fca9f672dab56561e2acd9e8eed51d431bde52eafdfef30f643586c4162f1aecfc78 + languageName: node + linkType: hard + +"@types/minimatch@npm:*, @types/minimatch@npm:^5.1.2": + version: 5.1.2 + resolution: "@types/minimatch@npm:5.1.2" + checksum: 0391a282860c7cb6fe262c12b99564732401bdaa5e395bee9ca323c312c1a0f45efbf34dce974682036e857db59a5c9b1da522f3d6055aeead7097264c8705a8 languageName: node linkType: hard -"@types/minimatch@npm:*, @types/minimatch@npm:^3.0.3, @types/minimatch@npm:^3.0.4": +"@types/minimatch@npm:^3.0.3, @types/minimatch@npm:^3.0.4": version: 3.0.5 resolution: "@types/minimatch@npm:3.0.5" checksum: c41d136f67231c3131cf1d4ca0b06687f4a322918a3a5adddc87ce90ed9dbd175a3610adee36b106ae68c0b92c637c35e02b58c8a56c424f71d30993ea220b92 languageName: node linkType: hard -"@types/minimist@npm:1.2.2, @types/minimist@npm:^1.2.0, @types/minimist@npm:^1.2.2": +"@types/minimist@npm:1.2.2": version: 1.2.2 resolution: "@types/minimist@npm:1.2.2" checksum: b8da83c66eb4aac0440e64674b19564d9d86c80ae273144db9681e5eeff66f238ade9515f5006ffbfa955ceff8b89ad2bd8ec577d7caee74ba101431fb07045d languageName: node linkType: hard +"@types/minimist@npm:^1.2.0, @types/minimist@npm:^1.2.2": + version: 1.2.5 + resolution: "@types/minimist@npm:1.2.5" + checksum: 477047b606005058ab0263c4f58097136268007f320003c348794f74adedc3166ffc47c80ec3e94687787f2ab7f4e72c468223946e79892cf0fd9e25e9970a90 + languageName: node + linkType: hard + "@types/morgan@npm:1.9.1": version: 1.9.1 resolution: "@types/morgan@npm:1.9.1" @@ -13275,13 +11940,13 @@ __metadata: linkType: hard "@types/ms@npm:*": - version: 0.7.31 - resolution: "@types/ms@npm:0.7.31" - checksum: daadd354aedde024cce6f5aa873fefe7b71b22cd0e28632a69e8b677aeb48ae8caa1c60e5919bb781df040d116b01cb4316335167a3fc0ef6a63fa3614c0f6da + version: 0.7.34 + resolution: "@types/ms@npm:0.7.34" + checksum: f38d36e7b6edecd9badc9cf50474159e9da5fa6965a75186cceaf883278611b9df6669dc3a3cc122b7938d317b68a9e3d573d316fcb35d1be47ec9e468c6bd8a languageName: node linkType: hard -"@types/multer@npm:1.4.7, @types/multer@npm:^1.4.7": +"@types/multer@npm:1.4.7": version: 1.4.7 resolution: "@types/multer@npm:1.4.7" dependencies: @@ -13290,6 +11955,15 @@ __metadata: languageName: node linkType: hard +"@types/multer@npm:^1.4.7": + version: 1.4.11 + resolution: "@types/multer@npm:1.4.11" + dependencies: + "@types/express": "*" + checksum: 3d80b2acdfbc9f3e9027d4467e948925810b67e5622a3017f42f58a3598d34b25376890801e55d0c03973ccc34573abf5218af334e8292ec455832f4ade3e5f5 + languageName: node + linkType: hard + "@types/node-fetch@npm:2.6.4": version: 2.6.4 resolution: "@types/node-fetch@npm:2.6.4" @@ -13301,12 +11975,12 @@ __metadata: linkType: hard "@types/node-fetch@npm:^2.5.0": - version: 2.6.1 - resolution: "@types/node-fetch@npm:2.6.1" + version: 2.6.10 + resolution: "@types/node-fetch@npm:2.6.10" dependencies: "@types/node": "*" - form-data: ^3.0.0 - checksum: a3e5d7f413d1638d795dff03f7b142b1b0e0c109ed210479000ce7b3ea11f9a6d89d9a024c96578d9249570c5fe5287a5f0f4aaba98199222230196ff2d6b283 + form-data: ^4.0.0 + checksum: e0c9a6023752ff6c744a33a3045b9adb11fd1882997ef891bf7ce91f937ddab91c0acee4c8e806a8a5aec0e8d8c132709141e8512fec28030d7cc9ef92c7ff1e languageName: node linkType: hard @@ -13328,6 +12002,15 @@ __metadata: languageName: node linkType: hard +"@types/node-forge@npm:^1.3.0": + version: 1.3.10 + resolution: "@types/node-forge@npm:1.3.10" + dependencies: + "@types/node": "*" + checksum: 363af42c83956c7e2483a71e398a02101ef6a55b4d86386c276315ca98bad02d6050b99fdbe13debcd1bcda250086b4a5b5c15a6fb2953d32420d269865ca7f8 + languageName: node + linkType: hard + "@types/node-vault@npm:0.9.13": version: 0.9.13 resolution: "@types/node-vault@npm:0.9.13" @@ -13338,9 +12021,11 @@ __metadata: linkType: hard "@types/node@npm:*, @types/node@npm:>=10.0.0, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0": - version: 17.0.32 - resolution: "@types/node@npm:17.0.32" - checksum: afb05704b42032566b3da8b2d80a68883cd3b888472d1b8b4dd6c84f8fad371454f083d4e28bd30c10589187296119d92aba255638b30067afe062b5922388a5 + version: 20.10.6 + resolution: "@types/node@npm:20.10.6" + dependencies: + undici-types: ~5.26.4 + checksum: ada40e4ccbda3697dca88f8d13f4c996c493be6fbc15f5f5d3b91096d56bd700786a2c148a92a2b4c5d1f133379e63f754a786b3aebfc6a7d09fc7ea16dc017b languageName: node linkType: hard @@ -13372,10 +12057,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:20.4.7": - version: 20.4.7 - resolution: "@types/node@npm:20.4.7" - checksum: a40d7003f66b56220a2028179e49f950b46fa6dbf860a4a6ecbd6ba7976f05b2f0b31ced39689ec88a7d9e32d07e088c6a06d270b99d5bc13a28291ac2f30ca7 +"@types/node@npm:20.5.1": + version: 20.5.1 + resolution: "@types/node@npm:20.5.1" + checksum: 3dbe611cd67afa987102c8558ee70f848949c5dcfee5f60abc073e55c0d7b048e391bf06bb1e0dc052cb7210ca97136ac496cbaf6e89123c989de6bd125fde82 languageName: node linkType: hard @@ -13396,46 +12081,41 @@ __metadata: linkType: hard "@types/node@npm:^16.18.66": - version: 16.18.66 - resolution: "@types/node@npm:16.18.66" - checksum: 84408652068f8c7e3aa1fa6f333be8044ae802a700eb3b4101fc27d047eefcc742e636809a6318fb0100b1355658649f4a0fc2398fb04f27b1a357f6f3579cd0 - languageName: node - linkType: hard - -"@types/node@npm:^18.0.0": - version: 18.18.5 - resolution: "@types/node@npm:18.18.5" - checksum: fc8c9b2bf226270cf9085a7dac76ce09dd7c3519ec9b687ee2b50385954ab3709c45ca82d002d1536e24286803cd194d7ab7008acebdcd6681b8b19d4277fa5c + version: 16.18.69 + resolution: "@types/node@npm:16.18.69" + checksum: ac7076062e59169ac1907e9347d939ed5f79c6a3ec2a531fe7186caf2fcf8d66de9b87ad42d92c4dfa6cb44b1018ab89fef1e054a82af36deea04ba32a5a670a languageName: node linkType: hard -"@types/node@npm:^18.11.18": - version: 18.17.4 - resolution: "@types/node@npm:18.17.4" - checksum: d4c458202d82c999f38d85ca9ae8a2d3e521645c7f1b908cd6a0303d0e13c7d5eb3f888c41f584ba029ecf802d0a0005b7816c149400371a3c035abc4bd9a4c5 +"@types/node@npm:^18.0.0, @types/node@npm:^18.11.18": + version: 18.19.4 + resolution: "@types/node@npm:18.19.4" + dependencies: + undici-types: ~5.26.4 + checksum: 3a32a31b2df85d4bebb5e3c91ec1a0908d587a2a2fd31ab4eeebd609d1c04bbcc9ba97e290e3230f843c9f43f17efb9f5cde56412b4b0f5acbfe5577179b23c8 languageName: node linkType: hard "@types/normalize-package-data@npm:^2.4.0, @types/normalize-package-data@npm:^2.4.1": - version: 2.4.1 - resolution: "@types/normalize-package-data@npm:2.4.1" - checksum: e87bccbf11f95035c89a132b52b79ce69a1e3652fe55962363063c9c0dae0fe2477ebc585e03a9652adc6f381d24ba5589cc5e51849df4ced3d3e004a7d40ed5 + version: 2.4.4 + resolution: "@types/normalize-package-data@npm:2.4.4" + checksum: 65dff72b543997b7be8b0265eca7ace0e34b75c3e5fee31de11179d08fa7124a7a5587265d53d0409532ecb7f7fba662c2012807963e1f9b059653ec2c83ee05 languageName: node linkType: hard "@types/oauth@npm:*": - version: 0.9.1 - resolution: "@types/oauth@npm:0.9.1" + version: 0.9.4 + resolution: "@types/oauth@npm:0.9.4" dependencies: "@types/node": "*" - checksum: 5c079611b455eff58fba6358e028b191a1e65475600f8ed8d98c1696fedcfb0290aa6c6a19cf50f21a9e2d816ecb43a19f910900d91f8ba3727e33c48f97d7f3 + checksum: eb82393214ddc4e5bff2177cecb80237a7e2562ee94872234dcf822118a6b8bff11efa37e26f98a836b675bc211689272cdecb7d9221a9990dbc5a4b363fc033 languageName: node linkType: hard "@types/parse-json@npm:^4.0.0": - version: 4.0.0 - resolution: "@types/parse-json@npm:4.0.0" - checksum: fd6bce2b674b6efc3db4c7c3d336bd70c90838e8439de639b909ce22f3720d21344f52427f1d9e57b265fcb7f6c018699b99e5e0c208a1a4823014269a6bf35b + version: 4.0.2 + resolution: "@types/parse-json@npm:4.0.2" + checksum: 5bf62eec37c332ad10059252fc0dab7e7da730764869c980b0714777ad3d065e490627be9f40fc52f238ffa3ac4199b19de4127196910576c2fe34dd47c7a470 languageName: node linkType: hard @@ -13470,7 +12150,16 @@ __metadata: languageName: node linkType: hard -"@types/passport@npm:*, @types/passport@npm:1.0.7": +"@types/passport@npm:*": + version: 1.0.16 + resolution: "@types/passport@npm:1.0.16" + dependencies: + "@types/express": "*" + checksum: e4a02fa338536eb82694ea548689a7214b1ca98df6a896080daa2b6a8859db02a1e6244eeefaf6f3cc9c268239bb4a7912049a9ed86192144a65c10e55219f80 + languageName: node + linkType: hard + +"@types/passport@npm:1.0.7": version: 1.0.7 resolution: "@types/passport@npm:1.0.7" dependencies: @@ -13480,11 +12169,11 @@ __metadata: linkType: hard "@types/pbkdf2@npm:^3.0.0": - version: 3.1.0 - resolution: "@types/pbkdf2@npm:3.1.0" + version: 3.1.2 + resolution: "@types/pbkdf2@npm:3.1.2" dependencies: "@types/node": "*" - checksum: d15024b1957c21cf3b8887329d9bd8dfde754cf13a09d76ae25f1391cfc62bb8b8d7b760773c5dbaa748172fba8b3e0c3dbe962af6ccbd69b76df12a48dfba40 + checksum: bebe1e596cbbe5f7d2726a58859e61986c5a42459048e29cb7f2d4d764be6bbb0844572fd5d70ca8955a8a17e8b4ed80984fc4903e165d9efb8807a3fbb051aa languageName: node linkType: hard @@ -13500,27 +12189,27 @@ __metadata: linkType: hard "@types/phoenix@npm:^1.5.4": - version: 1.6.0 - resolution: "@types/phoenix@npm:1.6.0" - checksum: 715d9b9c6e57d6cd32e2260bf51301954a7ec346d51e091de3c579314c9eb6f0d69a8d43b7aae49a0aa280982765fb8c2cce6109a38ca5db3e82697547d0f3db + version: 1.6.4 + resolution: "@types/phoenix@npm:1.6.4" + checksum: 0f13849602db6d9a2a4b9d96386c45471acedf2bc3d6bf6b3289876fa73f0fe0e84c8466bd55c4f2763d33e142e5311c220820fed9ac2a21d9126f1f70a7338f languageName: node linkType: hard "@types/postcss-modules-local-by-default@npm:^4.0.0": - version: 4.0.0 - resolution: "@types/postcss-modules-local-by-default@npm:4.0.0" + version: 4.0.2 + resolution: "@types/postcss-modules-local-by-default@npm:4.0.2" dependencies: postcss: ^8.0.0 - checksum: 093a869240ddafc1b6946f3f6197c2de0ebd2f8ae3d5de7a6ec51aad5d6c8837a503496168f3d6230ddaa2bc4c815426a2353e8ddd88acae6bcb4a03477592d5 + checksum: c4a50f0fab1bacbf2968a05156f0acf10225a605b021dcfb4e39892429507089a91919609111c79d1ed5902c55f9b4ee35c00aa75d98bb18d5415b3cd1223239 languageName: node linkType: hard "@types/postcss-modules-scope@npm:^3.0.1": - version: 3.0.2 - resolution: "@types/postcss-modules-scope@npm:3.0.2" + version: 3.0.4 + resolution: "@types/postcss-modules-scope@npm:3.0.4" dependencies: postcss: ^8.0.0 - checksum: ec47ebe937c47836a5e4edc1f77652d4d92a3ae47e608c8ac806cab083dd4b1f57913c513c3ef6c43fa652ea8df94c8f702a3f2b02a9861d1d927fb868680c08 + checksum: 4249ace34023dc797b47a1041c844d6a772d6339a96e7a45fdacc70d03db8fb2917ac90728c390a743ecf2da821f921761ad2bdb57f4d6936ad4690bc572ad5c languageName: node linkType: hard @@ -13531,14 +12220,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*": - version: 15.7.4 - resolution: "@types/prop-types@npm:15.7.4" - checksum: ef6e1899e59b876c273811b1bd845022fc66d5a3d11cb38a25b6c566b30514ae38fe20a40f67622f362a4f4f7f9224e22d8da101cff3d6e97e11d7b4c307cfc1 - languageName: node - linkType: hard - -"@types/prop-types@npm:^15.7.11": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.11": version: 15.7.11 resolution: "@types/prop-types@npm:15.7.11" checksum: 7519ff11d06fbf6b275029fe03fff9ec377b4cb6e864cac34d87d7146c7f5a7560fd164bdc1d2dbe00b60c43713631251af1fd3d34d46c69cd354602bc0c7c54 @@ -13546,74 +12228,63 @@ __metadata: linkType: hard "@types/q@npm:^1.5.1": - version: 1.5.5 - resolution: "@types/q@npm:1.5.5" - checksum: 3bd386fb97a0e5f1ce1ed7a14e39b60e469b5ca9d920a7f69e0cdb58d22c0f5bdd16637d8c3a5bfeda76663c023564dd47a65389ee9aaabd65aee54803d5ba45 + version: 1.5.8 + resolution: "@types/q@npm:1.5.8" + checksum: ff3b7f09c2746d068dee8d39501f09dbf71728c4facdc9cb0e266ea6615ad97e61267c0606ab3da88d11ef1609ce904cef45a9c56b2b397f742388d7f15bb740 languageName: node linkType: hard "@types/qs@npm:*": - version: 6.9.7 - resolution: "@types/qs@npm:6.9.7" - checksum: 7fd6f9c25053e9b5bb6bc9f9f76c1d89e6c04f7707a7ba0e44cc01f17ef5284adb82f230f542c2d5557d69407c9a40f0f3515e8319afd14e1e16b5543ac6cdba + version: 6.9.11 + resolution: "@types/qs@npm:6.9.11" + checksum: 620ca1628bf3da65662c54ed6ebb120b18a3da477d0bfcc872b696685a9bb1893c3c92b53a1190a8f54d52eaddb6af8b2157755699ac83164604329935e8a7f2 languageName: node linkType: hard "@types/range-parser@npm:*": - version: 1.2.4 - resolution: "@types/range-parser@npm:1.2.4" - checksum: b7c0dfd5080a989d6c8bb0b6750fc0933d9acabeb476da6fe71d8bdf1ab65e37c136169d84148034802f48378ab94e3c37bb4ef7656b2bec2cb9c0f8d4146a95 + version: 1.2.7 + resolution: "@types/range-parser@npm:1.2.7" + checksum: 95640233b689dfbd85b8c6ee268812a732cf36d5affead89e806fe30da9a430767af8ef2cd661024fd97e19d61f3dec75af2df5e80ec3bea000019ab7028629a languageName: node linkType: hard "@types/react-dom@npm:^18.0.0, @types/react-dom@npm:^18.2.17": - version: 18.2.17 - resolution: "@types/react-dom@npm:18.2.17" + version: 18.2.18 + resolution: "@types/react-dom@npm:18.2.18" dependencies: "@types/react": "*" - checksum: 7a4e704ed4be6e0c3ccd8a22ff69386fe548304bf4db090513f42e059ff4c65f7a427790320051524d6578a2e4c9667bb7a80a4c989b72361c019fbe851d9385 + checksum: 8e3da404c980e2b2a76da3852f812ea6d8b9d0e7f5923fbaf3bfbbbfa1d59116ff91c129de8f68e9b7668a67ae34484fe9df74d5a7518cf8591ec07a0c4dad57 languageName: node linkType: hard -"@types/react-transition-group@npm:^4.4.9": - version: 4.4.9 - resolution: "@types/react-transition-group@npm:4.4.9" +"@types/react-transition-group@npm:^4.4.10": + version: 4.4.10 + resolution: "@types/react-transition-group@npm:4.4.10" dependencies: "@types/react": "*" - checksum: be9e256e53919a7cf3b4a075f6d01c0a2dd3a67911dd28276aa6158be4beade4ca5327cbf1f096c28b413e04989f069122319b02e5a09c280d903a0accea9ead + checksum: fe2ea11f70251e9f79f368e198c18fd469b1d4f1e1d44e4365845b44e15974b0ec925100036f449b023b0ca3480a82725c5f0a73040e282ad32ec7b0def9b57c languageName: node linkType: hard -"@types/react@npm:*": - version: 18.2.21 - resolution: "@types/react@npm:18.2.21" +"@types/react@npm:*, @types/react@npm:^18.2.39": + version: 18.2.46 + resolution: "@types/react@npm:18.2.46" dependencies: "@types/prop-types": "*" "@types/scheduler": "*" csstype: ^3.0.2 - checksum: ffed203bfe7aad772b8286f7953305c9181ac3a8f27d3f5400fbbc2a8e27ca8e5bbff818ee014f39ca0d19d2b3bb154e5bdbec7e232c6f80b59069375aa78349 + checksum: cb0e4dc7f41988a059e1246a19ec377101f5b16097ec4bf7000ef3c431ec0c8c873f40e95075821f908db1f4e3352775f0f18cea53dcad14dce67c0f5110f2bd languageName: node linkType: hard "@types/react@npm:^17.0.52": - version: 17.0.62 - resolution: "@types/react@npm:17.0.62" - dependencies: - "@types/prop-types": "*" - "@types/scheduler": "*" - csstype: ^3.0.2 - checksum: 428a5aff44824ef504e9a9259b5894fe44a5db1c344b536990f07e132900ff5b34cbef0be77a84f30f37be1f88fc8b56dce328f568de8d65de3bfe414c05b2e1 - languageName: node - linkType: hard - -"@types/react@npm:^18.2.39": - version: 18.2.39 - resolution: "@types/react@npm:18.2.39" + version: 17.0.74 + resolution: "@types/react@npm:17.0.74" dependencies: "@types/prop-types": "*" "@types/scheduler": "*" csstype: ^3.0.2 - checksum: 9bcb1f1f060f1bf8f4730fb1c7772d0323a6e707f274efee3b976c40d92af4677df4d88e9135faaacf34e13e02f92ef24eb7d0cbcf7fb75c1883f5623ccb19f4 + checksum: 0234cee33281607db663a9d878e799458d9ab7e31f818528c75f0d0047175fb06db0672b0d2b93977ff066c07636a9a09b121178a55cbb4a4fe82ff61dae7474 languageName: node linkType: hard @@ -13640,14 +12311,14 @@ __metadata: linkType: hard "@types/request@npm:^2.48.8": - version: 2.48.11 - resolution: "@types/request@npm:2.48.11" + version: 2.48.12 + resolution: "@types/request@npm:2.48.12" dependencies: "@types/caseless": "*" "@types/node": "*" "@types/tough-cookie": "*" form-data: ^2.5.0 - checksum: fa3682c6420d2da8223f12d8270ab51db6f1559f075379e8c87990785a5009ac38966f3ac0a7c61e31e2dd46117a6a0fee8c652d988772625a84c73348f027af + checksum: 20dfad0a46b4249bf42f09c51fbd4d02ec6738c5152194b5c7c69bab80b00eae9cc71df4489ffa929d0968d453ef7d0823d1f98871efed563a4fdb57bf0a4c58 languageName: node linkType: hard @@ -13661,11 +12332,11 @@ __metadata: linkType: hard "@types/responselike@npm:^1.0.0": - version: 1.0.2 - resolution: "@types/responselike@npm:1.0.2" + version: 1.0.3 + resolution: "@types/responselike@npm:1.0.3" dependencies: "@types/node": "*" - checksum: ff1767e947eb7d49849e4566040453efcd894888e85b398f7f8cb731552f303f26aceda573b680a142b77ec5fb6c79535d9c6d047d9f936c386dbf3863d2ae17 + checksum: 6ac4b35723429b11b117e813c7acc42c3af8b5554caaf1fc750404c1ae59f9b7376bc69b9e9e194a5a97357a597c2228b7173d317320f0360d617b6425212f58 languageName: node linkType: hard @@ -13677,9 +12348,9 @@ __metadata: linkType: hard "@types/retry@npm:^0.12.0": - version: 0.12.1 - resolution: "@types/retry@npm:0.12.1" - checksum: 5f46b2556053655f78262bb33040dc58417c900457cc63ff37d6c35349814471453ef511af0cec76a540c601296cd2b22f64bab1ab649c0dacc0223765ba876c + version: 0.12.5 + resolution: "@types/retry@npm:0.12.5" + checksum: 3fb6bf91835ca0eb2987567d6977585235a7567f8aeb38b34a8bb7bbee57ac050ed6f04b9998cda29701b8c893f5dfe315869bc54ac17e536c9235637fe351a2 languageName: node linkType: hard @@ -13693,13 +12364,13 @@ __metadata: linkType: hard "@types/scheduler@npm:*": - version: 0.16.2 - resolution: "@types/scheduler@npm:0.16.2" - checksum: b6b4dcfeae6deba2e06a70941860fb1435730576d3689225a421280b7742318d1548b3d22c1f66ab68e414f346a9542f29240bc955b6332c5b11e561077583bc + version: 0.16.8 + resolution: "@types/scheduler@npm:0.16.8" + checksum: 6c091b096daa490093bf30dd7947cd28e5b2cd612ec93448432b33f724b162587fed9309a0acc104d97b69b1d49a0f3fc755a62282054d62975d53d7fd13472d languageName: node linkType: hard -"@types/secp256k1@npm:4.0.3, @types/secp256k1@npm:^4.0.1": +"@types/secp256k1@npm:4.0.3": version: 4.0.3 resolution: "@types/secp256k1@npm:4.0.3" dependencies: @@ -13708,6 +12379,15 @@ __metadata: languageName: node linkType: hard +"@types/secp256k1@npm:^4.0.1": + version: 4.0.6 + resolution: "@types/secp256k1@npm:4.0.6" + dependencies: + "@types/node": "*" + checksum: 984494caf49a4ce99fda2b9ea1840eb47af946b8c2737314108949bcc0c06b4880e871296bd49ed6ea4c8423e3a302ad79fec43abfc987330e7eb98f0c4e8ba4 + languageName: node + linkType: hard + "@types/seedrandom@npm:3.0.1": version: 3.0.1 resolution: "@types/seedrandom@npm:3.0.1" @@ -13723,39 +12403,39 @@ __metadata: linkType: hard "@types/semver@npm:^7.3.12, @types/semver@npm:^7.5.0": - version: 7.5.0 - resolution: "@types/semver@npm:7.5.0" - checksum: 0a64b9b9c7424d9a467658b18dd70d1d781c2d6f033096a6e05762d20ebbad23c1b69b0083b0484722aabf35640b78ccc3de26368bcae1129c87e9df028a22e2 + version: 7.5.6 + resolution: "@types/semver@npm:7.5.6" + checksum: 563a0120ec0efcc326567db2ed920d5d98346f3638b6324ea6b50222b96f02a8add3c51a916b6897b51523aad8ac227d21d3dcf8913559f1bfc6c15b14d23037 languageName: node linkType: hard -"@types/serve-index@npm:^1.9.1": - version: 1.9.1 - resolution: "@types/serve-index@npm:1.9.1" +"@types/send@npm:*": + version: 0.17.4 + resolution: "@types/send@npm:0.17.4" dependencies: - "@types/express": "*" - checksum: 026f3995fb500f6df7c3fe5009e53bad6d739e20b84089f58ebfafb2f404bbbb6162bbe33f72d2f2af32d5b8d3799c8e179793f90d9ed5871fb8591190bb6056 + "@types/mime": ^1 + "@types/node": "*" + checksum: cf4db48251bbb03cd6452b4de6e8e09e2d75390a92fd798eca4a803df06444adc94ed050246c94c7ed46fb97be1f63607f0e1f13c3ce83d71788b3e08640e5e0 languageName: node linkType: hard -"@types/serve-static@npm:*": - version: 1.13.10 - resolution: "@types/serve-static@npm:1.13.10" +"@types/serve-index@npm:^1.9.1": + version: 1.9.4 + resolution: "@types/serve-index@npm:1.9.4" dependencies: - "@types/mime": ^1 - "@types/node": "*" - checksum: eaca858739483e3ded254cad7d7a679dc2c8b3f52c8bb0cd845b3b7eb1984bde0371fdcb0a5c83aa12e6daf61b6beb762545021f520f08a1fe882a3fa4ea5554 + "@types/express": "*" + checksum: 72727c88d54da5b13275ebfb75dcdc4aa12417bbe9da1939e017c4c5f0c906fae843aa4e0fbfe360e7ee9df2f3d388c21abfc488f77ce58693fb57809f8ded92 languageName: node linkType: hard -"@types/serve-static@npm:^1.13.10": - version: 1.15.2 - resolution: "@types/serve-static@npm:1.15.2" +"@types/serve-static@npm:*, @types/serve-static@npm:^1.13.10": + version: 1.15.5 + resolution: "@types/serve-static@npm:1.15.5" dependencies: "@types/http-errors": "*" "@types/mime": "*" "@types/node": "*" - checksum: 15c261dbfc57890f7cc17c04d5b22b418dfa0330c912b46c5d8ae2064da5d6f844ef7f41b63c7f4bbf07675e97ebe6ac804b032635ec742ae45d6f1274259b3e + checksum: 0ff4b3703cf20ba89c9f9e345bc38417860a88e85863c8d6fe274a543220ab7f5f647d307c60a71bb57dc9559f0890a661e8dc771a6ec5ef195d91c8afc4a893 languageName: node linkType: hard @@ -13790,15 +12470,24 @@ __metadata: linkType: hard "@types/sockjs@npm:^0.3.33": - version: 0.3.33 - resolution: "@types/sockjs@npm:0.3.33" + version: 0.3.36 + resolution: "@types/sockjs@npm:0.3.36" dependencies: "@types/node": "*" - checksum: b9bbb2b5c5ead2fb884bb019f61a014e37410bddd295de28184e1b2e71ee6b04120c5ba7b9954617f0bdf962c13d06249ce65004490889c747c80d3f628ea842 + checksum: b4b5381122465d80ea8b158537c00bc82317222d3fb31fd7229ff25b31fa89134abfbab969118da55622236bf3d8fee75759f3959908b5688991f492008f29bc languageName: node linkType: hard -"@types/ssh2-streams@npm:*, @types/ssh2-streams@npm:0.1.9": +"@types/ssh2-streams@npm:*": + version: 0.1.12 + resolution: "@types/ssh2-streams@npm:0.1.12" + dependencies: + "@types/node": "*" + checksum: aa0aa45e40cfca34b4443dafa8d28ff49196c05c71867cbf0a8cdd5127be4d8a3840819543fcad16535653ca8b0e29217671ed6500ff1e7a3ad2442c5d1b40a6 + languageName: node + linkType: hard + +"@types/ssh2-streams@npm:0.1.9": version: 0.1.9 resolution: "@types/ssh2-streams@npm:0.1.9" dependencies: @@ -13807,13 +12496,12 @@ __metadata: languageName: node linkType: hard -"@types/ssh2@npm:*": - version: 0.5.51 - resolution: "@types/ssh2@npm:0.5.51" +"@types/ssh2@npm:*, @types/ssh2@npm:^1.11.9": + version: 1.11.18 + resolution: "@types/ssh2@npm:1.11.18" dependencies: - "@types/node": "*" - "@types/ssh2-streams": "*" - checksum: 7822d4541abf7b7b431e00d28589f91b0b5db3be24880ce407fab6a9daf18098fe56b67877925f30415458c70d302de1962ba7ab5317c43ede80c91fb74498e8 + "@types/node": ^18.11.18 + checksum: 4ec15cf2c1184c4bf1de9c7d92f39c588225289200a8956e230c9f153957a71aeae759a7ab7667191be1f497081598f03f91c8e3f43391dff71381be406a6647 languageName: node linkType: hard @@ -13827,19 +12515,10 @@ __metadata: languageName: node linkType: hard -"@types/ssh2@npm:^1.11.9": - version: 1.11.13 - resolution: "@types/ssh2@npm:1.11.13" - dependencies: - "@types/node": ^18.11.18 - checksum: 89bfaf9363ca9ca2db8e3ff22e37d2ea21637aec421cac2d54be6b1321fe70250a056646e74e0df0e8c08efa81f7b14a60bb614c24319768655af06165350093 - languageName: node - linkType: hard - "@types/stack-utils@npm:^2.0.0": - version: 2.0.1 - resolution: "@types/stack-utils@npm:2.0.1" - checksum: 205fdbe3326b7046d7eaf5e494d8084f2659086a266f3f9cf00bccc549c8e36e407f88168ad4383c8b07099957ad669f75f2532ed4bc70be2b037330f7bae019 + version: 2.0.3 + resolution: "@types/stack-utils@npm:2.0.3" + checksum: 72576cc1522090fe497337c2b99d9838e320659ac57fa5560fcbdcbafcf5d0216c6b3a0a8a4ee4fdb3b1f5e3420aa4f6223ab57b82fef3578bec3206425c6cf5 languageName: node linkType: hard @@ -13853,11 +12532,12 @@ __metadata: linkType: hard "@types/tape@npm:*": - version: 4.13.2 - resolution: "@types/tape@npm:4.13.2" + version: 5.6.4 + resolution: "@types/tape@npm:5.6.4" dependencies: "@types/node": "*" - checksum: 055a896c10289e2f3ce023f66c1845941179590b3d6c342db3df117b682fb36d825822ed02238208cc00aa2360b223b64cd1bcb605f5edeac32893dbf3a2d96a + "@types/through": "*" + checksum: 08b1b69e2255824366e66f10d4f18fc68bb4b06a0651f974c136488bd2e9798e1a9679604351346b384ba492787e848e4ecfe1a966e027185c64fddce0f7a103 languageName: node linkType: hard @@ -13899,25 +12579,32 @@ __metadata: linkType: hard "@types/through@npm:*": - version: 0.0.30 - resolution: "@types/through@npm:0.0.30" + version: 0.0.33 + resolution: "@types/through@npm:0.0.33" dependencies: "@types/node": "*" - checksum: 9578470db0b527c26e246a1220ae9bffc6bf47f20f89c54aac467c083ab1f7e16c00d9a7b4bb6cb4e2dfae465027270827e5908a6236063f6214625e50585d78 + checksum: fd0b73f873a64ed5366d1d757c42e5dbbb2201002667c8958eda7ca02fff09d73de91360572db465ee00240c32d50c6039ea736d8eca374300f9664f93e8da39 languageName: node linkType: hard "@types/tough-cookie@npm:*": - version: 4.0.1 - resolution: "@types/tough-cookie@npm:4.0.1" - checksum: 7570c1c2d74201f4ead3512cf8e4c99e97d92ab8a02ae2fb987fd720ced0ca1a2baf250c98a861a170b86762606c9bf6d32207675f13dffc5ab75c08c96578d2 + version: 4.0.5 + resolution: "@types/tough-cookie@npm:4.0.5" + checksum: f19409d0190b179331586365912920d192733112a195e870c7f18d20ac8adb7ad0b0ff69dad430dba8bc2be09593453a719cfea92dc3bda19748fd158fe1498d + languageName: node + linkType: hard + +"@types/triple-beam@npm:^1.3.2": + version: 1.3.5 + resolution: "@types/triple-beam@npm:1.3.5" + checksum: 519b6a1b30d4571965c9706ad5400a200b94e4050feca3e7856e3ea7ac00ec9903e32e9a10e2762d0f7e472d5d03e5f4b29c16c0bd8c1f77c8876c683b2231f1 languageName: node linkType: hard "@types/trusted-types@npm:^2.0.2": - version: 2.0.3 - resolution: "@types/trusted-types@npm:2.0.3" - checksum: 4794804bc4a4a173d589841b6d26cf455ff5dc4f3e704e847de7d65d215f2e7043d8757e4741ce3a823af3f08260a8d04a1a6e9c5ec9b20b7b04586956a6b005 + version: 2.0.7 + resolution: "@types/trusted-types@npm:2.0.7" + checksum: 8e4202766a65877efcf5d5a41b7dd458480b36195e580a3b1085ad21e948bc417d55d6f8af1fd2a7ad008015d4117d5fdfe432731157da3c68678487174e4ba3 languageName: node linkType: hard @@ -13951,7 +12638,7 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:8.5.3, @types/ws@npm:^8.2.2": +"@types/ws@npm:8.5.3": version: 8.5.3 resolution: "@types/ws@npm:8.5.3" dependencies: @@ -13960,12 +12647,12 @@ __metadata: languageName: node linkType: hard -"@types/ws@npm:^8.5.5": - version: 8.5.5 - resolution: "@types/ws@npm:8.5.5" +"@types/ws@npm:^8.2.2, @types/ws@npm:^8.5.5": + version: 8.5.10 + resolution: "@types/ws@npm:8.5.10" dependencies: "@types/node": "*" - checksum: d00bf8070e6938e3ccf933010921c6ce78ac3606696ce37a393b27a9a603f7bd93ea64f3c5fa295a2f743575ba9c9a9fdb904af0f5fe2229bf2adf0630386e4a + checksum: 3ec416ea2be24042ebd677932a462cf16d2080393d8d7d0b1b3f5d6eaa4a7387aaf0eefb99193c0bfd29444857cf2e0c3ac89899e130550dc6c14ada8a46d25e languageName: node linkType: hard @@ -13979,9 +12666,9 @@ __metadata: linkType: hard "@types/yargs-parser@npm:*": - version: 20.2.1 - resolution: "@types/yargs-parser@npm:20.2.1" - checksum: 1d039e64494a7a61ddd278349a3dc60b19f99ff0517425696e796f794e4252452b9d62178e69755ad03f439f9dc0c8c3d7b3a1201b3a24e134bac1a09fa11eaa + version: 21.0.3 + resolution: "@types/yargs-parser@npm:21.0.3" + checksum: ef236c27f9432983e91432d974243e6c4cdae227cb673740320eff32d04d853eed59c92ca6f1142a335cfdc0e17cccafa62e95886a8154ca8891cc2dec4ee6fc languageName: node linkType: hard @@ -13995,29 +12682,20 @@ __metadata: linkType: hard "@types/yargs@npm:^16.0.0": - version: 16.0.6 - resolution: "@types/yargs@npm:16.0.6" + version: 16.0.9 + resolution: "@types/yargs@npm:16.0.9" dependencies: "@types/yargs-parser": "*" - checksum: 3531be5c8fc804405dffbba6f4f5486610e13a321e8c87a97c6e70f681bbdcb594d3259a0d3fdbeba2c38a8ef23dc5609dfffeb58fde0bdda95ce27e8c0ef265 + checksum: 00d9276ed4e0f17a78c1ed57f644a8c14061959bd5bfab113d57f082ea4b663ba97f71b89371304a34a2dba5061e9ae4523e357e577ba61834d661f82c223bf8 languageName: node linkType: hard -"@types/yargs@npm:^17.0.2": - version: 17.0.8 - resolution: "@types/yargs@npm:17.0.8" - dependencies: - "@types/yargs-parser": "*" - checksum: 63d06700ffbed745f00d7994eb92416649c8a3ead22f26446979d383f3af52fa9400bb185268f3a44a2348749098ffe33a8185ca676b77bc3206c63b8b73fd01 - languageName: node - linkType: hard - -"@types/yargs@npm:^17.0.8": - version: 17.0.10 - resolution: "@types/yargs@npm:17.0.10" +"@types/yargs@npm:^17.0.2, @types/yargs@npm:^17.0.8": + version: 17.0.32 + resolution: "@types/yargs@npm:17.0.32" dependencies: "@types/yargs-parser": "*" - checksum: f0673cbfc08e17239dc58952a88350d6c4db04a027a28a06fbad27d87b670e909f9cd9e66f9c64cebdd5071d1096261e33454a55868395f125297e5c50992ca8 + checksum: 4505bdebe8716ff383640c6e928f855b5d337cb3c68c81f7249fc6b983d0aa48de3eee26062b84f37e0d75a5797bc745e0c6e76f42f81771252a758c638f36ba languageName: node linkType: hard @@ -14470,6 +13148,13 @@ __metadata: languageName: node linkType: hard +"@ungap/structured-clone@npm:^1.2.0": + version: 1.2.0 + resolution: "@ungap/structured-clone@npm:1.2.0" + checksum: 4f656b7b4672f2ce6e272f2427d8b0824ed11546a601d8d5412b9d7704e83db38a8d9f402ecdf2b9063fc164af842ad0ec4a55819f621ed7e7ea4d1efcc74524 + languageName: node + linkType: hard + "@vitejs/plugin-basic-ssl@npm:1.0.1": version: 1.0.1 resolution: "@vitejs/plugin-basic-ssl@npm:1.0.1" @@ -14479,73 +13164,60 @@ __metadata: languageName: node linkType: hard -"@vue/compiler-core@npm:3.3.7": - version: 3.3.7 - resolution: "@vue/compiler-core@npm:3.3.7" +"@vue/compiler-core@npm:3.4.3": + version: 3.4.3 + resolution: "@vue/compiler-core@npm:3.4.3" dependencies: - "@babel/parser": ^7.23.0 - "@vue/shared": 3.3.7 + "@babel/parser": ^7.23.6 + "@vue/shared": 3.4.3 + entities: ^4.5.0 estree-walker: ^2.0.2 source-map-js: ^1.0.2 - checksum: 94ac56a5a8409f1302324a4373b5d1eeb474b54a92eb348fa555a8677c2ed99c77fb8c1ce55e969a6b5347f1ff3ee6d6ccd209cbd66de30aa9378498cf5cc84f + checksum: 775ef54c51f613e9ed8eebd6618e00399ffc69491238001caba93307e9f796d0e32b2ce1129c0738f53e0933ba49a59ca8745e4dd57ebc442b3697900ae67fa4 languageName: node linkType: hard -"@vue/compiler-dom@npm:3.3.7": - version: 3.3.7 - resolution: "@vue/compiler-dom@npm:3.3.7" +"@vue/compiler-dom@npm:3.4.3": + version: 3.4.3 + resolution: "@vue/compiler-dom@npm:3.4.3" dependencies: - "@vue/compiler-core": 3.3.7 - "@vue/shared": 3.3.7 - checksum: d54c49fd820d38657efa0342540479784b16b7e2be52cc329c6292b5ef460ff0275e9d7c70c2745cce8321d7ec7886b3bed3441dd0619ea2d97762c8f8a830f9 + "@vue/compiler-core": 3.4.3 + "@vue/shared": 3.4.3 + checksum: f07c50d7abf8dba40ef8451028b7254fa71ac1c1c20f10d5fd530f94485de3b717df734bd648be57e31605e5986f8ad55b8462514dd621f73adf5dee9aa038c1 languageName: node linkType: hard "@vue/compiler-sfc@npm:^3.3.4": - version: 3.3.7 - resolution: "@vue/compiler-sfc@npm:3.3.7" + version: 3.4.3 + resolution: "@vue/compiler-sfc@npm:3.4.3" dependencies: - "@babel/parser": ^7.23.0 - "@vue/compiler-core": 3.3.7 - "@vue/compiler-dom": 3.3.7 - "@vue/compiler-ssr": 3.3.7 - "@vue/reactivity-transform": 3.3.7 - "@vue/shared": 3.3.7 + "@babel/parser": ^7.23.6 + "@vue/compiler-core": 3.4.3 + "@vue/compiler-dom": 3.4.3 + "@vue/compiler-ssr": 3.4.3 + "@vue/shared": 3.4.3 estree-walker: ^2.0.2 magic-string: ^0.30.5 - postcss: ^8.4.31 + postcss: ^8.4.32 source-map-js: ^1.0.2 - checksum: 593c0b00f359fea7e64dfe2afd6b724063af890776f44bd3b2a99549231e5c62ea418f1f9f1edb849506f3f8fae54ea86c6fc090d1f49d9e8f3a187e7f60ed99 + checksum: 182c47f544f8cc7c3f819dbcbbb1b873fdd2df3fec19448e637429d94e9be22680224f062edf49e39dacca7caea95b8b9c2f4cec04faf1d41fb29721bc633a83 languageName: node linkType: hard -"@vue/compiler-ssr@npm:3.3.7": - version: 3.3.7 - resolution: "@vue/compiler-ssr@npm:3.3.7" +"@vue/compiler-ssr@npm:3.4.3": + version: 3.4.3 + resolution: "@vue/compiler-ssr@npm:3.4.3" dependencies: - "@vue/compiler-dom": 3.3.7 - "@vue/shared": 3.3.7 - checksum: 42f8ddc9ff7fd14431c3e876e032c9ff137e7cd15b86bd19e5187717cfa98e97a8e1a3cbf847bfd9cef7c66a1f4b69ce693787488ca1e8af61df846e5c039495 + "@vue/compiler-dom": 3.4.3 + "@vue/shared": 3.4.3 + checksum: 7b93bdf5a3bb8464bc0c7b767b2dafff69506efdc3b8e82272aba8d4d359b026929f31da36e4ef2fc9c0e98da98dd91842798d15ec07a369bb8d9a124fe525a9 languageName: node linkType: hard -"@vue/reactivity-transform@npm:3.3.7": - version: 3.3.7 - resolution: "@vue/reactivity-transform@npm:3.3.7" - dependencies: - "@babel/parser": ^7.23.0 - "@vue/compiler-core": 3.3.7 - "@vue/shared": 3.3.7 - estree-walker: ^2.0.2 - magic-string: ^0.30.5 - checksum: f88d39c8a41a9e868c03ed3765f828cffbcad88938292ef8615e7407e74d3048b5a0fce5038dbee74b608b39b7d52d7fb0d3e6cfe934013f6ef33d80b7d7a68d - languageName: node - linkType: hard - -"@vue/shared@npm:3.3.7": - version: 3.3.7 - resolution: "@vue/shared@npm:3.3.7" - checksum: a6718f760b18b5fa68b43e37ca2bbd22f902f2c03f02e655d0e18985fe1f6aceb45553c996d0b8dadde683d3971fb80f35fcbc4cd93630f4f1d403a7d99da3c5 +"@vue/shared@npm:3.4.3": + version: 3.4.3 + resolution: "@vue/shared@npm:3.4.3" + checksum: 29abea1d2564163ae963c9745d7c6bbb469132370fbed5c77090613b549863df5efdf6a862be4ddc9c6b1d2481dce1c7e25719e5add8c680941139fdac09b801 languageName: node linkType: hard @@ -14768,6 +13440,13 @@ __metadata: languageName: node linkType: hard +"@yr/monotone-cubic-spline@npm:^1.0.3": + version: 1.0.3 + resolution: "@yr/monotone-cubic-spline@npm:1.0.3" + checksum: ebc75e4d84d5b97d1d715452088ffe3cf6b3d71943433118116a2e90f17aed654b6f726868e913a49aef28645bb8afcc28580349de1ac77ad0c7dab3d991843e + languageName: node + linkType: hard + "JSONStream@npm:^1.3.5": version: 1.3.5 resolution: "JSONStream@npm:1.3.5" @@ -14780,20 +13459,13 @@ __metadata: languageName: node linkType: hard -"abab@npm:^2.0.3, abab@npm:^2.0.6": +"abab@npm:^2.0.3, abab@npm:^2.0.5, abab@npm:^2.0.6": version: 2.0.6 resolution: "abab@npm:2.0.6" checksum: 6ffc1af4ff315066c62600123990d87551ceb0aafa01e6539da77b0f5987ac7019466780bf480f1787576d4385e3690c81ccc37cfda12819bf510b8ab47e5a3e languageName: node linkType: hard -"abab@npm:^2.0.5": - version: 2.0.5 - resolution: "abab@npm:2.0.5" - checksum: 0ec951b46d5418c2c2f923021ec193eaebdb4e802ffd5506286781b454be722a13a8430f98085cd3e204918401d9130ec6cc8f5ae19be315b3a0e857d83196e1 - languageName: node - linkType: hard - "abbrev@npm:1, abbrev@npm:^1.0.0": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -14830,17 +13502,7 @@ __metadata: languageName: node linkType: hard -"abortable-iterator@npm:^5.0.1": - version: 5.0.1 - resolution: "abortable-iterator@npm:5.0.1" - dependencies: - get-iterator: ^2.0.0 - it-stream-types: ^2.0.1 - checksum: 9f50b2d2416d1c4312288d8a981f9cae8caeaaac6f4b0aa13be361c13f8e7e375b0ff2099d515ea46ade7cf2a91b9573f1f224434ff63966f76eb09be3202ed9 - languageName: node - linkType: hard - -"abortcontroller-polyfill@npm:^1.7.3": +"abortcontroller-polyfill@npm:^1.7.3, abortcontroller-polyfill@npm:^1.7.5": version: 1.7.5 resolution: "abortcontroller-polyfill@npm:1.7.5" checksum: daf4169f4228ae0e4f4dbcfa782e501b923667f2666b7c55bd3b7664e5d6b100e333a93371173985fdf21f65d7dfba15bdb2e6031bdc9e57e4ce0297147da3aa @@ -14938,7 +13600,7 @@ __metadata: languageName: node linkType: hard -"accepts@npm:^1.3.5, accepts@npm:~1.3.7, accepts@npm:~1.3.8": +"accepts@npm:^1.3.5, accepts@npm:~1.3.4, accepts@npm:~1.3.5, accepts@npm:~1.3.7, accepts@npm:~1.3.8": version: 1.3.8 resolution: "accepts@npm:1.3.8" dependencies: @@ -14948,16 +13610,6 @@ __metadata: languageName: node linkType: hard -"accepts@npm:~1.3.4, accepts@npm:~1.3.5": - version: 1.3.7 - resolution: "accepts@npm:1.3.7" - dependencies: - mime-types: ~2.1.24 - negotiator: 0.6.2 - checksum: 27fc8060ffc69481ff6719cd3ee06387d2b88381cb0ce626f087781bbd02201a645a9febc8e7e7333558354b33b1d2f922ad13560be4ec1b7ba9e76fc1c1241d - languageName: node - linkType: hard - "acorn-globals@npm:^6.0.0": version: 6.0.0 resolution: "acorn-globals@npm:6.0.0" @@ -15003,9 +13655,9 @@ __metadata: linkType: hard "acorn-walk@npm:^8.0.0, acorn-walk@npm:^8.1.1": - version: 8.2.0 - resolution: "acorn-walk@npm:8.2.0" - checksum: 1715e76c01dd7b2d4ca472f9c58968516a4899378a63ad5b6c2d668bba8da21a71976c14ec5f5b75f887b6317c4ae0b897ab141c831d741dc76024d8745f1ad1 + version: 8.3.1 + resolution: "acorn-walk@npm:8.3.1" + checksum: 5c8926ddb5400bc825b6baca782931f9df4ace603ba1a517f5243290fd9cdb089d52877840687b5d5c939591ebc314e2e63721514feaa37c6829c828f2b940ce languageName: node linkType: hard @@ -15036,21 +13688,12 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1": - version: 8.8.2 - resolution: "acorn@npm:8.8.2" +"acorn@npm:^8.0.4, acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": + version: 8.11.3 + resolution: "acorn@npm:8.11.3" bin: acorn: bin/acorn - checksum: f790b99a1bf63ef160c967e23c46feea7787e531292bb827126334612c234ed489a0dc2c7ba33156416f0ffa8d25bf2b0fdb7f35c2ba60eb3e960572bece4001 - languageName: node - linkType: hard - -"acorn@npm:^8.2.4, acorn@npm:^8.8.2, acorn@npm:^8.9.0": - version: 8.10.0 - resolution: "acorn@npm:8.10.0" - bin: - acorn: bin/acorn - checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d + checksum: 76d8e7d559512566b43ab4aadc374f11f563f0a9e21626dd59cb2888444e9445923ae9f3699972767f18af61df89cd89f5eaaf772d1327b055b45cb829b4a88c languageName: node linkType: hard @@ -15125,13 +13768,11 @@ __metadata: linkType: hard "agentkeepalive@npm:^4.1.3, agentkeepalive@npm:^4.2.1": - version: 4.2.1 - resolution: "agentkeepalive@npm:4.2.1" + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" dependencies: - debug: ^4.1.0 - depd: ^1.1.2 humanize-ms: ^1.2.1 - checksum: 39cb49ed8cf217fd6da058a92828a0a84e0b74c35550f82ee0a10e1ee403c4b78ade7948be2279b188b7a7303f5d396ea2738b134731e464bf28de00a4f72a18 + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 languageName: node linkType: hard @@ -15146,12 +13787,12 @@ __metadata: linkType: hard "aggregate-error@npm:^4.0.0": - version: 4.0.0 - resolution: "aggregate-error@npm:4.0.0" + version: 4.0.1 + resolution: "aggregate-error@npm:4.0.1" dependencies: clean-stack: ^4.0.0 indent-string: ^5.0.0 - checksum: 586397769e25fc5c2da5995c736f11ba83adf0bbc5f72c7101ea38e795458fd7b497f672318119218b4d3b1f8b8d3001417cebe9de55b5467af5cbcbff4befa3 + checksum: bb3ffdfd13447800fff237c2cba752c59868ee669104bb995dfbbe0b8320e967d679e683dabb640feb32e4882d60258165cde0baafc4cd467cc7d275a13ad6b5 languageName: node linkType: hard @@ -15208,7 +13849,7 @@ __metadata: languageName: node linkType: hard -"ajv-keywords@npm:^5.0.0": +"ajv-keywords@npm:^5.1.0": version: 5.1.0 resolution: "ajv-keywords@npm:5.1.0" dependencies: @@ -15219,7 +13860,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:8.12.0, ajv@npm:^8.11.0, ajv@npm:^8.11.2, ajv@npm:^8.6.0, ajv@npm:^8.6.3": +"ajv@npm:8.12.0, ajv@npm:^8.0.0, ajv@npm:^8.0.1, ajv@npm:^8.11.0, ajv@npm:^8.11.2, ajv@npm:^8.6.0, ajv@npm:^8.6.3, ajv@npm:^8.9.0": version: 8.12.0 resolution: "ajv@npm:8.12.0" dependencies: @@ -15253,7 +13894,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.11.0, ajv@npm:^6.12.2, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -15265,47 +13906,14 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^8.0.0, ajv@npm:^8.0.1": - version: 8.10.0 - resolution: "ajv@npm:8.10.0" - dependencies: - fast-deep-equal: ^3.1.1 - json-schema-traverse: ^1.0.0 - require-from-string: ^2.0.2 - uri-js: ^4.2.2 - checksum: 3594728ef1e31219ef97bfacb203d0d72db8ad5c35d6d0578e38ee453e4537c2bf927dad144bb84b0c893f661d71b58337d4643e8ee2f2a6e1d63b041c92fe82 - languageName: node - linkType: hard - -"ajv@npm:^8.8.0": - version: 8.11.0 - resolution: "ajv@npm:8.11.0" - dependencies: - fast-deep-equal: ^3.1.1 - json-schema-traverse: ^1.0.0 - require-from-string: ^2.0.2 - uri-js: ^4.2.2 - checksum: 5e0ff226806763be73e93dd7805b634f6f5921e3e90ca04acdf8db81eed9d8d3f0d4c5f1213047f45ebbf8047ffe0c840fa1ef2ec42c3a644899f69aa72b5bef - languageName: node - linkType: hard - -"ansi-align@npm:^3.0.0": - version: 3.0.1 - resolution: "ansi-align@npm:3.0.1" - dependencies: - string-width: ^4.1.0 - checksum: 6abfa08f2141d231c257162b15292467081fa49a208593e055c866aa0455b57f3a86b5a678c190c618faa79b4c59e254493099cb700dd9cf2293c6be2c8f5d8d - languageName: node - linkType: hard - -"ansi-colors@npm:4.1.1, ansi-colors@npm:^4.1.1": +"ansi-colors@npm:4.1.1": version: 4.1.1 resolution: "ansi-colors@npm:4.1.1" checksum: 138d04a51076cb085da0a7e2d000c5c0bb09f6e772ed5c65c53cb118d37f6c5f1637506d7155fb5f330f0abcf6f12fa2e489ac3f8cdab9da393bf1bb4f9a32b0 languageName: node linkType: hard -"ansi-colors@npm:4.1.3": +"ansi-colors@npm:4.1.3, ansi-colors@npm:^4.1.1": version: 4.1.3 resolution: "ansi-colors@npm:4.1.3" checksum: a9c2ec842038a1fabc7db9ece7d3177e2fe1c5dc6f0c51ecfbf5f39911427b89c00b5dc6b8bd95f82a26e9b16aaae2e83d45f060e98070ce4d1333038edceb0e @@ -15463,12 +14071,12 @@ __metadata: linkType: hard "anymatch@npm:^3.0.3, anymatch@npm:~3.1.2": - version: 3.1.2 - resolution: "anymatch@npm:3.1.2" + version: 3.1.3 + resolution: "anymatch@npm:3.1.3" dependencies: normalize-path: ^3.0.0 picomatch: ^2.0.4 - checksum: 985163db2292fac9e5a1e072bf99f1b5baccf196e4de25a0b0b81865ebddeb3b3eb4480734ef0a2ac8c002845396b91aa89121f5b84f93981a4658164a9ec6e9 + checksum: 3e044fd6d1d26545f235a9fe4d7a534e2029d8e59fa7fd9f2a6eb21230f6b5380ea1eaf55136e60cbf8e613544b3b766e7a6fa2102e2a3a117505466e3025dc2 languageName: node linkType: hard @@ -15487,16 +14095,17 @@ __metadata: linkType: hard "apexcharts@npm:^3.33.1": - version: 3.41.0 - resolution: "apexcharts@npm:3.41.0" + version: 3.45.1 + resolution: "apexcharts@npm:3.45.1" dependencies: + "@yr/monotone-cubic-spline": ^1.0.3 svg.draggable.js: ^2.2.2 svg.easing.js: ^2.0.0 svg.filter.js: ^2.0.2 svg.pathmorphing.js: ^0.1.3 svg.resize.js: ^1.4.3 svg.select.js: ^3.0.1 - checksum: b578d2473ffeffa66026dfc9c0c7f39a40663d3b1cfdd9732cf9b6624e3e9348474a3cbdfaf5ada0924cb296f52a59a1ffc4dc3930899cdb5df690b4970a3762 + checksum: 1d9b5ee77c8596f8067397915d499af0c099cdeccfca50c000dfd071f38eb6f5a38b3615425297c20cc1caf41ade65714d05865a22b913447db5cd4ffc89d360 languageName: node linkType: hard @@ -15528,9 +14137,9 @@ __metadata: languageName: node linkType: hard -"apollo-server-core@npm:^3.12.0": - version: 3.12.0 - resolution: "apollo-server-core@npm:3.12.0" +"apollo-server-core@npm:^3.13.0": + version: 3.13.0 + resolution: "apollo-server-core@npm:3.13.0" dependencies: "@apollo/utils.keyvaluecache": ^1.0.1 "@apollo/utils.logger": ^1.0.0 @@ -15557,7 +14166,7 @@ __metadata: whatwg-mimetype: ^3.0.0 peerDependencies: graphql: ^15.3.0 || ^16.0.0 - checksum: b7a37a78901d38a330c9df8fe870da3dcf512f43ab60fdf9ab0ba37be03977db5d4b72eabf51a830d2a9dcfb2974d7bfbc5aa8719e3afac113c8bd7222740b8f + checksum: 94f97f6e25cba506fa5ced2e1e88fbe1cf7abccdf4cfbd7ce218e26af02a58a1b1c9191490876a7679b8285b85eb036208353dbd833144608f730a0dab9473bd languageName: node linkType: hard @@ -15579,9 +14188,9 @@ __metadata: languageName: node linkType: hard -"apollo-server-express@npm:^3.12.0": - version: 3.12.0 - resolution: "apollo-server-express@npm:3.12.0" +"apollo-server-express@npm:^3.13.0": + version: 3.13.0 + resolution: "apollo-server-express@npm:3.13.0" dependencies: "@types/accepts": ^1.3.5 "@types/body-parser": 1.19.2 @@ -15589,7 +14198,7 @@ __metadata: "@types/express": 4.17.14 "@types/express-serve-static-core": 4.17.31 accepts: ^1.3.5 - apollo-server-core: ^3.12.0 + apollo-server-core: ^3.13.0 apollo-server-types: ^3.8.0 body-parser: ^1.19.0 cors: ^2.8.5 @@ -15597,7 +14206,7 @@ __metadata: peerDependencies: express: ^4.17.1 graphql: ^15.3.0 || ^16.0.0 - checksum: bd4bc213f506e2aeb2be961961de51e431f8774344b349e9b02f475714a623703eb62423ad968a8f8b6859919ae0d1912c40cf15a4df24e6f81b4f4c5653e70b + checksum: 8a5ea9b79147d45059d5ad4be3cb7fbf09574e9526a50a67ae498a4772fd9d7561522055dcb3dcb7efe3cfb855f36b71c3762d9d1dc5cfe48fe80b614e4a0499 languageName: node linkType: hard @@ -15627,16 +14236,16 @@ __metadata: linkType: hard "apollo-server@npm:^3.11.0": - version: 3.12.0 - resolution: "apollo-server@npm:3.12.0" + version: 3.13.0 + resolution: "apollo-server@npm:3.13.0" dependencies: "@types/express": 4.17.14 - apollo-server-core: ^3.12.0 - apollo-server-express: ^3.12.0 + apollo-server-core: ^3.13.0 + apollo-server-express: ^3.13.0 express: ^4.17.1 peerDependencies: graphql: ^15.3.0 || ^16.0.0 - checksum: 6f3dade76f202f04a890b2385923a0319a859a0ab48121b1636e22d5eae83afe042d7a0a501aff3d8816e67de4f29f8efa598e350814a40f41d079610dee346e + checksum: 855738c07c9280f1a874aeec8875b00d5c772823cafbbe8d8a7acd0498d479828de30915edb5012d5b1c960b9e7993035115e3894b26f8eaacaccbfa6a8e7aad languageName: node linkType: hard @@ -15713,22 +14322,22 @@ __metadata: linkType: hard "are-we-there-yet@npm:^3.0.0": - version: 3.0.0 - resolution: "are-we-there-yet@npm:3.0.0" + version: 3.0.1 + resolution: "are-we-there-yet@npm:3.0.1" dependencies: delegates: ^1.0.0 readable-stream: ^3.6.0 - checksum: 348edfdd931b0b50868b55402c01c3f64df1d4c229ab6f063539a5025fd6c5f5bb8a0cab409bbed8d75d34762d22aa91b7c20b4204eb8177063158d9ba792981 + checksum: 52590c24860fa7173bedeb69a4c05fb573473e860197f618b9a28432ee4379049336727ae3a1f9c4cb083114601c1140cee578376164d0e651217a9843f9fe83 languageName: node linkType: hard "are-we-there-yet@npm:^4.0.0": - version: 4.0.0 - resolution: "are-we-there-yet@npm:4.0.0" + version: 4.0.1 + resolution: "are-we-there-yet@npm:4.0.1" dependencies: delegates: ^1.0.0 readable-stream: ^4.1.0 - checksum: 35d6a65ce9a0c53d8d8eeef8805528c483c5c3512f2050b32c07e61becc440c4ec8178d6ee6cedc1e5a81b819eb55d9c0a9fc7d9f862cae4c7dc30ec393f0a58 + checksum: 16871ee259e138bfab60800ae5b53406fb1b72b5d356f98b13c1b222bb2a13d9bc4292d79f4521fb0eca10874eb3838ae0d9f721f3bb34ddd37ee8f949831800 languageName: node linkType: hard @@ -15788,7 +14397,7 @@ __metadata: languageName: node linkType: hard -"aria-query@npm:^5.0.0, aria-query@npm:^5.1.3": +"aria-query@npm:^5.0.0, aria-query@npm:^5.3.0": version: 5.3.0 resolution: "aria-query@npm:5.3.0" dependencies: @@ -15879,16 +14488,16 @@ __metadata: languageName: node linkType: hard -"array-includes@npm:^3.1.6": - version: 3.1.6 - resolution: "array-includes@npm:3.1.6" +"array-includes@npm:^3.1.6, array-includes@npm:^3.1.7": + version: 3.1.7 + resolution: "array-includes@npm:3.1.7" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - get-intrinsic: ^1.1.3 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + get-intrinsic: ^1.2.1 is-string: ^1.0.7 - checksum: f22f8cd8ba8a6448d91eebdc69f04e4e55085d09232b5216ee2d476dab3ef59984e8d1889e662c6a0ed939dcb1b57fd05b2c0209c3370942fc41b752c82a2ca5 + checksum: 06f9e4598fac12a919f7c59a3f04f010ea07f0b7f0585465ed12ef528a60e45f374e79d1bddbb34cdd4338357d00023ddbd0ac18b0be36964f5e726e8965d7fc languageName: node linkType: hard @@ -15928,76 +14537,63 @@ __metadata: linkType: hard "array.prototype.every@npm:^1.1.4": - version: 1.1.4 - resolution: "array.prototype.every@npm:1.1.4" + version: 1.1.5 + resolution: "array.prototype.every@npm:1.1.5" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 is-string: ^1.0.7 - checksum: 6a11683fd0148a1f70108ad20eeb5e174813dc22799264584a543d463810ed42261aad0c1c5de1097ea515ec159d20deb9babb465f4ae3ceeb11e28094c3b5b3 + checksum: 9974435604e135fc8c359a76c89bfe0672c1a80974a76dc61c673e5ea5068f78a31b7a168634ed7691501130ed61d3c788dd1d48ec1265c6cdf3910897b1eba4 languageName: node linkType: hard "array.prototype.find@npm:^2.0.1": - version: 2.2.1 - resolution: "array.prototype.find@npm:2.2.1" + version: 2.2.2 + resolution: "array.prototype.find@npm:2.2.2" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 es-shim-unscopables: ^1.0.0 - checksum: 3bde6c9137a1b11e28c8e098574ae93aa4c660f3b917ab08e7076ee8ca32704ee158d562437b38b8a5a03b0f0ccacf4df9b7a4e4b4497f4bbe66b8406dc334e5 + checksum: 5daa59fe6b55a449379d91070971cd386b4884bcc97957828c6bd821b49c282cc5b20b2b8d737a815f858d037ba126b0adb04a0690ad4923f69674f2ba704643 languageName: node linkType: hard -"array.prototype.findlastindex@npm:^1.2.2": - version: 1.2.2 - resolution: "array.prototype.findlastindex@npm:1.2.2" +"array.prototype.findlastindex@npm:^1.2.2, array.prototype.findlastindex@npm:^1.2.3": + version: 1.2.3 + resolution: "array.prototype.findlastindex@npm:1.2.3" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 es-shim-unscopables: ^1.0.0 - get-intrinsic: ^1.1.3 - checksum: 8a166359f69a2a751c843f26b9c8cd03d0dc396a92cdcb85f4126b5f1cecdae5b2c0c616a71ea8aff026bde68165b44950b3664404bb73db0673e288495ba264 + get-intrinsic: ^1.2.1 + checksum: 31f35d7b370c84db56484618132041a9af401b338f51899c2e78ef7690fbba5909ee7ca3c59a7192085b328cc0c68c6fd1f6d1553db01a689a589ae510f3966e languageName: node linkType: hard -"array.prototype.flat@npm:^1.3.1": - version: 1.3.1 - resolution: "array.prototype.flat@npm:1.3.1" +"array.prototype.flat@npm:^1.3.1, array.prototype.flat@npm:^1.3.2": + version: 1.3.2 + resolution: "array.prototype.flat@npm:1.3.2" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 es-shim-unscopables: ^1.0.0 - checksum: 5a8415949df79bf6e01afd7e8839bbde5a3581300e8ad5d8449dea52639e9e59b26a467665622783697917b43bf39940a6e621877c7dd9b3d1c1f97484b9b88b + checksum: 5d6b4bf102065fb3f43764bfff6feb3295d372ce89591e6005df3d0ce388527a9f03c909af6f2a973969a4d178ab232ffc9236654149173e0e187ec3a1a6b87b languageName: node linkType: hard -"array.prototype.flatmap@npm:^1.3.1": - version: 1.3.1 - resolution: "array.prototype.flatmap@npm:1.3.1" +"array.prototype.flatmap@npm:^1.3.1, array.prototype.flatmap@npm:^1.3.2": + version: 1.3.2 + resolution: "array.prototype.flatmap@npm:1.3.2" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 es-shim-unscopables: ^1.0.0 - checksum: 8c1c43a4995f12cf12523436da28515184c753807b3f0bc2ca6c075f71c470b099e2090cc67dba8e5280958fea401c1d0c59e1db0143272aef6cd1103921a987 - languageName: node - linkType: hard - -"array.prototype.reduce@npm:^1.0.5": - version: 1.0.5 - resolution: "array.prototype.reduce@npm:1.0.5" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - es-array-method-boxes-properly: ^1.0.0 - is-string: ^1.0.7 - checksum: f44691395f9202aba5ec2446468d4c27209bfa81464f342ae024b7157dbf05b164e47cca01250b8c7c2a8219953fb57651cca16aab3d16f43b85c0d92c26eef3 + checksum: ce09fe21dc0bcd4f30271f8144083aa8c13d4639074d6c8dc82054b847c7fc9a0c97f857491f4da19d4003e507172a78f4bcd12903098adac8b9cd374f734be3 languageName: node linkType: hard @@ -16015,29 +14611,30 @@ __metadata: linkType: hard "array.prototype.tosorted@npm:^1.1.1": - version: 1.1.1 - resolution: "array.prototype.tosorted@npm:1.1.1" + version: 1.1.2 + resolution: "array.prototype.tosorted@npm:1.1.2" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 es-shim-unscopables: ^1.0.0 - get-intrinsic: ^1.1.3 - checksum: 7923324a67e70a2fc0a6e40237405d92395e45ebd76f5cb89c2a5cf1e66b47aca6baacd0cd628ffd88830b90d47fff268071493d09c9ae123645613dac2c2ca3 + get-intrinsic: ^1.2.1 + checksum: 3607a7d6b117f0ffa6f4012457b7af0d47d38cf05e01d50e09682fd2fb782a66093a5e5fbbdbad77c8c824794a9d892a51844041641f719ad41e3a974f0764de languageName: node linkType: hard -"arraybuffer.prototype.slice@npm:^1.0.1": - version: 1.0.1 - resolution: "arraybuffer.prototype.slice@npm:1.0.1" +"arraybuffer.prototype.slice@npm:^1.0.2": + version: 1.0.2 + resolution: "arraybuffer.prototype.slice@npm:1.0.2" dependencies: array-buffer-byte-length: ^1.0.0 call-bind: ^1.0.2 define-properties: ^1.2.0 + es-abstract: ^1.22.1 get-intrinsic: ^1.2.1 is-array-buffer: ^3.0.2 is-shared-array-buffer: ^1.0.2 - checksum: e3e9b2a3e988ebfeddce4c7e8f69df730c9e48cb04b0d40ff0874ce3d86b3d1339dd520ffde5e39c02610bc172ecfbd4bc93324b1cabd9554c44a56b131ce0ce + checksum: c200faf437786f5b2c80d4564ff5481c886a16dee642ef02abdc7306c7edd523d1f01d1dd12b769c7eb42ac9bc53874510db19a92a2c035c0f6696172aafa5d3 languageName: node linkType: hard @@ -16081,7 +14678,7 @@ __metadata: languageName: node linkType: hard -"asn1@npm:^0.2.4, asn1@npm:^0.2.6, asn1@npm:~0.2.3": +"asn1@npm:^0.2.6, asn1@npm:~0.2.3": version: 0.2.6 resolution: "asn1@npm:0.2.6" dependencies: @@ -16098,14 +14695,15 @@ __metadata: linkType: hard "assert@npm:^2.0.0": - version: 2.0.0 - resolution: "assert@npm:2.0.0" + version: 2.1.0 + resolution: "assert@npm:2.1.0" dependencies: - es6-object-assign: ^1.1.0 - is-nan: ^1.2.1 - object-is: ^1.0.1 - util: ^0.12.0 - checksum: bb91f181a86d10588ee16c5e09c280f9811373974c29974cbe401987ea34e966699d7989a812b0e19377b511ea0bc627f5905647ce569311824848ede382cae8 + call-bind: ^1.0.2 + is-nan: ^1.3.2 + object-is: ^1.1.5 + object.assign: ^4.1.4 + util: ^0.12.5 + checksum: 1ed1cabba9abe55f4109b3f7292b4e4f3cf2953aad8dc148c0b3c3bd676675c31b1abb32ef563b7d5a19d1715bf90d1e5f09fad2a4ee655199468902da80f7c2 languageName: node linkType: hard @@ -16134,10 +14732,10 @@ __metadata: languageName: node linkType: hard -"ast-types-flow@npm:^0.0.7": - version: 0.0.7 - resolution: "ast-types-flow@npm:0.0.7" - checksum: a26dcc2182ffee111cad7c471759b0bda22d3b7ebacf27c348b22c55f16896b18ab0a4d03b85b4020dce7f3e634b8f00b593888f622915096ea1927fa51866c4 +"ast-types-flow@npm:^0.0.8": + version: 0.0.8 + resolution: "ast-types-flow@npm:0.0.8" + checksum: 0a64706609a179233aac23817837abab614f3548c252a2d3d79ea1e10c74aa28a0846e11f466cf72771b6ed8713abc094dcf8c40c3ec4207da163efa525a94a8 languageName: node linkType: hard @@ -16210,7 +14808,7 @@ __metadata: languageName: node linkType: hard -"async@npm:^2.0.1, async@npm:^2.1.2, async@npm:^2.4.0, async@npm:^2.6.0, async@npm:^2.6.1": +"async@npm:^2.0.1, async@npm:^2.1.2, async@npm:^2.4.0, async@npm:^2.6.0, async@npm:^2.6.1, async@npm:^2.6.4": version: 2.6.4 resolution: "async@npm:2.6.4" dependencies: @@ -16219,24 +14817,10 @@ __metadata: languageName: node linkType: hard -"async@npm:^3.0.0, async@npm:^3.1.0": - version: 3.2.4 - resolution: "async@npm:3.2.4" - checksum: 43d07459a4e1d09b84a20772414aa684ff4de085cbcaec6eea3c7a8f8150e8c62aa6cd4e699fe8ee93c3a5b324e777d34642531875a0817a35697522c1b02e89 - languageName: node - linkType: hard - -"async@npm:^3.2.3": - version: 3.2.3 - resolution: "async@npm:3.2.3" - checksum: c4bee57ab2249af3dc83ca3ef9acfa8e822c0d5e5aa41bae3eaf7f673648343cd64ecd7d26091ffd357f3f044428b17b5f00098494b6cf8b6b3e9681f0636ca1 - languageName: node - linkType: hard - -"async@npm:~1.0.0": - version: 1.0.0 - resolution: "async@npm:1.0.0" - checksum: 04d4e57806b1a46b1635a3d821a9bcc06f893d6828a0468ceb494d1857b565754cbbaed22529aef79749dbbe7cf5080bfdb346b54be0e9cd35c41d7ef8d7911f +"async@npm:^3.0.0, async@npm:^3.1.0, async@npm:^3.2.3": + version: 3.2.5 + resolution: "async@npm:3.2.5" + checksum: 5ec77f1312301dee02d62140a6b1f7ee0edd2a0f983b6fd2b0849b969f245225b990b47b8243e7b9ad16451a53e7f68e753700385b706198ced888beedba3af4 languageName: node linkType: hard @@ -16323,12 +14907,12 @@ __metadata: linkType: hard "autoprefixer@npm:^10.4.13": - version: 10.4.15 - resolution: "autoprefixer@npm:10.4.15" + version: 10.4.16 + resolution: "autoprefixer@npm:10.4.16" dependencies: browserslist: ^4.21.10 - caniuse-lite: ^1.0.30001520 - fraction.js: ^4.2.0 + caniuse-lite: ^1.0.30001538 + fraction.js: ^4.3.6 normalize-range: ^0.1.2 picocolors: ^1.0.0 postcss-value-parser: ^4.2.0 @@ -16336,7 +14920,7 @@ __metadata: postcss: ^8.1.0 bin: autoprefixer: bin/autoprefixer - checksum: d490b14fb098c043e109fc13cd23628f146af99a493d35b9df3a26f8ec0b4dd8937c5601cdbaeb465b98ea31d3ea05aa7184711d4d93dfb52358d073dcb67032 + checksum: 45fad7086495048dacb14bb7b00313e70e135b5d8e8751dcc60548889400763705ab16fc2d99ea628b44c3472698fb0e39598f595ba28409c965ab159035afde languageName: node linkType: hard @@ -16372,31 +14956,31 @@ __metadata: linkType: hard "aws4@npm:^1.8.0": - version: 1.11.0 - resolution: "aws4@npm:1.11.0" - checksum: 5a00d045fd0385926d20ebebcfba5ec79d4482fe706f63c27b324d489a04c68edb0db99ed991e19eda09cb8c97dc2452059a34d97545cebf591d7a2b5a10999f + version: 1.12.0 + resolution: "aws4@npm:1.12.0" + checksum: 68f79708ac7c335992730bf638286a3ee0a645cf12575d557860100767c500c08b30e24726b9f03265d74116417f628af78509e1333575e9f8d52a80edfe8cbc languageName: node linkType: hard -"axe-core@npm:^4.6.2": - version: 4.7.2 - resolution: "axe-core@npm:4.7.2" - checksum: 5d86fa0f45213b0e54cbb5d713ce885c4a8fe3a72b92dd915a47aa396d6fd149c4a87fec53aa978511f6d941402256cfeb26f2db35129e370f25a453c688655a +"axe-core@npm:=4.7.0": + version: 4.7.0 + resolution: "axe-core@npm:4.7.0" + checksum: f086bcab42be1761ba2b0b127dec350087f4c3a853bba8dd58f69d898cefaac31a1561da23146f6f3c07954c76171d1f2ce460e555e052d2b02cd79af628fa4a languageName: node linkType: hard "axios@npm:>=0.27.2": - version: 1.5.1 - resolution: "axios@npm:1.5.1" + version: 1.6.3 + resolution: "axios@npm:1.6.3" dependencies: follow-redirects: ^1.15.0 form-data: ^4.0.0 proxy-from-env: ^1.1.0 - checksum: 4444f06601f4ede154183767863d2b8e472b4a6bfc5253597ed6d21899887e1fd0ee2b3de792ac4f8459fe2e359d2aa07c216e45fd8b9e4e0688a6ebf48a5a8d + checksum: 07ef3bb83fc2dacc1ae2c97f2bbd04ef7701f5655f9037789d79ee78b698ffa50eaa8465c2017d4d3e9ce7d94cb779f730acaab32ce9036d0a4933c1e89df4da languageName: node linkType: hard -"axobject-query@npm:^3.1.1": +"axobject-query@npm:^3.2.1": version: 3.2.1 resolution: "axobject-query@npm:3.2.1" dependencies: @@ -16483,20 +15067,20 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^29.6.2": - version: 29.6.2 - resolution: "babel-jest@npm:29.6.2" +"babel-jest@npm:^29.7.0": + version: 29.7.0 + resolution: "babel-jest@npm:29.7.0" dependencies: - "@jest/transform": ^29.6.2 + "@jest/transform": ^29.7.0 "@types/babel__core": ^7.1.14 babel-plugin-istanbul: ^6.1.1 - babel-preset-jest: ^29.5.0 + babel-preset-jest: ^29.6.3 chalk: ^4.0.0 graceful-fs: ^4.2.9 slash: ^3.0.0 peerDependencies: "@babel/core": ^7.8.0 - checksum: 3936b5d6ed6f08670c830ed919e38a4a593d0643b8e30fdeb16f4588b262ea5255fb96fd1849c02fba0b082ecfa4e788ce9a128ad1b9e654d46aac09c3a55504 + checksum: ee6f8e0495afee07cac5e4ee167be705c711a8cc8a737e05a587a131fdae2b3c8f9aa55dfd4d9c03009ac2d27f2de63d8ba96d3e8460da4d00e8af19ef9a83f7 languageName: node linkType: hard @@ -16553,21 +15137,21 @@ __metadata: languageName: node linkType: hard -"babel-plugin-jest-hoist@npm:^29.5.0": - version: 29.5.0 - resolution: "babel-plugin-jest-hoist@npm:29.5.0" +"babel-plugin-jest-hoist@npm:^29.6.3": + version: 29.6.3 + resolution: "babel-plugin-jest-hoist@npm:29.6.3" dependencies: "@babel/template": ^7.3.3 "@babel/types": ^7.3.3 "@types/babel__core": ^7.1.14 "@types/babel__traverse": ^7.0.6 - checksum: 099b5254073b6bc985b6d2d045ad26fb8ed30ff8ae6404c4fe8ee7cd0e98a820f69e3dfb871c7c65aae0f4b65af77046244c07bb92d49ef9005c90eedf681539 + checksum: 51250f22815a7318f17214a9d44650ba89551e6d4f47a2dc259128428324b52f5a73979d010cefd921fd5a720d8c1d55ad74ff601cd94c7bd44d5f6292fde2d1 languageName: node linkType: hard -"babel-plugin-jsx-dom-expressions@npm:^0.36.10": - version: 0.36.10 - resolution: "babel-plugin-jsx-dom-expressions@npm:0.36.10" +"babel-plugin-jsx-dom-expressions@npm:^0.37.9": + version: 0.37.9 + resolution: "babel-plugin-jsx-dom-expressions@npm:0.37.9" dependencies: "@babel/helper-module-imports": 7.18.6 "@babel/plugin-syntax-jsx": ^7.18.6 @@ -16576,7 +15160,7 @@ __metadata: validate-html-nesting: ^1.2.1 peerDependencies: "@babel/core": ^7.20.12 - checksum: 1d9cac605de70e39d75250ba0d68eca92c38091466dea9b06dc8292e27cf2af4f988d85c3bd04e7fa5011c7edebc4e121e0b20699134f0fc127c350705e52cb1 + checksum: 34e686db2dad06f1eeb1bfee83e5a58a1a284607d31afe3db3a830760b711b3fdf75887eb604e4128ec4f27b7454fbbe1b7bbf13acffcd40eb2657c9463c0ce5 languageName: node linkType: hard @@ -16607,15 +15191,15 @@ __metadata: languageName: node linkType: hard -"babel-plugin-minify-dead-code-elimination@npm:^0.5.1": - version: 0.5.1 - resolution: "babel-plugin-minify-dead-code-elimination@npm:0.5.1" +"babel-plugin-minify-dead-code-elimination@npm:^0.5.2": + version: 0.5.2 + resolution: "babel-plugin-minify-dead-code-elimination@npm:0.5.2" dependencies: babel-helper-evaluate-path: ^0.5.0 babel-helper-mark-eval-scopes: ^0.4.3 babel-helper-remove-or-void: ^0.4.3 lodash: ^4.17.11 - checksum: 55a9c84c0bea5b69ee640ceaf5ee4d92b1932e19cdf895d82133816def8aa2cc6e7caf5124f16fd425c58ff935a6c74cd865a19860704c613c5784895cefe05f + checksum: ed4c683aa9dac021f08bf46a9a8dae28428e32e0beb0cb0e1923e195490019c5169c42e8211ecc9e23c9e2ce6ac54a809af7b9f9d8cece57eebb51b07b9f2e64 languageName: node linkType: hard @@ -16645,12 +15229,12 @@ __metadata: languageName: node linkType: hard -"babel-plugin-minify-mangle-names@npm:^0.5.0": - version: 0.5.0 - resolution: "babel-plugin-minify-mangle-names@npm:0.5.0" +"babel-plugin-minify-mangle-names@npm:^0.5.1": + version: 0.5.1 + resolution: "babel-plugin-minify-mangle-names@npm:0.5.1" dependencies: babel-helper-mark-eval-scopes: ^0.4.3 - checksum: 4b970658aa252f317fb3ca65757305261e438a4ed1246c4e144a6490c0169e989a2e7ee3b8f3707f0ffb397a6fae9e24876ec4b1baebde9996fc02f61a85080c + checksum: fd4dcf6d20b68130063c2e44ebf7c5fa4e912be6bfc8d9036697ac087a348ce2c289aab8d04a3905228e40a3c966300dc0c8e58cc53a16d97553637d820f0669 languageName: node linkType: hard @@ -16698,75 +15282,39 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.4": - version: 0.4.5 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.5" +"babel-plugin-polyfill-corejs2@npm:^0.4.4, babel-plugin-polyfill-corejs2@npm:^0.4.7": + version: 0.4.7 + resolution: "babel-plugin-polyfill-corejs2@npm:0.4.7" dependencies: "@babel/compat-data": ^7.22.6 - "@babel/helper-define-polyfill-provider": ^0.4.2 + "@babel/helper-define-polyfill-provider": ^0.4.4 semver: ^6.3.1 peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 33a8e06aa54e2858d211c743d179f0487b03222f9ca1bfd7c4865bca243fca942a3358cb75f6bb894ed476cbddede834811fbd6903ff589f055821146f053e1a + checksum: b3c84ce44d00211c919a94f76453fb2065861612f3e44862eb7acf854e325c738a7441ad82690deba2b6fddfa2ad2cf2c46960f46fab2e3b17c6ed4fd2d73b38 languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.5, babel-plugin-polyfill-corejs2@npm:^0.4.6": - version: 0.4.6 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.6" - dependencies: - "@babel/compat-data": ^7.22.6 - "@babel/helper-define-polyfill-provider": ^0.4.3 - semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 08896811df31530be6a9bcdd630cb9fd4b5ae5181039d18db3796efbc54e38d57a42af460845c10a04434e1bc45c0d47743c7e6c860383cc6b141083cde22030 - languageName: node - linkType: hard - -"babel-plugin-polyfill-corejs3@npm:^0.8.2": - version: 0.8.3 - resolution: "babel-plugin-polyfill-corejs3@npm:0.8.3" - dependencies: - "@babel/helper-define-polyfill-provider": ^0.4.2 - core-js-compat: ^3.31.0 - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: dcbb30e551702a82cfd4d2c375da2c317658e55f95e9edcda93b9bbfdcc8fb6e5344efcb144e04d3406859e7682afce7974c60ededd9f12072a48a83dd22a0da - languageName: node - linkType: hard - -"babel-plugin-polyfill-corejs3@npm:^0.8.3, babel-plugin-polyfill-corejs3@npm:^0.8.5": - version: 0.8.5 - resolution: "babel-plugin-polyfill-corejs3@npm:0.8.5" - dependencies: - "@babel/helper-define-polyfill-provider": ^0.4.3 - core-js-compat: ^3.32.2 - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 54ff3956c4f88e483d38b27ceec6199b9e73fceac10ebf969469d215e6a62929384e4433f85335c9a6ba809329636e27f9bdae2f54075f833e7a745341c07d84 - languageName: node - linkType: hard - -"babel-plugin-polyfill-regenerator@npm:^0.5.1, babel-plugin-polyfill-regenerator@npm:^0.5.2": - version: 0.5.2 - resolution: "babel-plugin-polyfill-regenerator@npm:0.5.2" +"babel-plugin-polyfill-corejs3@npm:^0.8.2, babel-plugin-polyfill-corejs3@npm:^0.8.7": + version: 0.8.7 + resolution: "babel-plugin-polyfill-corejs3@npm:0.8.7" dependencies: - "@babel/helper-define-polyfill-provider": ^0.4.2 + "@babel/helper-define-polyfill-provider": ^0.4.4 + core-js-compat: ^3.33.1 peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: d962200f604016a9a09bc9b4aaf60a3db7af876bb65bcefaeac04d44ac9d9ec4037cf24ce117760cc141d7046b6394c7eb0320ba9665cb4a2ee64df2be187c93 + checksum: 51bc215ab0c062bbb2225d912f69f8a6705d1837c8e01f9651307b5b937804287c1d73ebd8015689efcc02c3c21f37688b9ee6f5997635619b7a9cc4b7d9908d languageName: node linkType: hard -"babel-plugin-polyfill-regenerator@npm:^0.5.3": - version: 0.5.3 - resolution: "babel-plugin-polyfill-regenerator@npm:0.5.3" +"babel-plugin-polyfill-regenerator@npm:^0.5.1, babel-plugin-polyfill-regenerator@npm:^0.5.4": + version: 0.5.4 + resolution: "babel-plugin-polyfill-regenerator@npm:0.5.4" dependencies: - "@babel/helper-define-polyfill-provider": ^0.4.3 + "@babel/helper-define-polyfill-provider": ^0.4.4 peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 2bb546582cda1870d19e646a7183baeb2cccd56e0ef3e4eaeabd28e120daf17cb87399194a9ccdcf32506bcaa68d23e73440fc8ab990a7a0f8c5a77c12d5d4bc + checksum: 461b735c6c0eca3c7b4434d14bfa98c2ab80f00e2bdc1c69eb46d1d300092a9786d76bbd3ee55e26d2d1a2380c14592d8d638e271dfd2a2b78a9eacffa3645d1 languageName: node linkType: hard @@ -16784,10 +15332,10 @@ __metadata: languageName: node linkType: hard -"babel-plugin-transform-merge-sibling-variables@npm:^6.9.4": - version: 6.9.4 - resolution: "babel-plugin-transform-merge-sibling-variables@npm:6.9.4" - checksum: ff09d225c0a0b54c6cdff82974023895d31c94c65592f29ae61d4a31a14a2a72d725e3a860bc11d1d2e360ed7be38d47d7a88ba6a1c9d4bbf7a41bb70e322c3a +"babel-plugin-transform-merge-sibling-variables@npm:^6.9.5": + version: 6.9.5 + resolution: "babel-plugin-transform-merge-sibling-variables@npm:6.9.5" + checksum: 6182f79703170b473fe4872cfe0df144057d94632be9972076265d3aae05e37aab3fb98ed932ce6d663c722d9aabb48ee2046b2f820ccc73dc45260173ba36e2 languageName: node linkType: hard @@ -16892,36 +15440,36 @@ __metadata: languageName: node linkType: hard -"babel-preset-jest@npm:^29.5.0": - version: 29.5.0 - resolution: "babel-preset-jest@npm:29.5.0" +"babel-preset-jest@npm:^29.6.3": + version: 29.6.3 + resolution: "babel-preset-jest@npm:29.6.3" dependencies: - babel-plugin-jest-hoist: ^29.5.0 + babel-plugin-jest-hoist: ^29.6.3 babel-preset-current-node-syntax: ^1.0.0 peerDependencies: "@babel/core": ^7.0.0 - checksum: 5566ca2762766c9319b4973d018d2fa08c0fcf6415c72cc54f4c8e7199e851ea8f5e6c6730f03ed7ed44fc8beefa959dd15911f2647dee47c615ff4faeddb1ad + checksum: aa4ff2a8a728d9d698ed521e3461a109a1e66202b13d3494e41eea30729a5e7cc03b3a2d56c594423a135429c37bf63a9fa8b0b9ce275298be3095a88c69f6fb languageName: node linkType: hard "babel-preset-minify@npm:^0.5.1": - version: 0.5.1 - resolution: "babel-preset-minify@npm:0.5.1" + version: 0.5.2 + resolution: "babel-preset-minify@npm:0.5.2" dependencies: babel-plugin-minify-builtins: ^0.5.0 babel-plugin-minify-constant-folding: ^0.5.0 - babel-plugin-minify-dead-code-elimination: ^0.5.1 + babel-plugin-minify-dead-code-elimination: ^0.5.2 babel-plugin-minify-flip-comparisons: ^0.4.3 babel-plugin-minify-guarded-expressions: ^0.4.4 babel-plugin-minify-infinity: ^0.4.3 - babel-plugin-minify-mangle-names: ^0.5.0 + babel-plugin-minify-mangle-names: ^0.5.1 babel-plugin-minify-numeric-literals: ^0.4.3 babel-plugin-minify-replace: ^0.5.0 babel-plugin-minify-simplify: ^0.5.1 babel-plugin-minify-type-constructors: ^0.4.3 babel-plugin-transform-inline-consecutive-adds: ^0.4.3 babel-plugin-transform-member-expression-literals: ^6.9.4 - babel-plugin-transform-merge-sibling-variables: ^6.9.4 + babel-plugin-transform-merge-sibling-variables: ^6.9.5 babel-plugin-transform-minify-booleans: ^6.9.4 babel-plugin-transform-property-literals: ^6.9.4 babel-plugin-transform-regexp-constructors: ^0.4.3 @@ -16931,7 +15479,7 @@ __metadata: babel-plugin-transform-simplify-comparison-operators: ^6.9.4 babel-plugin-transform-undefined-to-void: ^6.9.4 lodash: ^4.17.11 - checksum: f365a2e3821c905cf35fa1583a1e94b0e3d3b57187a9362c4adb097879d0150d471a64b2a2b0548569059d4b918ef4ac44b0c6127dd78d37c45f934fb90a5e82 + checksum: 36484ad5d4cf89948240ad99ee3eb8bc54c85aed9c5d47b188924dfea058157a7e66a6980624f34c8ec45fc2906161f7ae0cbd3017f983a71689b29f79bebc90 languageName: node linkType: hard @@ -16960,13 +15508,13 @@ __metadata: linkType: hard "babel-preset-solid@npm:^1.4.6": - version: 1.7.7 - resolution: "babel-preset-solid@npm:1.7.7" + version: 1.8.6 + resolution: "babel-preset-solid@npm:1.8.6" dependencies: - babel-plugin-jsx-dom-expressions: ^0.36.10 + babel-plugin-jsx-dom-expressions: ^0.37.9 peerDependencies: "@babel/core": ^7.0.0 - checksum: 4e38db85893e743fe076e24cb0f4bb3dfbf75e374dee1e1da99f96a0344cea7213f8c3192a01753cd33e388e5c831cc2ac564ee764e19148beafd67682d0eaa0 + checksum: bf36fb3fc20da57d722a82bff912b22d763f3c9a30bbbc6a4f0e59b071a0911af058e2a56cbbacc15aee4797dc1eef6fdf64dae8858d6f461b29ffc259c206d1 languageName: node linkType: hard @@ -17069,21 +15617,22 @@ __metadata: linkType: hard "before-after-hook@npm:^2.2.0": - version: 2.2.2 - resolution: "before-after-hook@npm:2.2.2" - checksum: dc2e1ffe389e5afbef2a46790b1b5a50247ed57aba67649cfa9ec2552d248cc9278f222e72fb5a8ff59bbb39d78fbaa97e7234ead0c6b5e8418b67a8644ce207 + version: 2.2.3 + resolution: "before-after-hook@npm:2.2.3" + checksum: a1a2430976d9bdab4cd89cb50d27fa86b19e2b41812bf1315923b0cba03371ebca99449809226425dd3bcef20e010db61abdaff549278e111d6480034bebae87 languageName: node linkType: hard "bfj@npm:^7.0.2": - version: 7.0.2 - resolution: "bfj@npm:7.0.2" + version: 7.1.0 + resolution: "bfj@npm:7.1.0" dependencies: - bluebird: ^3.5.5 - check-types: ^11.1.1 + bluebird: ^3.7.2 + check-types: ^11.2.3 hoopy: ^0.1.4 + jsonpath: ^1.1.1 tryer: ^1.0.1 - checksum: 0ca673234170eb3dcf00fb1d867ba274729ab05779dd19b35628c49da7adc32472b5f0bca0554ffdca15b094f9b36f16f2a8992ba8884ebd1d351d7f27abee7b + checksum: 36da9ed36c60f377a3f43bb0433092af7dc40442914b8155a1330ae86b1905640baf57e9c195ab83b36d6518b27cf8ed880adff663aa444c193be149e027d722 languageName: node linkType: hard @@ -17094,13 +15643,6 @@ __metadata: languageName: node linkType: hard -"big-integer@npm:^1.6.44": - version: 1.6.51 - resolution: "big-integer@npm:1.6.51" - checksum: 3d444173d1b2e20747e2c175568bedeebd8315b0637ea95d75fd27830d3b8e8ba36c6af40374f36bdaea7b5de376dcada1b07587cb2a79a928fccdb6e6e3c518 - languageName: node - linkType: hard - "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -17123,9 +15665,9 @@ __metadata: linkType: hard "bigint-crypto-utils@npm:^3.0.23": - version: 3.2.2 - resolution: "bigint-crypto-utils@npm:3.2.2" - checksum: 0e767ea67b7beb92de52bb7cdf8e79a261207491e28031547ed0457abf192f2bad89d8cc4cdde9c6cd8bb5570525cac978a5ed992a23c05c2af4b0075e3569c4 + version: 3.3.0 + resolution: "bigint-crypto-utils@npm:3.3.0" + checksum: 9598ce57b23f776c8936d44114c9f051e62b5fa654915b664784cbcbacc5aa0485f4479571c51ff58008abb1210c0d6a234853742f07cf84bda890f2a1e01000 languageName: node linkType: hard @@ -17137,21 +15679,21 @@ __metadata: linkType: hard "bignumber.js@npm:^9.0.0, bignumber.js@npm:^9.0.1": - version: 9.0.2 - resolution: "bignumber.js@npm:9.0.2" - checksum: 8637b71d0a99104b20413c47578953970006fec6b4df796b9dcfd9835ea9c402ea0e727eba9a5ca9f9a393c1d88b6168c5bbe0887598b708d4f8b4870ad62e1f + version: 9.1.2 + resolution: "bignumber.js@npm:9.1.2" + checksum: 582c03af77ec9cb0ebd682a373ee6c66475db94a4325f92299621d544aa4bd45cb45fd60001610e94aef8ae98a0905fa538241d9638d4422d57abbeeac6fadaf languageName: node linkType: hard "bin-links@npm:^4.0.1": - version: 4.0.1 - resolution: "bin-links@npm:4.0.1" + version: 4.0.3 + resolution: "bin-links@npm:4.0.3" dependencies: cmd-shim: ^6.0.0 npm-normalize-package-bin: ^3.0.0 read-cmd-shim: ^4.0.0 write-file-atomic: ^5.0.0 - checksum: a806561750039bcd7d4234efe5c0b8b7ba0ea8495086740b0da6395abe311e2cdb75f8324787354193f652d2ac5ab038c4ca926ed7bcc6ce9bc2001607741104 + checksum: 3b3ee22efc38d608479d51675c8958a841b8b55b8975342ce86f28ac4e0bb3aef46e9dbdde976c6dc1fe1bd2aa00d42e00869ad35b57ee6d868f39f662858911 languageName: node linkType: hard @@ -17178,10 +15720,10 @@ __metadata: languageName: node linkType: hard -"bintrees@npm:1.0.1": - version: 1.0.1 - resolution: "bintrees@npm:1.0.1" - checksum: 71d00ce450ee7ad080a3c86ae5f05fac841bdf95c0d78f3b3bbf8f754c19d7cb732f0f9213a46ed27cbec47eb124ffe2b686bef870718a4b9918c23210b55c73 +"bintrees@npm:1.0.2": + version: 1.0.2 + resolution: "bintrees@npm:1.0.2" + checksum: 56a52b7d3634e30002b1eda740d2517a22fa8e9e2eb088e919f37c030a0ed86e364ab59e472fc770fc8751308054bb1c892979d150e11d9e11ac33bcc1b5d16e languageName: node linkType: hard @@ -17256,28 +15798,35 @@ __metadata: linkType: hard "blakejs@npm:^1.1.0": - version: 1.1.1 - resolution: "blakejs@npm:1.1.1" - checksum: 77a0875af41fe0a6b15feacc69a4a730063df697b2932adbde15aa2c9c58a592870cd511a494ceee59cc8143ae64964dfa1bf301dab275b330debcd12c2b3db9 + version: 1.2.1 + resolution: "blakejs@npm:1.2.1" + checksum: d699ba116cfa21d0b01d12014a03e484dd76d483133e6dc9eb415aa70a119f08beb3bcefb8c71840106a00b542cba77383f8be60cd1f0d4589cb8afb922eefbe languageName: node linkType: hard "blob-to-it@npm:^2.0.0": - version: 2.0.4 - resolution: "blob-to-it@npm:2.0.4" + version: 2.0.5 + resolution: "blob-to-it@npm:2.0.5" dependencies: browser-readablestream-to-it: ^2.0.0 - checksum: b48acc3b83028b2a417a3f3add81ade8d44aec90409a7f196d2a6f7f0299e1109028627e04e786da44fbc3ceb62237f4284efe6428d534e5ad7e207048c8f791 + checksum: ff568573d7639490d63e18b28326fe1440d6c920d64006ad066683bf794f336acb050ea713a720f50187fff02c2ab3a110fb763a1572bc81bdd7edcf83f4ef35 languageName: node linkType: hard -"bluebird@npm:3.7.2, bluebird@npm:^3.4.1, bluebird@npm:^3.5.0, bluebird@npm:^3.5.2, bluebird@npm:^3.5.5": +"bluebird@npm:3.7.2, bluebird@npm:^3.4.1, bluebird@npm:^3.5.0, bluebird@npm:^3.5.2, bluebird@npm:^3.7.2": version: 3.7.2 resolution: "bluebird@npm:3.7.2" checksum: 869417503c722e7dc54ca46715f70e15f4d9c602a423a02c825570862d12935be59ed9c7ba34a9b31f186c017c23cac6b54e35446f8353059c101da73eac22ef languageName: node linkType: hard +"bluebird@npm:^2.6.2": + version: 2.11.0 + resolution: "bluebird@npm:2.11.0" + checksum: f1c6cbec64100bca65c88e5de0d9ee9bbb435f7c74c68a16a9466a8b40daf64346805c2fe04af821564ce6d4199085e7855d2e272282a065eb723344815cc354 + languageName: node + linkType: hard + "bn.js@npm:4.11.6": version: 4.11.6 resolution: "bn.js@npm:4.11.6" @@ -17292,7 +15841,7 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:5.2.1, bn.js@npm:^5.1.3, bn.js@npm:^5.2.1": +"bn.js@npm:5.2.1, bn.js@npm:^5.0.0, bn.js@npm:^5.1.2, bn.js@npm:^5.1.3, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 @@ -17306,13 +15855,6 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:^5.0.0, bn.js@npm:^5.1.1, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0": - version: 5.2.0 - resolution: "bn.js@npm:5.2.0" - checksum: 6117170393200f68b35a061ecbf55d01dd989302e7b3c798a3012354fa638d124f0b2f79e63f77be5556be80322a09c40339eda6413ba7468524c0b6d4b4cb7a - languageName: node - linkType: hard - "body-parser@npm:1.19.0": version: 1.19.0 resolution: "body-parser@npm:1.19.0" @@ -17351,7 +15893,7 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.2, body-parser@npm:^1.10.0, body-parser@npm:^1.18.2": +"body-parser@npm:1.20.2, body-parser@npm:^1.10.0, body-parser@npm:^1.16.0, body-parser@npm:^1.18.2, body-parser@npm:^1.19.0": version: 1.20.2 resolution: "body-parser@npm:1.20.2" dependencies: @@ -17371,26 +15913,6 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:^1.16.0, body-parser@npm:^1.19.0": - version: 1.20.0 - resolution: "body-parser@npm:1.20.0" - dependencies: - bytes: 3.1.2 - content-type: ~1.0.4 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.10.3 - raw-body: 2.5.1 - type-is: ~1.6.18 - unpipe: 1.0.0 - checksum: 12fffdeac82fe20dddcab7074215d5156e7d02a69ae90cbe9fee1ca3efa2f28ef52097cbea76685ee0a1509c71d85abd0056a08e612c09077cad6277a644cf88 - languageName: node - linkType: hard - "bonjour-service@npm:^1.0.11": version: 1.1.1 resolution: "bonjour-service@npm:1.1.1" @@ -17417,31 +15939,6 @@ __metadata: languageName: node linkType: hard -"boxen@npm:^5.0.0": - version: 5.1.2 - resolution: "boxen@npm:5.1.2" - dependencies: - ansi-align: ^3.0.0 - camelcase: ^6.2.0 - chalk: ^4.1.0 - cli-boxes: ^2.2.1 - string-width: ^4.2.2 - type-fest: ^0.20.2 - widest-line: ^3.1.0 - wrap-ansi: ^7.0.0 - checksum: 82d03e42a72576ff235123f17b7c505372fe05c83f75f61e7d4fa4bcb393897ec95ce766fecb8f26b915f0f7a7227d66e5ec7cef43f5b2bd9d3aeed47ec55877 - languageName: node - linkType: hard - -"bplist-parser@npm:^0.2.0": - version: 0.2.0 - resolution: "bplist-parser@npm:0.2.0" - dependencies: - big-integer: ^1.6.44 - checksum: d5339dd16afc51de6c88f88f58a45b72ed6a06aa31f5557d09877575f220b7c1d3fbe375da0b62e6a10d4b8ed80523567e351f24014f5bc886ad523758142cdd - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -17490,7 +15987,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:^3.0.2, braces@npm:~3.0.2": +"braces@npm:^3.0.2, braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -17540,9 +16037,9 @@ __metadata: linkType: hard "browser-readablestream-to-it@npm:^2.0.0": - version: 2.0.4 - resolution: "browser-readablestream-to-it@npm:2.0.4" - checksum: 8552a0a2b32edf60cc8c599b19725f3118792385c3054fe20f87f3117faee0e891efc64c65a5c9e6f4daf9e324e3b991f62f876b2013ca5666d29ef8603eeb68 + version: 2.0.5 + resolution: "browser-readablestream-to-it@npm:2.0.5" + checksum: 19a9f8bc738f46c09ed04730474f287d70cba5566b69d4f32978826f7509cb83d5d2f5b9f86c876b927bdb19f9b6c30912aa264deeaf97a4583def1228bdf7f1 languageName: node linkType: hard @@ -17601,7 +16098,7 @@ __metadata: languageName: node linkType: hard -"browserify-rsa@npm:^4.0.0, browserify-rsa@npm:^4.0.1": +"browserify-rsa@npm:^4.0.0, browserify-rsa@npm:^4.1.0": version: 4.1.0 resolution: "browserify-rsa@npm:4.1.0" dependencies: @@ -17612,19 +16109,19 @@ __metadata: linkType: hard "browserify-sign@npm:^4.0.0": - version: 4.2.1 - resolution: "browserify-sign@npm:4.2.1" + version: 4.2.2 + resolution: "browserify-sign@npm:4.2.2" dependencies: - bn.js: ^5.1.1 - browserify-rsa: ^4.0.1 + bn.js: ^5.2.1 + browserify-rsa: ^4.1.0 create-hash: ^1.2.0 create-hmac: ^1.1.7 - elliptic: ^6.5.3 + elliptic: ^6.5.4 inherits: ^2.0.4 - parse-asn1: ^5.1.5 - readable-stream: ^3.6.0 - safe-buffer: ^5.2.0 - checksum: 0221f190e3f5b2d40183fa51621be7e838d9caa329fe1ba773406b7637855f37b30f5d83e52ff8f244ed12ffe6278dd9983638609ed88c841ce547e603855707 + parse-asn1: ^5.1.6 + readable-stream: ^3.6.2 + safe-buffer: ^5.2.1 + checksum: b622730c0fc183328c3a1c9fdaaaa5118821ed6822b266fa6b0375db7e20061ebec87301d61931d79b9da9a96ada1cab317fce3c68f233e5e93ed02dbb35544c languageName: node linkType: hard @@ -17637,74 +16134,17 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.21.4, browserslist@npm:^4.22.1": - version: 4.22.1 - resolution: "browserslist@npm:4.22.1" +"browserslist@npm:^4.0.0, browserslist@npm:^4.14.5, browserslist@npm:^4.18.1, browserslist@npm:^4.21.10, browserslist@npm:^4.21.3, browserslist@npm:^4.21.4, browserslist@npm:^4.21.5, browserslist@npm:^4.22.2": + version: 4.22.2 + resolution: "browserslist@npm:4.22.2" dependencies: - caniuse-lite: ^1.0.30001541 - electron-to-chromium: ^1.4.535 - node-releases: ^2.0.13 + caniuse-lite: ^1.0.30001565 + electron-to-chromium: ^1.4.601 + node-releases: ^2.0.14 update-browserslist-db: ^1.0.13 bin: browserslist: cli.js - checksum: 7e6b10c53f7dd5d83fd2b95b00518889096382539fed6403829d447e05df4744088de46a571071afb447046abc3c66ad06fbc790e70234ec2517452e32ffd862 - languageName: node - linkType: hard - -"browserslist@npm:^4.14.5, browserslist@npm:^4.17.5, browserslist@npm:^4.20.2": - version: 4.20.3 - resolution: "browserslist@npm:4.20.3" - dependencies: - caniuse-lite: ^1.0.30001332 - electron-to-chromium: ^1.4.118 - escalade: ^3.1.1 - node-releases: ^2.0.3 - picocolors: ^1.0.0 - bin: - browserslist: cli.js - checksum: 1e4b719ac2ca0fe235218a606e8b8ef16b8809e0973b924158c39fbc435a0b0fe43437ea52dd6ef5ad2efcb83fcb07431244e472270177814217f7c563651f7d - languageName: node - linkType: hard - -"browserslist@npm:^4.21.10": - version: 4.21.10 - resolution: "browserslist@npm:4.21.10" - dependencies: - caniuse-lite: ^1.0.30001517 - electron-to-chromium: ^1.4.477 - node-releases: ^2.0.13 - update-browserslist-db: ^1.0.11 - bin: - browserslist: cli.js - checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 - languageName: node - linkType: hard - -"browserslist@npm:^4.21.3, browserslist@npm:^4.21.5": - version: 4.21.5 - resolution: "browserslist@npm:4.21.5" - dependencies: - caniuse-lite: ^1.0.30001449 - electron-to-chromium: ^1.4.284 - node-releases: ^2.0.8 - update-browserslist-db: ^1.0.10 - bin: - browserslist: cli.js - checksum: 9755986b22e73a6a1497fd8797aedd88e04270be33ce66ed5d85a1c8a798292a65e222b0f251bafa1c2522261e237d73b08b58689d4920a607e5a53d56dc4706 - languageName: node - linkType: hard - -"browserslist@npm:^4.21.9": - version: 4.21.9 - resolution: "browserslist@npm:4.21.9" - dependencies: - caniuse-lite: ^1.0.30001503 - electron-to-chromium: ^1.4.431 - node-releases: ^2.0.12 - update-browserslist-db: ^1.0.11 - bin: - browserslist: cli.js - checksum: 80d3820584e211484ad1b1a5cfdeca1dd00442f47be87e117e1dda34b628c87e18b81ae7986fa5977b3e6a03154f6d13cd763baa6b8bf5dd9dd19f4926603698 + checksum: 33ddfcd9145220099a7a1ac533cecfe5b7548ffeb29b313e1b57be6459000a1f8fa67e781cf4abee97268ac594d44134fcc4a6b2b4750ceddc9796e3a22076d9 languageName: node linkType: hard @@ -17880,12 +16320,12 @@ __metadata: linkType: hard "bufferutil@npm:^4.0.1": - version: 4.0.6 - resolution: "bufferutil@npm:4.0.6" + version: 4.0.8 + resolution: "bufferutil@npm:4.0.8" dependencies: node-gyp: latest node-gyp-build: ^4.3.0 - checksum: dd107560947445280af7820c3d0534127b911577d85d537e1d7e0aa30fd634853cef8a994d6e8aed3d81388ab1a20257de776164afe6a6af8e78f5f17968ebd6 + checksum: 7e9a46f1867dca72fda350966eb468eca77f4d623407b0650913fadf73d5750d883147d6e5e21c56f9d3b0bdc35d5474e80a600b9f31ec781315b4d2469ef087 languageName: node linkType: hard @@ -17926,16 +16366,7 @@ __metadata: languageName: node linkType: hard -"bundle-name@npm:^3.0.0": - version: 3.0.0 - resolution: "bundle-name@npm:3.0.0" - dependencies: - run-applescript: ^5.0.0 - checksum: edf2b1fbe6096ed32e7566947ace2ea937ee427391744d7510a2880c4b9a5b3543d3f6c551236a29e5c87d3195f8e2912516290e638c15bcbede7b37cc375615 - languageName: node - linkType: hard - -"busboy@npm:^1.0.0, busboy@npm:^1.6.0": +"busboy@npm:^1.0.0": version: 1.6.0 resolution: "busboy@npm:1.6.0" dependencies: @@ -18006,8 +16437,8 @@ __metadata: linkType: hard "cacache@npm:^16.1.0": - version: 16.1.0 - resolution: "cacache@npm:16.1.0" + version: 16.1.3 + resolution: "cacache@npm:16.1.3" dependencies: "@npmcli/fs": ^2.1.0 "@npmcli/move-file": ^2.0.0 @@ -18026,49 +16457,48 @@ __metadata: rimraf: ^3.0.2 ssri: ^9.0.0 tar: ^6.1.11 - unique-filename: ^1.1.1 - checksum: ddfcf92f079f24ccecef4e2ca1e4428443787b61429b921803b020fd0f33d9ac829ac47837b74b40868d8ae4f1b2ed82e164cdaa5508fbd790eee005a9d88469 + unique-filename: ^2.0.0 + checksum: d91409e6e57d7d9a3a25e5dcc589c84e75b178ae8ea7de05cbf6b783f77a5fae938f6e8fda6f5257ed70000be27a681e1e44829251bfffe4c10216002f8f14e6 languageName: node linkType: hard "cacache@npm:^17.0.0": - version: 17.0.5 - resolution: "cacache@npm:17.0.5" + version: 17.1.4 + resolution: "cacache@npm:17.1.4" dependencies: "@npmcli/fs": ^3.1.0 fs-minipass: ^3.0.0 - glob: ^9.3.1 + glob: ^10.2.2 lru-cache: ^7.7.1 - minipass: ^4.0.0 + minipass: ^7.0.3 minipass-collect: ^1.0.2 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 p-map: ^4.0.0 - promise-inflight: ^1.0.1 ssri: ^10.0.0 tar: ^6.1.11 unique-filename: ^3.0.0 - checksum: 83312d74acf4d17e378fc1f09ace1dedcb0a1b1033a0e9e22246052b8715cda7bdc8b7ab6dcadd3cb3f2965266def476835488cad5aea810159d452749757fbd + checksum: b7751df756656954a51201335addced8f63fc53266fa56392c9f5ae83c8d27debffb4458ac2d168a744a4517ec3f2163af05c20097f93d17bdc2dc8a385e14a6 languageName: node linkType: hard "cacache@npm:^18.0.0": - version: 18.0.0 - resolution: "cacache@npm:18.0.0" + version: 18.0.1 + resolution: "cacache@npm:18.0.1" dependencies: "@npmcli/fs": ^3.1.0 fs-minipass: ^3.0.0 glob: ^10.2.2 lru-cache: ^10.0.1 minipass: ^7.0.3 - minipass-collect: ^1.0.2 + minipass-collect: ^2.0.1 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 p-map: ^4.0.0 ssri: ^10.0.0 tar: ^6.1.11 unique-filename: ^3.0.0 - checksum: 2cd6bf15551abd4165acb3a4d1ef0593b3aa2fd6853ae16b5bb62199c2faecf27d36555a9545c0e07dd03347ec052e782923bdcece724a24611986aafb53e152 + checksum: 5a0b3b2ea451a0379814dc1d3c81af48c7c6db15cd8f7d72e028501ae0036a599a99bbac9687bfec307afb2760808d1c7708e9477c8c70d2b166e7d80b162a23 languageName: node linkType: hard @@ -18089,6 +16519,13 @@ __metadata: languageName: node linkType: hard +"cacheable-lookup@npm:^5.0.3": + version: 5.0.4 + resolution: "cacheable-lookup@npm:5.0.4" + checksum: 763e02cf9196bc9afccacd8c418d942fc2677f22261969a4c2c2e760fa44a2351a81557bd908291c3921fe9beb10b976ba8fa50c5ca837c5a0dd945f16468f2d + languageName: node + linkType: hard + "cacheable-lookup@npm:^6.0.4": version: 6.1.0 resolution: "cacheable-lookup@npm:6.1.0" @@ -18104,17 +16541,17 @@ __metadata: linkType: hard "cacheable-request@npm:^10.2.8": - version: 10.2.12 - resolution: "cacheable-request@npm:10.2.12" + version: 10.2.14 + resolution: "cacheable-request@npm:10.2.14" dependencies: - "@types/http-cache-semantics": ^4.0.1 + "@types/http-cache-semantics": ^4.0.2 get-stream: ^6.0.1 http-cache-semantics: ^4.1.1 - keyv: ^4.5.2 + keyv: ^4.5.3 mimic-response: ^4.0.0 normalize-url: ^8.0.0 responselike: ^3.0.0 - checksum: 106f6da294c7e39e222ceb89d9857a2b0bbf95d92f6a24a242de7690245c103ffadc2e181fc4abe5d0d6878d90f62ceb8277a6b9b95a71e5b689d348ea0e1558 + checksum: 56f2b8e1c497c91f8391f0b099d19907a7dde25e71087e622b23e45fc8061736c2a6964ef121b16f377c3c61079cf8dc17320ab54004209d1343e4d26aba7015 languageName: node linkType: hard @@ -18183,17 +16620,7 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2": - version: 1.0.2 - resolution: "call-bind@npm:1.0.2" - dependencies: - function-bind: ^1.1.1 - get-intrinsic: ^1.0.2 - checksum: f8e31de9d19988a4b80f3e704788c4a2d6b6f3d17cfec4f57dc29ced450c53a49270dc66bf0fbd693329ee948dd33e6c90a329519aef17474a4d961e8d6426b0 - languageName: node - linkType: hard - -"call-bind@npm:^1.0.4, call-bind@npm:^1.0.5": +"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.4, call-bind@npm:^1.0.5": version: 1.0.5 resolution: "call-bind@npm:1.0.5" dependencies: @@ -18205,9 +16632,9 @@ __metadata: linkType: hard "call-me-maybe@npm:^1.0.1": - version: 1.0.1 - resolution: "call-me-maybe@npm:1.0.1" - checksum: d19e9d6ac2c6a83fb1215718b64c5e233f688ebebb603bdfe4af59cde952df1f2b648530fab555bf290ea910d69d7d9665ebc916e871e0e194f47c2e48e4886b + version: 1.0.2 + resolution: "call-me-maybe@npm:1.0.2" + checksum: 42ff2d0bed5b207e3f0122589162eaaa47ba618f79ad2382fe0ba14d9e49fbf901099a6227440acc5946f86a4953e8aa2d242b330b0a5de4d090bb18f8935cae languageName: node linkType: hard @@ -18331,9 +16758,9 @@ __metadata: linkType: hard "camelize@npm:^1.0.0": - version: 1.0.0 - resolution: "camelize@npm:1.0.0" - checksum: 769f8d10071f57b974d9a51dc02f589dd7fb07ea6a7ecde1a57b52ae68657ba61fe85c60d50661b76c7dbb76b6474fbfd3356aee33cf5f025cd7fd6fb2811b73 + version: 1.0.1 + resolution: "camelize@npm:1.0.1" + checksum: 91d8611d09af725e422a23993890d22b2b72b4cabf7239651856950c76b4bf53fe0d0da7c5e4db05180e898e4e647220e78c9fbc976113bd96d603d1fcbfcb99 languageName: node linkType: hard @@ -18349,52 +16776,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001520": - version: 1.0.30001524 - resolution: "caniuse-lite@npm:1.0.30001524" - checksum: 35d662a62f5e6be3c2d2141f1f30b3428ec72c5756cbd9fc723e33606846f28a515fd30f1e8b56e506c63fe0755f6eb7e3548dc6eefd53c5591b1a3bd28fee98 - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001332": - version: 1.0.30001340 - resolution: "caniuse-lite@npm:1.0.30001340" - checksum: 5b419c93cb5a67568ffe8c84520d149146e5b84056ce41ee509c89d2bd036e4ce6d87485e25dfee2bb8a818d46e0734e93cacbef6b9b911c20166b943b36b78c - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001373": - version: 1.0.30001516 - resolution: "caniuse-lite@npm:1.0.30001516" - checksum: 044adf3493b734a356a2922445a30095a0f6de6b9194695cdf74deafe7bef658e85858a31177762c2813f6e1ed2722d832d59eee0ecb2151e93a611ee18cb21f - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001449": - version: 1.0.30001474 - resolution: "caniuse-lite@npm:1.0.30001474" - checksum: c05faab958fae1bbf3c595203c96d3a2f6b4c7a0d122069addc6c386f208b4db66eed3f5e3d606b80e3b384603d353b27a306f6dcb6145642b5b97a330dba86a - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001517": - version: 1.0.30001532 - resolution: "caniuse-lite@npm:1.0.30001532" - checksum: 613abeb15e03dde307d543195a7860f7ba7450c9c9262d45642b2c8fbe097914fa060d68c8647f9d443947b1f62b09d891858bde7d2cac94fae8133a0b518b28 - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001503": - version: 1.0.30001510 - resolution: "caniuse-lite@npm:1.0.30001510" - checksum: 4b5237c85760a8aea0d003eb329e84f66d00665e36a92f6b3795bd436ac590f67f304aa978111ca480913c893b8b37d806425d615853637b2b760db868d80041 - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001541": - version: 1.0.30001549 - resolution: "caniuse-lite@npm:1.0.30001549" - checksum: 7f2abeedc8cf8b92cc0613855d71b995ce436068c0bcdd798c5af7d297ccf9f52496b00181beda42d82d25079dd4b6e389c67486156d40d8854e5707a25cb054 +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001373, caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001565": + version: 1.0.30001572 + resolution: "caniuse-lite@npm:1.0.30001572" + checksum: 7d017a99a38e29ccee4ed3fc0ef1eb90cf082fcd3a7909c5c536c4ba1d55c5b26ecc1e4ad82c1caa6bfadce526764b354608710c9b61a75bdc7ce8ca15c5fcf2 languageName: node linkType: hard @@ -18494,11 +16879,11 @@ __metadata: linkType: hard "cborg@npm:^4.0.0": - version: 4.0.3 - resolution: "cborg@npm:4.0.3" + version: 4.0.5 + resolution: "cborg@npm:4.0.5" bin: cborg: lib/bin.js - checksum: c6ae097661793aa561b2322ec40c98a80c0e565da1433899d22e4571233422fe37068121b2600713915a28c839f4804e92934d02049534b1592910554378019f + checksum: 22d43c6cdb95fb6f4db7ad357e121a72a1495cb3ce3cce577ab61494d709154679cf6452834f364d83ebe12672c859845cd35e1252f5f4f505ff96a2b5528ef3 languageName: node linkType: hard @@ -18513,7 +16898,7 @@ __metadata: languageName: node linkType: hard -"chai@npm:4.3.7, chai@npm:^4.1.2": +"chai@npm:4.3.7": version: 4.3.7 resolution: "chai@npm:4.3.7" dependencies: @@ -18528,6 +16913,32 @@ __metadata: languageName: node linkType: hard +"chai@npm:^4.1.2": + version: 4.3.10 + resolution: "chai@npm:4.3.10" + dependencies: + assertion-error: ^1.1.0 + check-error: ^1.0.3 + deep-eql: ^4.1.3 + get-func-name: ^2.0.2 + loupe: ^2.3.6 + pathval: ^1.1.1 + type-detect: ^4.0.8 + checksum: 536668c60a0d985a0fbd94418028e388d243a925d7c5e858c7443e334753511614a3b6a124bac9ca077dfc4c37acc367d62f8c294960f440749536dc181dfc6d + languageName: node + linkType: hard + +"chalk@npm:2.4.2, chalk@npm:^2.0.0, chalk@npm:^2.1.0, chalk@npm:^2.3.0, chalk@npm:^2.3.2, chalk@npm:^2.4.1, chalk@npm:^2.4.2": + version: 2.4.2 + resolution: "chalk@npm:2.4.2" + dependencies: + ansi-styles: ^3.2.1 + escape-string-regexp: ^1.0.5 + supports-color: ^5.3.0 + checksum: ec3661d38fe77f681200f878edbd9448821924e0f93a9cefc0e26a33b145f1027a2084bf19967160d11e1f03bfe4eaffcabf5493b89098b2782c3fe0b03d80c2 + languageName: node + linkType: hard + "chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" @@ -18551,17 +16962,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0, chalk@npm:^2.1.0, chalk@npm:^2.3.0, chalk@npm:^2.3.2, chalk@npm:^2.4.1, chalk@npm:^2.4.2": - version: 2.4.2 - resolution: "chalk@npm:2.4.2" - dependencies: - ansi-styles: ^3.2.1 - escape-string-regexp: ^1.0.5 - supports-color: ^5.3.0 - checksum: ec3661d38fe77f681200f878edbd9448821924e0f93a9cefc0e26a33b145f1027a2084bf19967160d11e1f03bfe4eaffcabf5493b89098b2782c3fe0b03d80c2 - languageName: node - linkType: hard - "chalk@npm:^3.0.0": version: 3.0.0 resolution: "chalk@npm:3.0.0" @@ -18666,17 +17066,19 @@ __metadata: languageName: node linkType: hard -"check-error@npm:^1.0.2": - version: 1.0.2 - resolution: "check-error@npm:1.0.2" - checksum: d9d106504404b8addd1ee3f63f8c0eaa7cd962a1a28eb9c519b1c4a1dc7098be38007fc0060f045ee00f075fbb7a2a4f42abcf61d68323677e11ab98dc16042e +"check-error@npm:^1.0.2, check-error@npm:^1.0.3": + version: 1.0.3 + resolution: "check-error@npm:1.0.3" + dependencies: + get-func-name: ^2.0.2 + checksum: e2131025cf059b21080f4813e55b3c480419256914601750b0fee3bd9b2b8315b531e551ef12560419b8b6d92a3636511322752b1ce905703239e7cc451b6399 languageName: node linkType: hard -"check-types@npm:^11.1.1": - version: 11.2.2 - resolution: "check-types@npm:11.2.2" - checksum: 61ed60d59e3397c8cf694f20edf73d0061cd6a905754efdec2ccdceafbd390cb09717bab855f9eba921d36278f84c86fe20f7e731a384e9803bc469c09153831 +"check-types@npm:^11.2.3": + version: 11.2.3 + resolution: "check-types@npm:11.2.3" + checksum: f99ff09ae65e63cfcfa40a1275c0a70d8c43ffbf9ac35095f3bf030cc70361c92e075a9975a1144329e50b4fe4620be6bedb4568c18abc96071a3e23aed3ed8e languageName: node linkType: hard @@ -18766,9 +17168,9 @@ __metadata: linkType: hard "ci-info@npm:^3.1.1, ci-info@npm:^3.2.0": - version: 3.3.0 - resolution: "ci-info@npm:3.3.0" - checksum: c3d86fe374938ecda5093b1ba39acb535d8309185ba3f23587747c6a057e63f45419b406d880304dbc0e1d72392c9a33e42fe9a1e299209bc0ded5efaa232b66 + version: 3.9.0 + resolution: "ci-info@npm:3.9.0" + checksum: 6b19dc9b2966d1f8c2041a838217299718f15d6c4b63ae36e4674edd2bee48f780e94761286a56aa59eb305a85fbea4ddffb7630ec063e7ec7e7e5ad42549a87 languageName: node linkType: hard @@ -18779,6 +17181,27 @@ __metadata: languageName: node linkType: hard +"cidr-regex@npm:4.0.3": + version: 4.0.3 + resolution: "cidr-regex@npm:4.0.3" + dependencies: + ip-regex: ^5.0.0 + checksum: d26f9168c2c380a136ac3af6379959d6140c61e08adafed276ed50e9e0d55c129c6ac7c1629e2c676bca9a030d927fbc4a45355e90d10ebcca30a97e8f17011d + languageName: node + linkType: hard + +"cidr-tools@npm:^6.4.1": + version: 6.4.2 + resolution: "cidr-tools@npm:6.4.2" + dependencies: + cidr-regex: 4.0.3 + ip-bigint: 7.3.0 + ip-regex: 5.0.0 + string-natural-compare: 3.0.1 + checksum: 5bfaf1646848d1e92531b760960b6cac8a30b7d3877cb29fc2677fe7fa193ca4a1acb17405f424e83484d0d177a8f92df81e2b61e72a56782153d2ec010dfc2d + languageName: node + linkType: hard + "cids@npm:^0.7.1": version: 0.7.5 resolution: "cids@npm:0.7.5" @@ -18810,9 +17233,9 @@ __metadata: linkType: hard "cjs-module-lexer@npm:^1.0.0": - version: 1.2.2 - resolution: "cjs-module-lexer@npm:1.2.2" - checksum: 977f3f042bd4f08e368c890d91eecfbc4f91da0bc009a3c557bc4dfbf32022ad1141244ac1178d44de70fc9f3dea7add7cd9a658a34b9fae98a55d8f92331ce5 + version: 1.2.3 + resolution: "cjs-module-lexer@npm:1.2.3" + checksum: 5ea3cb867a9bb609b6d476cd86590d105f3cfd6514db38ff71f63992ab40939c2feb68967faa15a6d2b1f90daa6416b79ea2de486e9e2485a6f8b66a21b4fb0a languageName: node linkType: hard @@ -18850,11 +17273,11 @@ __metadata: linkType: hard "clean-css@npm:^5.2.2": - version: 5.3.2 - resolution: "clean-css@npm:5.3.2" + version: 5.3.3 + resolution: "clean-css@npm:5.3.3" dependencies: source-map: ~0.6.0 - checksum: 8787b281acc9878f309b5f835d410085deedfd4e126472666773040a6a8a72f472a1d24185947d23b87b1c419bf2c5ed429395d5c5ff8279c98b05d8011e9758 + checksum: 941987c14860dd7d346d5cf121a82fd2caf8344160b1565c5387f7ccca4bbcaf885bace961be37c4f4713ce2d8c488dd89483c1add47bb779790edbfdcc79cbc languageName: node linkType: hard @@ -18866,11 +17289,11 @@ __metadata: linkType: hard "clean-stack@npm:^4.0.0": - version: 4.1.0 - resolution: "clean-stack@npm:4.1.0" + version: 4.2.0 + resolution: "clean-stack@npm:4.2.0" dependencies: escape-string-regexp: 5.0.0 - checksum: 56fdca7a67a61528676eaddce35442824700b674cf882150ac416824966f65b5e15d4ea02d1d47f4d16ad50213718c1f00ae0f6cca46aeec3fd761b49cf7204f + checksum: 373f656a31face5c615c0839213b9b542a0a48057abfb1df66900eab4dc2a5c6097628e4a0b5aa559cdfc4e66f8a14ea47be9681773165a44470ef5fb8ccc172 languageName: node linkType: hard @@ -18884,7 +17307,7 @@ __metadata: languageName: node linkType: hard -"cli-boxes@npm:^2.2.0, cli-boxes@npm:^2.2.1": +"cli-boxes@npm:^2.2.0": version: 2.2.1 resolution: "cli-boxes@npm:2.2.1" checksum: be79f8ec23a558b49e01311b39a1ea01243ecee30539c880cf14bf518a12e223ef40c57ead0cb44f509bffdffc5c129c746cd50d863ab879385370112af4f585 @@ -18918,17 +17341,10 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:^2.2.0": - version: 2.9.0 - resolution: "cli-spinners@npm:2.9.0" - checksum: a9c56e1f44457d4a9f4f535364e729cb8726198efa9e98990cfd9eda9e220dfa4ba12f92808d1be5e29029cdfead781db82dc8549b97b31c907d55f96aa9b0e2 - languageName: node - linkType: hard - -"cli-spinners@npm:^2.5.0": - version: 2.6.1 - resolution: "cli-spinners@npm:2.6.1" - checksum: 423409baaa7a58e5104b46ca1745fbfc5888bbd0b0c5a626e052ae1387060839c8efd512fb127e25769b3dc9562db1dc1b5add6e0b93b7ef64f477feb6416a45 +"cli-spinners@npm:^2.2.0, cli-spinners@npm:^2.5.0": + version: 2.9.2 + resolution: "cli-spinners@npm:2.9.2" + checksum: 1bd588289b28432e4676cb5d40505cfe3e53f2e4e10fbe05c8a710a154d6fe0ce7836844b00d6858f740f2ffe67cdc36e0fce9c7b6a8430e80e6388d5aa4956c languageName: node linkType: hard @@ -19075,6 +17491,15 @@ __metadata: languageName: node linkType: hard +"clone-regexp@npm:^3.0.0": + version: 3.0.0 + resolution: "clone-regexp@npm:3.0.0" + dependencies: + is-regexp: ^3.0.0 + checksum: cb254bd47ce0aac55771c888211e796b5e2a2ed974d0a7020e4e3805eca597fd19b85a7bcbf2250d319f12626a09c0e4db120e02ce49fec81a61bcd208474651 + languageName: node + linkType: hard + "clone-response@npm:^1.0.2": version: 1.0.3 resolution: "clone-response@npm:1.0.3" @@ -19099,16 +17524,16 @@ __metadata: linkType: hard "clsx@npm:^2.0.0": - version: 2.0.0 - resolution: "clsx@npm:2.0.0" - checksum: a2cfb2351b254611acf92faa0daf15220f4cd648bdf96ce369d729813b85336993871a4bf6978ddea2b81b5a130478339c20d9d0b5c6fc287e5147f0c059276e + version: 2.1.0 + resolution: "clsx@npm:2.1.0" + checksum: 43fefc29b6b49c9476fbce4f8b1cc75c27b67747738e598e6651dd40d63692135dc60b18fa1c5b78a2a9ba8ae6fd2055a068924b94e20b42039bd53b78b98e1d languageName: node linkType: hard "cmd-shim@npm:^6.0.0": - version: 6.0.1 - resolution: "cmd-shim@npm:6.0.1" - checksum: 359006b3a5bb4a0ff161a44ccc18fbba947db748ef0dd12273e476792e316a5edb0945d74bfa1e91cd88ce0511025fde87901eda092c479d83cfcd6734562683 + version: 6.0.2 + resolution: "cmd-shim@npm:6.0.2" + checksum: df3a01fc4d72a49b450985b991205e65774b28e7f74a2e4d2a11fd0df8732e3828f9e7b644050def3cd0be026cbd3ee46a1f50ce5f57d0b3fb5afe335bdfacde languageName: node linkType: hard @@ -19147,9 +17572,9 @@ __metadata: linkType: hard "collect-v8-coverage@npm:^1.0.0": - version: 1.0.1 - resolution: "collect-v8-coverage@npm:1.0.1" - checksum: 4efe0a1fccd517b65478a2364b33dadd0a43fc92a56f59aaece9b6186fe5177b2de471253587de7c91516f07c7268c2f6770b6cbcffc0e0ece353b766ec87e55 + version: 1.0.2 + resolution: "collect-v8-coverage@npm:1.0.2" + checksum: c10f41c39ab84629d16f9f6137bc8a63d332244383fc368caf2d2052b5e04c20cd1fd70f66fcf4e2422b84c8226598b776d39d5f2d2a51867cc1ed5d1982b4da languageName: node linkType: hard @@ -19196,12 +17621,12 @@ __metadata: linkType: hard "color-string@npm:^1.6.0": - version: 1.9.0 - resolution: "color-string@npm:1.9.0" + version: 1.9.1 + resolution: "color-string@npm:1.9.1" dependencies: color-name: ^1.0.0 simple-swizzle: ^0.2.2 - checksum: 93c6678b847f8cfa47d19677fd19e1d4b19d7a33f100644400357c298266080b5bca64e5f874fa8ac8cc0aa0606ad44f7a838b4e6fd05e6affea190a68555bb4 + checksum: c13fe7cff7885f603f49105827d621ce87f4571d78ba28ef4a3f1a104304748f620615e6bf065ecd2145d0d9dad83a3553f52bb25ede7239d18e9f81622f1cc5 languageName: node linkType: hard @@ -19245,14 +17670,7 @@ __metadata: languageName: node linkType: hard -"colorette@npm:^2.0.10, colorette@npm:^2.0.16": - version: 2.0.16 - resolution: "colorette@npm:2.0.16" - checksum: cd55596a3a2d1071c1a28eee7fd8a5387593ff1bd10a3e8d0a6221499311fe34a9f2b9272d77c391e0e003dcdc8934fb2f8d106e7ef1f7516f8060c901d41a27 - languageName: node - linkType: hard - -"colorette@npm:^2.0.14": +"colorette@npm:^2.0.10, colorette@npm:^2.0.14, colorette@npm:^2.0.16": version: 2.0.20 resolution: "colorette@npm:2.0.20" checksum: 0c016fea2b91b733eb9f4bcdb580018f52c0bc0979443dad930e5037a968237ac53d9beb98e218d2e9235834f8eebce7f8e080422d6194e957454255bde71d3d @@ -19358,14 +17776,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^9.1.0": - version: 9.2.0 - resolution: "commander@npm:9.2.0" - checksum: 7c82e4cd969712aa6d7c055b8351807a7230f9f31ef7ec7881e11a1147511de85adf5d6ccfd200240a118eecf693b220caf6865b8efbcea558a70d35aa9ed711 - languageName: node - linkType: hard - -"commander@npm:^9.2.0": +"commander@npm:^9.1.0, commander@npm:^9.2.0": version: 9.5.0 resolution: "commander@npm:9.5.0" checksum: c7a3e27aa59e913b54a1bafd366b88650bc41d6651f0cbe258d4ff09d43d6a7394232a4dadd0bf518b3e696fdf595db1028a0d82c785b88bd61f8a440cecfade @@ -19380,15 +17791,15 @@ __metadata: linkType: hard "comment-json@npm:^4.2.2": - version: 4.2.2 - resolution: "comment-json@npm:4.2.2" + version: 4.2.3 + resolution: "comment-json@npm:4.2.3" dependencies: array-timsort: ^1.0.3 core-util-is: ^1.0.3 esprima: ^4.0.1 has-own-prop: ^2.0.0 repeat-string: ^1.6.1 - checksum: eb77124bf048c69384ef3df4ae03ab01229118232527476411580ae5f101292849807f937da59efdcbf05945e10f4392837f66bb82f7d69cc85240e762b76805 + checksum: 7f8d26266b0d49de9661f6365cbcc373fee4f4d0f422a203dfb17ad8f3d84c5be5ded444874935a197cd03cff297c53fe48910256cb4171cb2e52a3e6b9d317c languageName: node linkType: hard @@ -19445,9 +17856,9 @@ __metadata: linkType: hard "component-emitter@npm:^1.2.1": - version: 1.3.0 - resolution: "component-emitter@npm:1.3.0" - checksum: b3c46de38ffd35c57d1c02488355be9f218e582aec72d72d1b8bbec95a3ac1b38c96cd6e03ff015577e68f550fbb361a3bfdbd9bb248be9390b7b3745691be6b + version: 1.3.1 + resolution: "component-emitter@npm:1.3.1" + checksum: 94550aa462c7bd5a61c1bc480e28554aa306066930152d1b1844a0dd3845d4e5db7e261ddec62ae184913b3e59b55a2ad84093b9d3596a8f17c341514d6c483d languageName: node linkType: hard @@ -19669,20 +18080,13 @@ __metadata: languageName: node linkType: hard -"content-type@npm:^1.0.5, content-type@npm:~1.0.5": +"content-type@npm:^1.0.5, content-type@npm:~1.0.4, content-type@npm:~1.0.5": version: 1.0.5 resolution: "content-type@npm:1.0.5" checksum: 566271e0a251642254cde0f845f9dd4f9856e52d988f4eb0d0dcffbb7a1f8ec98de7a5215fc628f3bce30fe2fb6fd2bc064b562d721658c59b544e2d34ea2766 languageName: node linkType: hard -"content-type@npm:~1.0.4": - version: 1.0.4 - resolution: "content-type@npm:1.0.4" - checksum: 3d93585fda985d1554eca5ebd251994327608d2e200978fdbfba21c0c679914d5faf266d17027de44b34a72c7b0745b18584ecccaa7e1fdfb6a68ac7114f12e0 - languageName: node - linkType: hard - "conventional-changelog-angular@npm:^6.0.0": version: 6.0.0 resolution: "conventional-changelog-angular@npm:6.0.0" @@ -19802,19 +18206,17 @@ __metadata: languageName: node linkType: hard -"convert-source-map@npm:^1.4.0, convert-source-map@npm:^1.5.0": - version: 1.9.0 - resolution: "convert-source-map@npm:1.9.0" - checksum: dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 +"convert-hrtime@npm:^5.0.0": + version: 5.0.0 + resolution: "convert-hrtime@npm:5.0.0" + checksum: 5245ad1ac6dd57b2d87624ae0eeac1d2a74812a6631208c09368bef787a28e7dbfa736cddaa9c8a0c425cb240437ea506afec7b9684ff617004d06a551f26c87 languageName: node linkType: hard -"convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": - version: 1.8.0 - resolution: "convert-source-map@npm:1.8.0" - dependencies: - safe-buffer: ~5.1.1 - checksum: 985d974a2d33e1a2543ada51c93e1ba2f73eaed608dc39f229afc78f71dcc4c8b7d7c684aa647e3c6a3a204027444d69e53e169ce94e8d1fa8d7dee80c9c8fed +"convert-source-map@npm:^1.4.0, convert-source-map@npm:^1.5.0, convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": + version: 1.9.0 + resolution: "convert-source-map@npm:1.9.0" + checksum: dc55a1f28ddd0e9485ef13565f8f756b342f9a46c4ae18b843fe3c30c675d058d6a4823eff86d472f187b176f0adf51ea7b69ea38be34be4a63cbbf91b0593c8 languageName: node linkType: hard @@ -19945,35 +18347,19 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.31.0": - version: 3.32.1 - resolution: "core-js-compat@npm:3.32.1" +"core-js-compat@npm:^3.31.0, core-js-compat@npm:^3.33.1": + version: 3.35.0 + resolution: "core-js-compat@npm:3.35.0" dependencies: - browserslist: ^4.21.10 - checksum: 2ce0002d6d2acabfc6f4c1ea32915683406a10051a186db354b761303cb6f5728f83887d070fb8d0072b5601bb16cb0d24555ee72bfa6df244f7b3ef74d61f76 + browserslist: ^4.22.2 + checksum: 64c41ce6870aa9130b9d0cb8f00c05204094f46db7e345d520ec2e38f8b6e1d51e921d4974ceb880948f19c0a79e5639e55be0e56f88ea20e32e9a6274da7f82 languageName: node linkType: hard -"core-js-compat@npm:^3.32.2": - version: 3.33.0 - resolution: "core-js-compat@npm:3.33.0" - dependencies: - browserslist: ^4.22.1 - checksum: 83ae54008c09b8e0ae3c59457039866c342c7e28b0d30eebb638a5b51c01432e63fe97695c90645cbc6a8b073a4f9a8b0e75f0818bbf8b4b054e01f4c17d3181 - languageName: node - linkType: hard - -"core-js-pure@npm:^3.0.1": - version: 3.32.0 - resolution: "core-js-pure@npm:3.32.0" - checksum: 57b1ae97e6d468dfa34af3df75bba3fec3d01a04392f7c11f77a698f7157be199b647c599a06869fb403397a2e512dbbfc6eb3b8a690f857484125620f7d36e6 - languageName: node - linkType: hard - -"core-js-pure@npm:^3.23.3": - version: 3.32.1 - resolution: "core-js-pure@npm:3.32.1" - checksum: 06d3b1585b1f161e84adaf6a0f1db2434309b8d6c748ee82f1806c5d9755272a30074dfa888d60a164c639c6820588ab8462f1073c6971e76659f13788c2f10d +"core-js-pure@npm:^3.0.1, core-js-pure@npm:^3.23.3": + version: 3.35.0 + resolution: "core-js-pure@npm:3.35.0" + checksum: be542e17687656f4e08091f323a2aa7ee4b3368c4c964794d9475fd27ff34288390bdbe90fb3ba4c75300abf046f03e4783032f313011651a05fa1cca5ec24e0 languageName: node linkType: hard @@ -19985,9 +18371,9 @@ __metadata: linkType: hard "core-js@npm:^3.19.2": - version: 3.32.1 - resolution: "core-js@npm:3.32.1" - checksum: e4af91d9c6be7b59235feb3f273d16705126ce09a0b4a787144d131d874f0cd10be3c24fc52e5eea7d7cb03ceabe4be7b255abcd9474b5eb1ff365d2c5611f9a + version: 3.35.0 + resolution: "core-js@npm:3.35.0" + checksum: 25c224aca3df012b98f08f13ccbd8171ef5852acd33fd5e58e106d27f5f0c97de2fdbc520f0b4364d26253caf2deb3e5d265310f57d2a66ae6cc922850e649f0 languageName: node linkType: hard @@ -20027,7 +18413,7 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:7.0.1, cosmiconfig@npm:^7.0.1": +"cosmiconfig@npm:7.0.1": version: 7.0.1 resolution: "cosmiconfig@npm:7.0.1" dependencies: @@ -20053,7 +18439,7 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:^7.0.0, cosmiconfig@npm:^7.1.0": +"cosmiconfig@npm:^7.0.0, cosmiconfig@npm:^7.0.1, cosmiconfig@npm:^7.1.0": version: 7.1.0 resolution: "cosmiconfig@npm:7.1.0" dependencies: @@ -20067,8 +18453,8 @@ __metadata: linkType: hard "cosmiconfig@npm:^8.0.0, cosmiconfig@npm:^8.2.0": - version: 8.3.5 - resolution: "cosmiconfig@npm:8.3.5" + version: 8.3.6 + resolution: "cosmiconfig@npm:8.3.6" dependencies: import-fresh: ^3.3.0 js-yaml: ^4.1.0 @@ -20079,7 +18465,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: c6e44bb3cabf268b70049e7bd4ee8ecf00068854e53cbc32f9104794927ef406817f9e64e1c4949bd10776b604c01f7b50674336fcd2d5b9efc4cf8277fdf025 + checksum: dc339ebea427898c9e03bf01b56ba7afbac07fc7d2a2d5a15d6e9c14de98275a9565da949375aee1809591c152c0a3877bb86dbeaf74d5bd5aaa79955ad9e7a0 languageName: node linkType: hard @@ -20112,24 +18498,14 @@ __metadata: languageName: node linkType: hard -"cpu-features@npm:0.0.2": - version: 0.0.2 - resolution: "cpu-features@npm:0.0.2" - dependencies: - nan: ^2.14.1 - node-gyp: latest - checksum: 15177f9a2d465e4d84390f902c977b34f237dadb29fd8553853b13d906ffe5f15be9f091c72db4f34c71412d5ff4e0e4edf04caebc875b02d1d7ecfce2963299 - languageName: node - linkType: hard - -"cpu-features@npm:~0.0.8": - version: 0.0.8 - resolution: "cpu-features@npm:0.0.8" +"cpu-features@npm:~0.0.9": + version: 0.0.9 + resolution: "cpu-features@npm:0.0.9" dependencies: buildcheck: ~0.0.6 nan: ^2.17.0 node-gyp: latest - checksum: 7b52da1e538beb31185c63a874c8b88c40048ee7ebb5dfd37bb15d9c9044fffa2da048c2bc46d9f2e0916ec86d38c6812c7c6baafdddd504d56594eeff614444 + checksum: 1ff6045a16d32d9667d5dd69c7d485944494d3378ac9381c52bca772bd0c948812eaeda55a76ef09212b0c0e0c575e5d53221899ce51692b1196089452c5aef1 languageName: node linkType: hard @@ -20161,19 +18537,7 @@ __metadata: languageName: node linkType: hard -"crc-32@npm:^1.2.0": - version: 1.2.1 - resolution: "crc-32@npm:1.2.1" - dependencies: - exit-on-epipe: ~1.0.1 - printj: ~1.3.1 - bin: - crc32: bin/crc32.njs - checksum: b8942a404766990b1ebbcc488fe5972afbabfea870362325165e26d1156abc3e987afb22cc74bd624a1570d8837d7b910534e83a8ffb9413e6ff02ec5cc638aa - languageName: node - linkType: hard - -"crc-32@npm:^1.2.2": +"crc-32@npm:^1.2.0, crc-32@npm:^1.2.2": version: 1.2.2 resolution: "crc-32@npm:1.2.2" bin: @@ -20231,6 +18595,23 @@ __metadata: languageName: node linkType: hard +"create-jest@npm:^29.7.0": + version: 29.7.0 + resolution: "create-jest@npm:29.7.0" + dependencies: + "@jest/types": ^29.6.3 + chalk: ^4.0.0 + exit: ^0.1.2 + graceful-fs: ^4.2.9 + jest-config: ^29.7.0 + jest-util: ^29.7.0 + prompts: ^2.0.1 + bin: + create-jest: bin/create-jest.js + checksum: 1427d49458adcd88547ef6fa39041e1fe9033a661293aa8d2c3aa1b4967cb5bf4f0c00436c7a61816558f28ba2ba81a94d5c962e8022ea9a883978fc8e1f2945 + languageName: node + linkType: hard + "create-require@npm:^1.1.0": version: 1.1.1 resolution: "create-require@npm:1.1.1" @@ -20265,7 +18646,7 @@ __metadata: languageName: node linkType: hard -"cross-fetch@npm:^3.0.6, cross-fetch@npm:^3.1.0, cross-fetch@npm:^3.1.5": +"cross-fetch@npm:^3.0.6, cross-fetch@npm:^3.1.0, cross-fetch@npm:^3.1.4, cross-fetch@npm:^3.1.5": version: 3.1.8 resolution: "cross-fetch@npm:3.1.8" dependencies: @@ -20274,15 +18655,6 @@ __metadata: languageName: node linkType: hard -"cross-fetch@npm:^3.1.4": - version: 3.1.5 - resolution: "cross-fetch@npm:3.1.5" - dependencies: - node-fetch: 2.6.7 - checksum: f6b8c6ee3ef993ace6277fd789c71b6acf1b504fd5f5c7128df4ef2f125a429e29cd62dc8c127523f04a5f2fa4771ed80e3f3d9695617f441425045f505cf3bb - languageName: node - linkType: hard - "cross-fetch@npm:^4.0.0": version: 4.0.0 resolution: "cross-fetch@npm:4.0.0" @@ -20338,8 +18710,8 @@ __metadata: linkType: hard "crypto-addr-codec@npm:^0.1.7": - version: 0.1.7 - resolution: "crypto-addr-codec@npm:0.1.7" + version: 0.1.8 + resolution: "crypto-addr-codec@npm:0.1.8" dependencies: base-x: ^3.0.8 big-integer: 1.6.36 @@ -20348,7 +18720,7 @@ __metadata: ripemd160-min: 0.0.6 safe-buffer: ^5.2.0 sha3: ^2.1.1 - checksum: 76a198dea3703b92ecb9329783d30a83257cf5bc8b3c2ed09c2f0a46bf93479fb9d04449bed7cd1702158b3f65060c5fd275300187a5e86feb3bc6acfcaf6fa3 + checksum: c9d16a81eeb7cf6ac9392349dcf7d4bd5b9f3dd73c60e472fe6cba256dc2f9ba45b756f23b65a2e1abfe0612cfb4e85dd8e480783288bba239eade8abb4c4f43 languageName: node linkType: hard @@ -20659,9 +19031,9 @@ __metadata: linkType: hard "cssdb@npm:^7.1.0": - version: 7.7.1 - resolution: "cssdb@npm:7.7.1" - checksum: 61e3094a3c5cc94c6965ddd1b91af3383f6fb24fe96945e44954c548612a24a06713fe384e4da5efcd37e6383e534e6193aedcac9f2441b207d3c04dcc1aabf7 + version: 7.10.0 + resolution: "cssdb@npm:7.10.0" + checksum: 59a4b092cab1441f318b95801c21e57d22f33a9ca7c407db3beb7c66b08fc7cc436c365975d9ab92cca4db61a61167dfe07345ce1061b98ef294a89b9092186e languageName: node linkType: hard @@ -20774,17 +19146,10 @@ __metadata: languageName: node linkType: hard -"csstype@npm:^3.0.2": - version: 3.0.10 - resolution: "csstype@npm:3.0.10" - checksum: 20a8fa324f2b33ddf94aa7507d1b6ab3daa6f3cc308888dc50126585d7952f2471de69b2dbe0635d1fdc31223fef8e070842691877e725caf456e2378685a631 - languageName: node - linkType: hard - -"csstype@npm:^3.1.0, csstype@npm:^3.1.2": - version: 3.1.2 - resolution: "csstype@npm:3.1.2" - checksum: e1a52e6c25c1314d6beef5168da704ab29c5186b877c07d822bd0806717d9a265e8493a2e35ca7e68d0f5d472d43fac1cdce70fd79fd0853dff81f3028d857b5 +"csstype@npm:^3.0.2, csstype@npm:^3.1.0, csstype@npm:^3.1.2": + version: 3.1.3 + resolution: "csstype@npm:3.1.3" + checksum: 8db785cc92d259102725b3c694ec0c823f5619a84741b5c7991b8ad135dfaa66093038a1cc63e03361a6cd28d122be48f2106ae72334e067dd619a51f49eddf7 languageName: node linkType: hard @@ -20926,26 +19291,21 @@ __metadata: linkType: hard "date-fns@npm:^2.16.1": - version: 2.28.0 - resolution: "date-fns@npm:2.28.0" - checksum: a0516b2e4f99b8bffc6cc5193349f185f195398385bdcaf07f17c2c4a24473c99d933eb0018be4142a86a6d46cb0b06be6440ad874f15e795acbedd6fd727a1f + version: 2.30.0 + resolution: "date-fns@npm:2.30.0" + dependencies: + "@babel/runtime": ^7.21.0 + checksum: f7be01523282e9bb06c0cd2693d34f245247a29098527d4420628966a2d9aad154bd0e90a6b1cf66d37adcb769cd108cf8a7bd49d76db0fb119af5cdd13644f4 languageName: node linkType: hard -"date-format@npm:^4.0.14": +"date-format@npm:^4.0.14, date-format@npm:^4.0.3": version: 4.0.14 resolution: "date-format@npm:4.0.14" checksum: dfe5139df6af5759b9dd3c007b899b3f60d45a9240ffeee6314ab74e6ab52e9b519a44ccf285888bdd6b626c66ee9b4c8a523075fa1140617b5beb1cbb9b18d1 languageName: node linkType: hard -"date-format@npm:^4.0.3": - version: 4.0.3 - resolution: "date-format@npm:4.0.3" - checksum: 8ae4d9de3532010169a89bc7b079342051ba3ec88552636aa677bfb53e8eb15113af8394679aea7d41367dc8bb6e9865da17f21ac2802202180b09d6e3f2339e - languageName: node - linkType: hard - "debounce-fn@npm:^4.0.0": version: 4.0.0 resolution: "debounce-fn@npm:4.0.0" @@ -21004,7 +19364,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^3.0.1, debug@npm:^3.1.0, debug@npm:^3.2.6, debug@npm:^3.2.7": +"debug@npm:^3.0.1, debug@npm:^3.1.0, debug@npm:^3.2.7": version: 3.2.7 resolution: "debug@npm:3.2.7" dependencies: @@ -21014,12 +19374,12 @@ __metadata: linkType: hard "decamelize-keys@npm:^1.1.0": - version: 1.1.0 - resolution: "decamelize-keys@npm:1.1.0" + version: 1.1.1 + resolution: "decamelize-keys@npm:1.1.1" dependencies: decamelize: ^1.1.0 map-obj: ^1.0.0 - checksum: 8bc5d32e035a072f5dffc1f1f3d26ca7ab1fb44a9cade34c97ab6cd1e62c81a87e718101e96de07d78cecda20a3fdb955df958e46671ccad01bb8dcf0de2e298 + checksum: fc645fe20b7bda2680bbf9481a3477257a7f9304b1691036092b97ab04c0ab53e3bf9fcc2d2ae382536568e402ec41fb11e1d4c3836a9abe2d813dd9ef4311e0 languageName: node linkType: hard @@ -21058,7 +19418,7 @@ __metadata: languageName: node linkType: hard -"decompress-response@npm:^3.2.0, decompress-response@npm:^3.3.0": +"decompress-response@npm:^3.3.0": version: 3.3.0 resolution: "decompress-response@npm:3.3.0" dependencies: @@ -21167,7 +19527,7 @@ __metadata: languageName: node linkType: hard -"deep-eql@npm:^4.1.2": +"deep-eql@npm:^4.1.2, deep-eql@npm:^4.1.3": version: 4.1.3 resolution: "deep-eql@npm:4.1.3" dependencies: @@ -21176,7 +19536,7 @@ __metadata: languageName: node linkType: hard -"deep-equal@npm:^2.0.5": +"deep-equal@npm:^2.0.5, deep-equal@npm:^2.2.2": version: 2.2.3 resolution: "deep-equal@npm:2.2.3" dependencies: @@ -21202,32 +19562,6 @@ __metadata: languageName: node linkType: hard -"deep-equal@npm:^2.2.2": - version: 2.2.2 - resolution: "deep-equal@npm:2.2.2" - dependencies: - array-buffer-byte-length: ^1.0.0 - call-bind: ^1.0.2 - es-get-iterator: ^1.1.3 - get-intrinsic: ^1.2.1 - is-arguments: ^1.1.1 - is-array-buffer: ^3.0.2 - is-date-object: ^1.0.5 - is-regex: ^1.1.4 - is-shared-array-buffer: ^1.0.2 - isarray: ^2.0.5 - object-is: ^1.1.5 - object-keys: ^1.1.1 - object.assign: ^4.1.4 - regexp.prototype.flags: ^1.5.0 - side-channel: ^1.0.4 - which-boxed-primitive: ^1.0.2 - which-collection: ^1.0.1 - which-typed-array: ^1.1.9 - checksum: eb61c35157b6ecb96a5359b507b083fbff8ddb4c86a78a781ee38485f77a667465e45d63ee2ebd8a00e86d94c80e499906900cd82c2debb400237e1662cd5397 - languageName: node - linkType: hard - "deep-extend@npm:^0.6.0": version: 0.6.0 resolution: "deep-extend@npm:0.6.0" @@ -21250,31 +19584,9 @@ __metadata: linkType: hard "deepmerge@npm:^4.2.2": - version: 4.2.2 - resolution: "deepmerge@npm:4.2.2" - checksum: a8c43a1ed8d6d1ed2b5bf569fa4c8eb9f0924034baf75d5d406e47e157a451075c4db353efea7b6bcc56ec48116a8ce72fccf867b6e078e7c561904b5897530b - languageName: node - linkType: hard - -"default-browser-id@npm:^3.0.0": - version: 3.0.0 - resolution: "default-browser-id@npm:3.0.0" - dependencies: - bplist-parser: ^0.2.0 - untildify: ^4.0.0 - checksum: 279c7ad492542e5556336b6c254a4eaf31b2c63a5433265655ae6e47301197b6cfb15c595a6fdc6463b2ff8e1a1a1ed3cba56038a60e1527ba4ab1628c6b9941 - languageName: node - linkType: hard - -"default-browser@npm:^4.0.0": - version: 4.0.0 - resolution: "default-browser@npm:4.0.0" - dependencies: - bundle-name: ^3.0.0 - default-browser-id: ^3.0.0 - execa: ^7.1.1 - titleize: ^3.0.0 - checksum: 40c5af984799042b140300be5639c9742599bda76dc9eba5ac9ad5943c83dd36cebc4471eafcfddf8e0ec817166d5ba89d56f08e66a126c7c7908a179cead1a7 + version: 4.3.1 + resolution: "deepmerge@npm:4.3.1" + checksum: 2024c6a980a1b7128084170c4cf56b0fd58a63f2da1660dcfe977415f27b17dbe5888668b59d0b063753f3220719d5e400b7f113609489c90160bb9a5518d052 languageName: node linkType: hard @@ -21287,6 +19599,15 @@ __metadata: languageName: node linkType: hard +"default-gateway@npm:^7.2.2": + version: 7.2.2 + resolution: "default-gateway@npm:7.2.2" + dependencies: + execa: ^7.1.1 + checksum: eec8a2a338677322bcdbf339bbdede61225f6145eedd0c3d4948deadfc929dc0e04b153b33674873d36efa403f76649aaacbfc728a438ee9f538a28723515478 + languageName: node + linkType: hard + "default-require-extensions@npm:^1.0.0": version: 1.0.0 resolution: "default-require-extensions@npm:1.0.0" @@ -21306,20 +19627,20 @@ __metadata: linkType: hard "default-require-extensions@npm:^3.0.0": - version: 3.0.0 - resolution: "default-require-extensions@npm:3.0.0" + version: 3.0.1 + resolution: "default-require-extensions@npm:3.0.1" dependencies: strip-bom: ^4.0.0 - checksum: 0b5bdb6786ebb0ff6ef55386f37c8d221963fbbd3009588fe71032c85ca16da05eff2ad01bfe9bfc8bac5ce95a18f66b38c50d454482e3e9d2de1142424a3e7c + checksum: 45882fc971dd157faf6716ced04c15cf252c0a2d6f5c5844b66ca49f46ed03396a26cd940771aa569927aee22923a961bab789e74b25aabc94d90742c9dd1217 languageName: node linkType: hard "defaults@npm:^1.0.3": - version: 1.0.3 - resolution: "defaults@npm:1.0.3" + version: 1.0.4 + resolution: "defaults@npm:1.0.4" dependencies: clone: ^1.0.2 - checksum: 96e2112da6553d376afd5265ea7cbdb2a3b45535965d71ab8bb1da10c8126d168fdd5268799625324b368356d21ba2a7b3d4ec50961f11a47b7feb9de3d4413e + checksum: 3a88b7a587fc076b84e60affad8b85245c01f60f38fc1d259e7ac1d89eb9ce6abb19e27215de46b98568dd5bc48471730b327637e6f20b0f1bc85cf00440c80a languageName: node linkType: hard @@ -21330,7 +19651,7 @@ __metadata: languageName: node linkType: hard -"defer-to-connect@npm:^2.0.1": +"defer-to-connect@npm:^2.0.0, defer-to-connect@npm:^2.0.1": version: 2.0.1 resolution: "defer-to-connect@npm:2.0.1" checksum: 8a9b50d2f25446c0bfefb55a48e90afd58f85b21bcf78e9207cd7b804354f6409032a1705c2491686e202e64fc05f147aa5aa45f9aa82627563f045937f5791b @@ -21393,33 +19714,7 @@ __metadata: languageName: node linkType: hard -"define-lazy-prop@npm:^3.0.0": - version: 3.0.0 - resolution: "define-lazy-prop@npm:3.0.0" - checksum: 54884f94caac0791bf6395a3ec530ce901cf71c47b0196b8754f3fd17edb6c0e80149c1214429d851873bb0d689dbe08dcedbb2306dc45c8534a5934723851b6 - languageName: node - linkType: hard - -"define-properties@npm:^1.1.3": - version: 1.1.3 - resolution: "define-properties@npm:1.1.3" - dependencies: - object-keys: ^1.0.12 - checksum: da80dba55d0cd76a5a7ab71ef6ea0ebcb7b941f803793e4e0257b384cb772038faa0c31659d244e82c4342edef841c1a1212580006a05a5068ee48223d787317 - languageName: node - linkType: hard - -"define-properties@npm:^1.1.4, define-properties@npm:^1.2.0": - version: 1.2.0 - resolution: "define-properties@npm:1.2.0" - dependencies: - has-property-descriptors: ^1.0.0 - object-keys: ^1.1.1 - checksum: e60aee6a19b102df4e2b1f301816804e81ab48bb91f00d0d935f269bf4b3f79c88b39e4f89eaa132890d23267335fd1140dfcd8d5ccd61031a0a2c41a54e33a6 - languageName: node - linkType: hard - -"define-properties@npm:^1.2.1": +"define-properties@npm:^1.1.3, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" dependencies: @@ -21466,9 +19761,9 @@ __metadata: linkType: hard "defu@npm:^6.0.0": - version: 6.1.2 - resolution: "defu@npm:6.1.2" - checksum: 2ec0ff8414d5a1ab2b8c7e9a79bbad6d97d23ea7ebf5dcf80c3c7ffd9715c30f84a3cc47b917379ea756b3db0dc4701ce6400e493a1ae1688dffcd0f884233b2 + version: 6.1.3 + resolution: "defu@npm:6.1.3" + checksum: c857a0cf854632e8528dad36454fd1c812bff8f5f091d5a6892e75d7f6b76d8319afbbfb8c504daab84ac86e40037ff37c544d50f89ed5b5419ba1989a226777 languageName: node linkType: hard @@ -21516,8 +19811,8 @@ __metadata: linkType: hard "del@npm:^6.0.0": - version: 6.0.0 - resolution: "del@npm:6.0.0" + version: 6.1.1 + resolution: "del@npm:6.1.1" dependencies: globby: ^11.0.1 graceful-fs: ^4.2.4 @@ -21527,7 +19822,7 @@ __metadata: p-map: ^4.0.0 rimraf: ^3.0.2 slash: ^3.0.0 - checksum: 5742891627e91aaf62385714025233f4664da28bc55b6ab825649dcdea4691fed3cf329a2b1913fd2d2612e693e99e08a03c84cac7f36ef54bacac9390520192 + checksum: 563288b73b8b19a7261c47fd21a330eeab6e2acd7c6208c49790dfd369127120dd7836cdf0c1eca216b77c94782a81507eac6b4734252d3bef2795cb366996b6 languageName: node linkType: hard @@ -21592,7 +19887,7 @@ __metadata: languageName: node linkType: hard -"depd@npm:^1.1.2, depd@npm:~1.1.2": +"depd@npm:~1.1.2": version: 1.1.2 resolution: "depd@npm:1.1.2" checksum: 6b406620d269619852885ce15965272b829df6f409724415e0002c8632ab6a8c0a08ec1f0bd2add05dc7bd7507606f7e2cc034fa24224ab829580040b835ecd9 @@ -21621,12 +19916,12 @@ __metadata: linkType: hard "des.js@npm:^1.0.0": - version: 1.0.1 - resolution: "des.js@npm:1.0.1" + version: 1.1.0 + resolution: "des.js@npm:1.1.0" dependencies: inherits: ^2.0.1 minimalistic-assert: ^1.0.0 - checksum: 1ec2eedd7ed6bd61dd5e0519fd4c96124e93bb22de8a9d211b02d63e5dd152824853d919bb2090f965cc0e3eb9c515950a9836b332020d810f9c71feb0fd7df4 + checksum: 0e9c1584b70d31e20f20a613fc9ef60fbc6a147dfec9e448a168794a4b97ac04d8dc47ea008f1fa93b0f8aaf7c1ead632a5e59ce1913a6079d2d244c9f5ebe33 languageName: node linkType: hard @@ -21682,9 +19977,9 @@ __metadata: linkType: hard "detect-libc@npm:^2.0.0": - version: 2.0.1 - resolution: "detect-libc@npm:2.0.1" - checksum: ccb05fcabbb555beb544d48080179c18523a343face9ee4e1a86605a8715b4169f94d663c21a03c310ac824592f2ba9a5270218819bb411ad7be578a527593d7 + version: 2.0.2 + resolution: "detect-libc@npm:2.0.2" + checksum: 2b2cd3649b83d576f4be7cc37eb3b1815c79969c8b1a03a40a4d55d83bc74d010753485753448eacb98784abf22f7dbd3911fd3b60e29fda28fed2d1a997944d languageName: node linkType: hard @@ -21729,13 +20024,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^29.4.3": - version: 29.4.3 - resolution: "diff-sequences@npm:29.4.3" - checksum: 28b265e04fdddcf7f9f814effe102cc95a9dec0564a579b5aed140edb24fc345c611ca52d76d725a3cab55d3888b915b5e8a4702e0f6058968a90fa5f41fcde7 - languageName: node - linkType: hard - "diff-sequences@npm:^29.6.3": version: 29.6.3 resolution: "diff-sequences@npm:29.6.3" @@ -21798,36 +20086,46 @@ __metadata: languageName: node linkType: hard +"dns-over-http-resolver@npm:3.0.0": + version: 3.0.0 + resolution: "dns-over-http-resolver@npm:3.0.0" + dependencies: + debug: ^4.3.4 + receptacle: ^1.3.2 + checksum: 8527d5cda8b01ef6eff356a983abca2e65c967b0d5f368bfd0d3865e9ae4c0d360c38cef5e8bcd8055b3c7d392a15094c98d6b6eefd9cd54734efcd42ac24068 + languageName: node + linkType: hard + "dns-over-http-resolver@npm:^2.1.0": - version: 2.1.2 - resolution: "dns-over-http-resolver@npm:2.1.2" + version: 2.1.3 + resolution: "dns-over-http-resolver@npm:2.1.3" dependencies: debug: ^4.3.1 native-fetch: ^4.0.2 receptacle: ^1.3.2 undici: ^5.12.0 - checksum: 7b02c87c843595245c6df16310c4507606802de999f8d271c553c7206e44e3f1f7552cdcabc3a0fde762525b7b0e7344fd77ea44d2ca61c6487d3ee4e777fda6 + checksum: 6be87cd399a1e8df6e898195447d837b72fd5349cd6bd5915554e7ad8f8a910c1fb8193e416a4e041b0be275808880d56feb9781f1e2d97e93b53f84bf80dbf7 languageName: node linkType: hard "dns-packet@npm:^5.2.2": - version: 5.5.0 - resolution: "dns-packet@npm:5.5.0" + version: 5.6.1 + resolution: "dns-packet@npm:5.6.1" dependencies: "@leichtgewicht/ip-codec": ^2.0.1 - checksum: 3aa26bb03a613362937225f786d46b1a39b5002d0a68b40537326b090685d5c53d46e25cc7c610f2a29ea5029c8ce480c368a8b0492932c5fb88ebc377676e84 + checksum: 64c06457f0c6e143f7a0946e0aeb8de1c5f752217cfa143ef527467c00a6d78db1835cfdb6bb68333d9f9a4963cf23f410439b5262a8935cce1236f45e344b81 languageName: node linkType: hard "docker-modem@npm:^3.0.0": - version: 3.0.3 - resolution: "docker-modem@npm:3.0.3" + version: 3.0.8 + resolution: "docker-modem@npm:3.0.8" dependencies: debug: ^4.1.1 readable-stream: ^3.5.0 split-ca: ^1.0.1 - ssh2: ^1.4.0 - checksum: 4ad495d17a7bbb29f48e3bf8ab74508848a3ca62c2dffc399fc0b9b2d1caccb1be54cc53001d5e0d56069e6cb4a91da4b017240733080b6648a66b40345e1f96 + ssh2: ^1.11.0 + checksum: e3675c9b1ad800be8fb1cb9c5621fbef20a75bfedcd6e01b69808eadd7f0165681e4e30d1700897b788a67dbf4769964fcccd19c3d66f6d2499bb7aede6b34df languageName: node linkType: hard @@ -21842,12 +20140,13 @@ __metadata: linkType: hard "dockerode@npm:^3.3.1": - version: 3.3.1 - resolution: "dockerode@npm:3.3.1" + version: 3.3.5 + resolution: "dockerode@npm:3.3.5" dependencies: + "@balena/dockerignore": ^1.0.2 docker-modem: ^3.0.0 tar-fs: ~2.0.1 - checksum: 930162ae2d8a1fe0e99d9a5885b09aa438da6274d4a30cb90e73046655dbc90764eb755361a63ba08f167e257c4d649d67bce71f650461a20b97fcde0af05ca5 + checksum: 7f6650422b07fa7ea9d5801f04b1a432634446b5fe37b995b8302b953b64e93abf1bb4596c2fb574ba47aafee685ef2ab959cc86c9654add5a26d09541bbbcc6 languageName: node linkType: hard @@ -21926,13 +20225,13 @@ __metadata: linkType: hard "dom-serializer@npm:^1.0.1": - version: 1.3.2 - resolution: "dom-serializer@npm:1.3.2" + version: 1.4.1 + resolution: "dom-serializer@npm:1.4.1" dependencies: domelementtype: ^2.0.1 domhandler: ^4.2.0 entities: ^2.0.0 - checksum: bff48714944d67b160db71ba244fb0f3fe72e77ef2ec8414e2eeb56f2d926e404a13456b8b83a5392e217ba47dec2ec0c368801b31481813e94d185276c3e964 + checksum: fbb0b01f87a8a2d18e6e5a388ad0f7ec4a5c05c06d219377da1abc7bb0f674d804f4a8a94e3f71ff15f6cb7dcfc75704a54b261db672b9b3ab03da6b758b0b22 languageName: node linkType: hard @@ -21955,9 +20254,9 @@ __metadata: linkType: hard "domain-browser@npm:^4.19.0": - version: 4.22.0 - resolution: "domain-browser@npm:4.22.0" - checksum: e7ce1c19073e17dec35cfde050a3ddaac437d3ba8b870adabf9d5682e665eab3084df05de432dedf25b34303f0a2c71ac30f1cdba61b1aea018047b10de3d988 + version: 4.23.0 + resolution: "domain-browser@npm:4.23.0" + checksum: 95b772f5fa88300240694380e06e03868573acdf86ca392a58c78602d6536dca2097ad2469a1500bd23a1329b09992de846e0b66c364cbf5711a7fee3ee5dac9 languageName: node linkType: hard @@ -21968,14 +20267,7 @@ __metadata: languageName: node linkType: hard -"domelementtype@npm:^2.0.1, domelementtype@npm:^2.2.0": - version: 2.2.0 - resolution: "domelementtype@npm:2.2.0" - checksum: 24cb386198640cd58aa36f8c987f2ea61859929106d06ffcc8f547e70cb2ed82a6dc56dcb8252b21fba1f1ea07df6e4356d60bfe57f77114ca1aed6828362629 - languageName: node - linkType: hard - -"domelementtype@npm:^2.3.0": +"domelementtype@npm:^2.0.1, domelementtype@npm:^2.2.0, domelementtype@npm:^2.3.0": version: 2.3.0 resolution: "domelementtype@npm:2.3.0" checksum: ee837a318ff702622f383409d1f5b25dd1024b692ef64d3096ff702e26339f8e345820f29a68bcdcea8cfee3531776b3382651232fbeae95612d6f0a75efb4f6 @@ -21991,16 +20283,7 @@ __metadata: languageName: node linkType: hard -"domhandler@npm:^4.0.0, domhandler@npm:^4.2.0": - version: 4.3.0 - resolution: "domhandler@npm:4.3.0" - dependencies: - domelementtype: ^2.2.0 - checksum: d2a2dbf40dd99abf936b65ad83c6b530afdb3605a87cad37a11b5d9220e68423ebef1b86c89e0f6d93ffaf315cc327cf1a988652e7a9a95cce539e3984f4c64d - languageName: node - linkType: hard - -"domhandler@npm:^4.3.1": +"domhandler@npm:^4.0.0, domhandler@npm:^4.2.0, domhandler@npm:^4.3.1": version: 4.3.1 resolution: "domhandler@npm:4.3.1" dependencies: @@ -22009,7 +20292,7 @@ __metadata: languageName: node linkType: hard -"domhandler@npm:^5.0.1, domhandler@npm:^5.0.2, domhandler@npm:^5.0.3": +"domhandler@npm:^5.0.2, domhandler@npm:^5.0.3": version: 5.0.3 resolution: "domhandler@npm:5.0.3" dependencies: @@ -22040,13 +20323,13 @@ __metadata: linkType: hard "domutils@npm:^3.0.1": - version: 3.0.1 - resolution: "domutils@npm:3.0.1" + version: 3.1.0 + resolution: "domutils@npm:3.1.0" dependencies: dom-serializer: ^2.0.0 domelementtype: ^2.3.0 - domhandler: ^5.0.1 - checksum: 23aa7a840572d395220e173cb6263b0d028596e3950100520870a125af33ff819e6f609e1606d6f7d73bd9e7feb03bb404286e57a39063b5384c62b724d987b3 + domhandler: ^5.0.3 + checksum: e5757456ddd173caa411cfc02c2bb64133c65546d2c4081381a3bafc8a57411a41eed70494551aa58030be9e58574fcc489828bebd673863d39924fb4878f416 languageName: node linkType: hard @@ -22108,14 +20391,14 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:16.0.3, dotenv@npm:^16.0.3": +"dotenv@npm:16.0.3": version: 16.0.3 resolution: "dotenv@npm:16.0.3" checksum: afcf03f373d7a6d62c7e9afea6328e62851d627a4e73f2e12d0a8deae1cd375892004f3021883f8aec85932cd2834b091f568ced92b4774625b321db83b827f8 languageName: node linkType: hard -"dotenv@npm:16.3.1, dotenv@npm:^16.0.1, dotenv@npm:^16.3.1": +"dotenv@npm:16.3.1, dotenv@npm:^16.0.1, dotenv@npm:^16.0.3, dotenv@npm:^16.3.1": version: 16.3.1 resolution: "dotenv@npm:16.3.1" checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd @@ -22284,46 +20567,18 @@ __metadata: linkType: hard "electron-fetch@npm:^1.7.2": - version: 1.7.4 - resolution: "electron-fetch@npm:1.7.4" + version: 1.9.1 + resolution: "electron-fetch@npm:1.9.1" dependencies: encoding: ^0.1.13 - checksum: f48ea19df5779d71eda27dd3abaea7066fc632633dee5c1cd501173eab5c80d6e04224ffafffcc8008fd8116f09dd8db18152c24f0f3608e775cec6ad97ea1c4 + checksum: 33b5d363b9a234288e847237ef34536bd415f31cba3b1c69b2ae4679a2bae66fb7ded2b576b90a0b7cd240e3df71cf16f2b961d4ab82864df02b6b53cf49f05c languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.118": - version: 1.4.137 - resolution: "electron-to-chromium@npm:1.4.137" - checksum: 639d7b94906efafcf363519c3698eecc44be46755a6a5cdc9088954329978866cc93fbd57e08b97290599b68d5226243d21de9fa50be416b8a5d3fa8fd42c3a0 - languageName: node - linkType: hard - -"electron-to-chromium@npm:^1.4.284": - version: 1.4.351 - resolution: "electron-to-chromium@npm:1.4.351" - checksum: a62ab1d11a6694684d7b97d711680842dcdb0de13495c15a54bb6d3cd332273ef38f5ba71d529635dae15ff72d6f9a3546817f7ae240cc070c431dd8baf7f80e - languageName: node - linkType: hard - -"electron-to-chromium@npm:^1.4.431": - version: 1.4.447 - resolution: "electron-to-chromium@npm:1.4.447" - checksum: 2771bed3f43d8e93bfcedac7b85af11942a5b7af57ebc50bb26b034dafd9e99c040f6168b21f5694ef6348d5056bbc0dca87862a7d3f20864af40db87f7c319e - languageName: node - linkType: hard - -"electron-to-chromium@npm:^1.4.477": - version: 1.4.513 - resolution: "electron-to-chromium@npm:1.4.513" - checksum: 613b66da177dcf5abca2441c502cde4b4fb247665dc049c54d1fe3b79fc3a5a3ecae92faf97d3147af0fec9c50bf90db09e8ca3f0953a5ec2fdb472d6d6253c2 - languageName: node - linkType: hard - -"electron-to-chromium@npm:^1.4.535": - version: 1.4.556 - resolution: "electron-to-chromium@npm:1.4.556" - checksum: 8c9aa48776d80c23d8709dcd4342f1b18ca5b63bdb233fb6913f0db7b382d69afa84d5f08ead84bde6378a6a7ab3d1127f7cb6f4d0642fa625e96de6559dc1d7 +"electron-to-chromium@npm:^1.4.601": + version: 1.4.616 + resolution: "electron-to-chromium@npm:1.4.616" + checksum: 9fd53bd4e5cded61ee51164a0d23ced1d7677ab176ef8e28eb4a27ceaae1deb3bb0038024db48478507204bfcd48ef66866c078721915a9c7b019697cc5680bf languageName: node linkType: hard @@ -22485,11 +20740,9 @@ __metadata: linkType: hard "engine.io-parser@npm:~5.0.3": - version: 5.0.3 - resolution: "engine.io-parser@npm:5.0.3" - dependencies: - "@socket.io/base64-arraybuffer": ~1.0.2 - checksum: 88d664420a441dd02db17d110f7bbbd9efe971747918150bf666b82ee138df596a2f5038f461c8a01864c83af67cb202548364e4174543f8c0bf5f4776ca6e0d + version: 5.0.7 + resolution: "engine.io-parser@npm:5.0.7" + checksum: 70ce4e22429ad4afbba187a0f71f87eb1448dbc2e4ff611857e46ca5ad09951408afa97f216e5fda993be4a944815b6f8eaebd6f70a9de522b54c7b8262fafb4 languageName: node linkType: hard @@ -22501,8 +20754,8 @@ __metadata: linkType: hard "engine.io@npm:>=6.4.2": - version: 6.5.3 - resolution: "engine.io@npm:6.5.3" + version: 6.5.4 + resolution: "engine.io@npm:6.5.4" dependencies: "@types/cookie": ^0.4.1 "@types/cors": ^2.8.12 @@ -22514,21 +20767,11 @@ __metadata: debug: ~4.3.1 engine.io-parser: ~5.2.1 ws: ~8.11.0 - checksum: b71769b17a663d07b14a2ba6de7a729bce47cef936a25b46dcc1cc75e42b377d82548cfbaf66ce4a0b237536c488a29d301c2514ab1cafbdc1f594bd327fc498 - languageName: node - linkType: hard - -"enhanced-resolve@npm:^5.0.0": - version: 5.12.0 - resolution: "enhanced-resolve@npm:5.12.0" - dependencies: - graceful-fs: ^4.2.4 - tapable: ^2.2.0 - checksum: bf3f787facaf4ce3439bef59d148646344e372bef5557f0d37ea8aa02c51f50a925cd1f07b8d338f18992c29f544ec235a8c64bcdb56030196c48832a5494174 + checksum: d5b55cbac718c5b1c10800314379923f8c7ef9e3a8a60c6827ed86303d1154b81d354a89fdecf4cbb773515c82c84a98d3c791ff88279393b53625dd67299d30 languageName: node linkType: hard -"enhanced-resolve@npm:^5.15.0": +"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.15.0": version: 5.15.0 resolution: "enhanced-resolve@npm:5.15.0" dependencies: @@ -22538,7 +20781,7 @@ __metadata: languageName: node linkType: hard -"enquirer@npm:2.3.6, enquirer@npm:^2.3.0, enquirer@npm:^2.3.5, enquirer@npm:^2.3.6": +"enquirer@npm:2.3.6": version: 2.3.6 resolution: "enquirer@npm:2.3.6" dependencies: @@ -22547,6 +20790,16 @@ __metadata: languageName: node linkType: hard +"enquirer@npm:^2.3.0, enquirer@npm:^2.3.5, enquirer@npm:^2.3.6": + version: 2.4.1 + resolution: "enquirer@npm:2.4.1" + dependencies: + ansi-colors: ^4.1.1 + strip-ansi: ^6.0.1 + checksum: f080f11a74209647dbf347a7c6a83c8a47ae1ebf1e75073a808bc1088eb780aa54075bfecd1bcdb3e3c724520edb8e6ee05da031529436b421b71066fcc48cb5 + languageName: node + linkType: hard + "entities@npm:^2.0.0": version: 2.2.0 resolution: "entities@npm:2.2.0" @@ -22554,10 +20807,10 @@ __metadata: languageName: node linkType: hard -"entities@npm:^4.2.0, entities@npm:^4.3.0, entities@npm:^4.4.0": - version: 4.4.0 - resolution: "entities@npm:4.4.0" - checksum: 84d250329f4b56b40fa93ed067b194db21e8815e4eb9b59f43a086f0ecd342814f6bc483de8a77da5d64e0f626033192b1b4f1792232a7ea6b970ebe0f3187c2 +"entities@npm:^4.2.0, entities@npm:^4.3.0, entities@npm:^4.4.0, entities@npm:^4.5.0": + version: 4.5.0 + resolution: "entities@npm:4.5.0" + checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7 languageName: node linkType: hard @@ -22569,11 +20822,11 @@ __metadata: linkType: hard "envinfo@npm:^7.7.3": - version: 7.8.1 - resolution: "envinfo@npm:7.8.1" + version: 7.11.0 + resolution: "envinfo@npm:7.11.0" bin: envinfo: dist/cli.js - checksum: de736c98d6311c78523628ff127af138451b162e57af5293c1b984ca821d0aeb9c849537d2fde0434011bed33f6bca5310ca2aab8a51a3f28fc719e89045d648 + checksum: c45a7d20409d5f4cda72483b150d3816b15b434f2944d72c1495d8838bd7c4e7b2f32c12128ffb9b92b5f66f436237b8a525eb3a9a5da2d20013bc4effa28aef languageName: node linkType: hard @@ -22628,24 +20881,24 @@ __metadata: linkType: hard "es-abstract@npm:^1.17.2, es-abstract@npm:^1.22.1": - version: 1.22.1 - resolution: "es-abstract@npm:1.22.1" + version: 1.22.3 + resolution: "es-abstract@npm:1.22.3" dependencies: array-buffer-byte-length: ^1.0.0 - arraybuffer.prototype.slice: ^1.0.1 + arraybuffer.prototype.slice: ^1.0.2 available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 + call-bind: ^1.0.5 es-set-tostringtag: ^2.0.1 es-to-primitive: ^1.2.1 - function.prototype.name: ^1.1.5 - get-intrinsic: ^1.2.1 + function.prototype.name: ^1.1.6 + get-intrinsic: ^1.2.2 get-symbol-description: ^1.0.0 globalthis: ^1.0.3 gopd: ^1.0.1 - has: ^1.0.3 has-property-descriptors: ^1.0.0 has-proto: ^1.0.1 has-symbols: ^1.0.3 + hasown: ^2.0.0 internal-slot: ^1.0.5 is-array-buffer: ^3.0.2 is-callable: ^1.2.7 @@ -22653,94 +20906,24 @@ __metadata: is-regex: ^1.1.4 is-shared-array-buffer: ^1.0.2 is-string: ^1.0.7 - is-typed-array: ^1.1.10 + is-typed-array: ^1.1.12 is-weakref: ^1.0.2 - object-inspect: ^1.12.3 + object-inspect: ^1.13.1 object-keys: ^1.1.1 object.assign: ^4.1.4 - regexp.prototype.flags: ^1.5.0 - safe-array-concat: ^1.0.0 + regexp.prototype.flags: ^1.5.1 + safe-array-concat: ^1.0.1 safe-regex-test: ^1.0.0 - string.prototype.trim: ^1.2.7 - string.prototype.trimend: ^1.0.6 - string.prototype.trimstart: ^1.0.6 + string.prototype.trim: ^1.2.8 + string.prototype.trimend: ^1.0.7 + string.prototype.trimstart: ^1.0.7 typed-array-buffer: ^1.0.0 typed-array-byte-length: ^1.0.0 typed-array-byte-offset: ^1.0.0 typed-array-length: ^1.0.4 unbox-primitive: ^1.0.2 - which-typed-array: ^1.1.10 - checksum: 614e2c1c3717cb8d30b6128ef12ea110e06fd7d75ad77091ca1c5dbfb00da130e62e4bbbbbdda190eada098a22b27fe0f99ae5a1171dac2c8663b1e8be8a3a9b - languageName: node - linkType: hard - -"es-abstract@npm:^1.18.5, es-abstract@npm:^1.19.0, es-abstract@npm:^1.19.1": - version: 1.19.1 - resolution: "es-abstract@npm:1.19.1" - dependencies: - call-bind: ^1.0.2 - es-to-primitive: ^1.2.1 - function-bind: ^1.1.1 - get-intrinsic: ^1.1.1 - get-symbol-description: ^1.0.0 - has: ^1.0.3 - has-symbols: ^1.0.2 - internal-slot: ^1.0.3 - is-callable: ^1.2.4 - is-negative-zero: ^2.0.1 - is-regex: ^1.1.4 - is-shared-array-buffer: ^1.0.1 - is-string: ^1.0.7 - is-weakref: ^1.0.1 - object-inspect: ^1.11.0 - object-keys: ^1.1.1 - object.assign: ^4.1.2 - string.prototype.trimend: ^1.0.4 - string.prototype.trimstart: ^1.0.4 - unbox-primitive: ^1.0.1 - checksum: b6be8410672c5364db3fb01eb786e30c7b4bb32b4af63d381c08840f4382c4a168e7855cd338bf59d4f1a1a1138f4d748d1fd40ec65aaa071876f9e9fbfed949 - languageName: node - linkType: hard - -"es-abstract@npm:^1.20.4, es-abstract@npm:^1.21.2": - version: 1.21.2 - resolution: "es-abstract@npm:1.21.2" - dependencies: - array-buffer-byte-length: ^1.0.0 - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - es-set-tostringtag: ^2.0.1 - es-to-primitive: ^1.2.1 - function.prototype.name: ^1.1.5 - get-intrinsic: ^1.2.0 - get-symbol-description: ^1.0.0 - globalthis: ^1.0.3 - gopd: ^1.0.1 - has: ^1.0.3 - has-property-descriptors: ^1.0.0 - has-proto: ^1.0.1 - has-symbols: ^1.0.3 - internal-slot: ^1.0.5 - is-array-buffer: ^3.0.2 - is-callable: ^1.2.7 - is-negative-zero: ^2.0.2 - is-regex: ^1.1.4 - is-shared-array-buffer: ^1.0.2 - is-string: ^1.0.7 - is-typed-array: ^1.1.10 - is-weakref: ^1.0.2 - object-inspect: ^1.12.3 - object-keys: ^1.1.1 - object.assign: ^4.1.4 - regexp.prototype.flags: ^1.4.3 - safe-regex-test: ^1.0.0 - string.prototype.trim: ^1.2.7 - string.prototype.trimend: ^1.0.6 - string.prototype.trimstart: ^1.0.6 - typed-array-length: ^1.0.4 - unbox-primitive: ^1.0.2 - which-typed-array: ^1.1.9 - checksum: 037f55ee5e1cdf2e5edbab5524095a4f97144d95b94ea29e3611b77d852fd8c8a40e7ae7101fa6a759a9b9b1405f188c3c70928f2d3cd88d543a07fc0d5ad41a + which-typed-array: ^1.1.13 + checksum: b1bdc962856836f6e72be10b58dc128282bdf33771c7a38ae90419d920fc3b36cc5d2b70a222ad8016e3fc322c367bf4e9e89fc2bc79b7e933c05b218e83d79a languageName: node linkType: hard @@ -22768,7 +20951,7 @@ __metadata: languageName: node linkType: hard -"es-iterator-helpers@npm:^1.0.12": +"es-iterator-helpers@npm:^1.0.12, es-iterator-helpers@npm:^1.0.15": version: 1.0.15 resolution: "es-iterator-helpers@npm:1.0.15" dependencies: @@ -22798,29 +20981,29 @@ __metadata: linkType: hard "es-module-lexer@npm:^1.2.1": - version: 1.3.0 - resolution: "es-module-lexer@npm:1.3.0" - checksum: 48fd9f504a9d2a894126f75c8b7ccc6273a289983e9b67255f165bfd9ae765d50100218251e94e702ca567826905ea2f7b3b4a0c4d74d3ce99cce3a2a606a238 + version: 1.4.1 + resolution: "es-module-lexer@npm:1.4.1" + checksum: a11b5a256d4e8e9c7d94c2fd87415ccd1591617b6edd847e064503f8eaece2d25e2e9078a02c5ce3ed5e83bb748f5b4820efbe78072c8beb07ac619c2edec35d languageName: node linkType: hard "es-set-tostringtag@npm:^2.0.1": - version: 2.0.1 - resolution: "es-set-tostringtag@npm:2.0.1" + version: 2.0.2 + resolution: "es-set-tostringtag@npm:2.0.2" dependencies: - get-intrinsic: ^1.1.3 - has: ^1.0.3 + get-intrinsic: ^1.2.2 has-tostringtag: ^1.0.0 - checksum: ec416a12948cefb4b2a5932e62093a7cf36ddc3efd58d6c58ca7ae7064475ace556434b869b0bbeb0c365f1032a8ccd577211101234b69837ad83ad204fff884 + hasown: ^2.0.0 + checksum: afcec3a4c9890ae14d7ec606204858441c801ff84f312538e1d1ccf1e5493c8b17bd672235df785f803756472cb4f2d49b87bde5237aef33411e74c22f194e07 languageName: node linkType: hard "es-shim-unscopables@npm:^1.0.0": - version: 1.0.0 - resolution: "es-shim-unscopables@npm:1.0.0" + version: 1.0.2 + resolution: "es-shim-unscopables@npm:1.0.2" dependencies: - has: ^1.0.3 - checksum: 83e95cadbb6ee44d3644dfad60dcad7929edbc42c85e66c3e99aefd68a3a5c5665f2686885cddb47dfeabfd77bd5ea5a7060f2092a955a729bbd8834f0d86fa1 + hasown: ^2.0.0 + checksum: 432bd527c62065da09ed1d37a3f8e623c423683285e6188108286f4a1e8e164a5bcbfbc0051557c7d14633cd2a41ce24c7048e6bbb66a985413fd32f1be72626 languageName: node linkType: hard @@ -22835,18 +21018,7 @@ __metadata: languageName: node linkType: hard -"es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.50": - version: 0.10.53 - resolution: "es5-ext@npm:0.10.53" - dependencies: - es6-iterator: ~2.0.3 - es6-symbol: ~3.1.3 - next-tick: ~1.0.0 - checksum: 24ec22369260cf98605cb2f51eae9d7df5dc621bc5d3b311f6f5c3d0fcdb7bafae888270f3083ee6e9af27350a5ea49f1fe2dd6406a9017247ca40f091f529b2 - languageName: node - linkType: hard - -"es5-ext@npm:^0.10.46, es5-ext@npm:^0.10.62, es5-ext@npm:~0.10.14, es5-ext@npm:~0.10.46": +"es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.46, es5-ext@npm:^0.10.50, es5-ext@npm:^0.10.62, es5-ext@npm:~0.10.14, es5-ext@npm:~0.10.46": version: 0.10.62 resolution: "es5-ext@npm:0.10.62" dependencies: @@ -22889,13 +21061,6 @@ __metadata: languageName: node linkType: hard -"es6-object-assign@npm:^1.1.0": - version: 1.1.0 - resolution: "es6-object-assign@npm:1.1.0" - checksum: 8d4fdf63484d78b5c64cacc2c2e1165bc7b6a64b739d2a9db6a4dc8641d99cc9efb433cdd4dc3d3d6b00bfa6ce959694e4665e3255190339945c5f33b692b5d8 - languageName: node - linkType: hard - "es6-promise@npm:^4.1.1, es6-promise@npm:^4.2.8": version: 4.2.8 resolution: "es6-promise@npm:4.2.8" @@ -22917,7 +21082,7 @@ __metadata: languageName: node linkType: hard -"es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3, es6-symbol@npm:~3.1.1, es6-symbol@npm:~3.1.3": +"es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3, es6-symbol@npm:~3.1.1": version: 3.1.3 resolution: "es6-symbol@npm:3.1.3" dependencies: @@ -23323,13 +21488,6 @@ __metadata: languageName: node linkType: hard -"escape-goat@npm:^2.0.0": - version: 2.1.1 - resolution: "escape-goat@npm:2.1.1" - checksum: ce05c70c20dd7007b60d2d644b625da5412325fdb57acf671ba06cb2ab3cd6789e2087026921a05b665b0a03fadee2955e7fc0b9a67da15a6551a980b260eba7 - languageName: node - linkType: hard - "escape-html@npm:1.0.3, escape-html@npm:~1.0.3": version: 1.0.3 resolution: "escape-html@npm:1.0.3" @@ -23365,7 +21523,7 @@ __metadata: languageName: node linkType: hard -"escodegen@npm:^1.14.1": +"escodegen@npm:^1.14.1, escodegen@npm:^1.8.1": version: 1.14.3 resolution: "escodegen@npm:1.14.3" dependencies: @@ -23533,7 +21691,7 @@ __metadata: languageName: node linkType: hard -"eslint-import-resolver-node@npm:^0.3.7": +"eslint-import-resolver-node@npm:^0.3.7, eslint-import-resolver-node@npm:^0.3.9": version: 0.3.9 resolution: "eslint-import-resolver-node@npm:0.3.9" dependencies: @@ -23582,7 +21740,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:2.28.1, eslint-plugin-import@npm:^2.25.3": +"eslint-plugin-import@npm:2.28.1": version: 2.28.1 resolution: "eslint-plugin-import@npm:2.28.1" dependencies: @@ -23609,6 +21767,33 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-import@npm:^2.25.3": + version: 2.29.1 + resolution: "eslint-plugin-import@npm:2.29.1" + dependencies: + array-includes: ^3.1.7 + array.prototype.findlastindex: ^1.2.3 + array.prototype.flat: ^1.3.2 + array.prototype.flatmap: ^1.3.2 + debug: ^3.2.7 + doctrine: ^2.1.0 + eslint-import-resolver-node: ^0.3.9 + eslint-module-utils: ^2.8.0 + hasown: ^2.0.0 + is-core-module: ^2.13.1 + is-glob: ^4.0.3 + minimatch: ^3.1.2 + object.fromentries: ^2.0.7 + object.groupby: ^1.0.1 + object.values: ^1.1.7 + semver: ^6.3.1 + tsconfig-paths: ^3.15.0 + peerDependencies: + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + checksum: e65159aef808136d26d029b71c8c6e4cb5c628e65e5de77f1eb4c13a379315ae55c9c3afa847f43f4ff9df7e54515c77ffc6489c6a6f81f7dd7359267577468c + languageName: node + linkType: hard + "eslint-plugin-import@npm:~2.2.0": version: 2.2.0 resolution: "eslint-plugin-import@npm:2.2.0" @@ -23647,28 +21832,28 @@ __metadata: linkType: hard "eslint-plugin-jsx-a11y@npm:^6.5.1": - version: 6.7.1 - resolution: "eslint-plugin-jsx-a11y@npm:6.7.1" - dependencies: - "@babel/runtime": ^7.20.7 - aria-query: ^5.1.3 - array-includes: ^3.1.6 - array.prototype.flatmap: ^1.3.1 - ast-types-flow: ^0.0.7 - axe-core: ^4.6.2 - axobject-query: ^3.1.1 + version: 6.8.0 + resolution: "eslint-plugin-jsx-a11y@npm:6.8.0" + dependencies: + "@babel/runtime": ^7.23.2 + aria-query: ^5.3.0 + array-includes: ^3.1.7 + array.prototype.flatmap: ^1.3.2 + ast-types-flow: ^0.0.8 + axe-core: =4.7.0 + axobject-query: ^3.2.1 damerau-levenshtein: ^1.0.8 emoji-regex: ^9.2.2 - has: ^1.0.3 - jsx-ast-utils: ^3.3.3 - language-tags: =1.0.5 + es-iterator-helpers: ^1.0.15 + hasown: ^2.0.0 + jsx-ast-utils: ^3.3.5 + language-tags: ^1.0.9 minimatch: ^3.1.2 - object.entries: ^1.1.6 - object.fromentries: ^2.0.6 - semver: ^6.3.0 + object.entries: ^1.1.7 + object.fromentries: ^2.0.7 peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - checksum: f166dd5fe7257c7b891c6692e6a3ede6f237a14043ae3d97581daf318fc5833ddc6b4871aa34ab7656187430170500f6d806895747ea17ecdf8231a666c3c2fd + checksum: 3dec00e2a3089c4c61ac062e4196a70985fb7eda1fd67fe035363d92578debde92fdb8ed2e472321fc0d71e75f4a1e8888c6a3218c14dd93c8e8d19eb6f51554 languageName: node linkType: hard @@ -23890,14 +22075,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1": - version: 3.4.1 - resolution: "eslint-visitor-keys@npm:3.4.1" - checksum: f05121d868202736b97de7d750847a328fcfa8593b031c95ea89425333db59676ac087fa905eba438d0a3c5769632f828187e0c1a0d271832a2153c1d3661c2c - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60 @@ -24066,16 +22244,17 @@ __metadata: linkType: hard "eslint@npm:^8.3.0": - version: 8.48.0 - resolution: "eslint@npm:8.48.0" + version: 8.56.0 + resolution: "eslint@npm:8.56.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.6.1 - "@eslint/eslintrc": ^2.1.2 - "@eslint/js": 8.48.0 - "@humanwhocodes/config-array": ^0.11.10 + "@eslint/eslintrc": ^2.1.4 + "@eslint/js": 8.56.0 + "@humanwhocodes/config-array": ^0.11.13 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 + "@ungap/structured-clone": ^1.2.0 ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 @@ -24108,7 +22287,7 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: f20b359a4f8123fec5c033577368cc020d42978b1b45303974acd8da7a27063168ee3fe297ab5b35327162f6a93154063e3ce6577102f70f9809aff793db9bd0 + checksum: 883436d1e809b4a25d9eb03d42f584b84c408dbac28b0019f6ea07b5177940bf3cca86208f749a6a1e0039b63e085ee47aca1236c30721e91f0deef5cc5a5136 languageName: node linkType: hard @@ -24207,6 +22386,16 @@ __metadata: languageName: node linkType: hard +"esprima@npm:1.2.2": + version: 1.2.2 + resolution: "esprima@npm:1.2.2" + bin: + esparse: ./bin/esparse.js + esvalidate: ./bin/esvalidate.js + checksum: 4f10006f0e315f2f7d8cf6630e465f183512f1ab2e862b11785a133ce37ed1696573deefb5256e510eaa4368342b13b393334477f6ccdcdb8f10e782b0f5e6dc + languageName: node + linkType: hard + "esprima@npm:^4.0.0, esprima@npm:^4.0.1, esprima@npm:~4.0.0": version: 4.0.1 resolution: "esprima@npm:4.0.1" @@ -24217,7 +22406,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.0.0, esquery@npm:^1.0.1, esquery@npm:^1.4.2": +"esquery@npm:^1.0.0, esquery@npm:^1.0.1, esquery@npm:^1.4.0, esquery@npm:^1.4.2": version: 1.5.0 resolution: "esquery@npm:1.5.0" dependencies: @@ -24226,15 +22415,6 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.0": - version: 1.4.0 - resolution: "esquery@npm:1.4.0" - dependencies: - estraverse: ^5.1.0 - checksum: a0807e17abd7fbe5fbd4fab673038d6d8a50675cdae6b04fbaa520c34581be0c5fa24582990e8acd8854f671dd291c78bb2efb9e0ed5b62f33bac4f9cf820210 - languageName: node - linkType: hard - "esrecurse@npm:^4.1.0, esrecurse@npm:^4.3.0": version: 4.3.0 resolution: "esrecurse@npm:4.3.0" @@ -24495,20 +22675,7 @@ __metadata: languageName: node linkType: hard -"ethereumjs-util@npm:^7.0.10, ethereumjs-util@npm:^7.1.0, ethereumjs-util@npm:^7.1.1, ethereumjs-util@npm:^7.1.4": - version: 7.1.4 - resolution: "ethereumjs-util@npm:7.1.4" - dependencies: - "@types/bn.js": ^5.1.0 - bn.js: ^5.1.2 - create-hash: ^1.1.2 - ethereum-cryptography: ^0.1.3 - rlp: ^2.2.4 - checksum: ccfd9208bfe9205af124a9138c5a90db46cd2fcacf4b80f17f67915381c03253aa2fb90ead9e0b53d9a6fcfeed4310e5dfa8dc516ca2846d16baf81d605cd8c2 - languageName: node - linkType: hard - -"ethereumjs-util@npm:^7.0.2, ethereumjs-util@npm:^7.1.2, ethereumjs-util@npm:^7.1.5": +"ethereumjs-util@npm:^7.0.10, ethereumjs-util@npm:^7.0.2, ethereumjs-util@npm:^7.1.0, ethereumjs-util@npm:^7.1.1, ethereumjs-util@npm:^7.1.2, ethereumjs-util@npm:^7.1.5": version: 7.1.5 resolution: "ethereumjs-util@npm:7.1.5" dependencies: @@ -24815,13 +22982,6 @@ __metadata: languageName: node linkType: hard -"exit-on-epipe@npm:~1.0.1": - version: 1.0.1 - resolution: "exit-on-epipe@npm:1.0.1" - checksum: e8ab4940416d19f311b3c9226e3725c6c4c6026fe682266ecc0ff33a455d585fe3e4ee757857c7bf1d0491b478cb232b8e395dfb438e65ac87317eda47304c32 - languageName: node - linkType: hard - "exit@npm:^0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -24890,17 +23050,16 @@ __metadata: languageName: node linkType: hard -"expect@npm:^29.0.0, expect@npm:^29.6.2": - version: 29.6.2 - resolution: "expect@npm:29.6.2" +"expect@npm:^29.0.0, expect@npm:^29.7.0": + version: 29.7.0 + resolution: "expect@npm:29.7.0" dependencies: - "@jest/expect-utils": ^29.6.2 - "@types/node": "*" - jest-get-type: ^29.4.3 - jest-matcher-utils: ^29.6.2 - jest-message-util: ^29.6.2 - jest-util: ^29.6.2 - checksum: 71f7b0c560e58bf6d27e0fded261d4bdb7ef81552a6bb4bd1ee09ce7a1f7dca67fbf83cf9b07a6645a88ef52e65085a0dcbe17f6c063b53ff7c2f0f3ea4ef69e + "@jest/expect-utils": ^29.7.0 + jest-get-type: ^29.6.3 + jest-matcher-utils: ^29.7.0 + jest-message-util: ^29.7.0 + jest-util: ^29.7.0 + checksum: 9257f10288e149b81254a0fda8ffe8d54a7061cd61d7515779998b012579d2b8c22354b0eb901daf0145f347403da582f75f359f4810c007182ad3fb318b5c0c languageName: node linkType: hard @@ -25080,11 +23239,11 @@ __metadata: linkType: hard "ext@npm:^1.1.2": - version: 1.6.0 - resolution: "ext@npm:1.6.0" + version: 1.7.0 + resolution: "ext@npm:1.7.0" dependencies: - type: ^2.5.0 - checksum: ca3ef4619e838f441a92238a98b77ac873da2175ace746c64303ffe2c3208e79a3acf3bf7004e40b720f3c2a83bf0143e6dd4a7cdfae6e73f54a3bfc7a14b5c2 + type: ^2.7.2 + checksum: ef481f9ef45434d8c867cfd09d0393b60945b7c8a1798bedc4514cb35aac342ccb8d8ecb66a513e6a2b4ec1e294a338e3124c49b29736f8e7c735721af352c31 languageName: node linkType: hard @@ -25330,9 +23489,9 @@ __metadata: linkType: hard "fast-diff@npm:^1.1.2": - version: 1.2.0 - resolution: "fast-diff@npm:1.2.0" - checksum: 1b5306eaa9e826564d9e5ffcd6ebd881eb5f770b3f977fcbf38f05c824e42172b53c79920e8429c54eb742ce15a0caf268b0fdd5b38f6de52234c4a8368131ae + version: 1.3.0 + resolution: "fast-diff@npm:1.3.0" + checksum: d22d371b994fdc8cce9ff510d7b8dc4da70ac327bcba20df607dd5b9cae9f908f4d1028f5fe467650f058d1e7270235ae0b8230809a262b4df587a3b3aa216c3 languageName: node linkType: hard @@ -25344,13 +23503,13 @@ __metadata: linkType: hard "fast-fifo@npm:^1.0.0": - version: 1.1.0 - resolution: "fast-fifo@npm:1.1.0" - checksum: 895f4c9873a4d5059dfa244aa0dde2b22ee563fd673d85b638869715f92244f9d6469bc0873bcb40554d28c51cbc7590045718462cfda1da503b1c6985815209 + version: 1.3.2 + resolution: "fast-fifo@npm:1.3.2" + checksum: 6bfcba3e4df5af7be3332703b69a7898a8ed7020837ec4395bb341bd96cc3a6d86c3f6071dd98da289618cf2234c70d84b2a6f09a33dd6f988b1ff60d8e54275 languageName: node linkType: hard -"fast-glob@npm:3.3.1, fast-glob@npm:^3.2.12, fast-glob@npm:^3.3.0": +"fast-glob@npm:3.3.1": version: 3.3.1 resolution: "fast-glob@npm:3.3.1" dependencies: @@ -25363,20 +23522,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.7, fast-glob@npm:^3.2.9": - version: 3.2.11 - resolution: "fast-glob@npm:3.2.11" - dependencies: - "@nodelib/fs.stat": ^2.0.2 - "@nodelib/fs.walk": ^1.2.3 - glob-parent: ^5.1.2 - merge2: ^1.3.0 - micromatch: ^4.0.4 - checksum: f473105324a7780a20c06de842e15ddbb41d3cb7e71d1e4fe6e8373204f22245d54f5ab9e2061e6a1c613047345954d29b022e0e76f5c28b1df9858179a0e6d7 - languageName: node - linkType: hard - -"fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.7, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0, fast-glob@npm:^3.3.2": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -25396,18 +23542,6 @@ __metadata: languageName: node linkType: hard -"fast-json-stringify@npm:^2.7.10": - version: 2.7.13 - resolution: "fast-json-stringify@npm:2.7.13" - dependencies: - ajv: ^6.11.0 - deepmerge: ^4.2.2 - rfdc: ^1.2.0 - string-similarity: ^4.0.1 - checksum: f78ab25047c790de5b521c369e0b18c595055d48a106add36e9f86fe45be40226f168ff4708a226e187d0b46f1d6b32129842041728944bd9a03ca5efbbe4ccb - languageName: node - linkType: hard - "fast-levenshtein@npm:^2.0.6, fast-levenshtein@npm:~2.0.6": version: 2.0.6 resolution: "fast-levenshtein@npm:2.0.6" @@ -25424,7 +23558,7 @@ __metadata: languageName: node linkType: hard -"fast-safe-stringify@npm:2.1.1, fast-safe-stringify@npm:^2.1.1": +"fast-safe-stringify@npm:2.1.1": version: 2.1.1 resolution: "fast-safe-stringify@npm:2.1.1" checksum: a851cbddc451745662f8f00ddb622d6766f9bd97642dabfd9a405fb0d646d69fc0b9a1243cbf67f5f18a39f40f6fa821737651ff1bceeba06c9992ca2dc5bd3d @@ -25432,18 +23566,18 @@ __metadata: linkType: hard "fastest-levenshtein@npm:^1.0.12": - version: 1.0.12 - resolution: "fastest-levenshtein@npm:1.0.12" - checksum: e1a013698dd1d302c7a78150130c7d50bb678c2c2f8839842a796d66cc7cdf50ea6b3d7ca930b0c8e7e8c2cd84fea8ab831023b382f7aab6922c318c1451beab + version: 1.0.16 + resolution: "fastest-levenshtein@npm:1.0.16" + checksum: a78d44285c9e2ae2c25f3ef0f8a73f332c1247b7ea7fb4a191e6bb51aa6ee1ef0dfb3ed113616dcdc7023e18e35a8db41f61c8d88988e877cf510df8edafbc71 languageName: node linkType: hard "fastq@npm:^1.6.0": - version: 1.13.0 - resolution: "fastq@npm:1.13.0" + version: 1.16.0 + resolution: "fastq@npm:1.16.0" dependencies: reusify: ^1.0.4 - checksum: 32cf15c29afe622af187d12fc9cd93e160a0cb7c31a3bb6ace86b7dea3b28e7b72acde89c882663f307b2184e14782c6c664fa315973c03626c7d4bff070bb0b + checksum: 1d40ed1f100ae625e5720484e8602b7ad07649370f1cbc3e34a6b9630a0bfed6946bab0322d8a368a1e3cde87bb9bbb8d3bc2ae01a0c1f022fac1d07c04e4feb languageName: node linkType: hard @@ -25457,11 +23591,11 @@ __metadata: linkType: hard "fb-watchman@npm:^2.0.0": - version: 2.0.1 - resolution: "fb-watchman@npm:2.0.1" + version: 2.0.2 + resolution: "fb-watchman@npm:2.0.2" dependencies: bser: 2.1.1 - checksum: 8510230778ab3a51c27dffb1b76ef2c24fab672a42742d3c0a45c2e9d1e5f20210b1fbca33486088da4a9a3958bde96b5aec0a63aac9894b4e9df65c88b2cbd6 + checksum: b15a124cef28916fe07b400eb87cbc73ca082c142abf7ca8e8de6af43eca79ca7bd13eb4d4d48240b3bd3136eaac40d16e42d6edf87a8e5d1dd8070626860c78 languageName: node linkType: hard @@ -25475,9 +23609,9 @@ __metadata: linkType: hard "fecha@npm:^4.2.0": - version: 4.2.1 - resolution: "fecha@npm:4.2.1" - checksum: 26993474949d94cd2de5eee7dfe283d671d5cd61acdba8819df478cbc86495273363f4a7e98d15ee51563110a38328d268982a6e9048169bce8f15aeba5931f9 + version: 4.2.3 + resolution: "fecha@npm:4.2.3" + checksum: f94e2fb3acf5a7754165d04549460d3ae6c34830394d20c552197e3e000035d69732d74af04b9bed3283bf29fe2a9ebdcc0085e640b0be3cc3658b9726265e31 languageName: node linkType: hard @@ -25867,12 +24001,13 @@ __metadata: linkType: hard "flat-cache@npm:^3.0.4": - version: 3.0.4 - resolution: "flat-cache@npm:3.0.4" + version: 3.2.0 + resolution: "flat-cache@npm:3.2.0" dependencies: - flatted: ^3.1.0 + flatted: ^3.2.9 + keyv: ^4.5.3 rimraf: ^3.0.2 - checksum: 4fdd10ecbcbf7d520f9040dd1340eb5dfe951e6f0ecf2252edeec03ee68d989ec8b9a20f4434270e71bcfd57800dc09b3344fca3966b2eb8f613072c7d9a2365 + checksum: e7e0f59801e288b54bee5cb9681e9ee21ee28ef309f886b312c9d08415b79fc0f24ac842f84356ce80f47d6a53de62197ce0e6e148dc42d5db005992e2a756ec languageName: node linkType: hard @@ -25892,17 +24027,10 @@ __metadata: languageName: node linkType: hard -"flatted@npm:^3.1.0, flatted@npm:^3.2.4": - version: 3.2.5 - resolution: "flatted@npm:3.2.5" - checksum: 3c436e9695ccca29620b4be5671dd72e5dd0a7500e0856611b7ca9bd8169f177f408c3b9abfa78dfe1493ee2d873e2c119080a8a9bee4e1a186a9e60ca6c89f1 - languageName: node - linkType: hard - -"flatted@npm:^3.2.7": - version: 3.2.7 - resolution: "flatted@npm:3.2.7" - checksum: 427633049d55bdb80201c68f7eb1cbd533e03eac541f97d3aecab8c5526f12a20ccecaeede08b57503e772c769e7f8680b37e8d482d1e5f8d7e2194687f9ea35 +"flatted@npm:^3.2.4, flatted@npm:^3.2.7, flatted@npm:^3.2.9": + version: 3.2.9 + resolution: "flatted@npm:3.2.9" + checksum: f14167fbe26a9d20f6fca8d998e8f1f41df72c8e81f9f2c9d61ed2bea058248f5e1cbd05e7f88c0e5087a6a0b822a1e5e2b446e879f3cfbe0b07ba2d7f80b026 languageName: node linkType: hard @@ -25927,23 +24055,13 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.12.1": - version: 1.14.9 - resolution: "follow-redirects@npm:1.14.9" - peerDependenciesMeta: - debug: - optional: true - checksum: f5982e0eb481818642492d3ca35a86989c98af1128b8e1a62911a3410621bc15d2b079e8170b35b19d3bdee770b73ed431a257ed86195af773771145baa57845 - languageName: node - linkType: hard - -"follow-redirects@npm:^1.15.0": - version: 1.15.2 - resolution: "follow-redirects@npm:1.15.2" +"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.12.1, follow-redirects@npm:^1.15.0": + version: 1.15.4 + resolution: "follow-redirects@npm:1.15.4" peerDependenciesMeta: debug: optional: true - checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190 + checksum: e178d1deff8b23d5d24ec3f7a94cde6e47d74d0dc649c35fc9857041267c12ec5d44650a0c5597ef83056ada9ea6ca0c30e7c4f97dbf07d035086be9e6a5b7b6 languageName: node linkType: hard @@ -25979,13 +24097,6 @@ __metadata: languageName: node linkType: hard -"foreach@npm:^2.0.5": - version: 2.0.5 - resolution: "foreach@npm:2.0.5" - checksum: dab4fbfef0b40b69ee5eab81bcb9626b8fa8b3469c8cfa26480f3e5e1ee08c40eae07048c9a967c65aeda26e774511ccc70b3f10a604c01753c6ef24361f0fc8 - languageName: node - linkType: hard - "foreground-child@npm:^1.5.3, foreground-child@npm:^1.5.6": version: 1.5.6 resolution: "foreground-child@npm:1.5.6" @@ -26149,10 +24260,10 @@ __metadata: languageName: node linkType: hard -"fraction.js@npm:^4.2.0": - version: 4.2.0 - resolution: "fraction.js@npm:4.2.0" - checksum: 8c76a6e21dedea87109d6171a0ac77afa14205794a565d71cb10d2925f629a3922da61bf45ea52dbc30bce4d8636dc0a27213a88cbd600eab047d82f9a3a94c5 +"fraction.js@npm:^4.2.0, fraction.js@npm:^4.3.6": + version: 4.3.7 + resolution: "fraction.js@npm:4.3.7" + checksum: e1553ae3f08e3ba0e8c06e43a3ab20b319966dfb7ddb96fd9b5d0ee11a66571af7f993229c88ebbb0d4a816eb813a24ed48207b140d442a8f76f33763b8d1f3f languageName: node linkType: hard @@ -26203,7 +24314,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:10.1.0, fs-extra@npm:^10.1.0": +"fs-extra@npm:10.1.0, fs-extra@npm:^10.0.0, fs-extra@npm:^10.1.0": version: 10.1.0 resolution: "fs-extra@npm:10.1.0" dependencies: @@ -26214,7 +24325,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:11.1.1, fs-extra@npm:^11.0.0": +"fs-extra@npm:11.1.1": version: 11.1.1 resolution: "fs-extra@npm:11.1.1" dependencies: @@ -26238,18 +24349,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^10.0.0": - version: 10.0.1 - resolution: "fs-extra@npm:10.0.1" - dependencies: - graceful-fs: ^4.2.0 - jsonfile: ^6.0.1 - universalify: ^2.0.0 - checksum: c1faaa5eb9e1c5c7c7ff09f966e93922ecb068ae1b04801cfc983ef05fcc1f66bfbb8d8d0b745c910014c7a2e7317fb6cf3bfe7390450c1157e3cc1a218f221d - languageName: node - linkType: hard - -"fs-extra@npm:^11.2.0": +"fs-extra@npm:^11.0.0, fs-extra@npm:^11.2.0": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" dependencies: @@ -26334,25 +24434,18 @@ __metadata: linkType: hard "fs-minipass@npm:^3.0.0": - version: 3.0.1 - resolution: "fs-minipass@npm:3.0.1" + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" dependencies: - minipass: ^4.0.0 - checksum: ce1fd3ccef7d64caa9ee5f566db1abe250b6e0067defe53003288537b310956e6f42c433c3ee6001e044f656ce8ba5a0b2e5b5589c513c67b57470d11c3d9b07 - languageName: node - linkType: hard - -"fs-monkey@npm:^1.0.3": - version: 1.0.3 - resolution: "fs-monkey@npm:1.0.3" - checksum: cf50804833f9b88a476911ae911fe50f61a98d986df52f890bd97e7262796d023698cb2309fa9b74fdd8974f04315b648748a0a8ee059e7d5257b293bfc409c0 + minipass: ^7.0.3 + checksum: 8722a41109130851d979222d3ec88aabaceeaaf8f57b2a8f744ef8bd2d1ce95453b04a61daa0078822bc5cd21e008814f06fe6586f56fef511e71b8d2394d802 languageName: node linkType: hard "fs-monkey@npm:^1.0.4": - version: 1.0.4 - resolution: "fs-monkey@npm:1.0.4" - checksum: 8b254c982905c0b7e028eab22b410dc35a5c0019c1c860456f5f54ae6a61666e1cb8c6b700d6c88cc873694c00953c935847b9959cc4dcf274aacb8673c1e8bf + version: 1.0.5 + resolution: "fs-monkey@npm:1.0.5" + checksum: 424b67f65b37fe66117ae2bb061f790fe6d4b609e1d160487c74b3d69fbf42f262c665ccfba32e8b5f113f96f92e9a58fcdebe42d5f6649bdfc72918093a3119 languageName: node linkType: hard @@ -26364,32 +24457,25 @@ __metadata: linkType: hard "fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": - version: 2.3.2 - resolution: "fsevents@npm:2.3.2" + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" dependencies: node-gyp: latest - checksum: 97ade64e75091afee5265e6956cb72ba34db7819b4c3e94c431d4be2b19b8bb7a2d4116da417950c3425f17c8fe693d25e20212cac583ac1521ad066b77ae31f + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 conditions: os=darwin languageName: node linkType: hard "fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": - version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" dependencies: node-gyp: latest conditions: os=darwin languageName: node linkType: hard -"function-bind@npm:^1.1.1": - version: 1.1.1 - resolution: "function-bind@npm:1.1.1" - checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a - languageName: node - linkType: hard - -"function-bind@npm:^1.1.2": +"function-bind@npm:^1.1.1, function-bind@npm:^1.1.2": version: 1.1.2 resolution: "function-bind@npm:1.1.2" checksum: 2b0ff4ce708d99715ad14a6d1f894e2a83242e4a52ccfcefaee5e40050562e5f6dafc1adbb4ce2d4ab47279a45dc736ab91ea5042d843c3c092820dfe032efb1 @@ -26403,15 +24489,22 @@ __metadata: languageName: node linkType: hard -"function.prototype.name@npm:^1.1.5": - version: 1.1.5 - resolution: "function.prototype.name@npm:1.1.5" +"function-timeout@npm:^0.1.0": + version: 0.1.1 + resolution: "function-timeout@npm:0.1.1" + checksum: 26a05935fde5abf8168f13f2a9d8d8930d12cd076dd694a55d425b3c124384a9d5bf4e254710684addd20749f42268e349acbc333ab7c9622b863a89d392f999 + languageName: node + linkType: hard + +"function.prototype.name@npm:^1.1.5, function.prototype.name@npm:^1.1.6": + version: 1.1.6 + resolution: "function.prototype.name@npm:1.1.6" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.3 - es-abstract: ^1.19.0 - functions-have-names: ^1.2.2 - checksum: acd21d733a9b649c2c442f067567743214af5fa248dbeee69d8278ce7df3329ea5abac572be9f7470b4ec1cd4d8f1040e3c5caccf98ebf2bf861a0deab735c27 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + functions-have-names: ^1.2.3 + checksum: 7a3f9bd98adab09a07f6e1f03da03d3f7c26abbdeaeee15223f6c04a9fb5674792bdf5e689dac19b97ac71de6aad2027ba3048a9b883aa1b3173eed6ab07f479 languageName: node linkType: hard @@ -26422,7 +24515,7 @@ __metadata: languageName: node linkType: hard -"functions-have-names@npm:^1.2.2, functions-have-names@npm:^1.2.3": +"functions-have-names@npm:^1.2.3": version: 1.2.3 resolution: "functions-have-names@npm:1.2.3" checksum: c3f1f5ba20f4e962efb71344ce0a40722163e85bee2101ce25f88214e78182d2d2476aa85ef37950c579eb6cf6ee811c17b3101bb84004bb75655f3e33f3fdb5 @@ -26515,18 +24608,18 @@ __metadata: linkType: hard "gauge@npm:^5.0.0": - version: 5.0.0 - resolution: "gauge@npm:5.0.0" + version: 5.0.1 + resolution: "gauge@npm:5.0.1" dependencies: aproba: ^1.0.3 || ^2.0.0 color-support: ^1.1.3 console-control-strings: ^1.1.0 has-unicode: ^2.0.1 - signal-exit: ^3.0.7 + signal-exit: ^4.0.1 string-width: ^4.2.3 strip-ansi: ^6.0.1 wide-align: ^1.1.5 - checksum: 663c3e9418a81274824301c5282d047f13e1612ccb458d96ea6cae5f63012c171af2829041501c459f7fa64845bbc5362d3574573747e9a114745d64ceb2480b + checksum: 09b1eb8d8c850df7e4e2822feef27427afc845d4839fa13a08ddad74f882caf668dd1e77ac5e059d3e9a7b0cef59b706d28be40e1dc5fd326da32965e1f206a6 languageName: node linkType: hard @@ -26546,7 +24639,7 @@ __metadata: languageName: node linkType: hard -"gaxios@npm:^6.0.0": +"gaxios@npm:^6.0.0, gaxios@npm:^6.1.1": version: 6.1.1 resolution: "gaxios@npm:6.1.1" dependencies: @@ -26558,13 +24651,13 @@ __metadata: languageName: node linkType: hard -"gcp-metadata@npm:^6.0.0": - version: 6.0.0 - resolution: "gcp-metadata@npm:6.0.0" +"gcp-metadata@npm:^6.1.0": + version: 6.1.0 + resolution: "gcp-metadata@npm:6.1.0" dependencies: gaxios: ^6.0.0 json-bigint: ^1.0.0 - checksum: c86a362819cee8d29cce02d9ce7e4e11687bfc6a91cb015f19a14f5015f66ef9cf2c93aa59f66e10915e4b0b8ed9ea90f0ac473594ad1dec5402f2e984a5662b + checksum: 55de8ae4a6b7664379a093abf7e758ae06e82f244d41bd58d881a470bf34db94c4067ce9e1b425d9455b7705636d5f8baad844e49bb73879c338753ba7785b2b languageName: node linkType: hard @@ -26621,52 +24714,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2": - version: 1.1.2 - resolution: "get-intrinsic@npm:1.1.2" - dependencies: - function-bind: ^1.1.1 - has: ^1.0.3 - has-symbols: ^1.0.3 - checksum: 252f45491f2ba88ebf5b38018020c7cc3279de54b1d67ffb70c0cdf1dfa8ab31cd56467b5d117a8b4275b7a4dde91f86766b163a17a850f036528a7b2faafb2b - languageName: node - linkType: hard - -"get-intrinsic@npm:^1.1.0, get-intrinsic@npm:^1.1.1": - version: 1.1.1 - resolution: "get-intrinsic@npm:1.1.1" - dependencies: - function-bind: ^1.1.1 - has: ^1.0.3 - has-symbols: ^1.0.1 - checksum: a9fe2ca8fa3f07f9b0d30fb202bcd01f3d9b9b6b732452e79c48e79f7d6d8d003af3f9e38514250e3553fdc83c61650851cb6870832ac89deaaceb08e3721a17 - languageName: node - linkType: hard - -"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0": - version: 1.2.0 - resolution: "get-intrinsic@npm:1.2.0" - dependencies: - function-bind: ^1.1.1 - has: ^1.0.3 - has-symbols: ^1.0.3 - checksum: 78fc0487b783f5c58cf2dccafc3ae656ee8d2d8062a8831ce4a95e7057af4587a1d4882246c033aca0a7b4965276f4802b45cc300338d1b77a73d3e3e3f4877d - languageName: node - linkType: hard - -"get-intrinsic@npm:^1.2.1": - version: 1.2.1 - resolution: "get-intrinsic@npm:1.2.1" - dependencies: - function-bind: ^1.1.1 - has: ^1.0.3 - has-proto: ^1.0.1 - has-symbols: ^1.0.3 - checksum: 5b61d88552c24b0cf6fa2d1b3bc5459d7306f699de060d76442cce49a4721f52b8c560a33ab392cf5575b7810277d54ded9d4d39a1ea61855619ebc005aa7e5f - languageName: node - linkType: hard - -"get-intrinsic@npm:^1.2.2": +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": version: 1.2.2 resolution: "get-intrinsic@npm:1.2.2" dependencies: @@ -26685,13 +24733,6 @@ __metadata: languageName: node linkType: hard -"get-iterator@npm:^2.0.0": - version: 2.0.1 - resolution: "get-iterator@npm:2.0.1" - checksum: 353baac51f5e335c19cb734cbf0401d7c47deeac9d375e2939fed646fe52db2912d61ed2a60112050cf4687080817d159ec938803e48e03cd602edd489a116f2 - languageName: node - linkType: hard - "get-own-enumerable-property-symbols@npm:^3.0.0": version: 3.0.2 resolution: "get-own-enumerable-property-symbols@npm:3.0.2" @@ -26945,7 +24986,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:7.2.0, glob@npm:^7.0.0, glob@npm:^7.0.5, glob@npm:^7.0.6, glob@npm:^7.1.1, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": +"glob@npm:7.2.0": version: 7.2.0 resolution: "glob@npm:7.2.0" dependencies: @@ -26959,22 +25000,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2": - version: 10.3.4 - resolution: "glob@npm:10.3.4" - dependencies: - foreground-child: ^3.1.0 - jackspeak: ^2.0.3 - minimatch: ^9.0.1 - minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 - path-scurry: ^1.10.1 - bin: - glob: dist/cjs/src/bin.js - checksum: 176b97c124414401cb51329a93d2ba112cef8814adbed10348481916b9521b677773eee2691cb6b24d66632d8c8bb8913533f5ac4bfb2d0ef5454a1856082361 - languageName: node - linkType: hard - -"glob@npm:^10.3.10": +"glob@npm:^10.2.2, glob@npm:^10.3.10": version: 10.3.10 resolution: "glob@npm:10.3.10" dependencies: @@ -26989,7 +25015,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.3, glob@npm:^7.1.2, glob@npm:^7.2.3": +"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.0.5, glob@npm:^7.0.6, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.3": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -27003,21 +25029,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1": - version: 8.0.1 - resolution: "glob@npm:8.0.1" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^5.0.1 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 7ac782f3ef1c08005884447479e68ceb0ad56997eb2003e1e9aefae71bad3cb48eb7c49190d3d6736f2ffcd8af4985d53a46831b3d5e0052cc5756822a38b61a - languageName: node - linkType: hard - -"glob@npm:^8.0.3": +"glob@npm:^8.0.1, glob@npm:^8.0.3": version: 8.1.0 resolution: "glob@npm:8.1.0" dependencies: @@ -27030,18 +25042,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^9.3.0, glob@npm:^9.3.1": - version: 9.3.4 - resolution: "glob@npm:9.3.4" - dependencies: - fs.realpath: ^1.0.0 - minimatch: ^8.0.2 - minipass: ^4.2.4 - path-scurry: ^1.6.1 - checksum: bcf49eaf475dc4ce8d4e98f896408a9f6507a2cb7d24a207c012cb318b969e04a02bcde2ff2920eadd5055ccae444a007b769e418147a56268fab2cda8694cde - languageName: node - linkType: hard - "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -27051,15 +25051,6 @@ __metadata: languageName: node linkType: hard -"global-dirs@npm:^3.0.0": - version: 3.0.0 - resolution: "global-dirs@npm:3.0.0" - dependencies: - ini: 2.0.0 - checksum: 953c17cf14bf6ee0e2100ae82a0d779934eed8a3ec5c94a7a4f37c5b3b592c31ea015fb9a15cf32484de13c79f4a814f3015152f3e1d65976cfbe47c1bfe4a88 - languageName: node - linkType: hard - "global-modules@npm:^1.0.0": version: 1.0.0 resolution: "global-modules@npm:1.0.0" @@ -27130,21 +25121,12 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.21.0 - resolution: "globals@npm:13.21.0" - dependencies: - type-fest: ^0.20.2 - checksum: 86c92ca8a04efd864c10852cd9abb1ebe6d447dcc72936783e66eaba1087d7dba5c9c3421a48d6ca722c319378754dbcc3f3f732dbe47592d7de908edf58a773 - languageName: node - linkType: hard - -"globals@npm:^13.6.0, globals@npm:^13.9.0": - version: 13.12.1 - resolution: "globals@npm:13.12.1" +"globals@npm:^13.19.0, globals@npm:^13.6.0, globals@npm:^13.9.0": + version: 13.24.0 + resolution: "globals@npm:13.24.0" dependencies: type-fest: ^0.20.2 - checksum: cf7877629c8f2a293b0a7d09d1dcce7f2d426ec2528600c481c5b3f3d070b0a120eb2499439ac0404990fb8a5742c0165b1bf1f52603364001ddc89bea3dda24 + checksum: 56066ef058f6867c04ff203b8a44c15b038346a62efbc3060052a1016be9f56f4cf0b2cd45b74b22b81e521a889fc7786c73691b0549c2f3a6e825b3d394f43c languageName: node linkType: hard @@ -27155,7 +25137,7 @@ __metadata: languageName: node linkType: hard -"globalthis@npm:^1.0.2, globalthis@npm:^1.0.3": +"globalthis@npm:^1.0.3": version: 1.0.3 resolution: "globalthis@npm:1.0.3" dependencies: @@ -27208,20 +25190,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^13.1.1": - version: 13.1.1 - resolution: "globby@npm:13.1.1" - dependencies: - dir-glob: ^3.0.1 - fast-glob: ^3.2.11 - ignore: ^5.2.0 - merge2: ^1.4.1 - slash: ^4.0.0 - checksum: e6c43409c6c31b374fbd1c01a8c1811de52336928be9c697e472d2a89a156c9cbf1fb33863755c0447b4db16485858aa57f16628d66a6b7c7131669c9fbe76cd - languageName: node - linkType: hard - -"globby@npm:^13.1.2": +"globby@npm:^13.1.1, globby@npm:^13.1.2": version: 13.2.2 resolution: "globby@npm:13.2.2" dependencies: @@ -27310,21 +25279,20 @@ __metadata: linkType: hard "google-auth-library@npm:^9.0.0": - version: 9.1.0 - resolution: "google-auth-library@npm:9.1.0" + version: 9.4.1 + resolution: "google-auth-library@npm:9.4.1" dependencies: base64-js: ^1.3.0 ecdsa-sig-formatter: ^1.0.11 - gaxios: ^6.0.0 - gcp-metadata: ^6.0.0 + gaxios: ^6.1.1 + gcp-metadata: ^6.1.0 gtoken: ^7.0.0 jws: ^4.0.0 - lru-cache: ^6.0.0 - checksum: 8208f718f22c76e5655fa289c7aeb06a1f0be768ad0e17183a14aa2d6f2167e70921ad4c5a0497824e7277a06f8878c491f47c6b0594996e801642a53b0e69e9 + checksum: c7d2d40ab704e0412db71e505a50b8b149233b9714db20b75c522e43c2a02033de52d4fc37787a8907875c93ff895a0a9582ed1217a990dfbf7389b1d7e2b3d0 languageName: node linkType: hard -"google-gax@npm:4.0.5": +"google-gax@npm:4.0.5, google-gax@npm:^4.0.3": version: 4.0.5 resolution: "google-gax@npm:4.0.5" dependencies: @@ -27343,25 +25311,6 @@ __metadata: languageName: node linkType: hard -"google-gax@npm:^4.0.3": - version: 4.0.4 - resolution: "google-gax@npm:4.0.4" - dependencies: - "@grpc/grpc-js": ~1.9.0 - "@grpc/proto-loader": ^0.7.0 - "@types/long": ^4.0.0 - abort-controller: ^3.0.0 - duplexify: ^4.0.0 - google-auth-library: ^9.0.0 - node-fetch: ^2.6.1 - object-hash: ^3.0.0 - proto3-json-serializer: ^2.0.0 - protobufjs: 7.2.5 - retry-request: ^6.0.0 - checksum: 95121b0636fdc60ba34583f49d98baaff3c2e27b1d0a880c8f5f3c41567b871f1243d278747842b4c4b2139357838cb03cb6b0ce420145c78e04cd074b26cb0f - languageName: node - linkType: hard - "google-protobuf@npm:3.15.8": version: 3.15.8 resolution: "google-protobuf@npm:3.15.8" @@ -27376,20 +25325,13 @@ __metadata: languageName: node linkType: hard -"google-protobuf@npm:3.21.2": +"google-protobuf@npm:3.21.2, google-protobuf@npm:^3.6.1, google-protobuf@npm:^3.9.1": version: 3.21.2 resolution: "google-protobuf@npm:3.21.2" checksum: 3caa2e1e2654714cc1a201ac5e5faabcaa48f5fba3d8ff9b64ca66fe19e4e0506b94053f32eddc77bf3a7a47ac1660315c6744185c1e2bb27654fd76fe91b988 languageName: node linkType: hard -"google-protobuf@npm:^3.6.1, google-protobuf@npm:^3.9.1": - version: 3.19.4 - resolution: "google-protobuf@npm:3.19.4" - checksum: c0ebc0afbb635271b54db933be74441429e0df095347d0145ae7036377a2cc6fc402ed015855ebc1809c7cedfde3246344ad28a98eac1e6a21800c7b572b2caf - languageName: node - linkType: hard - "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -27420,7 +25362,7 @@ __metadata: languageName: node linkType: hard -"got@npm:9.6.0, got@npm:^9.6.0": +"got@npm:9.6.0": version: 9.6.0 resolution: "got@npm:9.6.0" dependencies: @@ -27439,6 +25381,25 @@ __metadata: languageName: node linkType: hard +"got@npm:^11.8.5": + version: 11.8.6 + resolution: "got@npm:11.8.6" + dependencies: + "@sindresorhus/is": ^4.0.0 + "@szmarczak/http-timer": ^4.0.5 + "@types/cacheable-request": ^6.0.1 + "@types/responselike": ^1.0.0 + cacheable-lookup: ^5.0.3 + cacheable-request: ^7.0.2 + decompress-response: ^6.0.0 + http2-wrapper: ^1.0.0-beta.5.2 + lowercase-keys: ^2.0.0 + p-cancelable: ^2.0.0 + responselike: ^2.0.0 + checksum: bbc783578a8d5030c8164ef7f57ce41b5ad7db2ed13371e1944bef157eeca5a7475530e07c0aaa71610d7085474d0d96222c9f4268d41db333a17e39b463f45d + languageName: node + linkType: hard + "got@npm:^12.6.0": version: 12.6.1 resolution: "got@npm:12.6.1" @@ -27458,36 +25419,7 @@ __metadata: languageName: node linkType: hard -"got@npm:^7.1.0": - version: 7.1.0 - resolution: "got@npm:7.1.0" - dependencies: - decompress-response: ^3.2.0 - duplexer3: ^0.1.4 - get-stream: ^3.0.0 - is-plain-obj: ^1.1.0 - is-retry-allowed: ^1.0.0 - is-stream: ^1.0.0 - isurl: ^1.0.0-alpha5 - lowercase-keys: ^1.0.0 - p-cancelable: ^0.3.0 - p-timeout: ^1.1.1 - safe-buffer: ^5.0.1 - timed-out: ^4.0.0 - url-parse-lax: ^1.0.0 - url-to-options: ^1.0.1 - checksum: 0270472a389bdca67e60d36cccd014e502d1797d925c06ea2ef372fb41ae99c9e25ac4f187cc422760b4a66abb5478f8821b8134b4eaefe0bf5183daeded5e2f - languageName: node - linkType: hard - -"graceful-fs@npm:^4.1.10, graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.1.9, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": - version: 4.2.9 - resolution: "graceful-fs@npm:4.2.9" - checksum: 68ea4e07ff2c041ada184f9278b830375f8e0b75154e3f080af6b70f66172fabb4108d19b3863a96b53fc068a310b9b6493d86d1291acc5f3861eb4b79d26ad6 - languageName: node - linkType: hard - -"graceful-fs@npm:^4.2.10, graceful-fs@npm:^4.2.11": +"graceful-fs@npm:^4.1.10, graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.1.9, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.10, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 @@ -27601,7 +25533,7 @@ __metadata: languageName: node linkType: hard -"handlebars@npm:4.7.7, handlebars@npm:^4.0.3, handlebars@npm:^4.7.7": +"handlebars@npm:4.7.7": version: 4.7.7 resolution: "handlebars@npm:4.7.7" dependencies: @@ -27619,6 +25551,24 @@ __metadata: languageName: node linkType: hard +"handlebars@npm:^4.0.3, handlebars@npm:^4.7.7": + version: 4.7.8 + resolution: "handlebars@npm:4.7.8" + dependencies: + minimist: ^1.2.5 + neo-async: ^2.6.2 + source-map: ^0.6.1 + uglify-js: ^3.1.4 + wordwrap: ^1.0.0 + dependenciesMeta: + uglify-js: + optional: true + bin: + handlebars: bin/handlebars + checksum: 00e68bb5c183fd7b8b63322e6234b5ac8fbb960d712cb3f25587d559c2951d9642df83c04a1172c918c41bcfc81bfbd7a7718bbce93b893e0135fc99edea93ff + languageName: node + linkType: hard + "har-schema@npm:^2.0.0": version: 2.0.0 resolution: "har-schema@npm:2.0.0" @@ -27725,14 +25675,7 @@ __metadata: languageName: node linkType: hard -"has-bigints@npm:^1.0.1": - version: 1.0.1 - resolution: "has-bigints@npm:1.0.1" - checksum: 44ab55868174470065d2e0f8f6def1c990d12b82162a8803c679699fa8a39f966e336f2a33c185092fe8aea7e8bf2e85f1c26add5f29d98f2318bd270096b183 - languageName: node - linkType: hard - -"has-bigints@npm:^1.0.2": +"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" checksum: 390e31e7be7e5c6fe68b81babb73dfc35d413604d7ee5f56da101417027a4b4ce6a27e46eff97ad040c835b5d228676eae99a9b5c3bc0e23c8e81a49241ff45b @@ -27778,11 +25721,11 @@ __metadata: linkType: hard "has-property-descriptors@npm:^1.0.0": - version: 1.0.0 - resolution: "has-property-descriptors@npm:1.0.0" + version: 1.0.1 + resolution: "has-property-descriptors@npm:1.0.1" dependencies: - get-intrinsic: ^1.1.1 - checksum: a6d3f0a266d0294d972e354782e872e2fe1b6495b321e6ef678c9b7a06a40408a6891817350c62e752adced73a94ac903c54734fee05bf65b1905ee1368194bb + get-intrinsic: ^1.2.2 + checksum: 2bcc6bf6ec6af375add4e4b4ef586e43674850a91ad4d46666d0b28ba8e1fd69e424c7677d24d60f69470ad0afaa2f3197f508b20b0bb7dd99a8ab77ffc4b7c4 languageName: node linkType: hard @@ -27793,36 +25736,13 @@ __metadata: languageName: node linkType: hard -"has-symbol-support-x@npm:^1.4.1": - version: 1.4.2 - resolution: "has-symbol-support-x@npm:1.4.2" - checksum: ff06631d556d897424c00e8e79c10093ad34c93e88bb0563932d7837f148a4c90a4377abc5d8da000cb6637c0ecdb4acc9ae836c7cfd0ffc919986db32097609 - languageName: node - linkType: hard - -"has-symbols@npm:^1.0.1, has-symbols@npm:^1.0.2": - version: 1.0.2 - resolution: "has-symbols@npm:1.0.2" - checksum: 2309c426071731be792b5be43b3da6fb4ed7cbe8a9a6bcfca1862587709f01b33d575ce8f5c264c1eaad09fca2f9a8208c0a2be156232629daa2dd0c0740976b - languageName: node - linkType: hard - -"has-symbols@npm:^1.0.3": +"has-symbols@npm:^1.0.1, has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 languageName: node linkType: hard -"has-to-string-tag-x@npm:^1.2.0": - version: 1.4.1 - resolution: "has-to-string-tag-x@npm:1.4.1" - dependencies: - has-symbol-support-x: ^1.4.1 - checksum: 804c4505727be7770f8b2f5e727ce31c9affc5b83df4ce12344f44b68d557fefb31f77751dbd739de900653126bcd71f8842fac06f97a3fae5422685ab0ce6f0 - languageName: node - linkType: hard - "has-tostringtag@npm:^1.0.0": version: 1.0.0 resolution: "has-tostringtag@npm:1.0.0" @@ -27878,19 +25798,10 @@ __metadata: languageName: node linkType: hard -"has-yarn@npm:^2.1.0": - version: 2.1.0 - resolution: "has-yarn@npm:2.1.0" - checksum: 5eb1d0bb8518103d7da24532bdbc7124ffc6d367b5d3c10840b508116f2f1bcbcf10fd3ba843ff6e2e991bdf9969fd862d42b2ed58aade88343326c950b7e7f7 - languageName: node - linkType: hard - "has@npm:^1.0.1, has@npm:^1.0.3": - version: 1.0.3 - resolution: "has@npm:1.0.3" - dependencies: - function-bind: ^1.1.1 - checksum: b9ad53d53be4af90ce5d1c38331e712522417d017d5ef1ebd0507e07c2fbad8686fffb8e12ddecd4c39ca9b9b47431afbb975b8abf7f3c3b82c98e9aad052792 + version: 1.0.4 + resolution: "has@npm:1.0.4" + checksum: 8a11ba062e0627c9578a1d08285401e39f1d071a9692ddf793199070edb5648b21c774dd733e2a181edd635bf6862731885f476f4ccf67c998d7a5ff7cef2550 languageName: node linkType: hard @@ -28111,14 +26022,14 @@ __metadata: languageName: node linkType: hard -"html-entities@npm:2.3.3, html-entities@npm:^2.3.2": +"html-entities@npm:2.3.3": version: 2.3.3 resolution: "html-entities@npm:2.3.3" checksum: 92521501da8aa5f66fee27f0f022d6e9ceae62667dae93aa6a2f636afa71ad530b7fb24a18d4d6c124c9885970cac5f8a52dbf1731741161002816ae43f98196 languageName: node linkType: hard -"html-entities@npm:^2.1.0": +"html-entities@npm:^2.1.0, html-entities@npm:^2.3.2": version: 2.4.0 resolution: "html-entities@npm:2.4.0" checksum: 25bea32642ce9ebd0eedc4d24381883ecb0335ccb8ac26379a0958b9b16652fdbaa725d70207ce54a51db24103436a698a8e454397d3ba8ad81460224751f1dc @@ -28150,8 +26061,8 @@ __metadata: linkType: hard "html-webpack-plugin@npm:^5.5.0": - version: 5.5.3 - resolution: "html-webpack-plugin@npm:5.5.3" + version: 5.6.0 + resolution: "html-webpack-plugin@npm:5.6.0" dependencies: "@types/html-minifier-terser": ^6.0.0 html-minifier-terser: ^6.0.2 @@ -28159,8 +26070,14 @@ __metadata: pretty-error: ^4.0.0 tapable: ^2.0.0 peerDependencies: + "@rspack/core": 0.x || 1.x webpack: ^5.20.0 - checksum: ccf685195739c372ad641bbd0c9100a847904f34eedc7aff3ece7856cd6c78fd3746d2d615af1bb71e5727993fe711b89e9b744f033ed3fde646540bf5d5e954 + peerDependenciesMeta: + "@rspack/core": + optional: true + webpack: + optional: true + checksum: 32a6e41da538e798fd0be476637d7611a5e8a98a3508f031996e9eb27804dcdc282cb01f847cf5d066f21b49cfb8e21627fcf977ffd0c9bea81cf80e5a65070d languageName: node linkType: hard @@ -28176,19 +26093,7 @@ __metadata: languageName: node linkType: hard -"htmlparser2@npm:^8.0.1": - version: 8.0.1 - resolution: "htmlparser2@npm:8.0.1" - dependencies: - domelementtype: ^2.3.0 - domhandler: ^5.0.2 - domutils: ^3.0.1 - entities: ^4.3.0 - checksum: 06d5c71e8313597722bc429ae2a7a8333d77bd3ab07ccb916628384b37332027b047f8619448d8f4a3312b6609c6ea3302a4e77435d859e9e686999e6699ca39 - languageName: node - linkType: hard - -"htmlparser2@npm:^8.0.2": +"htmlparser2@npm:^8.0.1, htmlparser2@npm:^8.0.2": version: 8.0.2 resolution: "htmlparser2@npm:8.0.2" dependencies: @@ -28273,9 +26178,9 @@ __metadata: linkType: hard "http-parser-js@npm:>=0.5.1": - version: 0.5.5 - resolution: "http-parser-js@npm:0.5.5" - checksum: 85e67f12d99d67565be6c82dd86d4cf71939825fdf9826e10047b2443460bfef13235859ca67c0235d54e553db242204ec813febc86f11f83ed8ebd3cd475b65 + version: 0.5.8 + resolution: "http-parser-js@npm:0.5.8" + checksum: 6bbdf2429858e8cf13c62375b0bfb6dc3955ca0f32e58237488bc86cd2378f31d31785fd3ac4ce93f1c74e0189cf8823c91f5cb061696214fd368d2452dc871d languageName: node linkType: hard @@ -28370,13 +26275,23 @@ __metadata: languageName: node linkType: hard +"http2-wrapper@npm:^1.0.0-beta.5.2": + version: 1.0.3 + resolution: "http2-wrapper@npm:1.0.3" + dependencies: + quick-lru: ^5.1.1 + resolve-alpn: ^1.0.0 + checksum: 74160b862ec699e3f859739101ff592d52ce1cb207b7950295bf7962e4aa1597ef709b4292c673bece9c9b300efad0559fc86c71b1409c7a1e02b7229456003e + languageName: node + linkType: hard + "http2-wrapper@npm:^2.1.10": - version: 2.2.0 - resolution: "http2-wrapper@npm:2.2.0" + version: 2.2.1 + resolution: "http2-wrapper@npm:2.2.1" dependencies: quick-lru: ^5.1.1 resolve-alpn: ^1.2.0 - checksum: 6fd20e5cb6a58151715b3581e06a62a47df943187d2d1f69e538a50cccb7175dd334ecfde7900a37d18f3e13a1a199518a2c211f39860e81e9a16210c199cfaa + checksum: e95e55e22c6fd61182ce81fecb9b7da3af680d479febe8ad870d05f7ebbc9f076e455193766f4e7934e50913bf1d8da3ba121fb5cd2928892390b58cf9d5c509 languageName: node linkType: hard @@ -28387,7 +26302,7 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:5.0.1": +"https-proxy-agent@npm:5.0.1, https-proxy-agent@npm:^5.0.0": version: 5.0.1 resolution: "https-proxy-agent@npm:5.0.1" dependencies: @@ -28397,16 +26312,6 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^5.0.0": - version: 5.0.0 - resolution: "https-proxy-agent@npm:5.0.0" - dependencies: - agent-base: 6 - debug: 4 - checksum: 165bfb090bd26d47693597661298006841ab733d0c7383a8cb2f17373387a94c903a3ac687090aa739de05e379ab6f868bae84ab4eac288ad85c328cd1ec9e53 - languageName: node - linkType: hard - "https-proxy-agent@npm:^7.0.1": version: 7.0.2 resolution: "https-proxy-agent@npm:7.0.2" @@ -28543,16 +26448,7 @@ __metadata: languageName: node linkType: hard -"ignore-walk@npm:^6.0.0": - version: 6.0.2 - resolution: "ignore-walk@npm:6.0.2" - dependencies: - minimatch: ^7.4.2 - checksum: 99dda4d6977cf47b359ae17d62f4abfb9273a2507d14d38db7a29abcd8385ec45cc1d8cf00e73695f98ef4001e7439a4f5b619a3d4055a37bd953288be01b485 - languageName: node - linkType: hard - -"ignore-walk@npm:^6.0.4": +"ignore-walk@npm:^6.0.0, ignore-walk@npm:^6.0.4": version: 6.0.4 resolution: "ignore-walk@npm:6.0.4" dependencies: @@ -28575,17 +26471,10 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.1.1, ignore@npm:^5.1.8, ignore@npm:^5.2.0": - version: 5.2.0 - resolution: "ignore@npm:5.2.0" - checksum: 6b1f926792d614f64c6c83da3a1f9c83f6196c2839aa41e1e32dd7b8d174cef2e329d75caabb62cb61ce9dc432f75e67d07d122a037312db7caa73166a1bdb77 - languageName: node - linkType: hard - -"ignore@npm:^5.1.9, ignore@npm:^5.2.4": - version: 5.2.4 - resolution: "ignore@npm:5.2.4" - checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef +"ignore@npm:^5.1.1, ignore@npm:^5.1.8, ignore@npm:^5.1.9, ignore@npm:^5.2.0, ignore@npm:^5.2.4": + version: 5.3.0 + resolution: "ignore@npm:5.3.0" + checksum: 2736da6621f14ced652785cb05d86301a66d70248597537176612bd0c8630893564bd5f6421f8806b09e8472e75c591ef01672ab8059c07c6eb2c09cefe04bf9 languageName: node linkType: hard @@ -28620,9 +26509,9 @@ __metadata: linkType: hard "immutable@npm:^4.0.0, immutable@npm:^4.0.0-rc.12": - version: 4.0.0 - resolution: "immutable@npm:4.0.0" - checksum: 4b5e9181e4d5fa06728a481835ec09c86367e5d03268666c95b522b7644ab891098022e4479a43c4c81a68f2ed82f10751ce5d33e208d7b873b6e7f9dfaf4d87 + version: 4.3.4 + resolution: "immutable@npm:4.3.4" + checksum: de3edd964c394bab83432429d3fb0b4816b42f56050f2ca913ba520bd3068ec3e504230d0800332d3abc478616e8f55d3787424a90d0952e6aba864524f1afc3 languageName: node linkType: hard @@ -28636,13 +26525,6 @@ __metadata: languageName: node linkType: hard -"import-lazy@npm:^2.1.0": - version: 2.1.0 - resolution: "import-lazy@npm:2.1.0" - checksum: 05294f3b9dd4971d3a996f0d2f176410fb6745d491d6e73376429189f5c1c3d290548116b2960a7cf3e89c20cdf11431739d1d2d8c54b84061980795010e803a - languageName: node - linkType: hard - "import-local@npm:^3.0.2, import-local@npm:^3.1.0": version: 3.1.0 resolution: "import-local@npm:3.1.0" @@ -28746,13 +26628,6 @@ __metadata: languageName: node linkType: hard -"ini@npm:2.0.0, ini@npm:^2.0.0": - version: 2.0.0 - resolution: "ini@npm:2.0.0" - checksum: e7aadc5fb2e4aefc666d74ee2160c073995a4061556b1b5b4241ecb19ad609243b9cceafe91bae49c219519394bbd31512516cb22a3b1ca6e66d869e0447e84e - languageName: node - linkType: hard - "ini@npm:4.1.1": version: 4.1.1 resolution: "ini@npm:4.1.1" @@ -28760,6 +26635,13 @@ __metadata: languageName: node linkType: hard +"ini@npm:^2.0.0": + version: 2.0.0 + resolution: "ini@npm:2.0.0" + checksum: e7aadc5fb2e4aefc666d74ee2160c073995a4061556b1b5b4241ecb19ad609243b9cceafe91bae49c219519394bbd31512516cb22a3b1ca6e66d869e0447e84e + languageName: node + linkType: hard + "ink@npm:^3.2.0": version: 3.2.0 resolution: "ink@npm:3.2.0" @@ -28965,13 +26847,12 @@ __metadata: linkType: hard "interface-datastore@npm:^8.2.0": - version: 8.2.5 - resolution: "interface-datastore@npm:8.2.5" + version: 8.2.10 + resolution: "interface-datastore@npm:8.2.10" dependencies: interface-store: ^5.0.0 - nanoid: ^4.0.0 - uint8arrays: ^4.0.2 - checksum: 83f79ad9c97d362d8068046b1481f1ae65b95d3c89061d508493c0fb199c7abcf4116753c910d27d155e9d0902d7684b3835506504ef254820192a3ad2b3ff21 + uint8arrays: ^5.0.0 + checksum: 16e12820b8423e457a6255377f373ea20132d7080809756b350e8914fde9abb73c4dd226cb3a9dda31bff790c181a02382bdde0482f9385ea4d2168c35ae93d8 languageName: node linkType: hard @@ -28983,21 +26864,21 @@ __metadata: linkType: hard "interface-store@npm:^5.0.0": - version: 5.1.4 - resolution: "interface-store@npm:5.1.4" - checksum: 3c252b54224746aacce8533d409042cf5a5a5c9e9b70defaa549b62a64c3e461eacab10dc80920b3cb15179c65d448471b278a137e77df9de14e9b6eb262e563 + version: 5.1.7 + resolution: "interface-store@npm:5.1.7" + checksum: aeddcdbfe8601f127c485ede6c6323bf2b302c713a1661036403dfd01b6b91e19a314ecf002477f108cb9c94d67781f88d386d3688f1e9c7cd1464a756ac28fa languageName: node linkType: hard "internal-ip@npm:*": - version: 7.0.0 - resolution: "internal-ip@npm:7.0.0" + version: 8.0.0 + resolution: "internal-ip@npm:8.0.0" dependencies: - default-gateway: ^6.0.3 - ipaddr.js: ^2.0.1 - is-ip: ^3.1.0 - p-event: ^4.2.0 - checksum: 058fafe81a7e4d2466474361b74fd712d986f553def881c7dff51fd7eb98573d03c44cab047dddf41473252406e66fa20ed23f6a1b76962b090eee26a22854b6 + cidr-tools: ^6.4.1 + default-gateway: ^7.2.2 + is-ip: ^5.0.0 + p-event: ^5.0.1 + checksum: f37e83fb887887003291ad704f54abb2c97c4e87f8e9680aa02e608d3983d68d76ee93e2ac8d0c7344b93b28a214e6e297053052d689fc9f8a071b1aa3183df0 languageName: node linkType: hard @@ -29013,25 +26894,14 @@ __metadata: languageName: node linkType: hard -"internal-slot@npm:^1.0.3": - version: 1.0.3 - resolution: "internal-slot@npm:1.0.3" - dependencies: - get-intrinsic: ^1.1.0 - has: ^1.0.3 - side-channel: ^1.0.4 - checksum: 1944f92e981e47aebc98a88ff0db579fd90543d937806104d0b96557b10c1f170c51fb777b97740a8b6ddeec585fca8c39ae99fd08a8e058dfc8ab70937238bf - languageName: node - linkType: hard - "internal-slot@npm:^1.0.4, internal-slot@npm:^1.0.5": - version: 1.0.5 - resolution: "internal-slot@npm:1.0.5" + version: 1.0.6 + resolution: "internal-slot@npm:1.0.6" dependencies: - get-intrinsic: ^1.2.0 - has: ^1.0.3 + get-intrinsic: ^1.2.2 + hasown: ^2.0.0 side-channel: ^1.0.4 - checksum: 97e84046bf9e7574d0956bd98d7162313ce7057883b6db6c5c7b5e5f05688864b0978ba07610c726d15d66544ffe4b1050107d93f8a39ebc59b15d8b429b497a + checksum: 7872454888047553ce97a3fa1da7cc054a28ec5400a9c2e9f4dbe4fe7c1d041cb8e8301467614b80d4246d50377aad2fb58860b294ed74d6700cc346b6f89549 languageName: node linkType: hard @@ -29092,11 +26962,25 @@ __metadata: linkType: hard "ionicons@npm:^7.0.0": - version: 7.1.2 - resolution: "ionicons@npm:7.1.2" + version: 7.2.2 + resolution: "ionicons@npm:7.2.2" dependencies: - "@stencil/core": ^2.18.0 - checksum: 5462bab32a4ce7b5ecf84d55f44c7110791dfdf7233aec32b08f0baed88fdde3a3c3053e9b08074f72b3a1d080763e95c22fba350c518215a3df8c744b2b229a + "@stencil/core": ^4.0.3 + checksum: ac8a66cce464892ed9cc16f07ea4d8b6b025555a37847e8f599479192a76cf62a614c8842b5309bec7e459345a36893b5770e3536b650f1cd0746986a12f019f + languageName: node + linkType: hard + +"ip-bigint@npm:7.3.0": + version: 7.3.0 + resolution: "ip-bigint@npm:7.3.0" + checksum: ad235be9ef9a2133aa40f1c91b573ecbefdaebcd8154e55ff03fa6882a3b3e9ad7ff37f20dcad29cab87179b6c0e652664802ce90f5aa6ab4fcf7a70160e7863 + languageName: node + linkType: hard + +"ip-regex@npm:5.0.0, ip-regex@npm:^5.0.0": + version: 5.0.0 + resolution: "ip-regex@npm:5.0.0" + checksum: 4098b2df89c015f1484a5946e733ec126af8c1828719d90e09f04af23ce487e1a852670e4d3f51b0dc6dfbaf7d8bfab23fd7893ca60e69833da99b7b1ee3623b languageName: node linkType: hard @@ -29107,13 +26991,6 @@ __metadata: languageName: node linkType: hard -"ip@npm:^1.1.5": - version: 1.1.5 - resolution: "ip@npm:1.1.5" - checksum: 30133981f082a060a32644f6a7746e9ba7ac9e2bc07ecc8bbdda3ee8ca9bec1190724c390e45a1ee7695e7edfd2a8f7dda2c104ec5f7ac5068c00648504c7e5a - languageName: node - linkType: hard - "ip@npm:^2.0.0": version: 2.0.0 resolution: "ip@npm:2.0.0" @@ -29129,9 +27006,9 @@ __metadata: linkType: hard "ipaddr.js@npm:^2.0.1": - version: 2.0.1 - resolution: "ipaddr.js@npm:2.0.1" - checksum: dd194a394a843d470f88d17191b0948f383ed1c8e320813f850c336a0fcb5e9215d97ec26ca35ab4fbbd31392c8b3467f3e8344628029ed3710b2ff6b5d1034e + version: 2.1.0 + resolution: "ipaddr.js@npm:2.1.0" + checksum: 807a054f2bd720c4d97ee479d6c9e865c233bea21f139fb8dabd5a35c4226d2621c42e07b4ad94ff3f82add926a607d8d9d37c625ad0319f0e08f9f2bd1968e2 languageName: node linkType: hard @@ -29236,21 +27113,12 @@ __metadata: languageName: node linkType: hard -"is-accessor-descriptor@npm:^0.1.6": - version: 0.1.6 - resolution: "is-accessor-descriptor@npm:0.1.6" - dependencies: - kind-of: ^3.0.2 - checksum: 3d629a086a9585bc16a83a8e8a3416f400023301855cafb7ccc9a1d63145b7480f0ad28877dcc2cce09492c4ec1c39ef4c071996f24ee6ac626be4217b8ffc8a - languageName: node - linkType: hard - -"is-accessor-descriptor@npm:^1.0.0": - version: 1.0.0 - resolution: "is-accessor-descriptor@npm:1.0.0" +"is-accessor-descriptor@npm:^1.0.1": + version: 1.0.1 + resolution: "is-accessor-descriptor@npm:1.0.1" dependencies: - kind-of: ^6.0.0 - checksum: 8e475968e9b22f9849343c25854fa24492dbe8ba0dea1a818978f9f1b887339190b022c9300d08c47fe36f1b913d70ce8cbaca00369c55a56705fdb7caed37fe + hasown: ^2.0.0 + checksum: 8db44c02230a5e9b9dec390a343178791f073d5d5556a400527d2fd67a72d93b226abab2bd4123305c268f5dc22831bfdbd38430441fda82ea9e0b95ddc6b267 languageName: node linkType: hard @@ -29340,14 +27208,7 @@ __metadata: languageName: node linkType: hard -"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.4": - version: 1.2.4 - resolution: "is-callable@npm:1.2.4" - checksum: 1a28d57dc435797dae04b173b65d6d1e77d4f16276e9eff973f994eadcfdc30a017e6a597f092752a083c1103cceb56c91e3dadc6692fedb9898dfaba701575f - languageName: node - linkType: hard - -"is-callable@npm:^1.2.7": +"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" checksum: 61fd57d03b0d984e2ed3720fb1c7a897827ea174bd44402878e059542ea8c4aeedee0ea0985998aa5cc2736b2fa6e271c08587addb5b3959ac52cf665173d1ac @@ -29376,16 +27237,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.11.0": - version: 2.12.0 - resolution: "is-core-module@npm:2.12.0" - dependencies: - has: ^1.0.3 - checksum: f7f7eb2ab71fd769ee9fb2385c095d503aa4b5ce0028c04557de03f1e67a87c85e5bac1f215945fc3c955867a139a415a3ec4c4234a0bffdf715232660f440a6 - languageName: node - linkType: hard - -"is-core-module@npm:^2.12.0": +"is-core-module@npm:^2.11.0, is-core-module@npm:^2.12.0, is-core-module@npm:^2.13.0, is-core-module@npm:^2.13.1, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1": version: 2.13.1 resolution: "is-core-module@npm:2.13.1" dependencies: @@ -29394,48 +27246,12 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.13.0": - version: 2.13.0 - resolution: "is-core-module@npm:2.13.0" - dependencies: - has: ^1.0.3 - checksum: 053ab101fb390bfeb2333360fd131387bed54e476b26860dc7f5a700bbf34a0ec4454f7c8c4d43e8a0030957e4b3db6e16d35e1890ea6fb654c833095e040355 - languageName: node - linkType: hard - -"is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1": - version: 2.8.1 - resolution: "is-core-module@npm:2.8.1" - dependencies: - has: ^1.0.3 - checksum: 418b7bc10768a73c41c7ef497e293719604007f88934a6ffc5f7c78702791b8528102fb4c9e56d006d69361549b3d9519440214a74aefc7e0b79e5e4411d377f - languageName: node - linkType: hard - -"is-core-module@npm:^2.9.0": - version: 2.12.1 - resolution: "is-core-module@npm:2.12.1" - dependencies: - has: ^1.0.3 - checksum: f04ea30533b5e62764e7b2e049d3157dc0abd95ef44275b32489ea2081176ac9746ffb1cdb107445cf1ff0e0dfcad522726ca27c27ece64dadf3795428b8e468 - languageName: node - linkType: hard - -"is-data-descriptor@npm:^0.1.4": - version: 0.1.4 - resolution: "is-data-descriptor@npm:0.1.4" - dependencies: - kind-of: ^3.0.2 - checksum: 5c622e078ba933a78338ae398a3d1fc5c23332b395312daf4f74bab4afb10d061cea74821add726cb4db8b946ba36217ee71a24fe71dd5bca4632edb7f6aad87 - languageName: node - linkType: hard - -"is-data-descriptor@npm:^1.0.0": - version: 1.0.0 - resolution: "is-data-descriptor@npm:1.0.0" +"is-data-descriptor@npm:^1.0.1": + version: 1.0.1 + resolution: "is-data-descriptor@npm:1.0.1" dependencies: - kind-of: ^6.0.0 - checksum: e705e6816241c013b05a65dc452244ee378d1c3e3842bd140beabe6e12c0d700ef23c91803f971aa7b091fb0573c5da8963af34a2b573337d87bc3e1f53a4e6d + hasown: ^2.0.0 + checksum: fc6da5be5177149d554c5612cc382e9549418ed72f2d3ed5a3e6511b03dd119ae1b2258320ca94931df50b7e9ee012894eccd4ca45bbcadf0d5b27da6faeb15a languageName: node linkType: hard @@ -29449,24 +27265,22 @@ __metadata: linkType: hard "is-descriptor@npm:^0.1.0": - version: 0.1.6 - resolution: "is-descriptor@npm:0.1.6" + version: 0.1.7 + resolution: "is-descriptor@npm:0.1.7" dependencies: - is-accessor-descriptor: ^0.1.6 - is-data-descriptor: ^0.1.4 - kind-of: ^5.0.0 - checksum: 0f780c1b46b465f71d970fd7754096ffdb7b69fd8797ca1f5069c163eaedcd6a20ec4a50af669075c9ebcfb5266d2e53c8b227e485eefdb0d1fee09aa1dd8ab6 + is-accessor-descriptor: ^1.0.1 + is-data-descriptor: ^1.0.1 + checksum: 45743109f0bb03f9fa989c34d31ece87cc15792649f147b896a7c4db2906a02fca685867619f4d312e024d7bbd53b945a47c6830d01f5e73efcc6388ac211963 languageName: node linkType: hard "is-descriptor@npm:^1.0.0, is-descriptor@npm:^1.0.2": - version: 1.0.2 - resolution: "is-descriptor@npm:1.0.2" + version: 1.0.3 + resolution: "is-descriptor@npm:1.0.3" dependencies: - is-accessor-descriptor: ^1.0.0 - is-data-descriptor: ^1.0.0 - kind-of: ^6.0.2 - checksum: 2ed623560bee035fb67b23e32ce885700bef8abe3fbf8c909907d86507b91a2c89a9d3a4d835a4d7334dd5db0237a0aeae9ca109c1e4ef1c0e7b577c0846ab5a + is-accessor-descriptor: ^1.0.1 + is-data-descriptor: ^1.0.1 + checksum: 316153b2fd86ac23b0a2f28b77744ae0a4e3c7a54fe52fa70b125d0971eb0a3bcfb562fa8e74537af0dad5bc405cc606726eb501fc748a241c10910deea89cfb languageName: node linkType: hard @@ -29479,15 +27293,6 @@ __metadata: languageName: node linkType: hard -"is-docker@npm:^3.0.0": - version: 3.0.0 - resolution: "is-docker@npm:3.0.0" - bin: - is-docker: cli.js - checksum: b698118f04feb7eaf3338922bd79cba064ea54a1c3db6ec8c0c8d8ee7613e7e5854d802d3ef646812a8a3ace81182a085dfa0a71cc68b06f3fa794b9783b3c90 - languageName: node - linkType: hard - "is-dotfile@npm:^1.0.0": version: 1.0.3 resolution: "is-dotfile@npm:1.0.3" @@ -29496,9 +27301,9 @@ __metadata: linkType: hard "is-electron@npm:^2.2.0": - version: 2.2.1 - resolution: "is-electron@npm:2.2.1" - checksum: 06e569aa933a737d418489bb9ca081af62eceb714d4c3d553ad2497610e35494be6dddd010c4e29890c7dd9d0481c2e3e1e9097af9d19df1c52dd5be747d80a0 + version: 2.2.2 + resolution: "is-electron@npm:2.2.2" + checksum: de5aa8bd8d72c96675b8d0f93fab4cc21f62be5440f65bc05c61338ca27bd851a64200f31f1bf9facbaa01b3dbfed7997b2186741d84b93b63e0aff1db6a9494 languageName: node linkType: hard @@ -29628,27 +27433,6 @@ __metadata: languageName: node linkType: hard -"is-inside-container@npm:^1.0.0": - version: 1.0.0 - resolution: "is-inside-container@npm:1.0.0" - dependencies: - is-docker: ^3.0.0 - bin: - is-inside-container: cli.js - checksum: c50b75a2ab66ab3e8b92b3bc534e1ea72ca25766832c0623ac22d134116a98bcf012197d1caabe1d1c4bd5f84363d4aa5c36bb4b585fbcaf57be172cd10a1a03 - languageName: node - linkType: hard - -"is-installed-globally@npm:^0.4.0": - version: 0.4.0 - resolution: "is-installed-globally@npm:0.4.0" - dependencies: - global-dirs: ^3.0.0 - is-path-inside: ^3.0.2 - checksum: 3359840d5982d22e9b350034237b2cda2a12bac1b48a721912e1ab8e0631dd07d45a2797a120b7b87552759a65ba03e819f1bd63f2d7ab8657ec0b44ee0bf399 - languageName: node - linkType: hard - "is-interactive@npm:^1.0.0": version: 1.0.0 resolution: "is-interactive@npm:1.0.0" @@ -29665,6 +27449,16 @@ __metadata: languageName: node linkType: hard +"is-ip@npm:^5.0.0": + version: 5.0.1 + resolution: "is-ip@npm:5.0.1" + dependencies: + ip-regex: ^5.0.0 + super-regex: ^0.2.0 + checksum: 86dcac321f05e7ca0bdd2061cec022d3bfe2328fdb1a4fd2d0e7fbdb8689b1223c31ae1c4681faff9ef202816c8fe99ef6b4145a990583b494e530ee6bdeafb9 + languageName: node + linkType: hard + "is-lambda@npm:^1.0.1": version: 1.0.1 resolution: "is-lambda@npm:1.0.1" @@ -29715,7 +27509,7 @@ __metadata: languageName: node linkType: hard -"is-nan@npm:^1.2.1": +"is-nan@npm:^1.3.2": version: 1.3.2 resolution: "is-nan@npm:1.3.2" dependencies: @@ -29732,26 +27526,19 @@ __metadata: languageName: node linkType: hard -"is-negative-zero@npm:^2.0.1, is-negative-zero@npm:^2.0.2": +"is-negative-zero@npm:^2.0.2": version: 2.0.2 resolution: "is-negative-zero@npm:2.0.2" checksum: f3232194c47a549da60c3d509c9a09be442507616b69454716692e37ae9f37c4dea264fb208ad0c9f3efd15a796a46b79df07c7e53c6227c32170608b809149a languageName: node linkType: hard -"is-npm@npm:^5.0.0": - version: 5.0.0 - resolution: "is-npm@npm:5.0.0" - checksum: 9baff02b0c69a3d3c79b162cb2f9e67fb40ef6d172c16601b2e2471c21e9a4fa1fc9885a308d7bc6f3a3cd2a324c27fa0bf284c133c3349bb22571ab70d041cc - languageName: node - linkType: hard - "is-number-object@npm:^1.0.4": - version: 1.0.6 - resolution: "is-number-object@npm:1.0.6" + version: 1.0.7 + resolution: "is-number-object@npm:1.0.7" dependencies: has-tostringtag: ^1.0.0 - checksum: c697704e8fc2027fc41cb81d29805de4e8b6dc9c3efee93741dbf126a8ecc8443fef85adbc581415ae7e55d325e51d0a942324ae35c829131748cce39cba55f3 + checksum: d1e8d01bb0a7134c74649c4e62da0c6118a0bfc6771ea3c560914d52a627873e6920dd0fd0ebc0e12ad2ff4687eac4c308f7e80320b973b2c8a2c8f97a7524f7 languageName: node linkType: hard @@ -29801,13 +27588,6 @@ __metadata: languageName: node linkType: hard -"is-object@npm:^1.0.1": - version: 1.0.2 - resolution: "is-object@npm:1.0.2" - checksum: 971219c4b1985b9751f65e4c8296d3104f0457b0e8a70849e848a4a2208bc47317d73b3b85d4a369619cb2df8284dc22584cb2695a7d99aca5e8d0aa64fc075a - languageName: node - linkType: hard - "is-object@npm:~0.1.2": version: 0.1.2 resolution: "is-object@npm:0.1.2" @@ -29946,6 +27726,13 @@ __metadata: languageName: node linkType: hard +"is-regexp@npm:^3.0.0": + version: 3.1.0 + resolution: "is-regexp@npm:3.1.0" + checksum: d39dbd9892f0a25d01ee1a8e650c3f2e045bf7b1fa87eafb50b31dd29342869aa9135fd372628202254398956bf7f4b62094bdda39283ec2a9bb749fbb7f427c + languageName: node + linkType: hard + "is-resolvable@npm:^1.0.0": version: 1.1.0 resolution: "is-resolvable@npm:1.1.0" @@ -29953,13 +27740,6 @@ __metadata: languageName: node linkType: hard -"is-retry-allowed@npm:^1.0.0": - version: 1.2.0 - resolution: "is-retry-allowed@npm:1.2.0" - checksum: 50d700a89ae31926b1c91b3eb0104dbceeac8790d8b80d02f5c76d9a75c2056f1bb24b5268a8a018dead606bddf116b2262e5ac07401eb8b8783b266ed22558d - languageName: node - linkType: hard - "is-root@npm:^2.1.0": version: 2.1.0 resolution: "is-root@npm:2.1.0" @@ -29974,13 +27754,6 @@ __metadata: languageName: node linkType: hard -"is-shared-array-buffer@npm:^1.0.1": - version: 1.0.1 - resolution: "is-shared-array-buffer@npm:1.0.1" - checksum: 2ffb92533e64e2876e6cfe6906871d28400b6f1a53130fe652ec8007bc0e5044d05e7af8e31bdc992fbba520bd92938cfbeedd0f286be92f250c7c76191c4d90 - languageName: node - linkType: hard - "is-shared-array-buffer@npm:^1.0.2": version: 1.0.2 resolution: "is-shared-array-buffer@npm:1.0.2" @@ -29999,7 +27772,7 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^1.0.0, is-stream@npm:^1.0.1, is-stream@npm:^1.1.0": +"is-stream@npm:^1.0.1, is-stream@npm:^1.1.0": version: 1.1.0 resolution: "is-stream@npm:1.1.0" checksum: 063c6bec9d5647aa6d42108d4c59723d2bd4ae42135a2d4db6eadbd49b7ea05b750fd69d279e5c7c45cf9da753ad2c00d8978be354d65aa9f6bb434969c6a2ae @@ -30056,29 +27829,12 @@ __metadata: languageName: node linkType: hard -"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.9": - version: 1.1.10 - resolution: "is-typed-array@npm:1.1.10" +"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.12, is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.9": + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - checksum: aac6ecb59d4c56a1cdeb69b1f129154ef462bbffe434cb8a8235ca89b42f258b7ae94073c41b3cb7bce37f6a1733ad4499f07882d5d5093a7ba84dfc4ebb8017 - languageName: node - linkType: hard - -"is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.7": - version: 1.1.8 - resolution: "is-typed-array@npm:1.1.8" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - es-abstract: ^1.18.5 - foreach: ^2.0.5 - has-tostringtag: ^1.0.0 - checksum: aa0f9f0716e19e2fb8aef69e69e4205479d25ace778e2339fc910948115cde4b0d9aff9d5d1e8b80f09a5664998278e05e54ad3dc9cb12cefcf86db71084ed00 + which-typed-array: ^1.1.11 + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 languageName: node linkType: hard @@ -30126,7 +27882,7 @@ __metadata: languageName: node linkType: hard -"is-weakref@npm:^1.0.1, is-weakref@npm:^1.0.2": +"is-weakref@npm:^1.0.2": version: 1.0.2 resolution: "is-weakref@npm:1.0.2" dependencies: @@ -30153,9 +27909,9 @@ __metadata: linkType: hard "is-what@npm:^4.1.8": - version: 4.1.15 - resolution: "is-what@npm:4.1.15" - checksum: fe27f6cd4af41be59a60caf46ec09e3071bcc69b9b12a7c871c90f54360edb6d0bc7240cb944a251fb0afa3d35635d1cecea9e70709876b368a8285128d70a89 + version: 4.1.16 + resolution: "is-what@npm:4.1.16" + checksum: baf99e4b9f06003ceb3b2eea4a1e17179524ee3a6310dc44903eb675cfe3c0a17819ab057bb1ae6ba7ca4939ae4bdfcc6a0c4210a8457aff1756abd3607b713c languageName: node linkType: hard @@ -30175,13 +27931,6 @@ __metadata: languageName: node linkType: hard -"is-yarn-global@npm:^0.3.0": - version: 0.3.0 - resolution: "is-yarn-global@npm:0.3.0" - checksum: bca013d65fee2862024c9fbb3ba13720ffca2fe750095174c1c80922fdda16402b5c233f5ac9e265bc12ecb5446e7b7f519a32d9541788f01d4d44e24d2bf481 - languageName: node - linkType: hard - "is@npm:~0.2.6": version: 0.2.7 resolution: "is@npm:0.2.7" @@ -30302,10 +28051,10 @@ __metadata: languageName: node linkType: hard -"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.0.0-alpha.1, istanbul-lib-coverage@npm:^3.2.0": - version: 3.2.0 - resolution: "istanbul-lib-coverage@npm:3.2.0" - checksum: a2a545033b9d56da04a8571ed05c8120bf10e9bce01cf8633a3a2b0d1d83dff4ac4fe78d6d5673c27fc29b7f21a41d75f83a36be09f82a61c367b56aa73c1ff9 +"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": + version: 3.2.2 + resolution: "istanbul-lib-coverage@npm:3.2.2" + checksum: 2367407a8d13982d8f7a859a35e7f8dd5d8f75aae4bb5484ede3a9ea1b426dc245aff28b976a2af48ee759fdd9be374ce2bd2669b644f31e76c5f46a2e29a831 languageName: node linkType: hard @@ -30379,34 +28128,32 @@ __metadata: linkType: hard "istanbul-lib-instrument@npm:^5.0.4, istanbul-lib-instrument@npm:^5.1.0": - version: 5.1.0 - resolution: "istanbul-lib-instrument@npm:5.1.0" + version: 5.2.1 + resolution: "istanbul-lib-instrument@npm:5.2.1" dependencies: "@babel/core": ^7.12.3 "@babel/parser": ^7.14.7 "@istanbuljs/schema": ^0.1.2 istanbul-lib-coverage: ^3.2.0 semver: ^6.3.0 - checksum: 8b82e733c69fe9f94d2e21f3e5760c9bedb110329aa75df4bd40df95f1cac3bf38767e43f35b125cc547ceca7376b72ce7d95cc5238b7e9088345c7b589233d3 + checksum: bf16f1803ba5e51b28bbd49ed955a736488381e09375d830e42ddeb403855b2006f850711d95ad726f2ba3f1ae8e7366de7e51d2b9ac67dc4d80191ef7ddf272 languageName: node linkType: hard -"istanbul-lib-processinfo@npm:^2.0.2": - version: 2.0.2 - resolution: "istanbul-lib-processinfo@npm:2.0.2" +"istanbul-lib-instrument@npm:^6.0.0": + version: 6.0.1 + resolution: "istanbul-lib-instrument@npm:6.0.1" dependencies: - archy: ^1.0.0 - cross-spawn: ^7.0.0 - istanbul-lib-coverage: ^3.0.0-alpha.1 - make-dir: ^3.0.0 - p-map: ^3.0.0 - rimraf: ^3.0.0 - uuid: ^3.3.3 - checksum: 400bd0b25b623c172e48d37e5bdda7a58b2fe5beeedfeb03099aed3385223d31e4cfa6f9932be07bbf06cfd039023301bce81d3b70b9a20a79a38b0f12cb261a + "@babel/core": ^7.12.3 + "@babel/parser": ^7.14.7 + "@istanbuljs/schema": ^0.1.2 + istanbul-lib-coverage: ^3.2.0 + semver: ^7.5.4 + checksum: fb23472e739cfc9b027cefcd7d551d5e7ca7ff2817ae5150fab99fe42786a7f7b56a29a2aa8309c37092e18297b8003f9c274f50ca4360949094d17fbac81472 languageName: node linkType: hard -"istanbul-lib-processinfo@npm:^2.0.3": +"istanbul-lib-processinfo@npm:^2.0.2, istanbul-lib-processinfo@npm:^2.0.3": version: 2.0.3 resolution: "istanbul-lib-processinfo@npm:2.0.3" dependencies: @@ -30444,13 +28191,13 @@ __metadata: linkType: hard "istanbul-lib-report@npm:^3.0.0": - version: 3.0.0 - resolution: "istanbul-lib-report@npm:3.0.0" + version: 3.0.1 + resolution: "istanbul-lib-report@npm:3.0.1" dependencies: istanbul-lib-coverage: ^3.0.0 - make-dir: ^3.0.0 + make-dir: ^4.0.0 supports-color: ^7.1.0 - checksum: 3f29eb3f53c59b987386e07fe772d24c7f58c6897f34c9d7a296f4000de7ae3de9eb95c3de3df91dc65b134c84dee35c54eee572a56243e8907c48064e34ff1b + checksum: fd17a1b879e7faf9bb1dc8f80b2a16e9f5b7b8498fe6ed580a618c34df0bfe53d2abd35bf8a0a00e628fb7405462576427c7df20bbe4148d19c14b431c974b21 languageName: node linkType: hard @@ -30510,22 +28257,12 @@ __metadata: linkType: hard "istanbul-reports@npm:^3.0.2, istanbul-reports@npm:^3.1.3": - version: 3.1.4 - resolution: "istanbul-reports@npm:3.1.4" + version: 3.1.6 + resolution: "istanbul-reports@npm:3.1.6" dependencies: html-escaper: ^2.0.0 istanbul-lib-report: ^3.0.0 - checksum: 2132983355710c522f6b26808015cab9a0ee8b9f5ae0db0d3edeff40b886dd83cb670fb123cb7b32dbe59473d7c00cdde2ba6136bc0acdb20a865fccea64dfe1 - languageName: node - linkType: hard - -"isurl@npm:^1.0.0-alpha5": - version: 1.0.0 - resolution: "isurl@npm:1.0.0" - dependencies: - has-to-string-tag-x: ^1.2.0 - is-object: ^1.0.1 - checksum: 28a96e019269d57015fa5869f19dda5a3ed1f7b21e3e0c4ff695419bd0541547db352aa32ee4a3659e811a177b0e37a5bc1a036731e71939dd16b59808ab92bd + checksum: 44c4c0582f287f02341e9720997f9e82c071627e1e862895745d5f52ec72c9b9f38e1d12370015d2a71dcead794f34c7732aaef3fab80a24bc617a21c3d911d6 languageName: node linkType: hard @@ -30581,12 +28318,12 @@ __metadata: languageName: node linkType: hard -"it-pushable@npm:^3.0.0, it-pushable@npm:^3.2.0": - version: 3.2.1 - resolution: "it-pushable@npm:3.2.1" +"it-pushable@npm:^3.0.0, it-pushable@npm:^3.2.1": + version: 3.2.3 + resolution: "it-pushable@npm:3.2.3" dependencies: p-defer: ^4.0.0 - checksum: a23eaac8d1ec86785d0f3e71c67f1544cb1b99aff88c70d3043f3b87a9966c154ca387de76739f91dd744cd7815b40d20e9711a54079cc7ddaf36be54fd10c41 + checksum: 8b1d1ceb2a42b31b55119f9721b1f4568c498627470bac18479e6f8db3791fe1185653480cd1c319462bae3d64091bd9ca9e6e90e217e38a5ab7f078559ccca4 languageName: node linkType: hard @@ -30647,19 +28384,6 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^2.0.3": - version: 2.3.3 - resolution: "jackspeak@npm:2.3.3" - dependencies: - "@isaacs/cliui": ^8.0.2 - "@pkgjs/parseargs": ^0.11.0 - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 4313a7c0cc44c7753c4cb9869935f0b06f4cf96827515f63f58ff46b3d2f6e29aba6b3b5151778397c3f5ae67ef8bfc48871967bd10343c27e90cff198ec7808 - languageName: node - linkType: hard - "jackspeak@npm:^2.3.5": version: 2.3.6 resolution: "jackspeak@npm:2.3.6" @@ -30698,13 +28422,14 @@ __metadata: languageName: node linkType: hard -"jest-changed-files@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-changed-files@npm:29.5.0" +"jest-changed-files@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-changed-files@npm:29.7.0" dependencies: execa: ^5.0.0 + jest-util: ^29.7.0 p-limit: ^3.1.0 - checksum: a67a7cb3c11f8f92bd1b7c79e84f724cbd11a9ad51f3cdadafe3ce7ee3c79ee50dbea128f920f5fddc807e9e4e83f5462143094391feedd959a77dd20ab96cf3 + checksum: 963e203893c396c5dfc75e00a49426688efea7361b0f0e040035809cecd2d46b3c01c02be2d9e8d38b1138357d2de7719ea5b5be21f66c10f2e9685a5a73bb99 languageName: node linkType: hard @@ -30735,31 +28460,31 @@ __metadata: languageName: node linkType: hard -"jest-circus@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-circus@npm:29.6.2" +"jest-circus@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-circus@npm:29.7.0" dependencies: - "@jest/environment": ^29.6.2 - "@jest/expect": ^29.6.2 - "@jest/test-result": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/environment": ^29.7.0 + "@jest/expect": ^29.7.0 + "@jest/test-result": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" chalk: ^4.0.0 co: ^4.6.0 dedent: ^1.0.0 is-generator-fn: ^2.0.0 - jest-each: ^29.6.2 - jest-matcher-utils: ^29.6.2 - jest-message-util: ^29.6.2 - jest-runtime: ^29.6.2 - jest-snapshot: ^29.6.2 - jest-util: ^29.6.2 + jest-each: ^29.7.0 + jest-matcher-utils: ^29.7.0 + jest-message-util: ^29.7.0 + jest-runtime: ^29.7.0 + jest-snapshot: ^29.7.0 + jest-util: ^29.7.0 p-limit: ^3.1.0 - pretty-format: ^29.6.2 + pretty-format: ^29.7.0 pure-rand: ^6.0.0 slash: ^3.0.0 stack-utils: ^2.0.3 - checksum: 4f5a96a68c3c808c3d5a9279a2f39a2937386e2cebba5096971f267d79562ce2133a13bc05356a39f8f1ba68fcfe1eb39c4572b3fb0f91affbd932950e89c1e3 + checksum: 349437148924a5a109c9b8aad6d393a9591b4dac1918fc97d81b7fc515bc905af9918495055071404af1fab4e48e4b04ac3593477b1d5dcf48c4e71b527c70a7 languageName: node linkType: hard @@ -30791,20 +28516,19 @@ __metadata: linkType: hard "jest-cli@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-cli@npm:29.6.2" + version: 29.7.0 + resolution: "jest-cli@npm:29.7.0" dependencies: - "@jest/core": ^29.6.2 - "@jest/test-result": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/core": ^29.7.0 + "@jest/test-result": ^29.7.0 + "@jest/types": ^29.6.3 chalk: ^4.0.0 + create-jest: ^29.7.0 exit: ^0.1.2 - graceful-fs: ^4.2.9 import-local: ^3.0.2 - jest-config: ^29.6.2 - jest-util: ^29.6.2 - jest-validate: ^29.6.2 - prompts: ^2.0.1 + jest-config: ^29.7.0 + jest-util: ^29.7.0 + jest-validate: ^29.7.0 yargs: ^17.3.1 peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -30813,7 +28537,7 @@ __metadata: optional: true bin: jest: bin/jest.js - checksum: 0b7b09ae4bd327caf1981eac5a14679ddda3c5c836c9f8ea0ecfe1e5e10e9a39a5ed783fa38d25383604c4d3405595e74b391d955e99aea7e51acb41a59ea108 + checksum: 664901277a3f5007ea4870632ed6e7889db9da35b2434e7cb488443e6bf5513889b344b7fddf15112135495b9875892b156faeb2d7391ddb9e2a849dcb7b6c36 languageName: node linkType: hard @@ -30854,30 +28578,30 @@ __metadata: languageName: node linkType: hard -"jest-config@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-config@npm:29.6.2" +"jest-config@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-config@npm:29.7.0" dependencies: "@babel/core": ^7.11.6 - "@jest/test-sequencer": ^29.6.2 - "@jest/types": ^29.6.1 - babel-jest: ^29.6.2 + "@jest/test-sequencer": ^29.7.0 + "@jest/types": ^29.6.3 + babel-jest: ^29.7.0 chalk: ^4.0.0 ci-info: ^3.2.0 deepmerge: ^4.2.2 glob: ^7.1.3 graceful-fs: ^4.2.9 - jest-circus: ^29.6.2 - jest-environment-node: ^29.6.2 - jest-get-type: ^29.4.3 - jest-regex-util: ^29.4.3 - jest-resolve: ^29.6.2 - jest-runner: ^29.6.2 - jest-util: ^29.6.2 - jest-validate: ^29.6.2 + jest-circus: ^29.7.0 + jest-environment-node: ^29.7.0 + jest-get-type: ^29.6.3 + jest-regex-util: ^29.6.3 + jest-resolve: ^29.7.0 + jest-runner: ^29.7.0 + jest-util: ^29.7.0 + jest-validate: ^29.7.0 micromatch: ^4.0.4 parse-json: ^5.2.0 - pretty-format: ^29.6.2 + pretty-format: ^29.7.0 slash: ^3.0.0 strip-json-comments: ^3.1.1 peerDependencies: @@ -30888,7 +28612,7 @@ __metadata: optional: true ts-node: optional: true - checksum: 3bd104a3ac2dd9d34986238142437606354169766dcf88359a7a12ac106d0dc17dcc6b627e4f20db97a58bac5b0502b5436c9cc4722b3629b2a114bba6da9128 + checksum: 4cabf8f894c180cac80b7df1038912a3fc88f96f2622de33832f4b3314f83e22b08fb751da570c0ab2b7988f21604bdabade95e3c0c041068ac578c085cf7dff languageName: node linkType: hard @@ -30904,19 +28628,7 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.0.0, jest-diff@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-diff@npm:29.6.2" - dependencies: - chalk: ^4.0.0 - diff-sequences: ^29.4.3 - jest-get-type: ^29.4.3 - pretty-format: ^29.6.2 - checksum: 0effd66a0c23f8c139ebf7ca99ed30b479b86fff66f19ad4869f130aaf7ae6a24ca1533f697b7e4930cbe2ddffc85387723fcca673501c653fb77a38f538e959 - languageName: node - linkType: hard - -"jest-diff@npm:^29.2.0": +"jest-diff@npm:^29.0.0, jest-diff@npm:^29.2.0, jest-diff@npm:^29.7.0": version: 29.7.0 resolution: "jest-diff@npm:29.7.0" dependencies: @@ -30937,12 +28649,12 @@ __metadata: languageName: node linkType: hard -"jest-docblock@npm:^29.4.3": - version: 29.4.3 - resolution: "jest-docblock@npm:29.4.3" +"jest-docblock@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-docblock@npm:29.7.0" dependencies: detect-newline: ^3.0.0 - checksum: e0e9df1485bb8926e5b33478cdf84b3387d9caf3658e7dc1eaa6dc34cb93dea0d2d74797f6e940f0233a88f3dadd60957f2288eb8f95506361f85b84bf8661df + checksum: 66390c3e9451f8d96c5da62f577a1dad701180cfa9b071c5025acab2f94d7a3efc2515cfa1654ebe707213241541ce9c5530232cdc8017c91ed64eea1bd3b192 languageName: node linkType: hard @@ -30959,16 +28671,16 @@ __metadata: languageName: node linkType: hard -"jest-each@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-each@npm:29.6.2" +"jest-each@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-each@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 chalk: ^4.0.0 - jest-get-type: ^29.4.3 - jest-util: ^29.6.2 - pretty-format: ^29.6.2 - checksum: b64194f4ca27afc6070a42b7ecccbc68be0ded19a849f8cd8f91a2abb23fadae2d38d47559a315f4d1f576927761f3ea437a75ab6cf19206332abb8527d7c165 + jest-get-type: ^29.6.3 + jest-util: ^29.7.0 + pretty-format: ^29.7.0 + checksum: e88f99f0184000fc8813f2a0aa79e29deeb63700a3b9b7928b8a418d7d93cd24933608591dbbdea732b473eb2021c72991b5cc51a17966842841c6e28e6f691c languageName: node linkType: hard @@ -31001,17 +28713,17 @@ __metadata: languageName: node linkType: hard -"jest-environment-node@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-environment-node@npm:29.6.2" +"jest-environment-node@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-environment-node@npm:29.7.0" dependencies: - "@jest/environment": ^29.6.2 - "@jest/fake-timers": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/environment": ^29.7.0 + "@jest/fake-timers": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" - jest-mock: ^29.6.2 - jest-util: ^29.6.2 - checksum: 0b754ac2d3bdb7ce5d6fc28595b9d1c64176f20506b6f773b18b0280ab0b396ed7d927c8519779d3c560fa2b13236ee7077092ccb19a13bea23d40dd30f06450 + jest-mock: ^29.7.0 + jest-util: ^29.7.0 + checksum: 501a9966292cbe0ca3f40057a37587cb6def25e1e0c5e39ac6c650fe78d3c70a2428304341d084ac0cced5041483acef41c477abac47e9a290d5545fd2f15646 languageName: node linkType: hard @@ -31037,14 +28749,7 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^29.0.0, jest-get-type@npm:^29.4.3": - version: 29.4.3 - resolution: "jest-get-type@npm:29.4.3" - checksum: 6ac7f2dde1c65e292e4355b6c63b3a4897d7e92cb4c8afcf6d397f2682f8080e094c8b0b68205a74d269882ec06bf696a9de6cd3e1b7333531e5ed7b112605ce - languageName: node - linkType: hard - -"jest-get-type@npm:^29.6.3": +"jest-get-type@npm:^29.0.0, jest-get-type@npm:^29.6.3": version: 29.6.3 resolution: "jest-get-type@npm:29.6.3" checksum: 88ac9102d4679d768accae29f1e75f592b760b44277df288ad76ce5bf038c3f5ce3719dea8aa0f035dac30e9eb034b848ce716b9183ad7cc222d029f03e92205 @@ -31075,26 +28780,26 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-haste-map@npm:29.6.2" +"jest-haste-map@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-haste-map@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@types/graceful-fs": ^4.1.3 "@types/node": "*" anymatch: ^3.0.3 fb-watchman: ^2.0.0 fsevents: ^2.3.2 graceful-fs: ^4.2.9 - jest-regex-util: ^29.4.3 - jest-util: ^29.6.2 - jest-worker: ^29.6.2 + jest-regex-util: ^29.6.3 + jest-util: ^29.7.0 + jest-worker: ^29.7.0 micromatch: ^4.0.4 walker: ^1.0.8 dependenciesMeta: fsevents: optional: true - checksum: 726233972030eb2e5bce6c9468e497310436b455c88b40e744bd053e20a6f3ff19aec340edcbd89537c629ed5cf8916506bc895d690cc39a0862c74dcd95b7b8 + checksum: c2c8f2d3e792a963940fbdfa563ce14ef9e14d4d86da645b96d3cd346b8d35c5ce0b992ee08593939b5f718cf0a1f5a90011a056548a1dbf58397d4356786f01 languageName: node linkType: hard @@ -31133,13 +28838,13 @@ __metadata: languageName: node linkType: hard -"jest-leak-detector@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-leak-detector@npm:29.6.2" +"jest-leak-detector@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-leak-detector@npm:29.7.0" dependencies: - jest-get-type: ^29.4.3 - pretty-format: ^29.6.2 - checksum: e00152acdba8aa8f9334775b77375947508051c34646fbeb702275da2b6ac6145f8cad6d5893112e76484d00fa8c0b4fd71b78ab0b4ef34950f5b6a84f37ae67 + jest-get-type: ^29.6.3 + pretty-format: ^29.7.0 + checksum: e3950e3ddd71e1d0c22924c51a300a1c2db6cf69ec1e51f95ccf424bcc070f78664813bef7aed4b16b96dfbdeea53fe358f8aeaaea84346ae15c3735758f1605 languageName: node linkType: hard @@ -31155,15 +28860,15 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-matcher-utils@npm:29.6.2" +"jest-matcher-utils@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-matcher-utils@npm:29.7.0" dependencies: chalk: ^4.0.0 - jest-diff: ^29.6.2 - jest-get-type: ^29.4.3 - pretty-format: ^29.6.2 - checksum: 3e1b65dd30d05f75fe56dc45fbe4135aec2ff96a3d1e21afbf6a66f3a45a7e29cd0fd37cf80b9564e0381d6205833f77ccaf766c6f7e1aad6b7924d117be504e + jest-diff: ^29.7.0 + jest-get-type: ^29.6.3 + pretty-format: ^29.7.0 + checksum: d7259e5f995d915e8a37a8fd494cb7d6af24cd2a287b200f831717ba0d015190375f9f5dc35393b8ba2aae9b2ebd60984635269c7f8cff7d85b077543b7744cd languageName: node linkType: hard @@ -31201,20 +28906,20 @@ __metadata: languageName: node linkType: hard -"jest-message-util@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-message-util@npm:29.6.2" +"jest-message-util@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-message-util@npm:29.7.0" dependencies: "@babel/code-frame": ^7.12.13 - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@types/stack-utils": ^2.0.0 chalk: ^4.0.0 graceful-fs: ^4.2.9 micromatch: ^4.0.4 - pretty-format: ^29.6.2 + pretty-format: ^29.7.0 slash: ^3.0.0 stack-utils: ^2.0.3 - checksum: e8e3c8d2301e2ca4038ed6df8cbba7fedc6949d1ede4c0e3f1f44f53afb56d77eb35983fa460140d0eadeab99a5f3ae04b703fe77cd7b316b40b361228b5aa1a + checksum: a9d025b1c6726a2ff17d54cc694de088b0489456c69106be6b615db7a51b7beb66788bea7a59991a019d924fbf20f67d085a445aedb9a4d6760363f4d7d09930 languageName: node linkType: hard @@ -31228,26 +28933,26 @@ __metadata: languageName: node linkType: hard -"jest-mock@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-mock@npm:29.6.2" +"jest-mock@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-mock@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@types/node": "*" - jest-util: ^29.6.2 - checksum: 0bacb5d58441462c0e531ec4d2f7377eecbe21f664d8a460e72f94ba61d22635028931678e7a0f1c3e3f5894973db8e409432f7db4c01283456c8fdbd85f5b3b + jest-util: ^29.7.0 + checksum: 81ba9b68689a60be1482212878973700347cb72833c5e5af09895882b9eb5c4e02843a1bbdf23f94c52d42708bab53a30c45a3482952c9eec173d1eaac5b86c5 languageName: node linkType: hard "jest-pnp-resolver@npm:^1.2.2": - version: 1.2.2 - resolution: "jest-pnp-resolver@npm:1.2.2" + version: 1.2.3 + resolution: "jest-pnp-resolver@npm:1.2.3" peerDependencies: jest-resolve: "*" peerDependenciesMeta: jest-resolve: optional: true - checksum: bd85dcc0e76e0eb0c3d56382ec140f08d25ff4068cda9d0e360bb78fb176cb726d0beab82dc0e8694cafd09f55fee7622b8bcb240afa5fad301f4ed3eebb4f47 + checksum: db1a8ab2cb97ca19c01b1cfa9a9c8c69a143fde833c14df1fab0766f411b1148ff0df878adea09007ac6a2085ec116ba9a996a6ad104b1e58c20adbf88eed9b2 languageName: node linkType: hard @@ -31265,10 +28970,10 @@ __metadata: languageName: node linkType: hard -"jest-regex-util@npm:^29.4.3": - version: 29.4.3 - resolution: "jest-regex-util@npm:29.4.3" - checksum: 96fc7fc28cd4dd73a63c13a526202c4bd8b351d4e5b68b1a2a2c88da3308c2a16e26feaa593083eb0bac38cca1aa9dd05025412e7de013ba963fb8e66af22b8a +"jest-regex-util@npm:^29.6.3": + version: 29.6.3 + resolution: "jest-regex-util@npm:29.6.3" + checksum: 0518beeb9bf1228261695e54f0feaad3606df26a19764bc19541e0fc6e2a3737191904607fb72f3f2ce85d9c16b28df79b7b1ec9443aa08c3ef0e9efda6f8f2a languageName: node linkType: hard @@ -31283,13 +28988,13 @@ __metadata: languageName: node linkType: hard -"jest-resolve-dependencies@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-resolve-dependencies@npm:29.6.2" +"jest-resolve-dependencies@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-resolve-dependencies@npm:29.7.0" dependencies: - jest-regex-util: ^29.4.3 - jest-snapshot: ^29.6.2 - checksum: d40ee11af2c9d2ef0dbbcf9a5b7dda37c2b86cf4e5de1705795919fd8927907569115c502116ab56de0dca576d5faa31ec9b636240333b6830a568a63004da17 + jest-regex-util: ^29.6.3 + jest-snapshot: ^29.7.0 + checksum: aeb75d8150aaae60ca2bb345a0d198f23496494677cd6aefa26fc005faf354061f073982175daaf32b4b9d86b26ca928586344516e3e6969aa614cb13b883984 languageName: node linkType: hard @@ -31311,20 +29016,20 @@ __metadata: languageName: node linkType: hard -"jest-resolve@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-resolve@npm:29.6.2" +"jest-resolve@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-resolve@npm:29.7.0" dependencies: chalk: ^4.0.0 graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.2 + jest-haste-map: ^29.7.0 jest-pnp-resolver: ^1.2.2 - jest-util: ^29.6.2 - jest-validate: ^29.6.2 + jest-util: ^29.7.0 + jest-validate: ^29.7.0 resolve: ^1.20.0 resolve.exports: ^2.0.0 slash: ^3.0.0 - checksum: 01721957e61821a576b2ded043eeab8b392166e0e6d8d680f75657737e2ea7481ff29c2716b866ccd12e743f3a8da465504b1028e78b6a3c68b9561303de7ec8 + checksum: 0ca218e10731aa17920526ec39deaec59ab9b966237905ffc4545444481112cd422f01581230eceb7e82d86f44a543d520a71391ec66e1b4ef1a578bd5c73487 languageName: node linkType: hard @@ -31357,32 +29062,32 @@ __metadata: languageName: node linkType: hard -"jest-runner@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-runner@npm:29.6.2" +"jest-runner@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-runner@npm:29.7.0" dependencies: - "@jest/console": ^29.6.2 - "@jest/environment": ^29.6.2 - "@jest/test-result": ^29.6.2 - "@jest/transform": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/console": ^29.7.0 + "@jest/environment": ^29.7.0 + "@jest/test-result": ^29.7.0 + "@jest/transform": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" chalk: ^4.0.0 emittery: ^0.13.1 graceful-fs: ^4.2.9 - jest-docblock: ^29.4.3 - jest-environment-node: ^29.6.2 - jest-haste-map: ^29.6.2 - jest-leak-detector: ^29.6.2 - jest-message-util: ^29.6.2 - jest-resolve: ^29.6.2 - jest-runtime: ^29.6.2 - jest-util: ^29.6.2 - jest-watcher: ^29.6.2 - jest-worker: ^29.6.2 + jest-docblock: ^29.7.0 + jest-environment-node: ^29.7.0 + jest-haste-map: ^29.7.0 + jest-leak-detector: ^29.7.0 + jest-message-util: ^29.7.0 + jest-resolve: ^29.7.0 + jest-runtime: ^29.7.0 + jest-util: ^29.7.0 + jest-watcher: ^29.7.0 + jest-worker: ^29.7.0 p-limit: ^3.1.0 source-map-support: 0.5.13 - checksum: 46bd506a08ddf79628a509aed4105ab74c0b03727a3e24c90bbc2915531860b3da99f7ace2fd9603194440553cffac9cfb1a3b7d0ce03d5fc9c5f2d5ffbb3d3f + checksum: f0405778ea64812bf9b5c50b598850d94ccf95d7ba21f090c64827b41decd680ee19fcbb494007cdd7f5d0d8906bfc9eceddd8fa583e753e736ecd462d4682fb languageName: node linkType: hard @@ -31416,33 +29121,33 @@ __metadata: languageName: node linkType: hard -"jest-runtime@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-runtime@npm:29.6.2" - dependencies: - "@jest/environment": ^29.6.2 - "@jest/fake-timers": ^29.6.2 - "@jest/globals": ^29.6.2 - "@jest/source-map": ^29.6.0 - "@jest/test-result": ^29.6.2 - "@jest/transform": ^29.6.2 - "@jest/types": ^29.6.1 +"jest-runtime@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-runtime@npm:29.7.0" + dependencies: + "@jest/environment": ^29.7.0 + "@jest/fake-timers": ^29.7.0 + "@jest/globals": ^29.7.0 + "@jest/source-map": ^29.6.3 + "@jest/test-result": ^29.7.0 + "@jest/transform": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" chalk: ^4.0.0 cjs-module-lexer: ^1.0.0 collect-v8-coverage: ^1.0.0 glob: ^7.1.3 graceful-fs: ^4.2.9 - jest-haste-map: ^29.6.2 - jest-message-util: ^29.6.2 - jest-mock: ^29.6.2 - jest-regex-util: ^29.4.3 - jest-resolve: ^29.6.2 - jest-snapshot: ^29.6.2 - jest-util: ^29.6.2 + jest-haste-map: ^29.7.0 + jest-message-util: ^29.7.0 + jest-mock: ^29.7.0 + jest-regex-util: ^29.6.3 + jest-resolve: ^29.7.0 + jest-snapshot: ^29.7.0 + jest-util: ^29.7.0 slash: ^3.0.0 strip-bom: ^4.0.0 - checksum: 8e7e4486b23b01a9c407313681bed0def39680c2ae21cf01347f111983252ec3a024c56493c5411fed53633f02863eed0816099110cbe04b3889aa5babf1042d + checksum: d19f113d013e80691e07047f68e1e3448ef024ff2c6b586ce4f90cd7d4c62a2cd1d460110491019719f3c59bfebe16f0e201ed005ef9f80e2cf798c374eed54e languageName: node linkType: hard @@ -31486,31 +29191,31 @@ __metadata: languageName: node linkType: hard -"jest-snapshot@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-snapshot@npm:29.6.2" +"jest-snapshot@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-snapshot@npm:29.7.0" dependencies: "@babel/core": ^7.11.6 "@babel/generator": ^7.7.2 "@babel/plugin-syntax-jsx": ^7.7.2 "@babel/plugin-syntax-typescript": ^7.7.2 "@babel/types": ^7.3.3 - "@jest/expect-utils": ^29.6.2 - "@jest/transform": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/expect-utils": ^29.7.0 + "@jest/transform": ^29.7.0 + "@jest/types": ^29.6.3 babel-preset-current-node-syntax: ^1.0.0 chalk: ^4.0.0 - expect: ^29.6.2 + expect: ^29.7.0 graceful-fs: ^4.2.9 - jest-diff: ^29.6.2 - jest-get-type: ^29.4.3 - jest-matcher-utils: ^29.6.2 - jest-message-util: ^29.6.2 - jest-util: ^29.6.2 + jest-diff: ^29.7.0 + jest-get-type: ^29.6.3 + jest-matcher-utils: ^29.7.0 + jest-message-util: ^29.7.0 + jest-util: ^29.7.0 natural-compare: ^1.4.0 - pretty-format: ^29.6.2 + pretty-format: ^29.7.0 semver: ^7.5.3 - checksum: c1c70a9dbce7fca62ed73ac38234b4ee643e8b667acf71b4417ab67776c1188bb08b8ad450e56a2889ad182903ffd416386fa8082a477724ccf8d8c29a4c6906 + checksum: 86821c3ad0b6899521ce75ee1ae7b01b17e6dfeff9166f2cf17f012e0c5d8c798f30f9e4f8f7f5bed01ea7b55a6bc159f5eda778311162cbfa48785447c237ad languageName: node linkType: hard @@ -31542,31 +29247,17 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^29.0.0": - version: 29.5.0 - resolution: "jest-util@npm:29.5.0" - dependencies: - "@jest/types": ^29.5.0 - "@types/node": "*" - chalk: ^4.0.0 - ci-info: ^3.2.0 - graceful-fs: ^4.2.9 - picomatch: ^2.2.3 - checksum: fd9212950d34d2ecad8c990dda0d8ea59a8a554b0c188b53ea5d6c4a0829a64f2e1d49e6e85e812014933d17426d7136da4785f9cf76fff1799de51b88bc85d3 - languageName: node - linkType: hard - -"jest-util@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-util@npm:29.6.2" +"jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-util@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 "@types/node": "*" chalk: ^4.0.0 ci-info: ^3.2.0 graceful-fs: ^4.2.9 picomatch: ^2.2.3 - checksum: 8aedc0c80083d0cabd6c6c4f04dea1cbcac609fd7bc3b1fc05a3999291bd6e63dd52b0c806f9378d5cae28eff5a6191709a4987861001293f8d03e53984adca4 + checksum: 042ab4980f4ccd4d50226e01e5c7376a8556b472442ca6091a8f102488c0f22e6e8b89ea874111d2328a2080083bf3225c86f3788c52af0bd0345a00eb57a3ca languageName: node linkType: hard @@ -31584,17 +29275,17 @@ __metadata: languageName: node linkType: hard -"jest-validate@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-validate@npm:29.6.2" +"jest-validate@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-validate@npm:29.7.0" dependencies: - "@jest/types": ^29.6.1 + "@jest/types": ^29.6.3 camelcase: ^6.2.0 chalk: ^4.0.0 - jest-get-type: ^29.4.3 + jest-get-type: ^29.6.3 leven: ^3.1.0 - pretty-format: ^29.6.2 - checksum: 32648d002189c0ad8a958eace7c6b7d05ea1dc440a1b91e0f22dc1aef489899446ec80b2d527fd13713862d89dfb4606e24a3bf8a10c4ddac3c911e93b7f0374 + pretty-format: ^29.7.0 + checksum: 191fcdc980f8a0de4dbdd879fa276435d00eb157a48683af7b3b1b98b0f7d9de7ffe12689b617779097ff1ed77601b9f7126b0871bba4f776e222c40f62e9dae languageName: node linkType: hard @@ -31646,19 +29337,19 @@ __metadata: languageName: node linkType: hard -"jest-watcher@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-watcher@npm:29.6.2" +"jest-watcher@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-watcher@npm:29.7.0" dependencies: - "@jest/test-result": ^29.6.2 - "@jest/types": ^29.6.1 + "@jest/test-result": ^29.7.0 + "@jest/types": ^29.6.3 "@types/node": "*" ansi-escapes: ^4.2.1 chalk: ^4.0.0 emittery: ^0.13.1 - jest-util: ^29.6.2 + jest-util: ^29.7.0 string-length: ^4.0.1 - checksum: 14624190fc8b5fbae466a2ec81458a88c15716d99f042bb4674d53e9623d305cb2905bc1dffeda05fd1a10a05c2a83efe5ac41942477e2b15eaebb08d0aaab32 + checksum: 67e6e7fe695416deff96b93a14a561a6db69389a0667e9489f24485bb85e5b54e12f3b2ba511ec0b777eca1e727235b073e3ebcdd473d68888650489f88df92f languageName: node linkType: hard @@ -31705,15 +29396,15 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^29.6.2": - version: 29.6.2 - resolution: "jest-worker@npm:29.6.2" +"jest-worker@npm:^29.7.0": + version: 29.7.0 + resolution: "jest-worker@npm:29.7.0" dependencies: "@types/node": "*" - jest-util: ^29.6.2 + jest-util: ^29.7.0 merge-stream: ^2.0.0 supports-color: ^8.0.0 - checksum: 11035564534bf181ead80b25be138c2d42372bd5626151a3e705200d47a74fd9da3ca79f8a7b15806cdc325ad73c3d21d23acceeed99d50941589ff02915ed38 + checksum: 30fff60af49675273644d408b650fc2eb4b5dcafc5a0a455f238322a8f9d8a98d847baca9d51ff197b6747f54c7901daa2287799230b856a0f48287d131f8c13 languageName: node linkType: hard @@ -31754,12 +29445,12 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^1.18.2": - version: 1.20.0 - resolution: "jiti@npm:1.20.0" +"jiti@npm:^1.18.2, jiti@npm:^1.19.1": + version: 1.21.0 + resolution: "jiti@npm:1.21.0" bin: jiti: bin/jiti.js - checksum: 7924062b5675142e3e272a27735be84b7bfc0a0eb73217fc2dcafa034f37c4f7b4b9ffc07dd98bcff0f739a8811ce1544db205ae7e97b1c86f0df92c65ce3c72 + checksum: a7bd5d63921c170eaec91eecd686388181c7828e1fa0657ab374b9372bfc1f383cf4b039e6b272383d5cb25607509880af814a39abdff967322459cca41f2961 languageName: node linkType: hard @@ -31802,9 +29493,9 @@ __metadata: linkType: hard "js-sdsl@npm:^4.1.4": - version: 4.4.0 - resolution: "js-sdsl@npm:4.4.0" - checksum: 7bb08a2d746ab7ff742720339aa006c631afe05e77d11eda988c1c35fae8e03e492e4e347e883e786e3ce6170685d4780c125619111f0730c11fdb41b04059c7 + version: 4.4.2 + resolution: "js-sdsl@npm:4.4.2" + checksum: ba705adc1788bf3c6f6c8e5077824f2bb4f0acab5a984420ce5cc492c7fff3daddc26335ad2c9a67d4f5e3241ec790f9e5b72a625adcf20cf321d2fd85e62b8b languageName: node linkType: hard @@ -31969,9 +29660,9 @@ __metadata: linkType: hard "json-parse-even-better-errors@npm:^3.0.0": - version: 3.0.0 - resolution: "json-parse-even-better-errors@npm:3.0.0" - checksum: f1970b5220c7fa23d888565510752c3d5e863f93668a202fcaa719739fa41485dfc6a1db212f702ebd3c873851cc067aebc2917e3f79763cae2fdb95046f38f3 + version: 3.0.1 + resolution: "json-parse-even-better-errors@npm:3.0.1" + checksum: bf74fa3f715e56699ccd68b80a7d20908de432a3fae2d5aa2ed530a148e9d9ccdf8e6983b93d9966a553aa70dcf003ce3a7ffec2c0ce74d2a6173e3691a426f0 languageName: node linkType: hard @@ -32035,7 +29726,7 @@ __metadata: languageName: node linkType: hard -"json-stable-stringify@npm:1.0.2, json-stable-stringify@npm:^1.0.0, json-stable-stringify@npm:^1.0.1": +"json-stable-stringify@npm:1.0.2": version: 1.0.2 resolution: "json-stable-stringify@npm:1.0.2" dependencies: @@ -32044,6 +29735,18 @@ __metadata: languageName: node linkType: hard +"json-stable-stringify@npm:^1.0.0, json-stable-stringify@npm:^1.0.1": + version: 1.1.0 + resolution: "json-stable-stringify@npm:1.1.0" + dependencies: + call-bind: ^1.0.5 + isarray: ^2.0.5 + jsonify: ^0.0.1 + object-keys: ^1.1.1 + checksum: 98e74dd45d3e93aa7cb5351b9f55475e15a8a7b57f401897373a1a1bbe41a6757f8b8d24f2bff0594893eccde616efe71bbaea2c1fdc1f67e8c39bcb9ee993e2 + languageName: node + linkType: hard + "json-stringify-nice@npm:^1.1.4": version: 1.1.4 resolution: "json-stringify-nice@npm:1.1.4" @@ -32058,7 +29761,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:2.2.3, json5@npm:^2.2.0, json5@npm:^2.2.2, json5@npm:^2.2.3": +"json5@npm:2.2.3, json5@npm:^2.1.1, json5@npm:^2.1.2, json5@npm:^2.2.0, json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -32078,29 +29781,13 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.1.1, json5@npm:^2.1.2, json5@npm:^2.2.1": - version: 2.2.2 - resolution: "json5@npm:2.2.2" - bin: - json5: lib/cli.js - checksum: 9a878d66b72157b073cf0017f3e5d93ec209fa5943abcb38d37a54b208917c166bd473c26a24695e67a016ce65759aeb89946592991f8f9174fb96c8e2492683 - languageName: node - linkType: hard - -"jsonc-parser@npm:3.2.0, jsonc-parser@npm:^3.2.0": +"jsonc-parser@npm:3.2.0, jsonc-parser@npm:^3.0.0, jsonc-parser@npm:^3.2.0": version: 3.2.0 resolution: "jsonc-parser@npm:3.2.0" checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 languageName: node linkType: hard -"jsonc-parser@npm:^3.0.0": - version: 3.0.0 - resolution: "jsonc-parser@npm:3.0.0" - checksum: 1df2326f1f9688de30c70ff19c5b2a83ba3b89a1036160da79821d1361090775e9db502dc57a67c11b56e1186fc1ed70b887f25c5febf9a3ec4f91435836c99d - languageName: node - linkType: hard - "jsonfile@npm:^2.1.0": version: 2.4.0 resolution: "jsonfile@npm:2.4.0" @@ -32138,20 +29825,13 @@ __metadata: languageName: node linkType: hard -"jsonify@npm:^0.0.1": +"jsonify@npm:^0.0.1, jsonify@npm:~0.0.0": version: 0.0.1 resolution: "jsonify@npm:0.0.1" checksum: 027287e1c0294fce15f18c0ff990cfc2318e7f01fb76515f784d5cd0784abfec6fc5c2355c3a2f2cb0ad7f4aa2f5b74ebbfe4e80476c35b2d13cabdb572e1134 languageName: node linkType: hard -"jsonify@npm:~0.0.0": - version: 0.0.0 - resolution: "jsonify@npm:0.0.0" - checksum: d8d4ed476c116e6987a460dcb82f22284686caae9f498ac87b0502c1765ac1522f4f450a4cad4cc368d202fd3b27a3860735140a82867fc6d558f5f199c38bce - languageName: node - linkType: hard - "jsonparse@npm:^1.2.0, jsonparse@npm:^1.3.1": version: 1.3.1 resolution: "jsonparse@npm:1.3.1" @@ -32159,6 +29839,17 @@ __metadata: languageName: node linkType: hard +"jsonpath@npm:^1.1.1": + version: 1.1.1 + resolution: "jsonpath@npm:1.1.1" + dependencies: + esprima: 1.2.2 + static-eval: 2.0.2 + underscore: 1.12.1 + checksum: 5480d8e9e424fe2ed4ade6860b6e2cefddb21adb3a99abe0254cd9428e8ef9b0c9fb5729d6a5a514e90df50d645ccea9f3be48d627570e6222dd5dadc28eba7b + languageName: node + linkType: hard + "jsonpointer@npm:^5.0.0": version: 5.0.1 resolution: "jsonpointer@npm:5.0.1" @@ -32196,7 +29887,7 @@ __metadata: languageName: node linkType: hard -"jsrsasign@npm:10.5.25, jsrsasign@npm:^10.4.0": +"jsrsasign@npm:10.5.25": version: 10.5.25 resolution: "jsrsasign@npm:10.5.25" checksum: e789cd6d5e6e236edebe91936279cdef886aafaab8d4ebc7d40b8ba0c7b7cd0d6d3c53fba26ea96eb33cc77a05368b369ef31fc9182662bce2344143ad50ea0f @@ -32210,10 +29901,10 @@ __metadata: languageName: node linkType: hard -"jsrsasign@npm:^10.5.25": - version: 10.5.26 - resolution: "jsrsasign@npm:10.5.26" - checksum: 1d717c7a0d2e4e745f4c819b0291a2f7a3c200001fce00c112fb9566d8f7bce108a86721a6eba804ca56f67885cfbf23167e592df1e568ca6f9855ca1f050682 +"jsrsasign@npm:^10.4.0, jsrsasign@npm:^10.5.25": + version: 10.9.0 + resolution: "jsrsasign@npm:10.9.0" + checksum: 6ddb6943660a3ebe7c72f2089adf16d9644cd68fb775910fd7ca925d9191cad5a84f6975a0e7d337a8b1ea762309abfcffff0b8f4624c23f97921076c6bb9679 languageName: node linkType: hard @@ -32224,7 +29915,7 @@ __metadata: languageName: node linkType: hard -"jsx-ast-utils@npm:^2.4.1 || ^3.0.0, jsx-ast-utils@npm:^3.3.3": +"jsx-ast-utils@npm:^2.4.1 || ^3.0.0, jsx-ast-utils@npm:^3.3.5": version: 3.3.5 resolution: "jsx-ast-utils@npm:3.3.5" dependencies: @@ -32237,9 +29928,9 @@ __metadata: linkType: hard "junk@npm:^4.0.0": - version: 4.0.0 - resolution: "junk@npm:4.0.0" - checksum: af79841fbdc0f3a8ec328a4bf68381013c7f52a78821184855a4b19ef95713edb3c30cd144c6393e6159e1b7dfb76b3f682dc983aafb54e52ff321ab1b4a9983 + version: 4.0.1 + resolution: "junk@npm:4.0.1" + checksum: 4f0c94c0b2e46172284d9eaeb57bf1b784d86d218dbc673a1c8e08ef3443d03164238eb067591d0ad9f2c76a6ad012aeb618bb8135a2f0f26a6da931058e131b languageName: node linkType: hard @@ -32315,7 +30006,7 @@ __metadata: languageName: node linkType: hard -"keccak@npm:3.0.2, keccak@npm:^3.0.0": +"keccak@npm:3.0.2": version: 3.0.2 resolution: "keccak@npm:3.0.2" dependencies: @@ -32327,15 +30018,15 @@ __metadata: languageName: node linkType: hard -"keccak@npm:^3.0.2": - version: 3.0.3 - resolution: "keccak@npm:3.0.3" +"keccak@npm:^3.0.0, keccak@npm:^3.0.2": + version: 3.0.4 + resolution: "keccak@npm:3.0.4" dependencies: node-addon-api: ^2.0.0 node-gyp: latest node-gyp-build: ^4.2.0 readable-stream: ^3.6.0 - checksum: f08f04f5cc87013a3fc9e87262f761daff38945c86dd09c01a7f7930a15ae3e14f93b310ef821dcc83675a7b814eb1c983222399a2f263ad980251201d1b9a99 + checksum: 2bf27b97b2f24225b1b44027de62be547f5c7326d87d249605665abd0c8c599d774671c35504c62c9b922cae02758504c6f76a73a84234d23af8a2211afaaa11 languageName: node linkType: hard @@ -32392,7 +30083,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.0.0": +"keyv@npm:^4.0.0, keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -32401,15 +30092,6 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.2": - version: 4.5.3 - resolution: "keyv@npm:4.5.3" - dependencies: - json-buffer: 3.0.1 - checksum: 3ffb4d5b72b6b4b4af443bbb75ca2526b23c750fccb5ac4c267c6116888b4b65681015c2833cb20d26cf3e6e32dac6b988c77f7f022e1a571b7d90f1442257da - languageName: node - linkType: hard - "kind-of@npm:^3.0.2, kind-of@npm:^3.0.3, kind-of@npm:^3.2.0": version: 3.2.2 resolution: "kind-of@npm:3.2.2" @@ -32428,13 +30110,6 @@ __metadata: languageName: node linkType: hard -"kind-of@npm:^5.0.0": - version: 5.1.0 - resolution: "kind-of@npm:5.1.0" - checksum: f2a0102ae0cf19c4a953397e552571bad2b588b53282874f25fca7236396e650e2db50d41f9f516bd402536e4df968dbb51b8e69e4d5d4a7173def78448f7bab - languageName: node - linkType: hard - "kind-of@npm:^6.0.0, kind-of@npm:^6.0.2, kind-of@npm:^6.0.3": version: 6.0.3 resolution: "kind-of@npm:6.0.3" @@ -32470,14 +30145,7 @@ __metadata: languageName: node linkType: hard -"klona@npm:^2.0.4": - version: 2.0.5 - resolution: "klona@npm:2.0.5" - checksum: 8c976126ea252b766e648a4866e1bccff9d3b08432474ad80c559f6c7265cf7caede2498d463754d8c88c4759895edd8210c85c0d3155e6aae4968362889466f - languageName: node - linkType: hard - -"klona@npm:^2.0.5": +"klona@npm:^2.0.4, klona@npm:^2.0.5": version: 2.0.6 resolution: "klona@npm:2.0.6" checksum: ac9ee3732e42b96feb67faae4d27cf49494e8a3bf3fa7115ce242fe04786788e0aff4741a07a45a2462e2079aa983d73d38519c85d65b70ef11447bbc3c58ce7 @@ -32632,38 +30300,29 @@ __metadata: languageName: node linkType: hard -"language-subtag-registry@npm:~0.3.2": +"language-subtag-registry@npm:^0.3.20": version: 0.3.22 resolution: "language-subtag-registry@npm:0.3.22" checksum: 8ab70a7e0e055fe977ac16ea4c261faec7205ac43db5e806f72e5b59606939a3b972c4bd1e10e323b35d6ffa97c3e1c4c99f6553069dad2dfdd22020fa3eb56a languageName: node linkType: hard -"language-tags@npm:=1.0.5": - version: 1.0.5 - resolution: "language-tags@npm:1.0.5" - dependencies: - language-subtag-registry: ~0.3.2 - checksum: c81b5d8b9f5f9cfd06ee71ada6ddfe1cf83044dd5eeefcd1e420ad491944da8957688db4a0a9bc562df4afdc2783425cbbdfd152c01d93179cf86888903123cf - languageName: node - linkType: hard - -"latest-version@npm:^5.1.0": - version: 5.1.0 - resolution: "latest-version@npm:5.1.0" +"language-tags@npm:^1.0.9": + version: 1.0.9 + resolution: "language-tags@npm:1.0.9" dependencies: - package-json: ^6.3.0 - checksum: fbc72b071eb66c40f652441fd783a9cca62f08bf42433651937f078cd9ef94bf728ec7743992777826e4e89305aef24f234b515e6030503a2cbee7fc9bdc2c0f + language-subtag-registry: ^0.3.20 + checksum: 57c530796dc7179914dee71bc94f3747fd694612480241d0453a063777265dfe3a951037f7acb48f456bf167d6eb419d4c00263745326b3ba1cdcf4657070e78 languageName: node linkType: hard "launch-editor@npm:^2.6.0": - version: 2.6.0 - resolution: "launch-editor@npm:2.6.0" + version: 2.6.1 + resolution: "launch-editor@npm:2.6.1" dependencies: picocolors: ^1.0.0 - shell-quote: ^1.7.3 - checksum: 48e4230643e8fdb5c14c11314706d58d9f3fbafe2606be3d6e37da1918ad8bfe39dd87875c726a1b59b9f4da99d87ec3e36d4c528464f0b820f9e91e5cb1c02d + shell-quote: ^1.8.1 + checksum: e06d193075ac09f7f8109f10cabe464a211bf7ed4cbe75f83348d6f67bf4d9f162f06e7a1ab3e1cd7fc250b5342c3b57080618aff2e646dc34248fe499227601 languageName: node linkType: hard @@ -32697,7 +30356,7 @@ __metadata: languageName: node linkType: hard -"less@npm:4.1.3, less@npm:^4.1.3": +"less@npm:4.1.3": version: 4.1.3 resolution: "less@npm:4.1.3" dependencies: @@ -32732,6 +30391,41 @@ __metadata: languageName: node linkType: hard +"less@npm:^4.1.3": + version: 4.2.0 + resolution: "less@npm:4.2.0" + dependencies: + copy-anything: ^2.0.1 + errno: ^0.1.1 + graceful-fs: ^4.1.2 + image-size: ~0.5.0 + make-dir: ^2.1.0 + mime: ^1.4.1 + needle: ^3.1.0 + parse-node-version: ^1.0.1 + source-map: ~0.6.0 + tslib: ^2.3.0 + dependenciesMeta: + errno: + optional: true + graceful-fs: + optional: true + image-size: + optional: true + make-dir: + optional: true + mime: + optional: true + needle: + optional: true + source-map: + optional: true + bin: + lessc: bin/lessc + checksum: 2ec4fa41e35e5c0331c1ee64419aa5c2cbb9a17b9e9d1deb524ec45843f59d9c4612dffc164ca16126911fbe9913e4ff811a13f33805f71e546f6d022ece93b6 + languageName: node + linkType: hard + "level-blobs@npm:^0.1.7": version: 0.1.7 resolution: "level-blobs@npm:0.1.7" @@ -33221,6 +30915,13 @@ __metadata: languageName: node linkType: hard +"lilconfig@npm:^3.0.0": + version: 3.0.0 + resolution: "lilconfig@npm:3.0.0" + checksum: a155f1cd24d324ab20dd6974db9ebcf3fb6f2b60175f7c052d917ff8a746b590bc1ee550f6fc3cb1e8716c8b58304e22fe2193febebc0cf16fa86d85e6f896c5 + languageName: node + linkType: hard + "lines-and-columns@npm:^1.1.6": version: 1.2.4 resolution: "lines-and-columns@npm:1.2.4" @@ -33229,9 +30930,9 @@ __metadata: linkType: hard "lines-and-columns@npm:^2.0.3": - version: 2.0.3 - resolution: "lines-and-columns@npm:2.0.3" - checksum: 5955363dfd7d3d7c476d002eb47944dbe0310d57959e2112dce004c0dc76cecfd479cf8c098fd479ff344acdf04ee0e82b455462a26492231ac152f6c48d17a1 + version: 2.0.4 + resolution: "lines-and-columns@npm:2.0.4" + checksum: f5e3e207467d3e722280c962b786dc20ebceb191821dcd771d14ab3146b6744cae28cf305ee4638805bec524ac54800e15698c853fcc53243821f88df37e4975 languageName: node linkType: hard @@ -33324,9 +31025,9 @@ __metadata: linkType: hard "loader-runner@npm:^4.2.0": - version: 4.2.0 - resolution: "loader-runner@npm:4.2.0" - checksum: e61aea8b6904b8af53d9de6f0484da86c462c0001f4511bedc837cec63deb9475cea813db62f702cd7930420ccb0e75c78112270ca5c8b61b374294f53c0cb3a + version: 4.3.0 + resolution: "loader-runner@npm:4.3.0" + checksum: a90e00dee9a16be118ea43fec3192d0b491fe03a32ed48a4132eb61d498f5536a03a1315531c19d284392a8726a4ecad71d82044c28d7f22ef62e029bf761569 languageName: node linkType: hard @@ -33746,15 +31447,16 @@ __metadata: linkType: hard "logform@npm:^2.3.2, logform@npm:^2.4.0": - version: 2.4.0 - resolution: "logform@npm:2.4.0" + version: 2.6.0 + resolution: "logform@npm:2.6.0" dependencies: - "@colors/colors": 1.5.0 + "@colors/colors": 1.6.0 + "@types/triple-beam": ^1.3.2 fecha: ^4.2.0 ms: ^2.1.1 safe-stable-stringify: ^2.3.1 triple-beam: ^1.3.0 - checksum: e75ccccc1a2664612ade3c7f3d3185787198b4028e54ea2795df87901f28b3881eddd8d7e73ce03f4420dca638a1cbe6d42254179685ab2075e4ac38a71ffb6c + checksum: b9ea74bb75e55379ad0eb3e4d65ae6e8d02bc45b431c218162878bf663997ab9258a73104c2b30e09dd2db288bb83c8bf8748e46689d75f5e7e34cf69378d6df languageName: node linkType: hard @@ -33830,12 +31532,12 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^2.3.1": - version: 2.3.6 - resolution: "loupe@npm:2.3.6" +"loupe@npm:^2.3.1, loupe@npm:^2.3.6": + version: 2.3.7 + resolution: "loupe@npm:2.3.7" dependencies: - get-func-name: ^2.0.0 - checksum: cc83f1b124a1df7384601d72d8d1f5fe95fd7a8185469fec48bb2e4027e45243949e7a013e8d91051a138451ff0552310c32aa9786e60b6a30d1e801bdc2163f + get-func-name: ^2.0.1 + checksum: 96c058ec7167598e238bb7fb9def2f9339215e97d6685d9c1e3e4bdb33d14600e11fe7a812cf0c003dfb73ca2df374f146280b2287cae9e8d989e9d7a69a203b languageName: node linkType: hard @@ -33893,9 +31595,9 @@ __metadata: linkType: hard "lru-cache@npm:^10.0.1, lru-cache@npm:^9.1.1 || ^10.0.0": - version: 10.0.1 - resolution: "lru-cache@npm:10.0.1" - checksum: 06f8d0e1ceabd76bb6f644a26dbb0b4c471b79c7b514c13c6856113879b3bf369eb7b497dad4ff2b7e2636db202412394865b33c332100876d838ad1372f0181 + version: 10.1.0 + resolution: "lru-cache@npm:10.1.0" + checksum: 58056d33e2500fbedce92f8c542e7c11b50d7d086578f14b7074d8c241422004af0718e08a6eaae8705cee09c77e39a61c1c79e9370ba689b7010c152e6a76ab languageName: node linkType: hard @@ -33927,7 +31629,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^7.14.1, lru-cache@npm:^7.4.4, lru-cache@npm:^7.5.1, lru-cache@npm:^7.7.1": +"lru-cache@npm:^7.4.4, lru-cache@npm:^7.5.1, lru-cache@npm:^7.7.1": version: 7.18.3 resolution: "lru-cache@npm:7.18.3" checksum: e550d772384709deea3f141af34b6d4fa392e2e418c1498c078de0ee63670f1f46f5eee746e8ef7e69e1c895af0d4224e62ee33e66a543a14763b0f2e74c1356 @@ -34071,30 +31773,7 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^11.0.0, make-fetch-happen@npm:^11.0.1": - version: 11.0.3 - resolution: "make-fetch-happen@npm:11.0.3" - dependencies: - agentkeepalive: ^4.2.1 - cacache: ^17.0.0 - http-cache-semantics: ^4.1.1 - http-proxy-agent: ^5.0.0 - https-proxy-agent: ^5.0.0 - is-lambda: ^1.0.1 - lru-cache: ^7.7.1 - minipass: ^4.0.0 - minipass-fetch: ^3.0.0 - minipass-flush: ^1.0.5 - minipass-pipeline: ^1.2.4 - negotiator: ^0.6.3 - promise-retry: ^2.0.1 - socks-proxy-agent: ^7.0.0 - ssri: ^10.0.0 - checksum: f718d6b6945d967fa02ae8c6b1146c6e36335b0f9654c5757fd57211a5bcc13bf1dfbaa0d2fdfe8bdd13f78b0e2aa79b4d4438f824dcf0d2ea74883baae1ae31 - languageName: node - linkType: hard - -"make-fetch-happen@npm:^11.0.3, make-fetch-happen@npm:^11.1.1": +"make-fetch-happen@npm:^11.0.0, make-fetch-happen@npm:^11.0.1, make-fetch-happen@npm:^11.1.1": version: 11.1.1 resolution: "make-fetch-happen@npm:11.1.1" dependencies: @@ -34334,7 +32013,7 @@ __metadata: languageName: node linkType: hard -"memfs@npm:^3.1.2": +"memfs@npm:^3.1.2, memfs@npm:^3.4.12, memfs@npm:^3.4.3": version: 3.5.3 resolution: "memfs@npm:3.5.3" dependencies: @@ -34343,24 +32022,6 @@ __metadata: languageName: node linkType: hard -"memfs@npm:^3.4.12": - version: 3.6.0 - resolution: "memfs@npm:3.6.0" - dependencies: - fs-monkey: ^1.0.4 - checksum: 934e79f32aabb10869056815bf369ed63aacb61d13183a3a3826847bbb359d7023fd5b365984ddd73faed463bbb5370ed5cd1e87ecf50ac010c5cac81929ed78 - languageName: node - linkType: hard - -"memfs@npm:^3.4.3": - version: 3.4.13 - resolution: "memfs@npm:3.4.13" - dependencies: - fs-monkey: ^1.0.3 - checksum: 3f9717d6f060919d53f211acb6096a0ea2f566a8cbcc4ef7e1f2561e31e33dc456053fdf951c90a49c8ec55402de7f01b006b81683ab7bd4bdbbd8c9b9cdae5f - languageName: node - linkType: hard - "memory-level@npm:^1.0.0": version: 1.0.0 resolution: "memory-level@npm:1.0.0" @@ -34380,8 +32041,8 @@ __metadata: linkType: hard "meow@npm:^10.0.0, meow@npm:^10.1.0, meow@npm:^10.1.2": - version: 10.1.2 - resolution: "meow@npm:10.1.2" + version: 10.1.5 + resolution: "meow@npm:10.1.5" dependencies: "@types/minimist": ^1.2.2 camelcase-keys: ^7.0.0 @@ -34395,7 +32056,7 @@ __metadata: trim-newlines: ^4.0.2 type-fest: ^1.2.2 yargs-parser: ^20.2.9 - checksum: 1ea19df7d6d5b160219d928937db247092ed2deada71923558487ce2d06b215b1bc8378e8bc28c9784dcdc4089b186e1a1409193d533b7f4764827f087370bda + checksum: dd5f0caa4af18517813547dc66741dcbf52c4c23def5062578d39b11189fd9457aee5c1f2263a5cd6592a465023df8357e8ac876b685b64dbcf545e3f66c23a7 languageName: node linkType: hard @@ -34552,17 +32213,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.0, micromatch@npm:^4.0.4": - version: 4.0.4 - resolution: "micromatch@npm:4.0.4" - dependencies: - braces: ^3.0.1 - picomatch: ^2.2.3 - checksum: ef3d1c88e79e0a68b0e94a03137676f3324ac18a908c245a9e5936f838079fcc108ac7170a5fadc265a9c2596963462e402841406bda1a4bb7b68805601d631c - languageName: node - linkType: hard - -"micromatch@npm:^4.0.2, micromatch@npm:^4.0.5": +"micromatch@npm:^4.0.0, micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -34715,7 +32366,16 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:5.0.1, minimatch@npm:^5.0.1": +"minimatch@npm:3.0.5": + version: 3.0.5 + resolution: "minimatch@npm:3.0.5" + dependencies: + brace-expansion: ^1.1.7 + checksum: a3b84b426eafca947741b864502cee02860c4e7b145de11ad98775cfcf3066fef422583bc0ffce0952ddf4750c1ccf4220b1556430d4ce10139f66247d87d69e + languageName: node + linkType: hard + +"minimatch@npm:5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" dependencies: @@ -34733,12 +32393,12 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^7.4.2": - version: 7.4.5 - resolution: "minimatch@npm:7.4.5" +"minimatch@npm:^5.0.1": + version: 5.1.6 + resolution: "minimatch@npm:5.1.6" dependencies: brace-expansion: ^2.0.1 - checksum: dfb82497bd9007d3dde3f5e033ea4e314e221186ece26863521a8fa955e73f58f0fd11704b79eec37ba29be460be0cf92a7a6455dd41d5763b5b12072c6013c3 + checksum: 7564208ef81d7065a370f788d337cd80a689e981042cb9a1d0e6580b6c6a8c9279eba80010516e258835a988363f99f54a6f711a315089b8b42694f5da9d0d77 languageName: node linkType: hard @@ -34751,15 +32411,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^8.0.2": - version: 8.0.3 - resolution: "minimatch@npm:8.0.3" - dependencies: - brace-expansion: ^2.0.1 - checksum: 8957d8105be6729bf1d3af9c410b2a38ffcf3cd17d4ffaf715b2aa4841490aaa82f1ebff785e71b5b97747199ccc61027db597495941cf46243d9a64382e1560 - languageName: node - linkType: hard - "minimatch@npm:^9.0.0, minimatch@npm:^9.0.1, minimatch@npm:^9.0.3": version: 9.0.3 resolution: "minimatch@npm:9.0.3" @@ -34796,6 +32447,15 @@ __metadata: languageName: node linkType: hard +"minipass-collect@npm:^2.0.1": + version: 2.0.1 + resolution: "minipass-collect@npm:2.0.1" + dependencies: + minipass: ^7.0.3 + checksum: b251bceea62090f67a6cced7a446a36f4cd61ee2d5cea9aee7fff79ba8030e416327a1c5aa2908dc22629d06214b46d88fdab8c51ac76bacbf5703851b5ad342 + languageName: node + linkType: hard + "minipass-fetch@npm:^1.3.2": version: 1.4.1 resolution: "minipass-fetch@npm:1.4.1" @@ -34812,8 +32472,8 @@ __metadata: linkType: hard "minipass-fetch@npm:^2.0.3": - version: 2.1.0 - resolution: "minipass-fetch@npm:2.1.0" + version: 2.1.2 + resolution: "minipass-fetch@npm:2.1.2" dependencies: encoding: ^0.1.13 minipass: ^3.1.6 @@ -34822,22 +32482,22 @@ __metadata: dependenciesMeta: encoding: optional: true - checksum: 1334732859a3f7959ed22589bafd9c40384b885aebb5932328071c33f86b3eb181d54c86919675d1825ab5f1c8e4f328878c863873258d113c29d79a4b0c9c9f + checksum: 3f216be79164e915fc91210cea1850e488793c740534985da017a4cbc7a5ff50506956d0f73bb0cb60e4fe91be08b6b61ef35101706d3ef5da2c8709b5f08f91 languageName: node linkType: hard "minipass-fetch@npm:^3.0.0": - version: 3.0.1 - resolution: "minipass-fetch@npm:3.0.1" + version: 3.0.4 + resolution: "minipass-fetch@npm:3.0.4" dependencies: encoding: ^0.1.13 - minipass: ^4.0.0 + minipass: ^7.0.3 minipass-sized: ^1.0.3 minizlib: ^2.1.2 dependenciesMeta: encoding: optional: true - checksum: b5eecf462ab8409891e4b8a786260e411304b958e45e10820b0a5d31f7841ccbce5f85e49934a34fdb94501206c273bde1988b9c0ad1625bdfb9883d90285420 + checksum: af7aad15d5c128ab1ebe52e043bdf7d62c3c6f0cecb9285b40d7b395e1375b45dcdfd40e63e93d26a0e8249c9efd5c325c65575aceee192883970ff8cb11364a languageName: node linkType: hard @@ -34888,16 +32548,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.0, minipass@npm:^3.1.1, minipass@npm:^3.1.3, minipass@npm:^3.1.5, minipass@npm:^3.1.6": - version: 3.1.6 - resolution: "minipass@npm:3.1.6" - dependencies: - yallist: ^4.0.0 - checksum: 57a04041413a3531a65062452cb5175f93383ef245d6f4a2961d34386eb9aa8ac11ac7f16f791f5e8bbaf1dfb1ef01596870c88e8822215db57aa591a5bb0a77 - languageName: node - linkType: hard - -"minipass@npm:^3.3.4": +"minipass@npm:^3.0.0, minipass@npm:^3.1.0, minipass@npm:^3.1.1, minipass@npm:^3.1.3, minipass@npm:^3.1.5, minipass@npm:^3.1.6, minipass@npm:^3.3.4": version: 3.3.6 resolution: "minipass@npm:3.3.6" dependencies: @@ -34906,10 +32557,10 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^4.0.0, minipass@npm:^4.0.2, minipass@npm:^4.2.4": - version: 4.2.5 - resolution: "minipass@npm:4.2.5" - checksum: 4f9c19af23a5d4a9e7156feefc9110634b178a8cff8f8271af16ec5ebf7e221725a97429952c856f5b17b30c2065ebd24c81722d90c93d2122611d75b952b48f +"minipass@npm:^4.0.0": + version: 4.2.8 + resolution: "minipass@npm:4.2.8" + checksum: 7f4914d5295a9a30807cae5227a37a926e6d910c03f315930fde52332cf0575dfbc20295318f91f0baf0e6bb11a6f668e30cde8027dea7a11b9d159867a3c830 languageName: node linkType: hard @@ -34921,9 +32572,9 @@ __metadata: linkType: hard "minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3": - version: 7.0.3 - resolution: "minipass@npm:7.0.3" - checksum: 6f1614f5b5b55568a46bca5fec0e7c46dac027691db27d0e1923a8192866903144cd962ac772c0e9f89b608ea818b702709c042bce98e190d258847d85461531 + version: 7.0.4 + resolution: "minipass@npm:7.0.4" + checksum: 87585e258b9488caf2e7acea242fd7856bbe9a2c84a7807643513a338d66f368c7d518200ad7b70a508664d408aa000517647b2930c259a8b1f9f0984f344a21 languageName: node linkType: hard @@ -34972,12 +32623,12 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:*, mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": - version: 1.0.4 - resolution: "mkdirp@npm:1.0.4" +"mkdirp@npm:*": + version: 3.0.1 + resolution: "mkdirp@npm:3.0.1" bin: - mkdirp: bin/cmd.js - checksum: a96865108c6c3b1b8e1d5e9f11843de1e077e57737602de1b82030815f311be11f96f09cce59bd5b903d0b29834733e5313f9301e3ed6d6f6fba2eae0df4298f + mkdirp: dist/cjs/src/bin.js + checksum: 972deb188e8fb55547f1e58d66bd6b4a3623bf0c7137802582602d73e6480c1c2268dcbafbfb1be466e00cc7e56ac514d7fd9334b7cf33e3e2ab547c16f83a8d languageName: node linkType: hard @@ -35003,6 +32654,15 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": + version: 1.0.4 + resolution: "mkdirp@npm:1.0.4" + bin: + mkdirp: bin/cmd.js + checksum: a96865108c6c3b1b8e1d5e9f11843de1e077e57737602de1b82030815f311be11f96f09cce59bd5b903d0b29834733e5313f9301e3ed6d6f6fba2eae0df4298f + languageName: node + linkType: hard + "mnemonist@npm:^0.38.0": version: 0.38.5 resolution: "mnemonist@npm:0.38.5" @@ -35152,20 +32812,13 @@ __metadata: languageName: node linkType: hard -"mrmime@npm:1.0.1": +"mrmime@npm:1.0.1, mrmime@npm:^1.0.0": version: 1.0.1 resolution: "mrmime@npm:1.0.1" checksum: cc979da44bbbffebaa8eaf7a45117e851f2d4cb46a3ada6ceb78130466a04c15a0de9a9ce1c8b8ba6f6e1b8618866b1352992bf1757d241c0ddca558b9f28a77 languageName: node linkType: hard -"mrmime@npm:^1.0.0": - version: 1.0.0 - resolution: "mrmime@npm:1.0.0" - checksum: 2c72a40942af7c53bc97d1e9e9c5cb0e6541d18f736811c3a1b46fa2a2b2362480d687daa8ae8372523acaacd82426a4f7ce34b0bf1825ea83b3983e8cb91afd - languageName: node - linkType: hard - "ms@npm:2.0.0": version: 2.0.0 resolution: "ms@npm:2.0.0" @@ -35268,9 +32921,16 @@ __metadata: linkType: hard "multiformats@npm:^12.0.1": - version: 12.1.2 - resolution: "multiformats@npm:12.1.2" - checksum: 092c914fc60e647c976da2bfa82236a426f88d1bd278a0b211539f7252b8a316eb24d78a04549111591beaeb83bbcac233f31f91a65450d27de79194d35ae127 + version: 12.1.3 + resolution: "multiformats@npm:12.1.3" + checksum: 1060488612f8e6729c600f47a8741b91aa6e7b807ce165eca3c8cf07ab7465d2d9b212415a9c18886938b9e35b30ea7b9ae19b5ab5122589c65063440643e6bb + languageName: node + linkType: hard + +"multiformats@npm:^13.0.0": + version: 13.0.0 + resolution: "multiformats@npm:13.0.0" + checksum: 49de70887df1449548c0e808833d9ec5adf6249b5f6e0c46b326fff7b771e6ceef7a8e93ef4afba99b3505b7c64a536ac002ee0ef8b787fd5a943d1eda9f7ae4 languageName: node linkType: hard @@ -35328,6 +32988,15 @@ __metadata: languageName: node linkType: hard +"mustache@npm:^4.2.0": + version: 4.2.0 + resolution: "mustache@npm:4.2.0" + bin: + mustache: bin/mustache + checksum: 928fcb63e3aa44a562bfe9b59ba202cccbe40a46da50be6f0dd831b495be1dd7e38ca4657f0ecab2c1a89dc7bccba0885eab7ee7c1b215830da765758c7e0506 + languageName: node + linkType: hard + "mute-stream@npm:0.0.5": version: 0.0.5 resolution: "mute-stream@npm:0.0.5" @@ -35367,7 +33036,7 @@ __metadata: languageName: node linkType: hard -"nan@npm:^2.11.1": +"nan@npm:^2.11.1, nan@npm:^2.15.0, nan@npm:^2.17.0, nan@npm:^2.18.0": version: 2.18.0 resolution: "nan@npm:2.18.0" dependencies: @@ -35376,24 +33045,6 @@ __metadata: languageName: node linkType: hard -"nan@npm:^2.14.1, nan@npm:^2.15.0": - version: 2.15.0 - resolution: "nan@npm:2.15.0" - dependencies: - node-gyp: latest - checksum: 33e1bb4dfca447fe37d4bb5889be55de154828632c8d38646db67293a21afd61ed9909cdf1b886214a64707d935926c4e60e2b09de9edfc2ad58de31d6ce8f39 - languageName: node - linkType: hard - -"nan@npm:^2.17.0": - version: 2.17.0 - resolution: "nan@npm:2.17.0" - dependencies: - node-gyp: latest - checksum: ec609aeaf7e68b76592a3ba96b372aa7f5df5b056c1e37410b0f1deefbab5a57a922061e2c5b369bae9c7c6b5e6eecf4ad2dac8833a1a7d3a751e0a7c7f849ed - languageName: node - linkType: hard - "nan@npm:~1.0.0": version: 1.0.0 resolution: "nan@npm:1.0.0" @@ -35416,13 +33067,13 @@ __metadata: linkType: hard "nano@npm:>=10.0.0": - version: 10.1.2 - resolution: "nano@npm:10.1.2" + version: 10.1.3 + resolution: "nano@npm:10.1.3" dependencies: - axios: ^1.2.2 + axios: ^1.6.2 node-abort-controller: ^3.0.1 qs: ^6.11.0 - checksum: bf866bbeecd376d372974f347c3d4601c3058207bbe660fac46f69676420815ddeedce98f056be9aaefbfbb8d05bef342ce0ac492aa04133b92737454e7f61ce + checksum: a58370c971691222d4c4aef9a1298bd48e15973776a51576afe015e64f02fdfff0ad0e55efe72f63c9242637585efe059ab331cf2cdf937503edab33b651cbe5 languageName: node linkType: hard @@ -35435,21 +33086,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.1.20": - version: 3.3.1 - resolution: "nanoid@npm:3.3.1" - bin: - nanoid: bin/nanoid.cjs - checksum: 4ef0969e1bbe866fc223eb32276cbccb0961900bfe79104fa5abe34361979dead8d0e061410a5c03bc3d47455685adf32c09d6f27790f4a6898fb51f7df7ec86 - languageName: node - linkType: hard - -"nanoid@npm:^3.3.6": - version: 3.3.6 - resolution: "nanoid@npm:3.3.6" +"nanoid@npm:^3.1.20, nanoid@npm:^3.3.7": + version: 3.3.7 + resolution: "nanoid@npm:3.3.7" bin: nanoid: bin/nanoid.cjs - checksum: 7d0eda657002738aa5206107bd0580aead6c95c460ef1bdd0b1a87a9c7ae6277ac2e9b945306aaa5b32c6dcb7feaf462d0f552e7f8b5718abfc6ead5c94a71b3 + checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 languageName: node linkType: hard @@ -35535,34 +33177,26 @@ __metadata: linkType: hard "nconf@npm:^0.12.0": - version: 0.12.0 - resolution: "nconf@npm:0.12.0" + version: 0.12.1 + resolution: "nconf@npm:0.12.1" dependencies: async: ^3.0.0 ini: ^2.0.0 secure-keys: ^1.0.0 yargs: ^16.1.1 - checksum: 70c1ce82d91149940dbe57555372c99282a9625a961915b302093b34e04ab308d978d1885224b9738a0873c064a0aa48914a7260e67ba312441fc4917221dbd8 + checksum: e3615d485bca665e2f2fcf7ba4e379e586a3f850d50cdf8fe19a5951399b768d8d39ec9eeb2f6ce91995973cfd9c6bef2bbeff2338807599f2b7368e9283c345 languageName: node linkType: hard "needle@npm:^3.1.0": - version: 3.2.0 - resolution: "needle@npm:3.2.0" + version: 3.3.1 + resolution: "needle@npm:3.3.1" dependencies: - debug: ^3.2.6 iconv-lite: ^0.6.3 sax: ^1.2.4 bin: needle: bin/needle - checksum: d6f3e8668bbaf943d28ced0ad843eff793b56025e80152e511fd02313b8974e4dd9674bcbe3d8f9aa31882adb190dafe29ea5fce03a92b4724adf4850070bcfc - languageName: node - linkType: hard - -"negotiator@npm:0.6.2": - version: 0.6.2 - resolution: "negotiator@npm:0.6.2" - checksum: dfddaff6c06792f1c4c3809e29a427b8daef8cd437c83b08dd51d7ee11bbd1c29d9512d66b801144d6c98e910ffd8723f2432e0cbf8b18d41d2a09599c975ab3 + checksum: ed4864d7ee85f1037ac803154868bf7151fa59399c1e55e5d93ca26a9d16e1c8ccbe9552d846ce7e2519b4bce1de3e81a501f0dc33244e02902e27cf5a9bc11d languageName: node linkType: hard @@ -35581,9 +33215,9 @@ __metadata: linkType: hard "nested-error-stacks@npm:^2.0.0, nested-error-stacks@npm:^2.1.0": - version: 2.1.0 - resolution: "nested-error-stacks@npm:2.1.0" - checksum: 206ee736f9eb83489cc093d43e7d3024255ec93c66a31eaee58ca14d5ad9d925d813494725dcf5dec264e70cd8430167b7f82a2d00b0dd099f83c78d9ca650fd + version: 2.1.1 + resolution: "nested-error-stacks@npm:2.1.1" + checksum: 5f452fad75db8480b4db584e1602894ff5977f8bf3d2822f7ba5cb7be80e89adf1fffa34dada3347ef313a4288850b4486eb0635b315c32bdfb505577e8880e3 languageName: node linkType: hard @@ -35614,13 +33248,6 @@ __metadata: languageName: node linkType: hard -"next-tick@npm:~1.0.0": - version: 1.0.0 - resolution: "next-tick@npm:1.0.0" - checksum: 83fcb3d4f8d9380210b1c2b8a610463602d80283f0c0c8571c1688e1ad6cbf3a16b345f5bb7212617d4898bedcfa10dff327dc09ec20a112a5bf43a0271375fb - languageName: node - linkType: hard - "ngo@npm:2.7.0": version: 2.7.0 resolution: "ngo@npm:2.7.0" @@ -35738,7 +33365,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.6.7, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7": +"node-fetch@npm:2.6.7": version: 2.6.7 resolution: "node-fetch@npm:2.6.7" dependencies: @@ -35752,7 +33379,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.7.0, node-fetch@npm:^2.6.8, node-fetch@npm:^2.6.9": +"node-fetch@npm:2.7.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12, node-fetch@npm:^2.6.7, node-fetch@npm:^2.6.8, node-fetch@npm:^2.6.9": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -35766,32 +33393,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.12": - version: 2.6.12 - resolution: "node-fetch@npm:2.6.12" - dependencies: - whatwg-url: ^5.0.0 - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: 3bc1655203d47ee8e313c0d96664b9673a3d4dd8002740318e9d27d14ef306693a4b2ef8d6525775056fd912a19e23f3ac0d7111ad8925877b7567b29a625592 - languageName: node - linkType: hard - -"node-fetch@npm:^3.2.10": - version: 3.3.1 - resolution: "node-fetch@npm:3.3.1" - dependencies: - data-uri-to-buffer: ^4.0.0 - fetch-blob: ^3.1.4 - formdata-polyfill: ^4.0.10 - checksum: 62145fd3ba4770a76110bc31fdc0054ab2f5442b5ce96e9c4b39fc9e94a3d305560eec76e1165d9259eab866e02a8eecf9301062bb5dfc9f08a4d08b69d223dd - languageName: node - linkType: hard - -"node-fetch@npm:^3.3.2": +"node-fetch@npm:^3.2.10, node-fetch@npm:^3.3.2": version: 3.3.2 resolution: "node-fetch@npm:3.3.2" dependencies: @@ -35821,13 +33423,13 @@ __metadata: linkType: hard "node-gyp-build@npm:^4.2.0, node-gyp-build@npm:^4.2.2, node-gyp-build@npm:^4.3.0": - version: 4.3.0 - resolution: "node-gyp-build@npm:4.3.0" + version: 4.7.1 + resolution: "node-gyp-build@npm:4.7.1" bin: node-gyp-build: bin.js node-gyp-build-optional: optional.js node-gyp-build-test: build-test.js - checksum: 1ecab16d9f275174d516e223f60f65ebe07540347d5c04a6a7d6921060b7f2e3af4f19463d9d1dcedc452e275c2ae71354a99405e55ebd5b655bb2f38025c728 + checksum: 2ef8248021489db03be3e8098977cdc797b80a9b12b77c6dcb89b0dc89b8c62e6a482672ee298f61021740ae7f080fb33154cfec8fb158cec620f57b0fae87c0 languageName: node linkType: hard @@ -35862,7 +33464,7 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:^10.0.0": +"node-gyp@npm:^10.0.0, node-gyp@npm:latest": version: 10.0.1 resolution: "node-gyp@npm:10.0.1" dependencies: @@ -35883,34 +33485,14 @@ __metadata: linkType: hard "node-gyp@npm:^9.0.0": - version: 9.3.1 - resolution: "node-gyp@npm:9.3.1" - dependencies: - env-paths: ^2.2.0 - glob: ^7.1.4 - graceful-fs: ^4.2.6 - make-fetch-happen: ^10.0.3 - nopt: ^6.0.0 - npmlog: ^6.0.0 - rimraf: ^3.0.2 - semver: ^7.3.5 - tar: ^6.1.2 - which: ^2.0.2 - bin: - node-gyp: bin/node-gyp.js - checksum: b860e9976fa645ca0789c69e25387401b4396b93c8375489b5151a6c55cf2640a3b6183c212b38625ef7c508994930b72198338e3d09b9d7ade5acc4aaf51ea7 - languageName: node - linkType: hard - -"node-gyp@npm:latest": - version: 9.4.0 - resolution: "node-gyp@npm:9.4.0" + version: 9.4.1 + resolution: "node-gyp@npm:9.4.1" dependencies: env-paths: ^2.2.0 exponential-backoff: ^3.1.1 glob: ^7.1.4 graceful-fs: ^4.2.6 - make-fetch-happen: ^11.0.3 + make-fetch-happen: ^10.0.3 nopt: ^6.0.0 npmlog: ^6.0.0 rimraf: ^3.0.2 @@ -35919,7 +33501,7 @@ __metadata: which: ^2.0.2 bin: node-gyp: bin/node-gyp.js - checksum: 78b404e2e0639d64e145845f7f5a3cb20c0520cdaf6dda2f6e025e9b644077202ea7de1232396ba5bde3fee84cdc79604feebe6ba3ec84d464c85d407bb5da99 + checksum: 8576c439e9e925ab50679f87b7dfa7aa6739e42822e2ad4e26c36341c0ba7163fdf5a946f0a67a476d2f24662bc40d6c97bd9e79ced4321506738e6b760a1577 languageName: node linkType: hard @@ -35996,31 +33578,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.12": - version: 2.0.12 - resolution: "node-releases@npm:2.0.12" - checksum: b8c56db82c4642a0f443332b331a4396dae452a2ac5a65c8dbd93ef89ecb2fbb0da9d42ac5366d4764973febadca816cf7587dad492dce18d2a6b2af59cda260 - languageName: node - linkType: hard - -"node-releases@npm:^2.0.13": - version: 2.0.13 - resolution: "node-releases@npm:2.0.13" - checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 - languageName: node - linkType: hard - -"node-releases@npm:^2.0.3": - version: 2.0.4 - resolution: "node-releases@npm:2.0.4" - checksum: b32d6c2032c7b169ae3938b416fc50f123f5bd577d54a79b2ae201febf27b22846b01c803dd35ac8689afe840f8ba4e5f7154723db629b80f359836b6707b92f - languageName: node - linkType: hard - -"node-releases@npm:^2.0.8": - version: 2.0.10 - resolution: "node-releases@npm:2.0.10" - checksum: d784ecde25696a15d449c4433077f5cce620ed30a1656c4abf31282bfc691a70d9618bae6868d247a67914d1be5cc4fde22f65a05f4398cdfb92e0fc83cadfbc +"node-releases@npm:^2.0.14": + version: 2.0.14 + resolution: "node-releases@npm:2.0.14" + checksum: 59443a2f77acac854c42d321bf1b43dea0aef55cd544c6a686e9816a697300458d4e82239e2d794ea05f7bbbc8a94500332e2d3ac3f11f52e4b16cbe638b3c41 languageName: node linkType: hard @@ -36039,7 +33600,19 @@ __metadata: languageName: node linkType: hard -"node-vault@npm:*, node-vault@npm:0.9.22": +"node-vault@npm:*": + version: 0.10.2 + resolution: "node-vault@npm:0.10.2" + dependencies: + debug: ^4.3.4 + mustache: ^4.2.0 + postman-request: ^2.88.1-postman.33 + tv4: ^1.3.0 + checksum: 1e2a172a54b6ac5b7f98f5118475b1f9ff208344fa4e5b05b0d7cfa2891a4f9095ff18f647d47f8182b7e94bfa5c7933f09a7697666382837a2dd340e8b87aa4 + languageName: node + linkType: hard + +"node-vault@npm:0.9.22": version: 0.9.22 resolution: "node-vault@npm:0.9.22" dependencies: @@ -36052,7 +33625,7 @@ __metadata: languageName: node linkType: hard -"nodemon@npm:2.0.22": +"nodemon@npm:2.0.22, nodemon@npm:^2.0.7": version: 2.0.22 resolution: "nodemon@npm:2.0.22" dependencies: @@ -36072,26 +33645,6 @@ __metadata: languageName: node linkType: hard -"nodemon@npm:^2.0.7": - version: 2.0.15 - resolution: "nodemon@npm:2.0.15" - dependencies: - chokidar: ^3.5.2 - debug: ^3.2.7 - ignore-by-default: ^1.0.1 - minimatch: ^3.0.4 - pstree.remy: ^1.1.8 - semver: ^5.7.1 - supports-color: ^5.5.0 - touch: ^3.1.0 - undefsafe: ^2.0.5 - update-notifier: ^5.1.0 - bin: - nodemon: bin/nodemon.js - checksum: 0569b09b713fdcc76f06734d7cc106950e69e02069cbf44bda3fae8d266926bdfa003aeddd22f8fcdf46ea6ff51ca64f5528f8006536e79820a26e648ef346cf - languageName: node - linkType: hard - "nofilter@npm:^1.0.4": version: 1.0.4 resolution: "nofilter@npm:1.0.4" @@ -36136,13 +33689,13 @@ __metadata: linkType: hard "nopt@npm:^7.0.0": - version: 7.1.0 - resolution: "nopt@npm:7.1.0" + version: 7.2.0 + resolution: "nopt@npm:7.2.0" dependencies: abbrev: ^2.0.0 bin: nopt: bin/nopt.js - checksum: 77185170d491b2ffdda0c72ce12dcf222b670814b7fb5ba1b750c708a6e5421b5607345c1f6341602476c8ef0a26929f5b861efa284e106c60b4baa6e6edb262 + checksum: a9c0f57fb8cb9cc82ae47192ca2b7ef00e199b9480eed202482c962d61b59a7fbe7541920b2a5839a97b42ee39e288c0aed770e38057a608d7f579389dfde410 languageName: node linkType: hard @@ -36258,28 +33811,19 @@ __metadata: languageName: node linkType: hard -"npm-install-checks@npm:^6.0.0": - version: 6.1.0 - resolution: "npm-install-checks@npm:6.1.0" - dependencies: - semver: ^7.1.1 - checksum: efbb4deac45bfe18ab8f619801f736f675ee9f80a60eeafc9fbf8f4657816b67d8e1b1a8dc50d47ee4226727f96e111974a752c4861e1aef1cc2e2ed70581e7c - languageName: node - linkType: hard - -"npm-install-checks@npm:^6.2.0": - version: 6.2.0 - resolution: "npm-install-checks@npm:6.2.0" +"npm-install-checks@npm:^6.0.0, npm-install-checks@npm:^6.2.0": + version: 6.3.0 + resolution: "npm-install-checks@npm:6.3.0" dependencies: semver: ^7.1.1 - checksum: 2f91f71e07111ef89c6f4ad37b89933322567be51ca3a4ec5e972cc5edbc8d1ac6059f3b8904d2bab9893df1567366230eda3d0fe3bcf0de610c48f3f57f17a8 + checksum: 6c20dadb878a0d2f1f777405217b6b63af1299d0b43e556af9363ee6eefaa98a17dfb7b612a473a473e96faf7e789c58b221e0d8ffdc1d34903c4f71618df3b4 languageName: node linkType: hard "npm-normalize-package-bin@npm:^3.0.0": - version: 3.0.0 - resolution: "npm-normalize-package-bin@npm:3.0.0" - checksum: 6a34886c150b0f5302aad52a9446e5c939aa14eeb462323e75681517b36c6b9eaef83e1f5bc2d7e5154b3b752cbce81bed05e290db3f1f7edf857cbb895e35c0 + version: 3.0.1 + resolution: "npm-normalize-package-bin@npm:3.0.1" + checksum: de416d720ab22137a36292ff8a333af499ea0933ef2320a8c6f56a73b0f0448227fec4db5c890d702e26d21d04f271415eab6580b5546456861cc0c19498a4bf languageName: node linkType: hard @@ -36316,16 +33860,7 @@ __metadata: languageName: node linkType: hard -"npm-packlist@npm:^8.0.0": - version: 8.0.0 - resolution: "npm-packlist@npm:8.0.0" - dependencies: - ignore-walk: ^6.0.0 - checksum: 7b6ac15710a1d6d8b7fca2db4cdbb87641eb8398ea70efde288538e7713a66a21c43ead7635affcf00bfd46b6643e18b03078449986e25b0753078c05b37cbcc - languageName: node - linkType: hard - -"npm-packlist@npm:^8.0.1": +"npm-packlist@npm:^8.0.0, npm-packlist@npm:^8.0.1": version: 8.0.1 resolution: "npm-packlist@npm:8.0.1" dependencies: @@ -36334,7 +33869,7 @@ __metadata: languageName: node linkType: hard -"npm-pick-manifest@npm:8.0.1, npm-pick-manifest@npm:^8.0.0": +"npm-pick-manifest@npm:8.0.1": version: 8.0.1 resolution: "npm-pick-manifest@npm:8.0.1" dependencies: @@ -36346,6 +33881,18 @@ __metadata: languageName: node linkType: hard +"npm-pick-manifest@npm:^8.0.0": + version: 8.0.2 + resolution: "npm-pick-manifest@npm:8.0.2" + dependencies: + npm-install-checks: ^6.0.0 + npm-normalize-package-bin: ^3.0.0 + npm-package-arg: ^10.0.0 + semver: ^7.3.5 + checksum: c9f71b57351a3a241a7e56148332f2f341a09dff2a1b1f4ffb1517eac25f1888ac7fbce4939e522cbd533577448c307d05fff0c32430cc03c8c6179fac320cd4 + languageName: node + linkType: hard + "npm-pick-manifest@npm:^9.0.0": version: 9.0.0 resolution: "npm-pick-manifest@npm:9.0.0" @@ -36359,36 +33906,21 @@ __metadata: linkType: hard "npm-registry-fetch@npm:^14.0.0": - version: 14.0.3 - resolution: "npm-registry-fetch@npm:14.0.3" + version: 14.0.5 + resolution: "npm-registry-fetch@npm:14.0.5" dependencies: make-fetch-happen: ^11.0.0 - minipass: ^4.0.0 + minipass: ^5.0.0 minipass-fetch: ^3.0.0 minipass-json-stream: ^1.0.1 minizlib: ^2.1.2 npm-package-arg: ^10.0.0 proc-log: ^3.0.0 - checksum: 451224e7272c8418000f6a0e27fb01d7eb5231bcd98dbd42acac3f275f0b5317590c152860cc84afa706427121b59f9422939e00af5690442b70e64cfa39de0a + checksum: c63649642955b424bc1baaff5955027144af312ae117ba8c24829e74484f859482591fe89687c6597d83e930c8054463eef23020ac69146097a72cc62ff10986 languageName: node linkType: hard -"npm-registry-fetch@npm:^16.0.0": - version: 16.0.0 - resolution: "npm-registry-fetch@npm:16.0.0" - dependencies: - make-fetch-happen: ^13.0.0 - minipass: ^7.0.2 - minipass-fetch: ^3.0.0 - minipass-json-stream: ^1.0.1 - minizlib: ^2.1.2 - npm-package-arg: ^11.0.0 - proc-log: ^3.0.0 - checksum: d50363d1f7e03234b9fcd6aea061f2a2cb6c65f5de0b9af9bf9d3f39174cc92c02bb227f6f49e3d12d35f07fb0bd568857b67481f0ec53649727e004cf1261cd - languageName: node - linkType: hard - -"npm-registry-fetch@npm:^16.1.0": +"npm-registry-fetch@npm:^16.0.0, npm-registry-fetch@npm:^16.1.0": version: 16.1.0 resolution: "npm-registry-fetch@npm:16.1.0" dependencies: @@ -36443,11 +33975,11 @@ __metadata: linkType: hard "npm-run-path@npm:^5.1.0": - version: 5.1.0 - resolution: "npm-run-path@npm:5.1.0" + version: 5.2.0 + resolution: "npm-run-path@npm:5.2.0" dependencies: path-key: ^4.0.0 - checksum: dc184eb5ec239d6a2b990b43236845332ef12f4e0beaa9701de724aa797fe40b6bbd0157fb7639d24d3ab13f5d5cf22d223a19c6300846b8126f335f788bee66 + checksum: c5325e016014e715689c4014f7e0be16cc4cbf529f32a1723e511bc4689b5f823b704d2bca61ac152ce2bda65e0205dc8b3ba0ec0f5e4c3e162d302f6f5b9efb languageName: node linkType: hard @@ -36521,11 +34053,11 @@ __metadata: linkType: hard "nth-check@npm:^2.0.1": - version: 2.0.1 - resolution: "nth-check@npm:2.0.1" + version: 2.1.1 + resolution: "nth-check@npm:2.1.1" dependencies: boolbase: ^1.0.0 - checksum: 5386d035c48438ff304fe687704d93886397349d1bed136de97aeae464caba10e8ffac55a04b215b86b3bc8897f33e0a5aa1045a9d8b2f251ae61b2a3ad3e450 + checksum: 5afc3dafcd1573b08877ca8e6148c52abd565f1d06b1eb08caf982e3fa289a82f2cae697ffb55b5021e146d60443f1590a5d6b944844e944714a5b549675bcd3 languageName: node linkType: hard @@ -36693,28 +34225,14 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.11.0": - version: 1.12.0 - resolution: "object-inspect@npm:1.12.0" - checksum: 2b36d4001a9c921c6b342e2965734519c9c58c355822243c3207fbf0aac271f8d44d30d2d570d450b2cc6f0f00b72bcdba515c37827d2560e5f22b1899a31cf4 +"object-inspect@npm:^1.12.3, object-inspect@npm:^1.13.1, object-inspect@npm:^1.9.0": + version: 1.13.1 + resolution: "object-inspect@npm:1.13.1" + checksum: 7d9fa9221de3311dcb5c7c307ee5dc011cdd31dc43624b7c184b3840514e118e05ef0002be5388304c416c0eb592feb46e983db12577fc47e47d5752fbbfb61f languageName: node linkType: hard -"object-inspect@npm:^1.12.3": - version: 1.12.3 - resolution: "object-inspect@npm:1.12.3" - checksum: dabfd824d97a5f407e6d5d24810d888859f6be394d8b733a77442b277e0808860555176719c5905e765e3743a7cada6b8b0a3b85e5331c530fd418cc8ae991db - languageName: node - linkType: hard - -"object-inspect@npm:^1.9.0": - version: 1.12.2 - resolution: "object-inspect@npm:1.12.2" - checksum: a534fc1b8534284ed71f25ce3a496013b7ea030f3d1b77118f6b7b1713829262be9e6243acbcb3ef8c626e2b64186112cb7f6db74e37b2789b9c789ca23048b2 - languageName: node - linkType: hard - -"object-is@npm:^1.0.1, object-is@npm:^1.1.5": +"object-is@npm:^1.1.5": version: 1.1.5 resolution: "object-is@npm:1.1.5" dependencies: @@ -36724,7 +34242,7 @@ __metadata: languageName: node linkType: hard -"object-keys@npm:^1.0.12, object-keys@npm:^1.1.1": +"object-keys@npm:^1.1.1": version: 1.1.1 resolution: "object-keys@npm:1.1.1" checksum: b363c5e7644b1e1b04aa507e88dcb8e3a2f52b6ffd0ea801e4c7a62d5aa559affe21c55a07fd4b1fd55fc03a33c610d73426664b20032405d7b92a1414c34d6a @@ -36765,42 +34283,19 @@ __metadata: languageName: node linkType: hard -"object.assign@npm:^4.0.4, object.assign@npm:^4.1.4": - version: 4.1.4 - resolution: "object.assign@npm:4.1.4" +"object.assign@npm:^4.0.4, object.assign@npm:^4.1.2, object.assign@npm:^4.1.4": + version: 4.1.5 + resolution: "object.assign@npm:4.1.5" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.4 + call-bind: ^1.0.5 + define-properties: ^1.2.1 has-symbols: ^1.0.3 object-keys: ^1.1.1 - checksum: 76cab513a5999acbfe0ff355f15a6a125e71805fcf53de4e9d4e082e1989bdb81d1e329291e1e4e0ae7719f0e4ef80e88fb2d367ae60500d79d25a6224ac8864 + checksum: f9aeac0541661370a1fc86e6a8065eb1668d3e771f7dbb33ee54578201336c057b21ee61207a186dd42db0c62201d91aac703d20d12a79fc79c353eed44d4e25 languageName: node linkType: hard -"object.assign@npm:^4.1.2": - version: 4.1.2 - resolution: "object.assign@npm:4.1.2" - dependencies: - call-bind: ^1.0.0 - define-properties: ^1.1.3 - has-symbols: ^1.0.1 - object-keys: ^1.1.1 - checksum: d621d832ed7b16ac74027adb87196804a500d80d9aca536fccb7ba48d33a7e9306a75f94c1d29cbfa324bc091bfc530bc24789568efdaee6a47fcfa298993814 - languageName: node - linkType: hard - -"object.entries@npm:^1.1.2": - version: 1.1.6 - resolution: "object.entries@npm:1.1.6" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - checksum: 0f8c47517e6a9a980241eafe3b73de11e59511883173c2b93d67424a008e47e11b77c80e431ad1d8a806f6108b225a1cab9223e53e555776c612a24297117d28 - languageName: node - linkType: hard - -"object.entries@npm:^1.1.6": +"object.entries@npm:^1.1.2, object.entries@npm:^1.1.6, object.entries@npm:^1.1.7": version: 1.1.7 resolution: "object.entries@npm:1.1.7" dependencies: @@ -36811,18 +34306,18 @@ __metadata: languageName: node linkType: hard -"object.fromentries@npm:^2.0.6": - version: 2.0.6 - resolution: "object.fromentries@npm:2.0.6" +"object.fromentries@npm:^2.0.6, object.fromentries@npm:^2.0.7": + version: 2.0.7 + resolution: "object.fromentries@npm:2.0.7" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - checksum: 453c6d694180c0c30df451b60eaf27a5b9bca3fb43c37908fd2b78af895803dc631242bcf05582173afa40d8d0e9c96e16e8874b39471aa53f3ac1f98a085d85 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 7341ce246e248b39a431b87a9ddd331ff52a454deb79afebc95609f94b1f8238966cf21f52188f2a353f0fdf83294f32f1ebf1f7826aae915ebad21fd0678065 languageName: node linkType: hard -"object.getownpropertydescriptors@npm:^2.1.0": +"object.getownpropertydescriptors@npm:^2.1.0, object.getownpropertydescriptors@npm:^2.1.6": version: 2.1.7 resolution: "object.getownpropertydescriptors@npm:2.1.7" dependencies: @@ -36835,28 +34330,15 @@ __metadata: languageName: node linkType: hard -"object.getownpropertydescriptors@npm:^2.1.6": - version: 2.1.6 - resolution: "object.getownpropertydescriptors@npm:2.1.6" - dependencies: - array.prototype.reduce: ^1.0.5 - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.21.2 - safe-array-concat: ^1.0.0 - checksum: 7757ce0ef61c8bee7f8043f8980fd3d46fc1ab3faf0795bd1f9f836781143b4afc91f7219a3eed4675fbd0b562f3708f7e736d679ebfd43ea37ab6077d9f5004 - languageName: node - linkType: hard - -"object.groupby@npm:^1.0.0": - version: 1.0.0 - resolution: "object.groupby@npm:1.0.0" +"object.groupby@npm:^1.0.0, object.groupby@npm:^1.0.1": + version: 1.0.1 + resolution: "object.groupby@npm:1.0.1" dependencies: call-bind: ^1.0.2 define-properties: ^1.2.0 - es-abstract: ^1.21.2 + es-abstract: ^1.22.1 get-intrinsic: ^1.2.1 - checksum: 64b00b287d57580111c958e7ff375c9b61811fa356f2cf0d35372d43cab61965701f00fac66c19fd8f49c4dfa28744bee6822379c69a73648ad03e09fcdeae70 + checksum: d7959d6eaaba358b1608066fc67ac97f23ce6f573dc8fc661f68c52be165266fcb02937076aedb0e42722fdda0bdc0bbf74778196ac04868178888e9fd3b78b5 languageName: node linkType: hard @@ -36889,7 +34371,7 @@ __metadata: languageName: node linkType: hard -"object.values@npm:^1.1.0": +"object.values@npm:^1.1.0, object.values@npm:^1.1.6, object.values@npm:^1.1.7": version: 1.1.7 resolution: "object.values@npm:1.1.7" dependencies: @@ -36900,21 +34382,10 @@ __metadata: languageName: node linkType: hard -"object.values@npm:^1.1.6": - version: 1.1.6 - resolution: "object.values@npm:1.1.6" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - checksum: f6fff9fd817c24cfd8107f50fb33061d81cd11bacc4e3dbb3852e9ff7692fde4dbce823d4333ea27cd9637ef1b6690df5fbb61f1ed314fa2959598dc3ae23d8e - languageName: node - linkType: hard - "obliterator@npm:^2.0.0": - version: 2.0.2 - resolution: "obliterator@npm:2.0.2" - checksum: 0aea7665bb200c17f782845d55e2a0cb10865f5c4d1a5808e778349147c025b811505ca317947b9dc4cace54a716ef74e988a91ffd05fea850c8ddcdd7b6a143 + version: 2.0.4 + resolution: "obliterator@npm:2.0.4" + checksum: f28ad35b6d812089315f375dc3e6e5f9bebf958ebe4b10ccd471c7115cbcf595e74bdac4783ae758e5b1f47e3096427fdb37cfa7bed566b132df92ff317b9a7c languageName: node linkType: hard @@ -37027,7 +34498,7 @@ __metadata: languageName: node linkType: hard -"open@npm:8.4.2, open@npm:^8.0.0, open@npm:^8.4.0": +"open@npm:8.4.2, open@npm:^8.0.0, open@npm:^8.0.9, open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" dependencies: @@ -37048,29 +34519,6 @@ __metadata: languageName: node linkType: hard -"open@npm:^8.0.9": - version: 8.4.0 - resolution: "open@npm:8.4.0" - dependencies: - define-lazy-prop: ^2.0.0 - is-docker: ^2.1.1 - is-wsl: ^2.2.0 - checksum: e9545bec64cdbf30a0c35c1bdc310344adf8428a117f7d8df3c0af0a0a24c513b304916a6d9b11db0190ff7225c2d578885080b761ed46a3d5f6f1eebb98b63c - languageName: node - linkType: hard - -"open@npm:^9.1.0": - version: 9.1.0 - resolution: "open@npm:9.1.0" - dependencies: - default-browser: ^4.0.0 - define-lazy-prop: ^3.0.0 - is-inside-container: ^1.0.0 - is-wsl: ^2.2.0 - checksum: 3993c0f61d51fed8ac290e99c9c3cf45d3b6cfb3e2aa2b74cafd312c3486c22fd81df16ac8f3ab91dd8a4e3e729a16fc2480cfc406c4833416cf908acf1ae7c9 - languageName: node - linkType: hard - "openapi-types@npm:12.1.3": version: 12.1.3 resolution: "openapi-types@npm:12.1.3" @@ -37115,21 +34563,7 @@ __metadata: languageName: node linkType: hard -"optionator@npm:^0.9.1": - version: 0.9.1 - resolution: "optionator@npm:0.9.1" - dependencies: - deep-is: ^0.1.3 - fast-levenshtein: ^2.0.6 - levn: ^0.4.1 - prelude-ls: ^1.2.1 - type-check: ^0.4.0 - word-wrap: ^1.2.3 - checksum: dbc6fa065604b24ea57d734261914e697bd73b69eff7f18e967e8912aa2a40a19a9f599a507fa805be6c13c24c4eae8c71306c239d517d42d4c041c942f508a0 - languageName: node - linkType: hard - -"optionator@npm:^0.9.3": +"optionator@npm:^0.9.1, optionator@npm:^0.9.3": version: 0.9.3 resolution: "optionator@npm:0.9.3" dependencies: @@ -37257,13 +34691,6 @@ __metadata: languageName: node linkType: hard -"p-cancelable@npm:^0.3.0": - version: 0.3.0 - resolution: "p-cancelable@npm:0.3.0" - checksum: 2b27639be8f7f8718f2854c1711f713c296db00acc4675975b1531ecb6253da197304b4a211a330a8e54e754d28d4b3f7feecb48f0566dd265e3ba6745cd4148 - languageName: node - linkType: hard - "p-cancelable@npm:^1.0.0": version: 1.1.0 resolution: "p-cancelable@npm:1.1.0" @@ -37271,6 +34698,13 @@ __metadata: languageName: node linkType: hard +"p-cancelable@npm:^2.0.0": + version: 2.1.1 + resolution: "p-cancelable@npm:2.1.1" + checksum: 3dba12b4fb4a1e3e34524535c7858fc82381bbbd0f247cc32dedc4018592a3950ce66b106d0880b4ec4c2d8d6576f98ca885dc1d7d0f274d1370be20e9523ddf + languageName: node + linkType: hard + "p-cancelable@npm:^3.0.0": version: 3.0.0 resolution: "p-cancelable@npm:3.0.0" @@ -37308,6 +34742,15 @@ __metadata: languageName: node linkType: hard +"p-event@npm:^5.0.1": + version: 5.0.1 + resolution: "p-event@npm:5.0.1" + dependencies: + p-timeout: ^5.0.2 + checksum: 3bdd8df6092e6b149f25e9c2eb1c0843b3b4279b07be2a2c72c02b65b267a8908c2040fefd606f2497b0f2bcefcd214f8ca5a74f0c883515d400ccf1d88d5683 + languageName: node + linkType: hard + "p-fifo@npm:^1.0.0": version: 1.0.0 resolution: "p-fifo@npm:1.0.0" @@ -37447,16 +34890,7 @@ __metadata: languageName: node linkType: hard -"p-map@npm:^5.1.0, p-map@npm:^5.3.0": - version: 5.3.0 - resolution: "p-map@npm:5.3.0" - dependencies: - aggregate-error: ^4.0.0 - checksum: 744f47b110a8a4c0a302fcae901abcf4224f269239d14f5f1eb2bf790a96e68146ad1acba0b57d8aeff013d17b2145324d9b56c601284db324fa13816ee155ec - languageName: node - linkType: hard - -"p-map@npm:^5.5.0": +"p-map@npm:^5.1.0, p-map@npm:^5.3.0, p-map@npm:^5.5.0": version: 5.5.0 resolution: "p-map@npm:5.5.0" dependencies: @@ -37466,9 +34900,9 @@ __metadata: linkType: hard "p-map@npm:^7.0.0": - version: 7.0.0 - resolution: "p-map@npm:7.0.0" - checksum: a2ab53c2bfc26a583e81320ffda5a645810aa5a6fddcb7531711e0905c237d62396bc74ba8fc7845c46e69aabf8adbf8401caca0e3fed71c01d4d7b9ce985837 + version: 7.0.1 + resolution: "p-map@npm:7.0.1" + checksum: 553c218f582b9c7f96159dd55d082fc6df386ea86a78a3798b768f87f761d6f01ea52dd76225e69199720fa0684901d38353cd0978a39ef4f7f4fd287c4e9262 languageName: node linkType: hard @@ -37480,12 +34914,12 @@ __metadata: linkType: hard "p-queue@npm:^8.0.0": - version: 8.0.0 - resolution: "p-queue@npm:8.0.0" + version: 8.0.1 + resolution: "p-queue@npm:8.0.1" dependencies: eventemitter3: ^5.0.1 p-timeout: ^6.1.2 - checksum: bdbe608b628b518d8ebe4ae2cf8f3e55107d29858c467fdae653ab2f7ff51e42aa6b4cba6b3314dce32efab53ace0f4b4ade712acc061a996adcafb7dfa36896 + checksum: 84a27a5b1faf2dcc96b8c0e423c34b5984b241acc07353d3cc6d8d3d1dadefb250b4ec84ce278cb1c946466999c6bf2a36ff718a75810bad8e11c7ca47ce80f5 languageName: node linkType: hard @@ -37516,15 +34950,6 @@ __metadata: languageName: node linkType: hard -"p-timeout@npm:^1.1.1": - version: 1.2.1 - resolution: "p-timeout@npm:1.2.1" - dependencies: - p-finally: ^1.0.0 - checksum: 65a456f49cca1328774a6bfba61aac98d854b36df9153c2887f82f078d4399e9a30463be8a479871c22ed350a23b34a66ff303ca652b9d81ed4ff5260ac660d2 - languageName: node - linkType: hard - "p-timeout@npm:^3.0.0, p-timeout@npm:^3.1.0": version: 3.2.0 resolution: "p-timeout@npm:3.2.0" @@ -37534,6 +34959,13 @@ __metadata: languageName: node linkType: hard +"p-timeout@npm:^5.0.2": + version: 5.1.0 + resolution: "p-timeout@npm:5.1.0" + checksum: f5cd4e17301ff1ff1d8dbf2817df0ad88c6bba99349fc24d8d181827176ad4f8aca649190b8a5b1a428dfd6ddc091af4606835d3e0cb0656e04045da5c9e270c + languageName: node + linkType: hard + "p-timeout@npm:^6.1.2": version: 6.1.2 resolution: "p-timeout@npm:6.1.2" @@ -37588,18 +35020,6 @@ __metadata: languageName: node linkType: hard -"package-json@npm:^6.3.0": - version: 6.5.0 - resolution: "package-json@npm:6.5.0" - dependencies: - got: ^9.6.0 - registry-auth-token: ^4.0.0 - registry-url: ^5.0.0 - semver: ^6.2.0 - checksum: cc9f890d3667d7610e6184decf543278b87f657d1ace0deb4a9c9155feca738ef88f660c82200763d3348010f4e42e9c7adc91e96ab0f86a770955995b5351e2 - languageName: node - linkType: hard - "packet-reader@npm:1.0.0": version: 1.0.0 resolution: "packet-reader@npm:1.0.0" @@ -37635,35 +35055,7 @@ __metadata: languageName: node linkType: hard -"pacote@npm:^17.0.0, pacote@npm:^17.0.4": - version: 17.0.4 - resolution: "pacote@npm:17.0.4" - dependencies: - "@npmcli/git": ^5.0.0 - "@npmcli/installed-package-contents": ^2.0.1 - "@npmcli/promise-spawn": ^7.0.0 - "@npmcli/run-script": ^7.0.0 - cacache: ^18.0.0 - fs-minipass: ^3.0.0 - minipass: ^7.0.2 - npm-package-arg: ^11.0.0 - npm-packlist: ^8.0.0 - npm-pick-manifest: ^9.0.0 - npm-registry-fetch: ^16.0.0 - proc-log: ^3.0.0 - promise-retry: ^2.0.1 - read-package-json: ^7.0.0 - read-package-json-fast: ^3.0.0 - sigstore: ^2.0.0 - ssri: ^10.0.0 - tar: ^6.1.11 - bin: - pacote: lib/bin.js - checksum: 931968cfb513d5bb40fcae8b5350c18d9734a50a8e848254ce2723de0fbd0f55a17959240ba53ee8185987c84ba9d3f71af9a5e6106746b867dc1f1e191ee9ce - languageName: node - linkType: hard - -"pacote@npm:^17.0.5": +"pacote@npm:^17.0.0, pacote@npm:^17.0.4, pacote@npm:^17.0.5": version: 17.0.5 resolution: "pacote@npm:17.0.5" dependencies: @@ -37744,7 +35136,7 @@ __metadata: languageName: node linkType: hard -"parse-asn1@npm:^5.0.0, parse-asn1@npm:^5.1.5": +"parse-asn1@npm:^5.0.0, parse-asn1@npm:^5.1.6": version: 5.1.6 resolution: "parse-asn1@npm:5.1.6" dependencies: @@ -37768,14 +35160,7 @@ __metadata: languageName: node linkType: hard -"parse-duration@npm:^1.0.0": - version: 1.0.2 - resolution: "parse-duration@npm:1.0.2" - checksum: d103ca9c3b630cc6169a89039349b735af796b94d9dc810750b16f79285ce5df20669ef0d02b23eda5832dc51aee88316857f3695584e88ba0ae5d77743134ef - languageName: node - linkType: hard - -"parse-duration@npm:^1.0.2": +"parse-duration@npm:^1.0.0, parse-duration@npm:^1.0.2": version: 1.1.0 resolution: "parse-duration@npm:1.1.0" checksum: 3cfc10aa61b3a06373a347289e1704de47d5d845c79330bbab20b54c02567f3710ba84544a3a44a986c3381c68670d89542fe9de607fb0814e52f78b34893cd9 @@ -37795,9 +35180,9 @@ __metadata: linkType: hard "parse-headers@npm:^2.0.0": - version: 2.0.4 - resolution: "parse-headers@npm:2.0.4" - checksum: 29519ac013e100c11a67d0fc64eb33ae86523abf547f71dba36d484dcd16a2835dd11f31303f4ded27c40133dca5a5fe4d15b77f49091e470a6f74a023c59c4a + version: 2.0.5 + resolution: "parse-headers@npm:2.0.5" + checksum: 3e97f01e4c7f960bfbfd0ee489f0bd8d3c72b6c814f1f79b66abec2cca8eaf8e4ecd89deba0b6e61266469aed87350bc932001181c01ff8c29a59e696abe251f languageName: node linkType: hard @@ -37833,15 +35218,15 @@ __metadata: linkType: hard "parse-json@npm:^7.0.0": - version: 7.1.0 - resolution: "parse-json@npm:7.1.0" + version: 7.1.1 + resolution: "parse-json@npm:7.1.1" dependencies: "@babel/code-frame": ^7.21.4 error-ex: ^1.3.2 json-parse-even-better-errors: ^3.0.0 lines-and-columns: ^2.0.3 type-fest: ^3.8.0 - checksum: bf9bc646e8b8cb9ae638988a303bf09866c13d2829c2ff75ee87c27631dac06d0d6e81913f8824c3c4586015bf3f0a6fee1dece168b37932d175ef0709e8860a + checksum: 187275c7ac097dcfb3c7420bca2399caa4da33bcd5d5aac3604bda0e2b8eee4df61cc26aa0d79fab97f0d67bf42d41d332baa9f9f56ad27636ad785f1ae639e5 languageName: node linkType: hard @@ -38093,16 +35478,6 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.6.1": - version: 1.6.3 - resolution: "path-scurry@npm:1.6.3" - dependencies: - lru-cache: ^7.14.1 - minipass: ^4.0.2 - checksum: 814ebd7f8df717e2381dc707ba3a3ddf84d0a4f9d653036c7554cb1fea632d4d78eb17dd5f4c85111b78ba8b8c0a5b59c756645c9d343bdacacda4ba8d1626c2 - languageName: node - linkType: hard - "path-to-regexp@npm:0.1.7": version: 0.1.7 resolution: "path-to-regexp@npm:0.1.7" @@ -38127,9 +35502,9 @@ __metadata: linkType: hard "path-to-regexp@npm:^6.2.0": - version: 6.2.0 - resolution: "path-to-regexp@npm:6.2.0" - checksum: a6aca74d2d6e2e7594d812f653cf85e9cb5054d3a8d80f099722a44ef6ad22639b02078e5ea83d11db16321c3e4359e3f1ab0274fa78dad0754a6e53f630b0fc + version: 6.2.1 + resolution: "path-to-regexp@npm:6.2.1" + checksum: f0227af8284ea13300f4293ba111e3635142f976d4197f14d5ad1f124aebd9118783dd2e5f1fe16f7273743cc3dbeddfb7493f237bb27c10fdae07020cc9b698 languageName: node linkType: hard @@ -38201,7 +35576,7 @@ __metadata: languageName: node linkType: hard -"pg-connection-string@npm:2.5.0, pg-connection-string@npm:^2.5.0": +"pg-connection-string@npm:2.5.0": version: 2.5.0 resolution: "pg-connection-string@npm:2.5.0" checksum: a6f3a068f7c9416a5b33a326811caf0dfaaee045c225b7c628b4c9b4e9a2b25bdd12a21e4c48940e1000ea223a4e608ca122d2ff3dd08c8b1db0fc9f5705133a @@ -38215,6 +35590,13 @@ __metadata: languageName: node linkType: hard +"pg-connection-string@npm:^2.5.0": + version: 2.6.2 + resolution: "pg-connection-string@npm:2.6.2" + checksum: 22265882c3b6f2320785378d0760b051294a684989163d5a1cde4009e64e84448d7bf67d9a7b9e7f69440c3ee9e2212f9aa10dd17ad6773f6143c6020cebbcb5 + languageName: node + linkType: hard + "pg-int8@npm:1.0.1": version: 1.0.1 resolution: "pg-int8@npm:1.0.1" @@ -38223,11 +35605,11 @@ __metadata: linkType: hard "pg-pool@npm:^3.5.2": - version: 3.6.0 - resolution: "pg-pool@npm:3.6.0" + version: 3.6.1 + resolution: "pg-pool@npm:3.6.1" peerDependencies: pg: ">=8.0" - checksum: f3fe050fbfe27406369340c4c26efcbe21a388ace085a876453de0ea496a315c38b2dc739ac97d4767a359e911da2ec4810467f72601eeec8ad540e58b27987c + checksum: 8a6513e6f74a794708c9dd16d2ccda0debadc56435ec2582de2b2e35b01315550c5dab8a0a9a2a16f4adce45523228f5739940fb7687ec7e9c300f284eb08fd1 languageName: node linkType: hard @@ -38347,20 +35729,13 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.1": +"pirates@npm:^4.0.1, pirates@npm:^4.0.4": version: 4.0.6 resolution: "pirates@npm:4.0.6" checksum: 46a65fefaf19c6f57460388a5af9ab81e3d7fd0e7bc44ca59d753cb5c4d0df97c6c6e583674869762101836d68675f027d60f841c105d72734df9dfca97cbcc6 languageName: node linkType: hard -"pirates@npm:^4.0.4": - version: 4.0.5 - resolution: "pirates@npm:4.0.5" - checksum: c9994e61b85260bec6c4fc0307016340d9b0c4f4b6550a957afaaff0c9b1ad58fbbea5cfcf083860a25cb27a375442e2b0edf52e2e1e40e69934e08dcc52d227 - languageName: node - linkType: hard - "piscina@npm:4.0.0": version: 4.0.0 resolution: "piscina@npm:4.0.0" @@ -38376,7 +35751,7 @@ __metadata: languageName: node linkType: hard -"pkcs11js@npm:1.3.1, pkcs11js@npm:^1.3.0": +"pkcs11js@npm:1.3.1, pkcs11js@npm:^1.0.6, pkcs11js@npm:^1.3.0": version: 1.3.1 resolution: "pkcs11js@npm:1.3.1" dependencies: @@ -38386,16 +35761,6 @@ __metadata: languageName: node linkType: hard -"pkcs11js@npm:^1.0.6": - version: 1.3.0 - resolution: "pkcs11js@npm:1.3.0" - dependencies: - nan: ^2.15.0 - node-gyp: latest - checksum: bc399abda3c7d3dc15afd1943c6b29f3ddf318d48510672487855ad68197dfb8f7c7a5e1e0e7d28ad79e8b782cc19e5cc61222a7aa86b3b17f23f28d1b4c75b1 - languageName: node - linkType: hard - "pkg-conf@npm:^2.0.0, pkg-conf@npm:^2.1.0": version: 2.1.0 resolution: "pkg-conf@npm:2.1.0" @@ -38888,11 +36253,11 @@ __metadata: linkType: hard "postcss-load-config@npm:^4.0.1": - version: 4.0.1 - resolution: "postcss-load-config@npm:4.0.1" + version: 4.0.2 + resolution: "postcss-load-config@npm:4.0.2" dependencies: - lilconfig: ^2.0.5 - yaml: ^2.1.1 + lilconfig: ^3.0.0 + yaml: ^2.3.4 peerDependencies: postcss: ">=8.0.9" ts-node: ">=9.0.0" @@ -38901,7 +36266,7 @@ __metadata: optional: true ts-node: optional: true - checksum: b61f890499ed7dcda1e36c20a9582b17d745bad5e2b2c7bc96942465e406bc43ae03f270c08e60d1e29dab1ee50cb26970b5eb20c9aae30e066e20bd607ae4e4 + checksum: 7c27dd3801db4eae207a5116fed2db6b1ebb780b40c3dd62a3e57e087093a8e6a14ee17ada729fee903152d6ef4826c6339eb135bee6208e0f3140d7e8090185 languageName: node linkType: hard @@ -39048,13 +36413,13 @@ __metadata: linkType: hard "postcss-modules-scope@npm:^3.0.0": - version: 3.0.0 - resolution: "postcss-modules-scope@npm:3.0.0" + version: 3.1.0 + resolution: "postcss-modules-scope@npm:3.1.0" dependencies: postcss-selector-parser: ^6.0.4 peerDependencies: postcss: ^8.1.0 - checksum: 330b9398dbd44c992c92b0dc612c0626135e2cc840fee41841eb61247a6cfed95af2bd6f67ead9dd9d0bb41f5b0367129d93c6e434fa3e9c58ade391d9a5a138 + checksum: 919d02e2e31956fa3dae2036d4f3259c9b8c5361bd58ee55867edededbee03507df88e98f418b5e553e47f3888daba9ea9ef0b18a82c41cf96cdb74df15322c7 languageName: node linkType: hard @@ -39370,33 +36735,13 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.10": - version: 6.0.10 - resolution: "postcss-selector-parser@npm:6.0.10" - dependencies: - cssesc: ^3.0.0 - util-deprecate: ^1.0.2 - checksum: 46afaa60e3d1998bd7adf6caa374baf857cc58d3ff944e29459c9a9e4680a7fe41597bd5b755fc81d7c388357e9bf67c0251d047c640a09f148e13606b8a8608 - languageName: node - linkType: hard - -"postcss-selector-parser@npm:^6.0.11, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": - version: 6.0.13 - resolution: "postcss-selector-parser@npm:6.0.13" - dependencies: - cssesc: ^3.0.0 - util-deprecate: ^1.0.2 - checksum: f89163338a1ce3b8ece8e9055cd5a3165e79a15e1c408e18de5ad8f87796b61ec2d48a2902d179ae0c4b5de10fccd3a325a4e660596549b040bc5ad1b465f096 - languageName: node - linkType: hard - -"postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4": - version: 6.0.9 - resolution: "postcss-selector-parser@npm:6.0.9" +"postcss-selector-parser@npm:^6.0.10, postcss-selector-parser@npm:^6.0.11, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": + version: 6.0.15 + resolution: "postcss-selector-parser@npm:6.0.15" dependencies: cssesc: ^3.0.0 util-deprecate: ^1.0.2 - checksum: f8161ab4d3e5c76b8467189c6d164ba0f6b6e74677435f29e34caa1df01e052b582b4ae4f7468b2243c4befdd8bdcdb7685542d1b2fca8deae21b3e849c78802 + checksum: 57decb94152111004f15e27b9c61131eb50ee10a3288e7fcf424cebbb4aba82c2817517ae718f8b5d704ee9e02a638d4a2acff8f47685c295a33ecee4fd31055 languageName: node linkType: hard @@ -39431,13 +36776,13 @@ __metadata: linkType: hard "postcss@npm:>=8.4.31": - version: 8.4.31 - resolution: "postcss@npm:8.4.31" + version: 8.4.32 + resolution: "postcss@npm:8.4.32" dependencies: - nanoid: ^3.3.6 + nanoid: ^3.3.7 picocolors: ^1.0.0 source-map-js: ^1.0.2 - checksum: 1d8611341b073143ad90486fcdfeab49edd243377b1f51834dc4f6d028e82ce5190e4f11bb2633276864503654fb7cab28e67abdc0fbf9d1f88cad4a0ff0beea + checksum: 220d9d0bf5d65be7ed31006c523bfb11619461d296245c1231831f90150aeb4a31eab9983ac9c5c89759a3ca8b60b3e0d098574964e1691673c3ce5c494305ae languageName: node linkType: hard @@ -39471,6 +36816,43 @@ __metadata: languageName: node linkType: hard +"postman-request@npm:^2.88.1-postman.33": + version: 2.88.1-postman.8-beta.1 + resolution: "postman-request@npm:2.88.1-postman.8-beta.1" + dependencies: + aws-sign2: ~0.7.0 + aws4: ^1.8.0 + caseless: ~0.12.0 + combined-stream: ~1.0.6 + extend: ~3.0.2 + forever-agent: ~0.6.1 + form-data: ~2.3.2 + har-validator: ~5.1.3 + http-signature: ~1.2.0 + is-typedarray: ~1.0.0 + isstream: ~0.1.2 + json-stringify-safe: ~5.0.1 + mime-types: ~2.1.19 + oauth-sign: ~0.9.0 + performance-now: ^2.1.0 + postman-url-encoder: 1.0.1 + qs: ~6.5.2 + safe-buffer: ^5.1.2 + stream-length: ^1.0.2 + tough-cookie: ~2.5.0 + tunnel-agent: ^0.6.0 + uuid: ^3.3.2 + checksum: 040580bf9e23eaecdde42761ca4e54804083d263016bdc40d09c34d4ee3926a82f59cb6a72ee10861c2b76e32ea9ab3d8d90e6e960e8c42f49372d9b72826903 + languageName: node + linkType: hard + +"postman-url-encoder@npm:1.0.1": + version: 1.0.1 + resolution: "postman-url-encoder@npm:1.0.1" + checksum: d076227d87fdb5528078a211d5e88b6ba8f2e59db8f2578b6ae1bb543be868d9beee306b76d03f7c4682f66b4313c0f80d6d531c26374d017ebbe7d2797227a4 + languageName: node + linkType: hard + "pouchdb-abstract-mapreduce@npm:7.3.1": version: 7.3.1 resolution: "pouchdb-abstract-mapreduce@npm:7.3.1" @@ -39732,13 +37114,6 @@ __metadata: languageName: node linkType: hard -"prepend-http@npm:^1.0.1": - version: 1.0.4 - resolution: "prepend-http@npm:1.0.4" - checksum: 01e7baf4ad38af02257b99098543469332fc42ae50df33d97a124bf8172295907352fa6138c9b1610c10c6dd0847ca736e53fda736387cc5cf8fcffe96b47f29 - languageName: node - linkType: hard - "prepend-http@npm:^2.0.0": version: 2.0.0 resolution: "prepend-http@npm:2.0.0" @@ -39859,18 +37234,7 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.0.0, pretty-format@npm:^29.6.2": - version: 29.6.2 - resolution: "pretty-format@npm:29.6.2" - dependencies: - "@jest/schemas": ^29.6.0 - ansi-styles: ^5.0.0 - react-is: ^18.0.0 - checksum: a0f972a44f959023c0df9cdfe9eed7540264d7f7ddf74667db8a5294444d5aa153fd47d20327df10ae86964e2ceec10e46ea06b1a5c9c12e02348b78c952c9fc - languageName: node - linkType: hard - -"pretty-format@npm:^29.7.0": +"pretty-format@npm:^29.0.0, pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" dependencies: @@ -39881,15 +37245,6 @@ __metadata: languageName: node linkType: hard -"printj@npm:~1.3.1": - version: 1.3.1 - resolution: "printj@npm:1.3.1" - bin: - printj: bin/printj.njs - checksum: 3bb8976e02c2a5943f86bf7d1cbe7764fa9fb6fb177cbc9fe0044adbd7be11dbf82e4c72d381f4d2ddc578fada92ea24ab263069549254cb796a252f11fd1ddf - languageName: node - linkType: hard - "proc-log@npm:^3.0.0": version: 3.0.0 resolution: "proc-log@npm:3.0.0" @@ -39920,6 +37275,13 @@ __metadata: languageName: node linkType: hard +"progress-events@npm:^1.0.0": + version: 1.0.0 + resolution: "progress-events@npm:1.0.0" + checksum: 41e5fb20c21cf2c5a6ad0501840120fc793f83216873c8be5ca006a0c904ec53cefc6bdb0b79bed82926c7b4541f590dc3c97ff55bfbaa126dba2cfec8e0976e + languageName: node + linkType: hard + "progress@npm:^1.1.8": version: 1.1.8 resolution: "progress@npm:1.1.8" @@ -40085,12 +37447,12 @@ __metadata: linkType: hard "protons-runtime@npm:^5.0.0": - version: 5.2.0 - resolution: "protons-runtime@npm:5.2.0" + version: 5.2.1 + resolution: "protons-runtime@npm:5.2.1" dependencies: uint8arraylist: ^2.4.3 - uint8arrays: ^4.0.6 - checksum: 0ddcd1f45dc6e92e34fd5e3ac7a626f7e6ff1e74efde60dcf0b5c171f6940df5697f3823f8994403e3276f413ed229cf61def45ad7f8862b5ed105c21c0c7a90 + uint8arrays: ^5.0.1 + checksum: a56db5f26693a3d06c386eea8a6c354140fc5325a4e3b8036240bbc93b7b73cc630aad29f5ce2bfd85a3ac4d47ce92c9cfefe2ed4d210e30c157119465761280 languageName: node linkType: hard @@ -40133,9 +37495,9 @@ __metadata: linkType: hard "psl@npm:^1.1.33": - version: 1.8.0 - resolution: "psl@npm:1.8.0" - checksum: 6150048ed2da3f919478bee8a82f3828303bc0fc730fb015a48f83c9977682c7b28c60ab01425a72d82a2891a1681627aa530a991d50c086b48a3be27744bde7 + version: 1.9.0 + resolution: "psl@npm:1.9.0" + checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d languageName: node linkType: hard @@ -40185,18 +37547,16 @@ __metadata: linkType: hard "punycode@npm:2.x.x, punycode@npm:^2.0.0, punycode@npm:^2.1.0, punycode@npm:^2.1.1": - version: 2.1.1 - resolution: "punycode@npm:2.1.1" - checksum: 823bf443c6dd14f669984dea25757b37993f67e8d94698996064035edd43bed8a5a17a9f12e439c2b35df1078c6bec05a6c86e336209eb1061e8025c481168e8 + version: 2.3.1 + resolution: "punycode@npm:2.3.1" + checksum: bb0a0ceedca4c3c57a9b981b90601579058903c62be23c5e8e843d2c2d4148a3ecf029d5133486fb0e1822b098ba8bba09e89d6b21742d02fa26bda6441a6fb2 languageName: node linkType: hard -"pupa@npm:^2.1.1": - version: 2.1.1 - resolution: "pupa@npm:2.1.1" - dependencies: - escape-goat: ^2.0.0 - checksum: 49529e50372ffdb0cccf0efa0f3b3cb0a2c77805d0d9cc2725bd2a0f6bb414631e61c93a38561b26be1259550b7bb6c2cb92315aa09c8bf93f3bdcb49f2b2fb7 +"punycode@npm:^1.4.1": + version: 1.4.1 + resolution: "punycode@npm:1.4.1" + checksum: fa6e698cb53db45e4628559e557ddaf554103d2a96a1d62892c8f4032cd3bc8871796cae9eabc1bc700e2b6677611521ce5bb1d9a27700086039965d0cf34518 languageName: node linkType: hard @@ -40208,9 +37568,9 @@ __metadata: linkType: hard "pure-rand@npm:^6.0.0": - version: 6.0.2 - resolution: "pure-rand@npm:6.0.2" - checksum: 79de33876a4f515d759c48e98d00756bbd916b4ea260cc572d7adfa4b62cace9952e89f0241d0410214554503d25061140fe325c66f845213d2b1728ba8d413e + version: 6.0.4 + resolution: "pure-rand@npm:6.0.4" + checksum: e1c4e69f8bf7303e5252756d67c3c7551385cd34d94a1f511fe099727ccbab74c898c03a06d4c4a24a89b51858781057b83ebbfe740d984240cdc04fead36068 languageName: node linkType: hard @@ -40221,15 +37581,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.10.3": - version: 6.10.3 - resolution: "qs@npm:6.10.3" - dependencies: - side-channel: ^1.0.4 - checksum: 0fac5e6c7191d0295a96d0e83c851aeb015df7e990e4d3b093897d3ac6c94e555dbd0a599739c84d7fa46d7fee282d94ba76943983935cf33bba6769539b8019 - languageName: node - linkType: hard - "qs@npm:6.11.0": version: 6.11.0 resolution: "qs@npm:6.11.0" @@ -40246,7 +37597,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:^6.11.0": +"qs@npm:^6.11.0, qs@npm:^6.11.2": version: 6.11.2 resolution: "qs@npm:6.11.2" dependencies: @@ -40327,13 +37678,6 @@ __metadata: languageName: node linkType: hard -"race-signal@npm:^1.0.0": - version: 1.0.1 - resolution: "race-signal@npm:1.0.1" - checksum: d872525af9228f198bf02cb8ecef222639aefe1e63af51c01b5b47aa936b1561556daa90b2503d98e030703873ffd9d5dba2525acfccc64b0abfd3a1fe1c0161 - languageName: node - linkType: hard - "raf@npm:^3.4.1": version: 3.4.1 resolution: "raf@npm:3.4.1" @@ -40404,7 +37748,7 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.2": +"raw-body@npm:2.5.2, raw-body@npm:^2.3.0, raw-body@npm:^2.4.1": version: 2.5.2 resolution: "raw-body@npm:2.5.2" dependencies: @@ -40416,18 +37760,6 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:^2.3.0, raw-body@npm:^2.4.1": - version: 2.5.0 - resolution: "raw-body@npm:2.5.0" - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - checksum: 2ff0683bbff500e6b4cb9dff7a147239fdb6673c33686ea933e5ac49cdb7e7a044581aed88d7c4308e51cc5a093a7a0ab586fe8edf943d6c4aa14d67139c5bd6 - languageName: node - linkType: hard - "rc@npm:^1.2.7, rc@npm:^1.2.8": version: 1.2.8 resolution: "rc@npm:1.2.8" @@ -40489,12 +37821,12 @@ __metadata: linkType: hard "react-devtools-core@npm:^4.19.1": - version: 4.27.8 - resolution: "react-devtools-core@npm:4.27.8" + version: 4.28.5 + resolution: "react-devtools-core@npm:4.28.5" dependencies: shell-quote: ^1.6.1 ws: ^7 - checksum: 83213d5f620e95cf9e60d21a186949f1a523253ea5cca3371d61cf74102efd5074e2e9431cebe4cd9be45a77db647af9c2cdb44c69907ed07441a3334ca19c8b + checksum: d8e4b32ffcfe1ada5c9f7decffd04afc4707a3d6261953a92b8aed1c8abe15cd57d6eb4ce711f842180a2f5c60d2947209e3c1202f7ea29303ee150c55da59e0 languageName: node linkType: hard @@ -40531,14 +37863,7 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^18.0.0": - version: 18.1.0 - resolution: "react-is@npm:18.1.0" - checksum: d206a0fe6790851bff168727bfb896de02c5591695afb0c441163e8630136a3e13ee1a7ddd59fdccddcc93968b4721ae112c10f790b194b03b35a3dc13a355ef - languageName: node - linkType: hard - -"react-is@npm:^18.2.0": +"react-is@npm:^18.0.0, react-is@npm:^18.2.0": version: 18.2.0 resolution: "react-is@npm:18.2.0" checksum: e72d0ba81b5922759e4aff17e0252bd29988f9642ed817f56b25a3e217e13eea8a7f2322af99a06edb779da12d5d636e9fda473d620df9a3da0df2a74141d53e @@ -40702,14 +38027,14 @@ __metadata: linkType: hard "read-package-json@npm:^6.0.0": - version: 6.0.1 - resolution: "read-package-json@npm:6.0.1" + version: 6.0.4 + resolution: "read-package-json@npm:6.0.4" dependencies: - glob: ^9.3.0 + glob: ^10.2.2 json-parse-even-better-errors: ^3.0.0 normalize-package-data: ^5.0.0 npm-normalize-package-bin: ^3.0.0 - checksum: 2fb5c2248da02d5a7180c0538c5b9ebdf04920f4bbf5c19d336d656277d99f1559ba90f2afcdfd6f580c3182a46fe5fb1d3d8c01bc63ffdeae927c91a11a82c9 + checksum: ce40c4671299753f1349aebe44693cd250d6936c4bacfb31cd884c87f24a0174ba5f651ee2866cf5e57365451cba38bc1db9c2a371e4ba7502fb46dcad50f1d7 languageName: node linkType: hard @@ -40848,7 +38173,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:2 || 3": +"readable-stream@npm:2 || 3, readable-stream@npm:3, readable-stream@npm:^3.0.0, readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0, readable-stream@npm:^3.6.2": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" dependencies: @@ -40859,18 +38184,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:3, readable-stream@npm:^3.0.0, readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0": - version: 3.6.0 - resolution: "readable-stream@npm:3.6.0" - dependencies: - inherits: ^2.0.3 - string_decoder: ^1.1.1 - util-deprecate: ^1.0.1 - checksum: d4ea81502d3799439bb955a3a5d1d808592cf3133350ed352aeaa499647858b27b1c4013984900238b0873ec8d0d8defce72469fb7a83e61d53f5ad61cb80dc8 - languageName: node - linkType: hard - -"readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.5, readable-stream@npm:^2.1.4, readable-stream@npm:^2.3.6": +"readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.1, readable-stream@npm:^2.0.5, readable-stream@npm:^2.0.6, readable-stream@npm:^2.1.4, readable-stream@npm:^2.2.2, readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5, readable-stream@npm:^2.3.6": version: 2.3.8 resolution: "readable-stream@npm:2.3.8" dependencies: @@ -40885,30 +38199,16 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^2.0.1, readable-stream@npm:^2.0.6, readable-stream@npm:^2.2.2, readable-stream@npm:^2.3.0, readable-stream@npm:^2.3.5": - version: 2.3.7 - resolution: "readable-stream@npm:2.3.7" - dependencies: - core-util-is: ~1.0.0 - inherits: ~2.0.3 - isarray: ~1.0.0 - process-nextick-args: ~2.0.0 - safe-buffer: ~5.1.1 - string_decoder: ~1.1.1 - util-deprecate: ~1.0.1 - checksum: e4920cf7549a60f8aaf694d483a0e61b2a878b969d224f89b3bc788b8d920075132c4b55a7494ee944c7b6a9a0eada28a7f6220d80b0312ece70bbf08eeca755 - languageName: node - linkType: hard - "readable-stream@npm:^4.1.0": - version: 4.3.0 - resolution: "readable-stream@npm:4.3.0" + version: 4.5.2 + resolution: "readable-stream@npm:4.5.2" dependencies: abort-controller: ^3.0.0 buffer: ^6.0.3 events: ^3.3.0 process: ^0.11.10 - checksum: 5f8d5fc1eb0c6eb47771ad4537881126d6280666e1f10ba1e2262a670a0352c36f59e6a04d17c9a6f7c888218984836dc67f55e95a77de8bfdf06fb75f00f670 + string_decoder: ^1.3.0 + checksum: c4030ccff010b83e4f33289c535f7830190773e274b3fcb6e2541475070bdfd69c98001c3b0cb78763fc00c8b62f514d96c2b10a8bd35d5ce45203a25fa1d33a languageName: node linkType: hard @@ -41055,13 +38355,20 @@ __metadata: languageName: node linkType: hard -"reflect-metadata@npm:0.1.13, reflect-metadata@npm:^0.1.2": +"reflect-metadata@npm:0.1.13": version: 0.1.13 resolution: "reflect-metadata@npm:0.1.13" checksum: 798d379a7b6f6455501145419505c97dd11cbc23857a386add2b9ef15963ccf15a48d9d15507afe01d4cd74116df8a213247200bac00320bd7c11ddeaa5e8fb4 languageName: node linkType: hard +"reflect-metadata@npm:^0.1.2": + version: 0.1.14 + resolution: "reflect-metadata@npm:0.1.14" + checksum: 155ad339319cec3c2d9d84719f730f8b6a6cd2a074733ec29dbae6c89d48a2914c7d07a2350212594f3aae160fa4da4f903e6512f27ceaf968443a7c692bcad0 + languageName: node + linkType: hard + "reflect.getprototypeof@npm:^1.0.4": version: 1.0.4 resolution: "reflect.getprototypeof@npm:1.0.4" @@ -41076,21 +38383,12 @@ __metadata: languageName: node linkType: hard -"regenerate-unicode-properties@npm:^10.0.1": - version: 10.0.1 - resolution: "regenerate-unicode-properties@npm:10.0.1" - dependencies: - regenerate: ^1.4.2 - checksum: 1b638b7087d8143e5be3e20e2cda197ea0440fa0bc2cc49646b2f50c5a2b1acdc54b21e4215805a5a2dd487c686b2291accd5ad00619534098d2667e76247754 - languageName: node - linkType: hard - "regenerate-unicode-properties@npm:^10.1.0": - version: 10.1.0 - resolution: "regenerate-unicode-properties@npm:10.1.0" + version: 10.1.1 + resolution: "regenerate-unicode-properties@npm:10.1.1" dependencies: regenerate: ^1.4.2 - checksum: b1a8929588433ab8b9dc1a34cf3665b3b472f79f2af6ceae00d905fc496b332b9af09c6718fb28c730918f19a00dc1d7310adbaa9b72a2ec7ad2f435da8ace17 + checksum: b80958ef40f125275824c2c47d5081dfaefebd80bff26c76761e9236767c748a4a95a69c053fe29d2df881177f2ca85df4a71fe70a82360388b31159ef19adcf languageName: node linkType: hard @@ -41109,9 +38407,9 @@ __metadata: linkType: hard "regenerator-runtime@npm:^0.14.0": - version: 0.14.0 - resolution: "regenerator-runtime@npm:0.14.0" - checksum: 1c977ad82a82a4412e4f639d65d22be376d3ebdd30da2c003eeafdaaacd03fc00c2320f18120007ee700900979284fc78a9f00da7fb593f6e6eeebc673fba9a3 + version: 0.14.1 + resolution: "regenerator-runtime@npm:0.14.1" + checksum: 9f57c93277b5585d3c83b0cf76be47b473ae8c6d9142a46ce8b0291a04bb2cf902059f0f8445dcabb3fb7378e5fe4bb4ea1e008876343d42e46d3b484534ce38 languageName: node linkType: hard @@ -41150,18 +38448,7 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.4.3, regexp.prototype.flags@npm:^1.5.0": - version: 1.5.0 - resolution: "regexp.prototype.flags@npm:1.5.0" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - functions-have-names: ^1.2.3 - checksum: c541687cdbdfff1b9a07f6e44879f82c66bbf07665f9a7544c5fd16acdb3ec8d1436caab01662d2fbcad403f3499d49ab0b77fbc7ef29ef961d98cc4bc9755b4 - languageName: node - linkType: hard - -"regexp.prototype.flags@npm:^1.5.1": +"regexp.prototype.flags@npm:^1.5.0, regexp.prototype.flags@npm:^1.5.1": version: 1.5.1 resolution: "regexp.prototype.flags@npm:1.5.1" dependencies: @@ -41193,20 +38480,6 @@ __metadata: languageName: node linkType: hard -"regexpu-core@npm:^5.0.1": - version: 5.0.1 - resolution: "regexpu-core@npm:5.0.1" - dependencies: - regenerate: ^1.4.2 - regenerate-unicode-properties: ^10.0.1 - regjsgen: ^0.6.0 - regjsparser: ^0.8.2 - unicode-match-property-ecmascript: ^2.0.0 - unicode-match-property-value-ecmascript: ^2.0.0 - checksum: 6151a9700dad512fadb5564ad23246d54c880eb9417efa5e5c3658b910c1ff894d622dfd159af2ed527ffd44751bfe98682ae06c717155c254d8e2b4bab62785 - languageName: node - linkType: hard - "regexpu-core@npm:^5.3.1": version: 5.3.2 resolution: "regexpu-core@npm:5.3.2" @@ -41221,42 +38494,6 @@ __metadata: languageName: node linkType: hard -"registry-auth-token@npm:^4.0.0": - version: 4.2.1 - resolution: "registry-auth-token@npm:4.2.1" - dependencies: - rc: ^1.2.8 - checksum: aa72060b573a50607cfd2dee16d0e51e13ca58b6a80442e74545325dc24d2c38896e6bad229bdcc1fc9759fa81b4066be8693d4d6f45927318e7c793a93e9cd0 - languageName: node - linkType: hard - -"registry-url@npm:^5.0.0": - version: 5.1.0 - resolution: "registry-url@npm:5.1.0" - dependencies: - rc: ^1.2.8 - checksum: bcea86c84a0dbb66467b53187fadebfea79017cddfb4a45cf27530d7275e49082fe9f44301976eb0164c438e395684bcf3dae4819b36ff9d1640d8cc60c73df9 - languageName: node - linkType: hard - -"regjsgen@npm:^0.6.0": - version: 0.6.0 - resolution: "regjsgen@npm:0.6.0" - checksum: c5158ebd735e75074e41292ade1ff05d85566d205426cc61501e360c450a63baced8512ee3ae238e5c0a0e42969563c7875b08fa69d6f0402daf36bcb3e4d348 - languageName: node - linkType: hard - -"regjsparser@npm:^0.8.2": - version: 0.8.4 - resolution: "regjsparser@npm:0.8.4" - dependencies: - jsesc: ~0.5.0 - bin: - regjsparser: bin/parser - checksum: d069b932491761cda127ce11f6bd2729c3b1b394a35200ec33f1199e937423db28ceb86cf33f0a97c76ecd7c0f8db996476579eaf0d80a1f74c1934f4ca8b27a - languageName: node - linkType: hard - "regjsparser@npm:^0.9.1": version: 0.9.1 resolution: "regjsparser@npm:0.9.1" @@ -41395,6 +38632,20 @@ __metadata: languageName: node linkType: hard +"replace@npm:1.2.2": + version: 1.2.2 + resolution: "replace@npm:1.2.2" + dependencies: + chalk: 2.4.2 + minimatch: 3.0.5 + yargs: ^15.3.1 + bin: + replace: bin/replace.js + search: bin/search.js + checksum: 1d69f43937a5fdf9dea278e78d6f3b51c1889ba5135bd201918bbda6330684adf8276e8e90e1c021034420dd4df239e51c23ca40752cb9bc6180c153d6d46a37 + languageName: node + linkType: hard + "request-progress@npm:^3.0.0": version: 3.0.0 resolution: "request-progress@npm:3.0.0" @@ -41599,7 +38850,7 @@ __metadata: languageName: node linkType: hard -"resolve-alpn@npm:^1.2.0": +"resolve-alpn@npm:^1.0.0, resolve-alpn@npm:^1.2.0": version: 1.2.1 resolution: "resolve-alpn@npm:1.2.1" checksum: f558071fcb2c60b04054c99aebd572a2af97ef64128d59bef7ab73bd50d896a222a056de40ffc545b633d99b304c259ea9d0c06830d5c867c34f0bfa60b8eae0 @@ -41733,7 +38984,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:1.22.2, resolve@npm:^1.15.1, resolve@npm:^1.22.1": +"resolve@npm:1.22.2": version: 1.22.2 resolution: "resolve@npm:1.22.2" dependencies: @@ -41746,33 +38997,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.1.6, resolve@npm:^1.10.0, resolve@npm:^1.10.1, resolve@npm:^1.14.2, resolve@npm:^1.20.0, resolve@npm:^1.3.2, resolve@npm:^1.9.0": - version: 1.22.0 - resolution: "resolve@npm:1.22.0" - dependencies: - is-core-module: ^2.8.1 - path-parse: ^1.0.7 - supports-preserve-symlinks-flag: ^1.0.0 - bin: - resolve: bin/resolve - checksum: a2d14cc437b3a23996f8c7367eee5c7cf8149c586b07ca2ae00e96581ce59455555a1190be9aa92154785cf9f2042646c200d0e00e0bbd2b8a995a93a0ed3e4e - languageName: node - linkType: hard - -"resolve@npm:^1.1.7, resolve@npm:^1.22.4, resolve@npm:^1.3.3": - version: 1.22.4 - resolution: "resolve@npm:1.22.4" - dependencies: - is-core-module: ^2.13.0 - path-parse: ^1.0.7 - supports-preserve-symlinks-flag: ^1.0.0 - bin: - resolve: bin/resolve - checksum: 23f25174c2736ce24c6d918910e0d1f89b6b38fefa07a995dff864acd7863d59a7f049e691f93b4b2ee29696303390d921552b6d1b841ed4a8101f517e1d0124 - languageName: node - linkType: hard - -"resolve@npm:^1.19.0, resolve@npm:^1.22.2, resolve@npm:^1.22.3": +"resolve@npm:^1.1.6, resolve@npm:^1.1.7, resolve@npm:^1.10.0, resolve@npm:^1.10.1, resolve@npm:^1.14.2, resolve@npm:^1.15.1, resolve@npm:^1.19.0, resolve@npm:^1.20.0, resolve@npm:^1.22.1, resolve@npm:^1.22.2, resolve@npm:^1.22.3, resolve@npm:^1.22.4, resolve@npm:^1.3.2, resolve@npm:^1.3.3, resolve@npm:^1.9.0": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -41786,15 +39011,15 @@ __metadata: linkType: hard "resolve@npm:^2.0.0-next.4": - version: 2.0.0-next.4 - resolution: "resolve@npm:2.0.0-next.4" + version: 2.0.0-next.5 + resolution: "resolve@npm:2.0.0-next.5" dependencies: - is-core-module: ^2.9.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: c438ac9a650f2030fd074219d7f12ceb983b475da2d89ad3d6dd05fbf6b7a0a8cd37d4d10b43cb1f632bc19f22246ab7f36ebda54d84a29bfb2910a0680906d3 + checksum: a73ac69a1c4bd34c56b213d91f5b17ce390688fdb4a1a96ed3025cc7e08e7bfb90b3a06fcce461780cb0b589c958afcb0080ab802c71c01a7ecc8c64feafc89f languageName: node linkType: hard @@ -41807,7 +39032,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@1.22.2#~builtin, resolve@patch:resolve@^1.15.1#~builtin, resolve@patch:resolve@^1.22.1#~builtin": +"resolve@patch:resolve@1.22.2#~builtin": version: 1.22.2 resolution: "resolve@patch:resolve@npm%3A1.22.2#~builtin::version=1.22.2&hash=c3c19d" dependencies: @@ -41820,33 +39045,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.10.1#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.3.2#~builtin, resolve@patch:resolve@^1.9.0#~builtin": - version: 1.22.0 - resolution: "resolve@patch:resolve@npm%3A1.22.0#~builtin::version=1.22.0&hash=c3c19d" - dependencies: - is-core-module: ^2.8.1 - path-parse: ^1.0.7 - supports-preserve-symlinks-flag: ^1.0.0 - bin: - resolve: bin/resolve - checksum: c79ecaea36c872ee4a79e3db0d3d4160b593f2ca16e031d8283735acd01715a203607e9ded3f91f68899c2937fa0d49390cddbe0fb2852629212f3cda283f4a7 - languageName: node - linkType: hard - -"resolve@patch:resolve@^1.1.7#~builtin, resolve@patch:resolve@^1.22.4#~builtin, resolve@patch:resolve@^1.3.3#~builtin": - version: 1.22.4 - resolution: "resolve@patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d" - dependencies: - is-core-module: ^2.13.0 - path-parse: ^1.0.7 - supports-preserve-symlinks-flag: ^1.0.0 - bin: - resolve: bin/resolve - checksum: c45f2545fdc4d21883861b032789e20aa67a2f2692f68da320cc84d5724cd02f2923766c5354b3210897e88f1a7b3d6d2c7c22faeead8eed7078e4c783a444bc - languageName: node - linkType: hard - -"resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.22.2#~builtin, resolve@patch:resolve@^1.22.3#~builtin": +"resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.1.7#~builtin, resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.10.1#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.15.1#~builtin, resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin, resolve@patch:resolve@^1.22.2#~builtin, resolve@patch:resolve@^1.22.3#~builtin, resolve@patch:resolve@^1.22.4#~builtin, resolve@patch:resolve@^1.3.2#~builtin, resolve@patch:resolve@^1.3.3#~builtin, resolve@patch:resolve@^1.9.0#~builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#~builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -41860,15 +39059,15 @@ __metadata: linkType: hard "resolve@patch:resolve@^2.0.0-next.4#~builtin": - version: 2.0.0-next.4 - resolution: "resolve@patch:resolve@npm%3A2.0.0-next.4#~builtin::version=2.0.0-next.4&hash=c3c19d" + version: 2.0.0-next.5 + resolution: "resolve@patch:resolve@npm%3A2.0.0-next.5#~builtin::version=2.0.0-next.5&hash=c3c19d" dependencies: - is-core-module: ^2.9.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: 4bf9f4f8a458607af90518ff73c67a4bc1a38b5a23fef2bb0ccbd45e8be89820a1639b637b0ba377eb2be9eedfb1739a84cde24fe4cd670c8207d8fea922b011 + checksum: 064d09c1808d0c51b3d90b5d27e198e6d0c5dad0eb57065fd40803d6a20553e5398b07f76739d69cbabc12547058bec6b32106ea66622375fb0d7e8fca6a846c languageName: node linkType: hard @@ -41943,16 +39142,6 @@ __metadata: languageName: node linkType: hard -"retry-request@npm:^6.0.0": - version: 6.0.0 - resolution: "retry-request@npm:6.0.0" - dependencies: - debug: ^4.1.1 - extend: ^3.0.2 - checksum: 54cd6bc37be509301ebaab944fa64a1be63986ccd2752a06acf05b2ef19b5c06875880754ecd0072680110ba1c30c81337f9547026034ba459ebd1b512799bd7 - languageName: node - linkType: hard - "retry-request@npm:^7.0.0": version: 7.0.1 resolution: "retry-request@npm:7.0.1" @@ -41995,7 +39184,7 @@ __metadata: languageName: node linkType: hard -"rfdc@npm:^1.2.0, rfdc@npm:^1.3.0": +"rfdc@npm:^1.3.0": version: 1.3.0 resolution: "rfdc@npm:1.3.0" checksum: fb2ba8512e43519983b4c61bd3fa77c0f410eff6bae68b08614437bc3f35f91362215f7b4a73cbda6f67330b5746ce07db5dd9850ad3edc91271ad6deea0df32 @@ -42064,16 +39253,13 @@ __metadata: linkType: hard "roarr@npm:^7.0.4": - version: 7.11.0 - resolution: "roarr@npm:7.11.0" + version: 7.21.0 + resolution: "roarr@npm:7.21.0" dependencies: - boolean: ^3.1.4 - fast-json-stringify: ^2.7.10 fast-printf: ^1.6.9 - fast-safe-stringify: ^2.1.1 - globalthis: ^1.0.2 + safe-stable-stringify: ^2.4.3 semver-compare: ^1.0.0 - checksum: 1a0a0c0c607f1e65778384266b303e7969e809a4f068c6846e6f02d9d4615dca146d08171f96846f879e8b54963361042b1164dff668b1d8e261a5eaca978832 + checksum: 95048f145a42547cab45e1a627f1ed028781230e7fee891a9485e670e8920a34480a3b3acdb2706f1d32a714fc2c1c0f5cc9baa4011869b678fcf15b05c899e7 languageName: node linkType: hard @@ -42105,9 +39291,9 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^3.25.2": - version: 3.29.0 - resolution: "rollup@npm:3.29.0" +"rollup@npm:^3.25.2, rollup@npm:^3.27.1": + version: 3.29.4 + resolution: "rollup@npm:3.29.4" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -42115,16 +39301,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 77124a606f44c065dce95b615cd0c9955e1a12f67a30ad28c1128438d5080535b0f028d0edef9dda576ebe8806bdc48aff990198334978738da9716fe9677d72 - languageName: node - linkType: hard - -"run-applescript@npm:^5.0.0": - version: 5.0.0 - resolution: "run-applescript@npm:5.0.0" - dependencies: - execa: ^5.0.0 - checksum: d00c2dbfa5b2d774de7451194b8b125f40f65fc183de7d9dcae97f57f59433586d3c39b9001e111c38bfa24c3436c99df1bb4066a2a0c90d39a8c4cd6889af77 + checksum: 8bb20a39c8d91130825159c3823eccf4dc2295c9a0a5c4ed851a5bf2167dbf24d9a29f23461a54c955e5506395e6cc188eafc8ab0e20399d7489fb33793b184e languageName: node linkType: hard @@ -42240,19 +39417,7 @@ __metadata: languageName: node linkType: hard -"safe-array-concat@npm:^1.0.0": - version: 1.0.0 - resolution: "safe-array-concat@npm:1.0.0" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.2.0 - has-symbols: ^1.0.3 - isarray: ^2.0.5 - checksum: f43cb98fe3b566327d0c09284de2b15fb85ae964a89495c1b1a5d50c7c8ed484190f4e5e71aacc167e16231940079b326f2c0807aea633d47cc7322f40a6b57f - languageName: node - linkType: hard - -"safe-array-concat@npm:^1.0.1": +"safe-array-concat@npm:^1.0.0, safe-array-concat@npm:^1.0.1": version: 1.0.1 resolution: "safe-array-concat@npm:1.0.1" dependencies: @@ -42305,20 +39470,13 @@ __metadata: languageName: node linkType: hard -"safe-stable-stringify@npm:2.4.3": +"safe-stable-stringify@npm:2.4.3, safe-stable-stringify@npm:^2.3.1, safe-stable-stringify@npm:^2.4.3": version: 2.4.3 resolution: "safe-stable-stringify@npm:2.4.3" checksum: 3aeb64449706ee1f5ad2459fc99648b131d48e7a1fbb608d7c628020177512dc9d94108a5cb61bbc953985d313d0afea6566d243237743e02870490afef04b43 languageName: node linkType: hard -"safe-stable-stringify@npm:^2.3.1": - version: 2.3.1 - resolution: "safe-stable-stringify@npm:2.3.1" - checksum: a0a0bad0294c3e2a9d1bf3cf2b1096dfb83c162d09a5e4891e488cce082120bd69161d2a92aae7fc48255290f17700decae9c89a07fe139794e61b5c8b411377 - languageName: node - linkType: hard - "safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.0.2, safer-buffer@npm:^2.1.0, safer-buffer@npm:~2.1.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" @@ -42419,15 +39577,15 @@ __metadata: linkType: hard "sass@npm:^1.58.3": - version: 1.69.3 - resolution: "sass@npm:1.69.3" + version: 1.69.6 + resolution: "sass@npm:1.69.6" dependencies: chokidar: ">=3.0.0 <4.0.0" immutable: ^4.0.0 source-map-js: ">=0.6.2 <2.0.0" bin: sass: sass.js - checksum: b89a3370c7ede462b344e2136bf1407bf375855c1ec54f73b6257b18fe59dae5377eb9f7b25f21ae4a25d8f0bc41a165d8d7e5f693d8285b1aa51ac6056c4d19 + checksum: 9e98eecd283ce6ca5d75ee233e4ec193cb00706d0e119ab6843c44236d3beed2ba28d0af0b4b6bdb4da76feadf426f559d364a69ae54c010467059d130238a36 languageName: node linkType: hard @@ -42438,7 +39596,14 @@ __metadata: languageName: node linkType: hard -"sax@npm:>=0.6.0, sax@npm:^1.2.4, sax@npm:~1.2.4": +"sax@npm:>=0.6.0, sax@npm:^1.2.4": + version: 1.3.0 + resolution: "sax@npm:1.3.0" + checksum: 238ab3a9ba8c8f8aaf1c5ea9120386391f6ee0af52f1a6a40bbb6df78241dd05d782f2359d614ac6aae08c4c4125208b456548a6cf68625aa4fe178486e63ecd + languageName: node + linkType: hard + +"sax@npm:~1.2.4": version: 1.2.4 resolution: "sax@npm:1.2.4" checksum: d3df7d32b897a2c2f28e941f732c71ba90e27c24f62ee918bd4d9a8cfb3553f2f81e5493c7f0be94a11c1911b643a9108f231dd6f60df3fa9586b5d2e3e9e1fe @@ -42511,7 +39676,7 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^3.0.0, schema-utils@npm:^3.2.0": +"schema-utils@npm:^3.0.0, schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0": version: 3.3.0 resolution: "schema-utils@npm:3.3.0" dependencies: @@ -42522,26 +39687,15 @@ __metadata: languageName: node linkType: hard -"schema-utils@npm:^3.1.1": - version: 3.1.1 - resolution: "schema-utils@npm:3.1.1" - dependencies: - "@types/json-schema": ^7.0.8 - ajv: ^6.12.5 - ajv-keywords: ^3.5.2 - checksum: fb73f3d759d43ba033c877628fe9751620a26879f6301d3dbeeb48cf2a65baec5cdf99da65d1bf3b4ff5444b2e59cbe4f81c2456b5e0d2ba7d7fd4aed5da29ce - languageName: node - linkType: hard - "schema-utils@npm:^4.0.0": - version: 4.0.0 - resolution: "schema-utils@npm:4.0.0" + version: 4.2.0 + resolution: "schema-utils@npm:4.2.0" dependencies: "@types/json-schema": ^7.0.9 - ajv: ^8.8.0 + ajv: ^8.9.0 ajv-formats: ^2.1.1 - ajv-keywords: ^5.0.0 - checksum: c843e92fdd1a5c145dbb6ffdae33e501867f9703afac67bdf35a685e49f85b1dcc10ea250033175a64bd9d31f0555bc6785b8359da0c90bcea30cf6dfbb55a8f + ajv-keywords: ^5.1.0 + checksum: 26a0463d47683258106e6652e9aeb0823bf0b85843039e068b57da1892f7ae6b6b1094d48e9ed5ba5cbe9f7166469d880858b9d91abe8bd249421eb813850cde languageName: node linkType: hard @@ -42617,11 +39771,12 @@ __metadata: linkType: hard "selfsigned@npm:^2.1.1": - version: 2.1.1 - resolution: "selfsigned@npm:2.1.1" + version: 2.4.1 + resolution: "selfsigned@npm:2.4.1" dependencies: + "@types/node-forge": ^1.3.0 node-forge: ^1 - checksum: aa9ce2150a54838978d5c0aee54d7ebe77649a32e4e690eb91775f71fdff773874a4fbafd0ac73d8ec3b702ff8a395c604df4f8e8868528f36fd6c15076fb43a + checksum: 38b91c56f1d7949c0b77f9bbe4545b19518475cae15e7d7f0043f87b1626710b011ce89879a88969651f650a19d213bb15b7d5b4c2877df9eeeff7ba8f8b9bfa languageName: node linkType: hard @@ -42639,15 +39794,6 @@ __metadata: languageName: node linkType: hard -"semver-diff@npm:^3.1.1": - version: 3.1.1 - resolution: "semver-diff@npm:3.1.1" - dependencies: - semver: ^6.3.0 - checksum: 8bbe5a5d7add2d5e51b72314a9215cd294d71f41cdc2bf6bd59ee76411f3610b576172896f1d191d0d7294cb9f2f847438d2ee158adacc0c224dca79052812fe - languageName: node - linkType: hard - "semver-parser@npm:4.1.4": version: 4.1.4 resolution: "semver-parser@npm:4.1.4" @@ -42736,7 +39882,7 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:6.0.0, serialize-javascript@npm:^6.0.0": +"serialize-javascript@npm:6.0.0": version: 6.0.0 resolution: "serialize-javascript@npm:6.0.0" dependencies: @@ -42754,7 +39900,7 @@ __metadata: languageName: node linkType: hard -"serialize-javascript@npm:^6.0.1": +"serialize-javascript@npm:^6.0.0, serialize-javascript@npm:^6.0.1": version: 6.0.1 resolution: "serialize-javascript@npm:6.0.1" dependencies: @@ -42763,10 +39909,10 @@ __metadata: languageName: node linkType: hard -"seroval@npm:^0.5.0": - version: 0.5.1 - resolution: "seroval@npm:0.5.1" - checksum: a4c1e42d6a65ed12de3c1f1b6a5b6b996e575c5bc838e1998e92daed7bc05421f3f6c82096387082dba33c475d64a31d0d932ac9b693352549259216e38dc091 +"seroval@npm:^0.15.1": + version: 0.15.1 + resolution: "seroval@npm:0.15.1" + checksum: 9d84fa556178abb716e5611b68daea0da9984953a4585206047a81a6a2e7402b546778bccf53ab6a1bff14cef4b96a68deaca1032cbd25f2daaa57046cc4e168 languageName: node linkType: hard @@ -42995,14 +40141,7 @@ __metadata: languageName: node linkType: hard -"shell-quote@npm:^1.6.1": - version: 1.7.3 - resolution: "shell-quote@npm:1.7.3" - checksum: aca58e73a3a5d933d02e0bdddedc53ee14f7c2ec264f97ac915b9d4482d077a38e422aa664631d60a672cd3cdb4054eb2e6c0303f54882453dacb6483e482d34 - languageName: node - linkType: hard - -"shell-quote@npm:^1.7.3": +"shell-quote@npm:^1.6.1, shell-quote@npm:^1.7.3, shell-quote@npm:^1.8.1": version: 1.8.1 resolution: "shell-quote@npm:1.8.1" checksum: 5f01201f4ef504d4c6a9d0d283fa17075f6770bfbe4c5850b074974c68062f37929ca61700d95ad2ac8822e14e8c4b990ca0e6e9272e64befd74ce5e19f0736b @@ -43043,14 +40182,14 @@ __metadata: linkType: hard "shiki@npm:^0.14.1": - version: 0.14.3 - resolution: "shiki@npm:0.14.3" + version: 0.14.7 + resolution: "shiki@npm:0.14.7" dependencies: ansi-sequence-parser: ^1.1.0 jsonc-parser: ^3.2.0 vscode-oniguruma: ^1.7.0 vscode-textmate: ^8.0.0 - checksum: a4dd98e3b2a5dd8be207448f111ffb9ad2ed6c530f215714d8b61cbf91ec3edbabb09109b8ec58a26678aacd24e8161d5a9bc0c1fa1b4f64b27ceb180cbd0c89 + checksum: 2aec3b3519df977c4391df9e1825cb496e9a4d7e11395f05a0da77e4fa2f7c3d9d6e6ee94029ac699533017f2b25637ee68f6d39f05f311535c2704d0329b520 languageName: node linkType: hard @@ -43418,13 +40557,13 @@ __metadata: linkType: hard "socks-proxy-agent@npm:^6.0.0": - version: 6.1.1 - resolution: "socks-proxy-agent@npm:6.1.1" + version: 6.2.1 + resolution: "socks-proxy-agent@npm:6.2.1" dependencies: agent-base: ^6.0.2 - debug: ^4.3.1 - socks: ^2.6.1 - checksum: 9a8a4f791bba0060315cf7291ca6f9db37d6fc280fd0860d73d8887d3efe4c22e823aa25a8d5375f6079279f8dc91b50c075345179bf832bfe3c7c26d3582e3c + debug: ^4.3.3 + socks: ^2.6.2 + checksum: 9ca089d489e5ee84af06741135c4b0d2022977dad27ac8d649478a114cdce87849e8d82b7c22b51501a4116e231241592946fc7fae0afc93b65030ee57084f58 languageName: node linkType: hard @@ -43450,17 +40589,7 @@ __metadata: languageName: node linkType: hard -"socks@npm:^2.6.1, socks@npm:^2.6.2": - version: 2.6.2 - resolution: "socks@npm:2.6.2" - dependencies: - ip: ^1.1.5 - smart-buffer: ^4.2.0 - checksum: dd9194293059d737759d5c69273850ad4149f448426249325c4bea0e340d1cf3d266c3b022694b0dcf5d31f759de23657244c481fc1e8322add80b7985c36b5e - languageName: node - linkType: hard - -"socks@npm:^2.7.1": +"socks@npm:^2.6.2, socks@npm:^2.7.1": version: 2.7.1 resolution: "socks@npm:2.7.1" dependencies: @@ -43588,12 +40717,12 @@ __metadata: linkType: hard "solid-js@npm:^1.1.7, solid-js@npm:^1.5.4": - version: 1.7.8 - resolution: "solid-js@npm:1.7.8" + version: 1.8.7 + resolution: "solid-js@npm:1.8.7" dependencies: csstype: ^3.1.0 - seroval: ^0.5.0 - checksum: e86ed6e8aa4a9afff652c4a9d49c7e78eae167b9139de8f41095b750f099c25be44a4506d28e927ddb6a684d70ca8c0c2e3398979542ffcbfab55659ad9eedb6 + seroval: ^0.15.1 + checksum: 44a9780e0f9ba2667e96e340b1ee1f33d8844a0b962c9c986049ec953b5bdf72077b53a90524cc98cef279ee4c9a6f06b820be4c5e81ebe8f110b912f22e2ee2 languageName: node linkType: hard @@ -43804,9 +40933,9 @@ __metadata: linkType: hard "spawn-command@npm:^0.0.2-1": - version: 0.0.2-1 - resolution: "spawn-command@npm:0.0.2-1" - checksum: 2cac8519332193d1ed37d57298c4a1f73095e9edd20440fbab4aa47f531da83831734f2b51c44bb42b2747bf3485dec3fa2b0a1003f74c67561f2636622e328b + version: 0.0.2 + resolution: "spawn-command@npm:0.0.2" + checksum: e35c5d28177b4d461d33c88cc11f6f3a5079e2b132c11e1746453bbb7a0c0b8a634f07541a2a234fa4758239d88203b758def509161b651e81958894c0b4b64b languageName: node linkType: hard @@ -43839,12 +40968,12 @@ __metadata: linkType: hard "spdx-correct@npm:^3.0.0": - version: 3.1.1 - resolution: "spdx-correct@npm:3.1.1" + version: 3.2.0 + resolution: "spdx-correct@npm:3.2.0" dependencies: spdx-expression-parse: ^3.0.0 spdx-license-ids: ^3.0.0 - checksum: 77ce438344a34f9930feffa61be0eddcda5b55fc592906ef75621d4b52c07400a97084d8701557b13f7d2aae0cb64f808431f469e566ef3fe0a3a131dcb775a6 + checksum: e9ae98d22f69c88e7aff5b8778dc01c361ef635580e82d29e5c60a6533cc8f4d820803e67d7432581af0cc4fb49973125076ee3b90df191d153e223c004193b2 languageName: node linkType: hard @@ -43866,9 +40995,9 @@ __metadata: linkType: hard "spdx-license-ids@npm:^3.0.0": - version: 3.0.11 - resolution: "spdx-license-ids@npm:3.0.11" - checksum: 1da1acb090257773e60b022094050e810ae9fec874dc1461f65dc0400cd42dd830ab2df6e64fb49c2db3dce386dd0362110780e1b154db7c0bb413488836aaeb + version: 3.0.16 + resolution: "spdx-license-ids@npm:3.0.16" + checksum: 5cdaa85aaa24bd02f9353a2e357b4df0a4f205cb35655f3fd0a5674a4fb77081f28ffd425379214bc3be2c2b7593ce1215df6bcc75884aeee0a9811207feabe2 languageName: node linkType: hard @@ -43943,20 +41072,13 @@ __metadata: languageName: node linkType: hard -"split2@npm:^4.0.0": +"split2@npm:^4.0.0, split2@npm:^4.1.0": version: 4.2.0 resolution: "split2@npm:4.2.0" checksum: 05d54102546549fe4d2455900699056580cca006c0275c334611420f854da30ac999230857a85fdd9914dc2109ae50f80fda43d2a445f2aa86eccdc1dfce779d languageName: node linkType: hard -"split2@npm:^4.1.0": - version: 4.1.0 - resolution: "split2@npm:4.1.0" - checksum: ec581597cb74c13cdfb5e2047543dd40cb1e8e9803c7b1e0c29ede05f2b4f049b2d6e7f2788a225d544549375719658b8f38e9366364dec35dc7a12edfda5ee5 - languageName: node - linkType: hard - "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -44005,40 +41127,23 @@ __metadata: linkType: hard "ssh2@npm:^1.11.0": - version: 1.14.0 - resolution: "ssh2@npm:1.14.0" + version: 1.15.0 + resolution: "ssh2@npm:1.15.0" dependencies: asn1: ^0.2.6 bcrypt-pbkdf: ^1.0.2 - cpu-features: ~0.0.8 - nan: ^2.17.0 - dependenciesMeta: - cpu-features: - optional: true - nan: - optional: true - checksum: c583527950312716f1b620d5120e3c3e241f8cc221f19fc88fd3d561c6020c1009532438f2177a2e706223d91842deff137d93e00832b7b9016593da9a00fb89 - languageName: node - linkType: hard - -"ssh2@npm:^1.4.0": - version: 1.6.0 - resolution: "ssh2@npm:1.6.0" - dependencies: - asn1: ^0.2.4 - bcrypt-pbkdf: ^1.0.2 - cpu-features: 0.0.2 - nan: ^2.15.0 + cpu-features: ~0.0.9 + nan: ^2.18.0 dependenciesMeta: cpu-features: optional: true nan: optional: true - checksum: a0bed1463729e7b1bb2b9e2381cb3b12e3b759c2416a666e0218825fa9eaae440676dc54c151e86186ec9e9d02a283938c7234ebdfc2d29976dd1d137e70cb23 + checksum: 56baa07dc0dd8d97aefa05033b8a95d220a34b2f203aa9116173d7adc5e9fd46be22d7cfed99cdd9f5548862ae44abd1ec136e20ea856d5c470a0df0e5aea9d1 languageName: node linkType: hard -"sshpk@npm:1.17.0, sshpk@npm:^1.7.0": +"sshpk@npm:1.17.0": version: 1.17.0 resolution: "sshpk@npm:1.17.0" dependencies: @@ -44059,16 +41164,28 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^10.0.0": - version: 10.0.2 - resolution: "ssri@npm:10.0.2" +"sshpk@npm:^1.7.0": + version: 1.18.0 + resolution: "sshpk@npm:1.18.0" dependencies: - minipass: ^4.0.0 - checksum: 080392d4c718a81409555d64cd6ebabbf647740605eb269d88ed2a2d8b6e0df6f08efdea13b2f7b2f3ac0e715572923cfd73e8bee866221bcc127f4354ea5ca3 + asn1: ~0.2.3 + assert-plus: ^1.0.0 + bcrypt-pbkdf: ^1.0.0 + dashdash: ^1.12.0 + ecc-jsbn: ~0.1.1 + getpass: ^0.1.1 + jsbn: ~0.1.0 + safer-buffer: ^2.0.2 + tweetnacl: ~0.14.0 + bin: + sshpk-conv: bin/sshpk-conv + sshpk-sign: bin/sshpk-sign + sshpk-verify: bin/sshpk-verify + checksum: 01d43374eee3a7e37b3b82fdbecd5518cbb2e47ccbed27d2ae30f9753f22bd6ffad31225cb8ef013bc3fb7785e686cea619203ee1439a228f965558c367c3cfa languageName: node linkType: hard -"ssri@npm:^10.0.5": +"ssri@npm:^10.0.0, ssri@npm:^10.0.5": version: 10.0.5 resolution: "ssri@npm:10.0.5" dependencies: @@ -44087,11 +41204,11 @@ __metadata: linkType: hard "ssri@npm:^9.0.0": - version: 9.0.0 - resolution: "ssri@npm:9.0.0" + version: 9.0.1 + resolution: "ssri@npm:9.0.1" dependencies: minipass: ^3.1.1 - checksum: bf33174232d07cc64e77ab1c51b55d28352273380c503d35642a19627e88a2c5f160039bb0a28608a353485075dda084dbf0390c7070f9f284559eb71d01b84b + checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb languageName: node linkType: hard @@ -44125,7 +41242,7 @@ __metadata: languageName: node linkType: hard -"stack-utils@npm:^2.0.2": +"stack-utils@npm:^2.0.2, stack-utils@npm:^2.0.3, stack-utils@npm:^2.0.4": version: 2.0.6 resolution: "stack-utils@npm:2.0.6" dependencies: @@ -44134,15 +41251,6 @@ __metadata: languageName: node linkType: hard -"stack-utils@npm:^2.0.3, stack-utils@npm:^2.0.4": - version: 2.0.5 - resolution: "stack-utils@npm:2.0.5" - dependencies: - escape-string-regexp: ^2.0.0 - checksum: 76b69da0f5b48a34a0f93c98ee2a96544d2c4ca2557f7eef5ddb961d3bdc33870b46f498a84a7c4f4ffb781df639840e7ebf6639164ed4da5e1aeb659615b9c7 - languageName: node - linkType: hard - "stackframe@npm:^1.3.4": version: 1.3.4 resolution: "stackframe@npm:1.3.4" @@ -44211,6 +41319,15 @@ __metadata: languageName: node linkType: hard +"static-eval@npm:2.0.2": + version: 2.0.2 + resolution: "static-eval@npm:2.0.2" + dependencies: + escodegen: ^1.8.1 + checksum: 335a923c5ccb29add404ac23d0a55c0da6cee3071f6f67a7053aeac0dedc6dbfc53ac9269e9c25f403f5b7603a291ef47d7114f99bde241184f7aa3f9286dc32 + languageName: node + linkType: hard + "static-extend@npm:^0.1.1": version: 0.1.2 resolution: "static-extend@npm:0.1.2" @@ -44298,6 +41415,15 @@ __metadata: languageName: node linkType: hard +"stream-length@npm:^1.0.2": + version: 1.0.2 + resolution: "stream-length@npm:1.0.2" + dependencies: + bluebird: ^2.6.2 + checksum: 604334be8f534dfc0f245edaf0347311b36b71897ff083485308ccf449f6563b4e15c6f7b3f9e4a4c5f6e633d2d29491afac4baf50084a351f73e3a8a5883bef + languageName: node + linkType: hard + "stream-meter@npm:^1.0.4": version: 1.0.4 resolution: "stream-meter@npm:1.0.4" @@ -44323,18 +41449,7 @@ __metadata: languageName: node linkType: hard -"streamroller@npm:^3.0.2": - version: 3.0.2 - resolution: "streamroller@npm:3.0.2" - dependencies: - date-format: ^4.0.3 - debug: ^4.1.1 - fs-extra: ^10.0.0 - checksum: 1f323824f0e81cc085c24f33addfd8ef00d0c15aafee520a8cf207ca6e2dc674fd852528c7b4450cc87f4335d1269ed18b3f0188853d45d7f0912c9a205d1fc1 - languageName: node - linkType: hard - -"streamroller@npm:^3.1.5": +"streamroller@npm:^3.0.2, streamroller@npm:^3.1.5": version: 3.1.5 resolution: "streamroller@npm:3.1.5" dependencies: @@ -44400,7 +41515,7 @@ __metadata: languageName: node linkType: hard -"string-natural-compare@npm:^3.0.1": +"string-natural-compare@npm:3.0.1, string-natural-compare@npm:^3.0.1": version: 3.0.1 resolution: "string-natural-compare@npm:3.0.1" checksum: 65910d9995074086e769a68728395effbba9b7186be5b4c16a7fad4f4ef50cae95ca16e3e9086e019cbb636ae8daac9c7b8fe91b5f21865c5c0f26e3c0725406 @@ -44414,13 +41529,6 @@ __metadata: languageName: node linkType: hard -"string-similarity@npm:^4.0.1": - version: 4.0.4 - resolution: "string-similarity@npm:4.0.4" - checksum: 797b41b24e1eb6b3b0ab896950b58c295a19a82933479c75f7b5279ffb63e0b456a8c8d10329c02f607ca1a50370e961e83d552aa468ff3b0fa15809abc9eff7 - languageName: node - linkType: hard - "string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.0.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.2, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" @@ -44493,66 +41601,46 @@ __metadata: linkType: hard "string.prototype.padend@npm:^3.0.0": - version: 3.1.3 - resolution: "string.prototype.padend@npm:3.1.3" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.3 - es-abstract: ^1.19.1 - checksum: ef9ee0542c17975629bc6d21497e8faaa142d873e9f07fb65de2a955df402a1eac45cbed375045a759501e9d4ef80e589e11f0e12103c20df0770e47f6b59bc7 - languageName: node - linkType: hard - -"string.prototype.trim@npm:^1.2.7": - version: 1.2.7 - resolution: "string.prototype.trim@npm:1.2.7" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - checksum: 05b7b2d6af63648e70e44c4a8d10d8cc457536df78b55b9d6230918bde75c5987f6b8604438c4c8652eb55e4fc9725d2912789eb4ec457d6995f3495af190c09 - languageName: node - linkType: hard - -"string.prototype.trimend@npm:^1.0.4": - version: 1.0.4 - resolution: "string.prototype.trimend@npm:1.0.4" + version: 3.1.5 + resolution: "string.prototype.padend@npm:3.1.5" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.3 - checksum: 17e5aa45c3983f582693161f972c1c1fa4bbbdf22e70e582b00c91b6575f01680dc34e83005b98e31abe4d5d29e0b21fcc24690239c106c7b2315aade6a898ac + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: fc915e0b6ae1dce07a9f5088429d84fda2c1c0ac9a05bc14a602f173cc2fdef32e4893dfba5656f8f955450c9c16deebdb8d303d27613a367bc6d8508a94cd5e languageName: node linkType: hard -"string.prototype.trimend@npm:^1.0.6": - version: 1.0.6 - resolution: "string.prototype.trimend@npm:1.0.6" +"string.prototype.trim@npm:^1.2.7, string.prototype.trim@npm:^1.2.8": + version: 1.2.8 + resolution: "string.prototype.trim@npm:1.2.8" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - checksum: 0fdc34645a639bd35179b5a08227a353b88dc089adf438f46be8a7c197fc3f22f8514c1c9be4629b3cd29c281582730a8cbbad6466c60f76b5f99cf2addb132e + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 49eb1a862a53aba73c3fb6c2a53f5463173cb1f4512374b623bcd6b43ad49dd559a06fb5789bdec771a40fc4d2a564411c0a75d35fb27e76bbe738c211ecff07 languageName: node linkType: hard -"string.prototype.trimstart@npm:^1.0.4": - version: 1.0.4 - resolution: "string.prototype.trimstart@npm:1.0.4" +"string.prototype.trimend@npm:^1.0.7": + version: 1.0.7 + resolution: "string.prototype.trimend@npm:1.0.7" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.3 - checksum: 3fb06818d3cccac5fa3f5f9873d984794ca0e9f6616fae6fcc745885d9efed4e17fe15f832515d9af5e16c279857fdbffdfc489ca4ed577811b017721b30302f + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 2375516272fd1ba75992f4c4aa88a7b5f3c7a9ca308d963bcd5645adf689eba6f8a04ebab80c33e30ec0aefc6554181a3a8416015c38da0aa118e60ec896310c languageName: node linkType: hard -"string.prototype.trimstart@npm:^1.0.6": - version: 1.0.6 - resolution: "string.prototype.trimstart@npm:1.0.6" +"string.prototype.trimstart@npm:^1.0.7": + version: 1.0.7 + resolution: "string.prototype.trimstart@npm:1.0.7" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.4 - es-abstract: ^1.20.4 - checksum: 89080feef416621e6ef1279588994305477a7a91648d9436490d56010a1f7adc39167cddac7ce0b9884b8cdbef086987c4dcb2960209f2af8bac0d23ceff4f41 + define-properties: ^1.2.0 + es-abstract: ^1.22.1 + checksum: 13d0c2cb0d5ff9e926fa0bec559158b062eed2b68cd5be777ffba782c96b2b492944e47057274e064549b94dd27cf81f48b27a31fee8af5b574cff253e7eb613 languageName: node linkType: hard @@ -44821,12 +41909,12 @@ __metadata: linkType: hard "sucrase@npm:^3.32.0": - version: 3.34.0 - resolution: "sucrase@npm:3.34.0" + version: 3.35.0 + resolution: "sucrase@npm:3.35.0" dependencies: "@jridgewell/gen-mapping": ^0.3.2 commander: ^4.0.0 - glob: 7.1.6 + glob: ^10.3.10 lines-and-columns: ^1.1.6 mz: ^2.7.0 pirates: ^4.0.1 @@ -44834,7 +41922,7 @@ __metadata: bin: sucrase: bin/sucrase sucrase-node: bin/sucrase-node - checksum: 61860063bdf6103413698e13247a3074d25843e91170825a9752e4af7668ffadd331b6e99e92fc32ee5b3c484ee134936f926fa9039d5711fafff29d017a2110 + checksum: 9fc5792a9ab8a14dcf9c47dcb704431d35c1cdff1d17d55d382a31c2e8e3063870ad32ce120a80915498486246d612e30cda44f1624d9d9a10423e1a43487ad1 languageName: node linkType: hard @@ -44851,6 +41939,17 @@ __metadata: languageName: node linkType: hard +"super-regex@npm:^0.2.0": + version: 0.2.0 + resolution: "super-regex@npm:0.2.0" + dependencies: + clone-regexp: ^3.0.0 + function-timeout: ^0.1.0 + time-span: ^5.1.0 + checksum: 99865cb002a7e4af78cbfb51ef9636d51c1678319cf50e3cca8a7ef205eff41732430de1d36f2872949388c11506ef6e9c7dbf220bea6748a80edd98c8170866 + languageName: node + linkType: hard + "supports-color@npm:5.4.0": version: 5.4.0 resolution: "supports-color@npm:5.4.0" @@ -45058,21 +42157,21 @@ __metadata: linkType: hard "swarm-js@npm:^0.1.40": - version: 0.1.40 - resolution: "swarm-js@npm:0.1.40" + version: 0.1.42 + resolution: "swarm-js@npm:0.1.42" dependencies: bluebird: ^3.5.0 buffer: ^5.0.5 eth-lib: ^0.1.26 fs-extra: ^4.0.2 - got: ^7.1.0 + got: ^11.8.5 mime-types: ^2.1.16 mkdirp-promise: ^5.0.1 mock-fs: ^4.1.0 setimmediate: ^1.0.5 tar: ^4.0.2 xhr-request: ^1.0.1 - checksum: 1de56e0cb02c1c80e041efb2bd2cc7250c5451c3016967266c16d5c1e8c74fe5c3aae45dc46065b1f4d77667a8453b967961ec58b3975469522f566aa840a914 + checksum: bbb54b84232ef113ee106cf8158d1c827fbf84b309799576f61603f63d7653fde7e71df981d07f9e4c41781bbbbd72be77e5a47e6b694d6a83b96a6a20641475 languageName: node linkType: hard @@ -45098,12 +42197,12 @@ __metadata: linkType: hard "synckit@npm:^0.8.5": - version: 0.8.5 - resolution: "synckit@npm:0.8.5" + version: 0.8.8 + resolution: "synckit@npm:0.8.8" dependencies: - "@pkgr/utils": ^2.3.1 - tslib: ^2.5.0 - checksum: 8a9560e5d8f3d94dc3cf5f7b9c83490ffa30d320093560a37b88f59483040771fd1750e76b9939abfbb1b5a23fd6dfbae77f6b338abffe7cae7329cd9b9bb86b + "@pkgr/core": ^0.1.0 + tslib: ^2.6.2 + checksum: 9ed5d33abb785f5f24e2531efd53b2782ca77abf7912f734d170134552b99001915531be5a50297aa45c5701b5c9041e8762e6cd7a38e41e2461c1e7fccdedf8 languageName: node linkType: hard @@ -45148,15 +42247,15 @@ __metadata: linkType: hard "table@npm:^6.0.9": - version: 6.8.0 - resolution: "table@npm:6.8.0" + version: 6.8.1 + resolution: "table@npm:6.8.1" dependencies: ajv: ^8.0.1 lodash.truncate: ^4.4.2 slice-ansi: ^4.0.0 string-width: ^4.2.3 strip-ansi: ^6.0.1 - checksum: 5b07fe462ee03d2e1fac02cbb578efd2e0b55ac07e3d3db2e950aa9570ade5a4a2b8d3c15e9f25c89e4e50b646bc4269934601ee1eef4ca7968ad31960977690 + checksum: 08249c7046125d9d0a944a6e96cfe9ec66908d6b8a9db125531be6eb05fa0de047fd5542e9d43b4f987057f00a093b276b8d3e19af162a9c40db2681058fd306 languageName: node linkType: hard @@ -45171,18 +42270,18 @@ __metadata: linkType: hard "tailwindcss@npm:^3.0.2": - version: 3.3.3 - resolution: "tailwindcss@npm:3.3.3" + version: 3.4.0 + resolution: "tailwindcss@npm:3.4.0" dependencies: "@alloc/quick-lru": ^5.2.0 arg: ^5.0.2 chokidar: ^3.5.3 didyoumean: ^1.2.2 dlv: ^1.1.3 - fast-glob: ^3.2.12 + fast-glob: ^3.3.0 glob-parent: ^6.0.2 is-glob: ^4.0.3 - jiti: ^1.18.2 + jiti: ^1.19.1 lilconfig: ^2.1.0 micromatch: ^4.0.5 normalize-path: ^3.0.0 @@ -45199,13 +42298,13 @@ __metadata: bin: tailwind: lib/cli.js tailwindcss: lib/cli.js - checksum: 0195c7a3ebb0de5e391d2a883d777c78a4749f0c532d204ee8aea9129f2ed8e701d8c0c276aa5f7338d07176a3c2a7682c1d0ab9c8a6c2abe6d9325c2954eb50 + checksum: d7f05beb1cf98d169b9b65ef674a82dd16c97757194f9bacee4c536cf74f3852e0008a74f7af8578f4a1e9639fac262fd8ef89efe3e6e06667243640422f9462 languageName: node linkType: hard "tap-mocha-reporter@npm:^5.0.3": - version: 5.0.3 - resolution: "tap-mocha-reporter@npm:5.0.3" + version: 5.0.4 + resolution: "tap-mocha-reporter@npm:5.0.4" dependencies: color-support: ^1.1.0 debug: ^4.1.1 @@ -45217,7 +42316,7 @@ __metadata: unicode-length: ^2.0.2 bin: tap-mocha-reporter: index.js - checksum: 8e09147308328486dab1e9a3b11beb522d3592e1403724c961b0adfc122f7ef6f429eaa1dcac6c54e1c7c9e746dcbc4e17576a8625f731a39eee775af1a78f94 + checksum: c3e1001fca84acd5c8148384c06997d99850695412d353823343884702ea722b404db8bc1218be11fec78fde4f1f90239b4c7c194a87490686cf05fa6fb5acb4 languageName: node linkType: hard @@ -45234,16 +42333,7 @@ __metadata: languageName: node linkType: hard -"tap-yaml@npm:^1.0.0": - version: 1.0.0 - resolution: "tap-yaml@npm:1.0.0" - dependencies: - yaml: ^1.5.0 - checksum: c69bc3ffcfd82b30c8e975d87d7bdc8f3a1b58a19b2bcd07b10460274bd4b3ab33522d72e69ef80afe79dbd1adc24c461373061ec17f4d073aaf87799c380c07 - languageName: node - linkType: hard - -"tap-yaml@npm:^1.0.2": +"tap-yaml@npm:^1.0.0, tap-yaml@npm:^1.0.2": version: 1.0.2 resolution: "tap-yaml@npm:1.0.2" dependencies: @@ -45438,21 +42528,7 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.1.11 - resolution: "tar@npm:6.1.11" - dependencies: - chownr: ^2.0.0 - fs-minipass: ^2.0.0 - minipass: ^3.0.0 - minizlib: ^2.1.1 - mkdirp: ^1.0.3 - yallist: ^4.0.0 - checksum: a04c07bb9e2d8f46776517d4618f2406fb977a74d914ad98b264fc3db0fe8224da5bec11e5f8902c5b9bcb8ace22d95fbe3c7b36b8593b7dfc8391a25898f32f - languageName: node - linkType: hard - -"tar@npm:^6.2.0": +"tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.2, tar@npm:^6.2.0": version: 6.2.0 resolution: "tar@npm:6.2.0" dependencies: @@ -45483,11 +42559,11 @@ __metadata: linkType: hard "tdigest@npm:^0.1.1": - version: 0.1.1 - resolution: "tdigest@npm:0.1.1" + version: 0.1.2 + resolution: "tdigest@npm:0.1.2" dependencies: - bintrees: 1.0.1 - checksum: 4d05fd70fb0aa70aa101d01557722b7ef9a91b2ebf8dfc274ca9852220397a74e4ed6e59c55335b4b1dd0ac5e1b65d25b8d32ae01278fc3b783c40f6d84303e2 + bintrees: 1.0.2 + checksum: 44de8246752b6f8c2924685f969fd3d94c36949f22b0907e99bef2b2220726dd8467f4730ea96b06040b9aa2587c0866049640039d1b956952dfa962bc2075a3 languageName: node linkType: hard @@ -45551,14 +42627,14 @@ __metadata: linkType: hard "terser-webpack-plugin@npm:^5.2.5, terser-webpack-plugin@npm:^5.3.7": - version: 5.3.9 - resolution: "terser-webpack-plugin@npm:5.3.9" + version: 5.3.10 + resolution: "terser-webpack-plugin@npm:5.3.10" dependencies: - "@jridgewell/trace-mapping": ^0.3.17 + "@jridgewell/trace-mapping": ^0.3.20 jest-worker: ^27.4.5 schema-utils: ^3.1.1 serialize-javascript: ^6.0.1 - terser: ^5.16.8 + terser: ^5.26.0 peerDependencies: webpack: ^5.1.0 peerDependenciesMeta: @@ -45568,7 +42644,7 @@ __metadata: optional: true uglify-js: optional: true - checksum: 41705713d6f9cb83287936b21e27c658891c78c4392159f5148b5623f0e8c48559869779619b058382a4c9758e7820ea034695e57dc7c474b4962b79f553bc5f + checksum: bd6e7596cf815f3353e2a53e79cbdec959a1b0276f5e5d4e63e9d7c3c5bb5306df567729da287d1c7b39d79093e56863c569c42c6c24cc34c76aa313bd2cbcea languageName: node linkType: hard @@ -45586,9 +42662,9 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.0.0, terser@npm:^5.10.0": - version: 5.22.0 - resolution: "terser@npm:5.22.0" +"terser@npm:^5.0.0, terser@npm:^5.10.0, terser@npm:^5.26.0": + version: 5.26.0 + resolution: "terser@npm:5.26.0" dependencies: "@jridgewell/source-map": ^0.3.3 acorn: ^8.8.2 @@ -45596,21 +42672,7 @@ __metadata: source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: ee95981c54ebd381e0b7f5872c646e7a05543e53960f8e0c2f240863c368989d43a3ca80b7e9f691683c92ba199eb4b91d61785fef0b9ca4a887eb55866001f4 - languageName: node - linkType: hard - -"terser@npm:^5.16.8": - version: 5.19.4 - resolution: "terser@npm:5.19.4" - dependencies: - "@jridgewell/source-map": ^0.3.3 - acorn: ^8.8.2 - commander: ^2.20.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: 09273ce7d3fbe8fea0ec2603ad1c06cc304838bdac42bbfe77835b0b0b6c4a894054575ca518fe16c95d5c401574a8c703f4fde97da45f1c972ea568e6ecafda + checksum: 02a9bb896f04df828025af8f0eced36c315d25d310b6c2418e7dad2bed19ddeb34a9cea9b34e7c24789830fa51e1b6a9be26679980987a9c817a7e6d9cd4154b languageName: node linkType: hard @@ -45711,9 +42773,9 @@ __metadata: linkType: hard "throttleit@npm:^1.0.0": - version: 1.0.0 - resolution: "throttleit@npm:1.0.0" - checksum: 1b2db4d2454202d589e8236c07a69d2fab838876d370030ebea237c34c0a7d1d9cf11c29f994531ebb00efd31e9728291042b7754f2798a8352ec4463455b659 + version: 1.0.1 + resolution: "throttleit@npm:1.0.1" + checksum: 32e0b12ca5810cd34dfce0408c7cb658dfd039848a073466eaac667ce6e846cafa53ac518e4b01dc6f34e6652b66fd29a5c6b666718ec5086ef328a9d029dc75 languageName: node linkType: hard @@ -45757,6 +42819,15 @@ __metadata: languageName: node linkType: hard +"time-span@npm:^5.1.0": + version: 5.1.0 + resolution: "time-span@npm:5.1.0" + dependencies: + convert-hrtime: ^5.0.0 + checksum: 949c45fcb873f2d26fda3db1b7f7161ce65206f6e94a7c6c9bf3a5a07a373570dba57ca5c1f816efa6326adbc3f9e93bb6ef19a7a220f4259a917e1192d49418 + languageName: node + linkType: hard + "time-stamp@npm:^2.0.0": version: 2.2.0 resolution: "time-stamp@npm:2.2.0" @@ -45764,7 +42835,7 @@ __metadata: languageName: node linkType: hard -"timed-out@npm:^4.0.0, timed-out@npm:^4.0.1": +"timed-out@npm:^4.0.1": version: 4.0.1 resolution: "timed-out@npm:4.0.1" checksum: 98efc5d6fc0d2a329277bd4d34f65c1bf44d9ca2b14fd267495df92898f522e6f563c5e9e467c418e0836f5ca1f47a84ca3ee1de79b1cc6fe433834b7f02ec54 @@ -45813,13 +42884,6 @@ __metadata: languageName: node linkType: hard -"titleize@npm:^3.0.0": - version: 3.0.0 - resolution: "titleize@npm:3.0.0" - checksum: 71fbbeabbfb36ccd840559f67f21e356e1d03da2915b32d2ae1a60ddcc13a124be2739f696d2feb884983441d159a18649e8d956648d591bdad35c430a6b6d28 - languageName: node - linkType: hard - "tls-browserify@npm:0.2.2": version: 0.2.2 resolution: "tls-browserify@npm:0.2.2" @@ -46026,9 +43090,9 @@ __metadata: linkType: hard "trim-newlines@npm:^4.0.2": - version: 4.0.2 - resolution: "trim-newlines@npm:4.0.2" - checksum: 1eef206eb77361856dff0b827e5811baf64574bb21e81b7ad643fe321c5c19b0a452dd83e9afc31206993fcff9bb90a379925d7b5915f887de1ca7da5b57933a + version: 4.1.1 + resolution: "trim-newlines@npm:4.1.1" + checksum: 5b09f8e329e8f33c1111ef26906332ba7ba7248cde3e26fc054bb3d69f2858bf5feedca9559c572ff91f33e52977c28e0d41c387df6a02a633cbb8c2d8238627 languageName: node linkType: hard @@ -46040,16 +43104,16 @@ __metadata: linkType: hard "triple-beam@npm:^1.3.0": - version: 1.3.0 - resolution: "triple-beam@npm:1.3.0" - checksum: 7d7b77d8625fb252c126c24984a68de462b538a8fcd1de2abd0a26421629cf3527d48e23b3c2264f08f4a6c3bc40a478a722176f4d7b6a1acc154cb70c359f2b + version: 1.4.1 + resolution: "triple-beam@npm:1.4.1" + checksum: 2e881a3e8e076b6f2b85b9ec9dd4a900d3f5016e6d21183ed98e78f9abcc0149e7d54d79a3f432b23afde46b0885bdcdcbff789f39bc75de796316961ec07f61 languageName: node linkType: hard "trivial-deferred@npm:^1.0.1": - version: 1.0.1 - resolution: "trivial-deferred@npm:1.0.1" - checksum: bfadeec953de30d1b751663cb96a84ace88e1b173e71e7361925aeb8025ab9f31628295935beb6791dd5bbae6d7146ba057e35c29613be0739f70cf2ed159cbb + version: 1.1.2 + resolution: "trivial-deferred@npm:1.1.2" + checksum: 1c1a45036b6c863ffe3272ac13b4256ba5f1fd43532bbb329fe9b8ead442a7eeedb6b818849517889084d09c9e8a14766051621354a31335bd7cdd4658564705 languageName: node linkType: hard @@ -46090,11 +43154,11 @@ __metadata: linkType: hard "ts-api-utils@npm:^1.0.1": - version: 1.0.1 - resolution: "ts-api-utils@npm:1.0.1" + version: 1.0.3 + resolution: "ts-api-utils@npm:1.0.3" peerDependencies: typescript: ">=4.2.0" - checksum: 78794fc7270d295b36c1ac613465b5dc7e7226907a533125b30f177efef9dd630d4e503b00be31b44335eb2ebf9e136ebe97353f8fc5d383885d5fead9d54c09 + checksum: 441cc4489d65fd515ae6b0f4eb8690057add6f3b6a63a36073753547fb6ce0c9ea0e0530220a0b282b0eec535f52c4dfc315d35f8a4c9a91c0def0707a714ca6 languageName: node linkType: hard @@ -46153,7 +43217,7 @@ __metadata: languageName: node linkType: hard -"ts-node@npm:10.9.1, ts-node@npm:^10.8.1": +"ts-node@npm:10.9.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1" dependencies: @@ -46211,11 +43275,11 @@ __metadata: languageName: node linkType: hard -"ts-node@npm:^10.0.0": - version: 10.5.0 - resolution: "ts-node@npm:10.5.0" +"ts-node@npm:^10.0.0, ts-node@npm:^10.8.1": + version: 10.9.2 + resolution: "ts-node@npm:10.9.2" dependencies: - "@cspotcode/source-map-support": 0.7.0 + "@cspotcode/source-map-support": ^0.8.0 "@tsconfig/node10": ^1.0.7 "@tsconfig/node12": ^1.0.7 "@tsconfig/node14": ^1.0.0 @@ -46226,7 +43290,7 @@ __metadata: create-require: ^1.1.0 diff: ^4.0.1 make-error: ^1.1.1 - v8-compile-cache-lib: ^3.0.0 + v8-compile-cache-lib: ^3.0.1 yn: 3.1.1 peerDependencies: "@swc/core": ">=1.2.50" @@ -46241,10 +43305,11 @@ __metadata: bin: ts-node: dist/bin.js ts-node-cwd: dist/bin-cwd.js + ts-node-esm: dist/bin-esm.js ts-node-script: dist/bin-script.js ts-node-transpile-only: dist/bin-transpile.js ts-script: dist/bin-script-deprecated.js - checksum: d51ac8a9b3582ce3705cef8d35f3372e40caa277dbd7c7baeb651961538f13d2f11f22402614348f78d9b10501bd1cb5f05ec4f2ec9a74bd0e288de769c32335 + checksum: fde256c9073969e234526e2cfead42591b9a2aec5222bac154b0de2fa9e4ceb30efcd717ee8bc785a56f3a119bdd5aa27b333d9dbec94ed254bd26f8944c67ac languageName: node linkType: hard @@ -46277,15 +43342,15 @@ __metadata: languageName: node linkType: hard -"tsconfig-paths@npm:^3.14.2": - version: 3.14.2 - resolution: "tsconfig-paths@npm:3.14.2" +"tsconfig-paths@npm:^3.14.2, tsconfig-paths@npm:^3.15.0": + version: 3.15.0 + resolution: "tsconfig-paths@npm:3.15.0" dependencies: "@types/json5": ^0.0.29 json5: ^1.0.2 minimist: ^1.2.6 strip-bom: ^3.0.0 - checksum: a6162eaa1aed680537f93621b82399c7856afd10ec299867b13a0675e981acac4e0ec00896860480efc59fc10fd0b16fdc928c0b885865b52be62cadac692447 + checksum: 59f35407a390d9482b320451f52a411a256a130ff0e7543d18c6f20afab29ac19fbe55c360a93d6476213cc335a4d76ce90f67df54c4e9037f7d240920832201 languageName: node linkType: hard @@ -46314,14 +43379,14 @@ __metadata: languageName: node linkType: hard -"tslib@npm:2.4.0, tslib@npm:^2.3.0": +"tslib@npm:2.4.0": version: 2.4.0 resolution: "tslib@npm:2.4.0" checksum: 8c4aa6a3c5a754bf76aefc38026134180c053b7bd2f81338cb5e5ebf96fefa0f417bff221592bf801077f5bf990562f6264fecbc42cd3309b33872cb6fc3b113 languageName: node linkType: hard -"tslib@npm:2.5.0, tslib@npm:^2.4.0": +"tslib@npm:2.5.0": version: 2.5.0 resolution: "tslib@npm:2.5.0" checksum: ae3ed5f9ce29932d049908ebfdf21b3a003a85653a9a140d614da6b767a93ef94f460e52c3d787f0e4f383546981713f165037dc2274df212ea9f8a4541004e1 @@ -46335,7 +43400,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:2.6.2, tslib@npm:^2.5.0, tslib@npm:^2.6.0": +"tslib@npm:2.6.2, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.2": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad @@ -46349,20 +43414,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.1.0, tslib@npm:^2.2.0": - version: 2.3.1 - resolution: "tslib@npm:2.3.1" - checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9 - languageName: node - linkType: hard - -"tslib@npm:^2.0.3": - version: 2.6.0 - resolution: "tslib@npm:2.6.0" - checksum: c01066038f950016a18106ddeca4649b4d76caa76ec5a31e2a26e10586a59fceb4ee45e96719bf6c715648e7c14085a81fee5c62f7e9ebee68e77a5396e5538f - languageName: node - linkType: hard - "tslib@npm:~2.4.0": version: 2.4.1 resolution: "tslib@npm:2.4.1" @@ -46501,7 +43552,7 @@ __metadata: languageName: node linkType: hard -"tv4@npm:^1.2.7": +"tv4@npm:^1.2.7, tv4@npm:^1.3.0": version: 1.3.0 resolution: "tv4@npm:1.3.0" checksum: 075096cf3bc2db5727650e16717a343954625c5fde6b2bb5553c86a9a5ca7b9fd287c0f5ab7ac03094f39e982fe9288dc715c7223a90e1684fd2263460a74bbd @@ -46631,17 +43682,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^4.2.0": - version: 4.3.1 - resolution: "type-fest@npm:4.3.1" - checksum: 04e0f073dcc31c113c1b8856c089b388e7e9f4383a9ed72cc1466a89ec50d9d67678844eeec342b5a1ce71b21e817764d4f067aa148f6bcb5df9005ff3803382 - languageName: node - linkType: hard - -"type-fest@npm:^4.6.0": - version: 4.8.3 - resolution: "type-fest@npm:4.8.3" - checksum: cd8c9a20a32b9d813f5f6d84bd81e52e22fb779a7ef0ae53974bae5baac427974bc8243269e9832b22ce2b6277d857b44769b3664f97dcac344e600bdd95f186 +"type-fest@npm:^4.2.0, type-fest@npm:^4.6.0": + version: 4.9.0 + resolution: "type-fest@npm:4.9.0" + checksum: 73383de23237b399a70397a53101152548846d919aebcc7d8733000c6c354dc2632fe37c4a70b8571b79fdbfa099e2d8304c5ac56b3254780acff93e4c7a797f languageName: node linkType: hard @@ -46662,13 +43706,6 @@ __metadata: languageName: node linkType: hard -"type@npm:^2.5.0": - version: 2.6.0 - resolution: "type@npm:2.6.0" - checksum: 80da01fcc0f6ed5a253dc326530e134000a8f66ea44b6d9687cde2f894f0d0b2486595b0cd040a64f7f79dc3120784236f8c9ef667a8aef03984e049b447cfb4 - languageName: node - linkType: hard - "type@npm:^2.7.2": version: 2.7.2 resolution: "type@npm:2.7.2" @@ -46847,13 +43884,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.6.4 || ^5.0.0": - version: 5.2.2 - resolution: "typescript@npm:5.2.2" +"typescript@npm:^4.6.4 || ^5.2.2": + version: 5.3.3 + resolution: "typescript@npm:5.3.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c + checksum: 2007ccb6e51bbbf6fde0a78099efe04dc1c3dfbdff04ca3b6a8bc717991862b39fd6126c0c3ebf2d2d98ac5e960bcaa873826bb2bb241f14277034148f41f6a2 languageName: node linkType: hard @@ -46877,13 +43914,13 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^4.6.4 || ^5.0.0#~builtin": - version: 5.2.2 - resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=5da071" +"typescript@patch:typescript@^4.6.4 || ^5.2.2#~builtin": + version: 5.3.3 + resolution: "typescript@patch:typescript@npm%3A5.3.3#~builtin::version=5.3.3&hash=5da071" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 07106822b4305de3f22835cbba949a2b35451cad50888759b6818421290ff95d522b38ef7919e70fb381c5fe9c1c643d7dea22c8b31652a717ddbd57b7f4d554 + checksum: f61375590b3162599f0f0d5b8737877ac0a7bc52761dbb585d67e7b8753a3a4c42d9a554c4cc929f591ffcf3a2b0602f65ae3ce74714fd5652623a816862b610 languageName: node linkType: hard @@ -46902,11 +43939,11 @@ __metadata: linkType: hard "uglify-js@npm:^3.1.4": - version: 3.15.1 - resolution: "uglify-js@npm:3.15.1" + version: 3.17.4 + resolution: "uglify-js@npm:3.17.4" bin: uglifyjs: bin/uglifyjs - checksum: cf88574ec8af4d69368142a3f9fb83ac11b1344a117dff08890fcf99ed12c782c810f02e71a0c2a7e8666ea6225894f1c171cbd90e1a1fe4b2c4a198f8ad61a3 + checksum: 7b3897df38b6fc7d7d9f4dcd658599d81aa2b1fb0d074829dd4e5290f7318dbca1f4af2f45acb833b95b1fe0ed4698662ab61b87e94328eb4c0a0d3435baf924 languageName: node linkType: hard @@ -46927,30 +43964,39 @@ __metadata: linkType: hard "uint8-varint@npm:^2.0.1": - version: 2.0.1 - resolution: "uint8-varint@npm:2.0.1" + version: 2.0.3 + resolution: "uint8-varint@npm:2.0.3" dependencies: uint8arraylist: ^2.0.0 - uint8arrays: ^4.0.2 - checksum: b03431e7fb87224726524b6dcc4ac0ff2c61c122134be0b16394c04bac4a3b59328800f302e3d3df7715bdb676b2e1fd0a17332cf6dbdb148cbb9f81332cedef + uint8arrays: ^5.0.0 + checksum: 8c20b02f803ade88d3aad0c01368e8bfebedca3cb43f2d74347f32b92a219ab734b8df4bb0dee5540261de984896ef4ffb3c58e83b200d4b1d01a7e3f7757dee languageName: node linkType: hard "uint8arraylist@npm:^2.0.0, uint8arraylist@npm:^2.1.2, uint8arraylist@npm:^2.4.3": - version: 2.4.3 - resolution: "uint8arraylist@npm:2.4.3" + version: 2.4.8 + resolution: "uint8arraylist@npm:2.4.8" dependencies: - uint8arrays: ^4.0.2 - checksum: 95225fe2b8f6a4d8919b6c8e3dcff32ced35a08a53efaef757a50bc0082fb5b91f09e7e46f0d1c234243899930f7cb02ef9eb44b97ce03e2381d416de15e16c9 + uint8arrays: ^5.0.1 + checksum: 8259124cf5c7acd29edeed346489d898f3eb12f129dadedb1c263ad8d637e1a2f689968934a94c16804e39f6e8765178507be6d7b3c3c6b67147ad7546d34186 languageName: node linkType: hard -"uint8arrays@npm:^4.0.2, uint8arrays@npm:^4.0.3, uint8arrays@npm:^4.0.6": - version: 4.0.6 - resolution: "uint8arrays@npm:4.0.6" +"uint8arrays@npm:^4.0.2, uint8arrays@npm:^4.0.3": + version: 4.0.10 + resolution: "uint8arrays@npm:4.0.10" dependencies: multiformats: ^12.0.1 - checksum: 0d55d74fe8d791ee24396bf6175ffe8ff73aae763cfaca5bf774e43315ee57bc69cc3af854de5e7b20bc7e6b7bde731f73a478bc43c295ea8115bff8a49621e0 + checksum: 784677a00f67d18d3aaaf441422b4055576e1ab76dbf276e474b86c91ddb95945ac1cc95a97979ab1f3b3c9a0ebeea74dd803ec6056adbd1ee6ef2f231f00f97 + languageName: node + linkType: hard + +"uint8arrays@npm:^5.0.0, uint8arrays@npm:^5.0.1": + version: 5.0.1 + resolution: "uint8arrays@npm:5.0.1" + dependencies: + multiformats: ^13.0.0 + checksum: 29b27d41e1b5fe2b3de0ce502556e9ac7caabf53c0a40f27d3654c4cb08f06913b14b7722325a1a4287664d15938abf48dd987340d966ca61c2daa40030b5f82 languageName: node linkType: hard @@ -46961,18 +44007,6 @@ __metadata: languageName: node linkType: hard -"unbox-primitive@npm:^1.0.1": - version: 1.0.1 - resolution: "unbox-primitive@npm:1.0.1" - dependencies: - function-bind: ^1.1.1 - has-bigints: ^1.0.1 - has-symbols: ^1.0.2 - which-boxed-primitive: ^1.0.2 - checksum: 89d950e18fb45672bc6b3c961f1e72c07beb9640c7ceed847b571ba6f7d2af570ae1a2584cfee268b9d9ea1e3293f7e33e0bc29eaeb9f8e8a0bab057ff9e6bba - languageName: node - linkType: hard - "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -47002,6 +44036,13 @@ __metadata: languageName: node linkType: hard +"underscore@npm:>=1.13.2": + version: 1.13.6 + resolution: "underscore@npm:1.13.6" + checksum: d5cedd14a9d0d91dd38c1ce6169e4455bb931f0aaf354108e47bd46d3f2da7464d49b2171a5cf786d61963204a42d01ea1332a903b7342ad428deaafaf70ec36 + languageName: node + linkType: hard + "undici-types@npm:~5.26.4": version: 5.26.5 resolution: "undici-types@npm:5.26.5" @@ -47018,21 +44059,12 @@ __metadata: languageName: node linkType: hard -"undici@npm:^5.12.0": - version: 5.26.3 - resolution: "undici@npm:5.26.3" +"undici@npm:^5.12.0, undici@npm:^5.14.0": + version: 5.28.2 + resolution: "undici@npm:5.28.2" dependencies: "@fastify/busboy": ^2.0.0 - checksum: aaa9aadb712cf80e1a9cea2377e4842670105e00abbc184a21770ea5a8b77e4e2eadc200eac62442e74a1cd3b16a840c6f73b112b9e886bd3c1a125eb22e4f21 - languageName: node - linkType: hard - -"undici@npm:^5.14.0": - version: 5.21.2 - resolution: "undici@npm:5.21.2" - dependencies: - busboy: ^1.6.0 - checksum: baceaa9e610966631e86ad2869b657556dd465438eed55e8079cec2a306ecbeecfde2d6e37e43baf96a4c59588ebef50476131e96e018dcc0a7f5db7e6a06c85 + checksum: f9e9335803f962fff07c3c11c6d50bbc76248bacf97035047155adb29c3622a65bd6bff23a22218189740133149d22e63b68131d8c40e78ac6cb4b6d686a6dfa languageName: node linkType: hard @@ -47044,12 +44076,11 @@ __metadata: linkType: hard "unicode-length@npm:^2.0.2": - version: 2.0.2 - resolution: "unicode-length@npm:2.0.2" + version: 2.1.0 + resolution: "unicode-length@npm:2.1.0" dependencies: punycode: ^2.0.0 - strip-ansi: ^3.0.1 - checksum: 767ef3f4752f4db80a904bd7229d96d9bb697f45a9646b2cf06322ed8e3d0c17f32b6a46b44258aa9eeb7d0b217faf92c4d9d945c6ed8f708d0406358a1a3e1c + checksum: e480510c1616af29c65999b951a4f2c50747dd545661cc4abc4afa0c8917ddf286b8a0b94a5aa7a51b17045a6a14a2399ee24f65ff23df42aa274b9a9515b9e5 languageName: node linkType: hard @@ -47063,13 +44094,6 @@ __metadata: languageName: node linkType: hard -"unicode-match-property-value-ecmascript@npm:^2.0.0": - version: 2.0.0 - resolution: "unicode-match-property-value-ecmascript@npm:2.0.0" - checksum: 8fe6a09d9085a625cabcead5d95bdbc1a2d5d481712856092ce0347231e81a60b93a68f1b69e82b3076a07e415a72c708044efa2aa40ae23e2e7b5c99ed4a9ea - languageName: node - linkType: hard - "unicode-match-property-value-ecmascript@npm:^2.1.0": version: 2.1.0 resolution: "unicode-match-property-value-ecmascript@npm:2.1.0" @@ -47078,9 +44102,9 @@ __metadata: linkType: hard "unicode-property-aliases-ecmascript@npm:^2.0.0": - version: 2.0.0 - resolution: "unicode-property-aliases-ecmascript@npm:2.0.0" - checksum: dda4d39128cbbede2ac60fbb85493d979ec65913b8a486bf7cb7a375a2346fa48cbf9dc6f1ae23376e7e8e684c2b411434891e151e865a661b40a85407db51d0 + version: 2.1.0 + resolution: "unicode-property-aliases-ecmascript@npm:2.1.0" + checksum: 243524431893649b62cc674d877bd64ef292d6071dd2fd01ab4d5ad26efbc104ffcd064f93f8a06b7e4ec54c172bf03f6417921a0d8c3a9994161fe1f88f815b languageName: node linkType: hard @@ -47119,6 +44143,15 @@ __metadata: languageName: node linkType: hard +"unique-filename@npm:^2.0.0": + version: 2.0.1 + resolution: "unique-filename@npm:2.0.1" + dependencies: + unique-slug: ^3.0.0 + checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f + languageName: node + linkType: hard + "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -47137,6 +44170,15 @@ __metadata: languageName: node linkType: hard +"unique-slug@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-slug@npm:3.0.0" + dependencies: + imurmurhash: ^0.1.4 + checksum: 49f8d915ba7f0101801b922062ee46b7953256c93ceca74303bd8e6413ae10aa7e8216556b54dc5382895e8221d04f1efaf75f945c2e4a515b4139f77aa6640c + languageName: node + linkType: hard + "unique-slug@npm:^4.0.0": version: 4.0.0 resolution: "unique-slug@npm:4.0.0" @@ -47167,9 +44209,9 @@ __metadata: linkType: hard "universal-user-agent@npm:^6.0.0": - version: 6.0.0 - resolution: "universal-user-agent@npm:6.0.0" - checksum: 5092bbc80dd0d583cef0b62c17df0043193b74f425112ea6c1f69bc5eda21eeec7a08d8c4f793a277eb2202ffe9b44bec852fa3faff971234cd209874d1b79ef + version: 6.0.1 + resolution: "universal-user-agent@npm:6.0.1" + checksum: fdc8e1ae48a05decfc7ded09b62071f571c7fe0bd793d700704c80cea316101d4eac15cc27ed2bb64f4ce166d2684777c3198b9ab16034f547abea0d3aa1c93c languageName: node linkType: hard @@ -47188,9 +44230,9 @@ __metadata: linkType: hard "universalify@npm:^2.0.0": - version: 2.0.0 - resolution: "universalify@npm:2.0.0" - checksum: 2406a4edf4a8830aa6813278bab1f953a8e40f2f63a37873ffa9a3bc8f9745d06cc8e88f3572cb899b7e509013f7f6fcc3e37e8a6d914167a5381d8440518c44 + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: ecd8469fe0db28e7de9e5289d32bd1b6ba8f7183db34f3bfc4ca53c49891c2d6aa05f3fb3936a81285a905cc509fb641a0c3fc131ec786167eff41236ae32e60 languageName: node linkType: hard @@ -47218,13 +44260,6 @@ __metadata: languageName: node linkType: hard -"untildify@npm:^4.0.0": - version: 4.0.0 - resolution: "untildify@npm:4.0.0" - checksum: 39ced9c418a74f73f0a56e1ba4634b4d959422dff61f4c72a8e39f60b99380c1b45ed776fbaa0a4101b157e4310d873ad7d114e8534ca02609b4916bb4187fb9 - languageName: node - linkType: hard - "upath@npm:^1.2.0": version: 1.2.0 resolution: "upath@npm:1.2.0" @@ -47239,34 +44274,6 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.10": - version: 1.0.10 - resolution: "update-browserslist-db@npm:1.0.10" - dependencies: - escalade: ^3.1.1 - picocolors: ^1.0.0 - peerDependencies: - browserslist: ">= 4.21.0" - bin: - browserslist-lint: cli.js - checksum: 12db73b4f63029ac407b153732e7cd69a1ea8206c9100b482b7d12859cd3cd0bc59c602d7ae31e652706189f1acb90d42c53ab24a5ba563ed13aebdddc5561a0 - languageName: node - linkType: hard - -"update-browserslist-db@npm:^1.0.11": - version: 1.0.11 - resolution: "update-browserslist-db@npm:1.0.11" - dependencies: - escalade: ^3.1.1 - picocolors: ^1.0.0 - peerDependencies: - browserslist: ">= 4.21.0" - bin: - update-browserslist-db: cli.js - checksum: b98327518f9a345c7cad5437afae4d2ae7d865f9779554baf2a200fdf4bac4969076b679b1115434bd6557376bdd37ca7583d0f9b8f8e302d7d4cc1e91b5f231 - languageName: node - linkType: hard - "update-browserslist-db@npm:^1.0.13": version: 1.0.13 resolution: "update-browserslist-db@npm:1.0.13" @@ -47281,28 +44288,6 @@ __metadata: languageName: node linkType: hard -"update-notifier@npm:^5.1.0": - version: 5.1.0 - resolution: "update-notifier@npm:5.1.0" - dependencies: - boxen: ^5.0.0 - chalk: ^4.1.0 - configstore: ^5.0.1 - has-yarn: ^2.1.0 - import-lazy: ^2.1.0 - is-ci: ^2.0.0 - is-installed-globally: ^0.4.0 - is-npm: ^5.0.0 - is-yarn-global: ^0.3.0 - latest-version: ^5.1.0 - pupa: ^2.1.1 - semver: ^7.3.4 - semver-diff: ^3.1.1 - xdg-basedir: ^4.0.0 - checksum: 461e5e5b002419296d3868ee2abe0f9ab3e1846d9db642936d0c46f838872ec56069eddfe662c45ce1af0a8d6d5026353728de2e0a95ab2e3546a22ea077caf1 - languageName: node - linkType: hard - "upper-case-first@npm:^1.1.0, upper-case-first@npm:^1.1.2": version: 1.1.2 resolution: "upper-case-first@npm:1.1.2" @@ -47358,15 +44343,6 @@ __metadata: languageName: node linkType: hard -"url-parse-lax@npm:^1.0.0": - version: 1.0.0 - resolution: "url-parse-lax@npm:1.0.0" - dependencies: - prepend-http: ^1.0.1 - checksum: 03316acff753845329652258c16d1688765ee34f7d242a94dadf9ff6e43ea567ec062cec7aa27c37f76f2c57f95e0660695afff32fb97b527591c7340a3090fa - languageName: node - linkType: hard - "url-parse-lax@npm:^3.0.0": version: 3.0.0 resolution: "url-parse-lax@npm:3.0.0" @@ -47400,13 +44376,6 @@ __metadata: languageName: node linkType: hard -"url-to-options@npm:^1.0.1": - version: 1.0.1 - resolution: "url-to-options@npm:1.0.1" - checksum: 20e59f4578525fb0d30ffc22b13b5aa60bc9e57cefd4f5842720f5b57211b6dec54abeae2d675381ac4486fd1a2e987f1318725dea996e503ff89f8c8ce2c17e - languageName: node - linkType: hard - "url@npm:0.10.3": version: 0.10.3 resolution: "url@npm:0.10.3" @@ -47418,12 +44387,12 @@ __metadata: linkType: hard "url@npm:^0.11.0": - version: 0.11.0 - resolution: "url@npm:0.11.0" + version: 0.11.3 + resolution: "url@npm:0.11.3" dependencies: - punycode: 1.3.2 - querystring: 0.2.0 - checksum: 50d100d3dd2d98b9fe3ada48cadb0b08aa6be6d3ac64112b867b56b19be4bfcba03c2a9a0d7922bfd7ac17d4834e88537749fe182430dfd9b68e520175900d90 + punycode: ^1.4.1 + qs: ^6.11.2 + checksum: f9e7886f46a16f96d2e42fbcc5d682c231c55ef5442c1ff66150c0f6556f6e3a97d094a84f51be15ec2432711d212eb60426659ce418f5fcadeaa3f601532c4e languageName: node linkType: hard @@ -47454,12 +44423,12 @@ __metadata: linkType: hard "utf-8-validate@npm:^5.0.2": - version: 5.0.8 - resolution: "utf-8-validate@npm:5.0.8" + version: 5.0.10 + resolution: "utf-8-validate@npm:5.0.10" dependencies: node-gyp: latest node-gyp-build: ^4.3.0 - checksum: cb1be3fa4eb896be17945a2e46c25f47ef9344d5955703a09d9d831efef681ce120bddfe02a8ebf3a96580ffa8f70edda55623e4d021adff70cb81cd0c8a885e + checksum: 5579350a023c66a2326752b6c8804cc7b39dcd251bb088241da38db994b8d78352e388dcc24ad398ab98385ba3c5ffcadb6b5b14b2637e43f767869055e46ba6 languageName: node linkType: hard @@ -47518,21 +44487,7 @@ __metadata: languageName: node linkType: hard -"util@npm:^0.12.0, util@npm:^0.12.4": - version: 0.12.4 - resolution: "util@npm:0.12.4" - dependencies: - inherits: ^2.0.3 - is-arguments: ^1.0.4 - is-generator-function: ^1.0.7 - is-typed-array: ^1.1.3 - safe-buffer: ^5.1.2 - which-typed-array: ^1.1.2 - checksum: 8eac7a6e6b341c0f1b3eb73bbe5dfcae31a7e9699c8fc3266789f3e95f7637946a7700dcf1904dbd3749a58a36760ebf7acf4bb5b717f7468532a8a79f44eff0 - languageName: node - linkType: hard - -"util@npm:^0.12.5": +"util@npm:^0.12.0, util@npm:^0.12.4, util@npm:^0.12.5": version: 0.12.5 resolution: "util@npm:0.12.5" dependencies: @@ -47593,7 +44548,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^3.3.2, uuid@npm:^3.3.3": +"uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" bin: @@ -47602,13 +44557,6 @@ __metadata: languageName: node linkType: hard -"v8-compile-cache-lib@npm:^3.0.0": - version: 3.0.0 - resolution: "v8-compile-cache-lib@npm:3.0.0" - checksum: 674e312bbca796584b61dc915f33c7e7dc4e06d196e0048cb772c8964493a1ec723f1dd014d9419fd55c24a6eae148f60769da23f622e05cd13268063fa1ed6b - languageName: node - linkType: hard - "v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" @@ -47617,9 +44565,9 @@ __metadata: linkType: hard "v8-compile-cache@npm:^2.0.3": - version: 2.3.0 - resolution: "v8-compile-cache@npm:2.3.0" - checksum: adb0a271eaa2297f2f4c536acbfee872d0dd26ec2d76f66921aa7fc437319132773483344207bdbeee169225f4739016d8d2dbf0553913a52bb34da6d0334f8e + version: 2.4.0 + resolution: "v8-compile-cache@npm:2.4.0" + checksum: 8eb6ddb59d86f24566503f1e6ca98f3e6f43599f05359bd3ab737eaaf1585b338091478a4d3d5c2646632cf8030288d7888684ea62238cdce15a65ae2416718f languageName: node linkType: hard @@ -47635,13 +44583,13 @@ __metadata: linkType: hard "v8-to-istanbul@npm:^9.0.1": - version: 9.1.0 - resolution: "v8-to-istanbul@npm:9.1.0" + version: 9.2.0 + resolution: "v8-to-istanbul@npm:9.2.0" dependencies: "@jridgewell/trace-mapping": ^0.3.12 "@types/istanbul-lib-coverage": ^2.0.1 - convert-source-map: ^1.6.0 - checksum: 2069d59ee46cf8d83b4adfd8a5c1a90834caffa9f675e4360f1157ffc8578ef0f763c8f32d128334424159bb6b01f3876acd39cd13297b2769405a9da241f8d1 + convert-source-map: ^2.0.0 + checksum: 31ef98c6a31b1dab6be024cf914f235408cd4c0dc56a5c744a5eea1a9e019ba279e1b6f90d695b78c3186feed391ed492380ccf095009e2eb91f3d058f0b4491 languageName: node linkType: hard @@ -47672,9 +44620,9 @@ __metadata: linkType: hard "validator@npm:^13.6.0": - version: 13.7.0 - resolution: "validator@npm:13.7.0" - checksum: 2b83283de1222ca549a7ef57f46e8d49c6669213348db78b7045bce36a3b5843ff1e9f709ebf74574e06223461ee1f264f8cc9a26a0060a79a27de079d8286ef + version: 13.11.0 + resolution: "validator@npm:13.11.0" + checksum: d1e0c27022681420756da25bc03eb08d5f0c66fb008f8ff02ebc95812b77c6be6e03d3bd05cf80ca702e23eeb73dadd66b4b3683173ea2a0bc7cc72820bee131 languageName: node linkType: hard @@ -47830,6 +44778,46 @@ __metadata: languageName: node linkType: hard +"vite@npm:4.5.1": + version: 4.5.1 + resolution: "vite@npm:4.5.1" + dependencies: + esbuild: ^0.18.10 + fsevents: ~2.3.2 + postcss: ^8.4.27 + rollup: ^3.27.1 + peerDependencies: + "@types/node": ">= 14" + less: "*" + lightningcss: ^1.21.0 + sass: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: 72b3584b3d3b8d14e8a37f0248e47fb8b4d02ab35de5b5a8e5ca8ae55c3be2aab73760dc36edac4fa722de182f78cc492eb44888fcb4a9a0712c4605dad644f9 + languageName: node + linkType: hard + "vm-browserify@npm:^1.1.2": version: 1.1.2 resolution: "vm-browserify@npm:1.1.2" @@ -47838,9 +44826,9 @@ __metadata: linkType: hard "vscode-languageserver-textdocument@npm:^1.0.4": - version: 1.0.10 - resolution: "vscode-languageserver-textdocument@npm:1.0.10" - checksum: 605ff0662535088567a145b48d28f0c41844d28269fa0b3fca3a1e179dd14baf7181150b274bf3840ef2a043ed8474a9227aaf169a6fae574516349a1b371a18 + version: 1.0.11 + resolution: "vscode-languageserver-textdocument@npm:1.0.11" + checksum: ea7cdc9d4ffaae5952071fa11d17d714215a76444e6936c9359f94b9ba3222a52a55edb5bd5928bd3e9712b900a9f175bb3565ec1c8923234fe3bd327584bafb languageName: node linkType: hard @@ -47859,9 +44847,9 @@ __metadata: linkType: hard "vscode-uri@npm:^3.0.3": - version: 3.0.3 - resolution: "vscode-uri@npm:3.0.3" - checksum: 683bf9de835c3cef0b51c104a4949bf746148ded7c2287ebafcc506d20aa0e90b99385a972dba8132903420dba67fc33a5e146e30212c4a6b3ca5d74d1f95702 + version: 3.0.8 + resolution: "vscode-uri@npm:3.0.8" + checksum: 514249126850c0a41a7d8c3c2836cab35983b9dc1938b903cfa253b9e33974c1416d62a00111385adcfa2b98df456437ab704f709a2ecca76a90134ef5eb4832 languageName: node linkType: hard @@ -47975,14 +44963,14 @@ __metadata: languageName: node linkType: hard -"web3-bzz@npm:1.10.1": - version: 1.10.1 - resolution: "web3-bzz@npm:1.10.1" +"web3-bzz@npm:1.10.3": + version: 1.10.3 + resolution: "web3-bzz@npm:1.10.3" dependencies: "@types/node": ^12.12.6 got: 12.1.0 swarm-js: ^0.1.40 - checksum: 6f66bccde8c662088824f62c3d526cd7800be8df9d16c5e559f4f16f00496b02d814a3a478ab4c9b092de6530f530b591337ee830207b9956c0844be0d7c65cd + checksum: bbf8cde02b344e99b9ee2483fd63ce6e9f2434c446b5686b224601b4f7329ca9cc1268203833d61b54fe8d0a345601673c5405828e21a9e5dad3f088c53b96dd languageName: node linkType: hard @@ -48029,13 +45017,13 @@ __metadata: languageName: node linkType: hard -"web3-core-helpers@npm:1.10.1": - version: 1.10.1 - resolution: "web3-core-helpers@npm:1.10.1" +"web3-core-helpers@npm:1.10.3": + version: 1.10.3 + resolution: "web3-core-helpers@npm:1.10.3" dependencies: - web3-eth-iban: 1.10.1 - web3-utils: 1.10.1 - checksum: d68fa1c51c51fe1859fed609091bd8de31ffcb75fa23ed068a7b05ca80de15af63cc280da4f63535d475faa8266942e1b22a8ac1de43e210e319730d7775fbd7 + web3-eth-iban: 1.10.3 + web3-utils: 1.10.3 + checksum: cd5a9f54620fa9c67d08bf7955d43f09260c23a9107201cdfc9455ec2cb04ce36d84f8c65529b86dbfcac2449b8a91c33383cb9cc6e70f1e554fd923e551cf16 languageName: node linkType: hard @@ -48092,16 +45080,16 @@ __metadata: languageName: node linkType: hard -"web3-core-method@npm:1.10.1": - version: 1.10.1 - resolution: "web3-core-method@npm:1.10.1" +"web3-core-method@npm:1.10.3": + version: 1.10.3 + resolution: "web3-core-method@npm:1.10.3" dependencies: "@ethersproject/transactions": ^5.6.2 - web3-core-helpers: 1.10.1 - web3-core-promievent: 1.10.1 - web3-core-subscriptions: 1.10.1 - web3-utils: 1.10.1 - checksum: 3ae837619712b5c6ec1430fa3ea280df7b5a410d47c7277671a280cc4cb574ca17ab126731878bb0cd1153f6e0cfb93bb813730cadd56d96c231cb0d1055b5ae + web3-core-helpers: 1.10.3 + web3-core-promievent: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-utils: 1.10.3 + checksum: a1f707b4085605cc50fd8c17f2217f5f0508e4e2cee8112a3cded1b65b82c5027501c418651c80152ac940884209d3609068568bb8d2007ea07ba700f3e60d63 languageName: node linkType: hard @@ -48167,12 +45155,12 @@ __metadata: languageName: node linkType: hard -"web3-core-promievent@npm:1.10.1": - version: 1.10.1 - resolution: "web3-core-promievent@npm:1.10.1" +"web3-core-promievent@npm:1.10.3": + version: 1.10.3 + resolution: "web3-core-promievent@npm:1.10.3" dependencies: eventemitter3: 4.0.4 - checksum: cd9bc5c067782f374ad4aa69536f382c0c0528a545f9ea8763e605de297cb78bdbc0ea708601d099f8d6ceaae11529062357309a6e037db3673601d7f9a63e88 + checksum: 5406e3d84a4f02e301ddae7e560be7e83c0f5f87988e1b1efb141697d816bbba8e4ddd0d0160123745a43fa152a5b986135b16901639172490abee4f9e16d106 languageName: node linkType: hard @@ -48225,16 +45213,16 @@ __metadata: languageName: node linkType: hard -"web3-core-requestmanager@npm:1.10.1": - version: 1.10.1 - resolution: "web3-core-requestmanager@npm:1.10.1" +"web3-core-requestmanager@npm:1.10.3": + version: 1.10.3 + resolution: "web3-core-requestmanager@npm:1.10.3" dependencies: util: ^0.12.5 - web3-core-helpers: 1.10.1 - web3-providers-http: 1.10.1 - web3-providers-ipc: 1.10.1 - web3-providers-ws: 1.10.1 - checksum: c4890e34a2fbcee48272d97c575d21526d8e1af61cbce50ecd97498726a739505225f24c02db174fa2e8436b86afd5ae79cfd29b4ec4749150f4d7ec531d1c0b + web3-core-helpers: 1.10.3 + web3-providers-http: 1.10.3 + web3-providers-ipc: 1.10.3 + web3-providers-ws: 1.10.3 + checksum: dfa64971fcdfaea6c0c041e4117f67bdd7af89b33b8f8bf41b51605a2803188705b39847d98a63d8c2899e7d81ec20236c33354b036e1843969fee1984c3aceb languageName: node linkType: hard @@ -48300,13 +45288,13 @@ __metadata: languageName: node linkType: hard -"web3-core-subscriptions@npm:1.10.1": - version: 1.10.1 - resolution: "web3-core-subscriptions@npm:1.10.1" +"web3-core-subscriptions@npm:1.10.3": + version: 1.10.3 + resolution: "web3-core-subscriptions@npm:1.10.3" dependencies: eventemitter3: 4.0.4 - web3-core-helpers: 1.10.1 - checksum: c7987c2eca46e6df029d0c13f06398b0b86f36ed8601f63ac0bee48c40c025bbaafb59bb080c9142de909154a57e9b60b01491b1356b3746b393a0497cef1d97 + web3-core-helpers: 1.10.3 + checksum: c996f9aa1c2bfad4e0fa91b79393909fcf9550e43e7d2a8e3ff822ca750a528839f52792e6e354d5617c94a5782868e57c5a928ae354a4e52748752bea381958 languageName: node linkType: hard @@ -48365,18 +45353,18 @@ __metadata: languageName: node linkType: hard -"web3-core@npm:1.10.1": - version: 1.10.1 - resolution: "web3-core@npm:1.10.1" +"web3-core@npm:1.10.3": + version: 1.10.3 + resolution: "web3-core@npm:1.10.3" dependencies: "@types/bn.js": ^5.1.1 "@types/node": ^12.12.6 bignumber.js: ^9.0.0 - web3-core-helpers: 1.10.1 - web3-core-method: 1.10.1 - web3-core-requestmanager: 1.10.1 - web3-utils: 1.10.1 - checksum: 3f849b5c657379291f095d435624681c262737304e35a7a48414612301c5c6db419d47d38bc373e1bbd1e2a996d51ddfb25860250a622417dce1e20f238899de + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-core-requestmanager: 1.10.3 + web3-utils: 1.10.3 + checksum: aab0ed09ccb38d842d205fda1c5505686e1f91f0ba408d96b49c962c91af2386552329124391a17f43918a18df383c63f521c64a56eff8513071ed48910afb5b languageName: node linkType: hard @@ -48440,7 +45428,7 @@ __metadata: languageName: node linkType: hard -"web3-core@npm:4.1.1, web3-core@npm:^4.0.3, web3-core@npm:^4.1.1": +"web3-core@npm:4.1.1": version: 4.1.1 resolution: "web3-core@npm:4.1.1" dependencies: @@ -48459,100 +45447,27 @@ __metadata: languageName: node linkType: hard -"web3-core@npm:^4.1.0, web3-core@npm:^4.3.0": - version: 4.3.0 - resolution: "web3-core@npm:4.3.0" - dependencies: - web3-errors: ^1.1.3 - web3-eth-iban: ^4.0.7 - web3-providers-http: ^4.1.0 - web3-providers-ipc: ^4.0.7 - web3-providers-ws: ^4.0.7 - web3-types: ^1.3.0 - web3-utils: ^4.0.7 - web3-validator: ^2.0.3 - dependenciesMeta: - web3-providers-ipc: - optional: true - checksum: ea60002057ec0a1b39cfbd3576f8988a562631e243f2d62ee19bd3f0abe0fa79de51dec609edf29c4ba729c774b5204166518eb98e4ac168e7c23e3dfe149edd - languageName: node - linkType: hard - -"web3-core@npm:^4.2.0": - version: 4.2.0 - resolution: "web3-core@npm:4.2.0" - dependencies: - web3-errors: ^1.1.2 - web3-eth-iban: ^4.0.6 - web3-providers-http: ^4.0.6 - web3-providers-ipc: ^4.0.6 - web3-providers-ws: ^4.0.6 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - web3-validator: ^2.0.2 - dependenciesMeta: - web3-providers-ipc: - optional: true - checksum: d3514d078d74ab13d2ca25738499dc58347fd7f42af4e98fe31367b404f7fc6260a7ad3cd1c1480077c2960fb874f9e3fdbaf8fb1424d0537c76d8c0e88dc74e - languageName: node - linkType: hard - -"web3-core@npm:^4.3.1": - version: 4.3.1 - resolution: "web3-core@npm:4.3.1" +"web3-core@npm:^4.0.3, web3-core@npm:^4.1.0, web3-core@npm:^4.1.1, web3-core@npm:^4.2.0, web3-core@npm:^4.3.0, web3-core@npm:^4.3.2": + version: 4.3.2 + resolution: "web3-core@npm:4.3.2" dependencies: web3-errors: ^1.1.4 + web3-eth-accounts: ^4.1.0 web3-eth-iban: ^4.0.7 web3-providers-http: ^4.1.0 web3-providers-ipc: ^4.0.7 web3-providers-ws: ^4.0.7 web3-types: ^1.3.1 - web3-utils: ^4.0.7 + web3-utils: ^4.1.0 web3-validator: ^2.0.3 dependenciesMeta: web3-providers-ipc: optional: true - checksum: f6ba6ef0154d9523aee5d9b375f339bf5b817be88fa6f574bde80359104d93c50586c09db3b42044c5ee6a970f84fce5554de5067d17934daa59fb92f4cc9dd5 - languageName: node - linkType: hard - -"web3-errors@npm:^1.0.2": - version: 1.0.2 - resolution: "web3-errors@npm:1.0.2" - dependencies: - web3-types: ^1.0.2 - checksum: d557c90baf757f2fa647a62d8c65301752b14c056c0731e435b1c7babdb569da3d1c55df6d1b5d2076407322e87a452083f4974e3a22e78ab7aacce749bdceae - languageName: node - linkType: hard - -"web3-errors@npm:^1.1.0, web3-errors@npm:^1.1.3": - version: 1.1.3 - resolution: "web3-errors@npm:1.1.3" - dependencies: - web3-types: ^1.3.0 - checksum: d9c61ff437daa9257e1ee38120e3eb8a907f6afd4da36777ab264487d35781b4bb15489fb0d9edc9668fb0ba6ec5d325a33f20add8f88c5418d7b48596098347 - languageName: node - linkType: hard - -"web3-errors@npm:^1.1.1": - version: 1.1.1 - resolution: "web3-errors@npm:1.1.1" - dependencies: - web3-types: ^1.1.1 - checksum: 1ac088d49e32f0952f4098a618cf1a89b318b052b6b9e58c9d54976e6b43ef5cd7583c2411275c6d6f7b0f3990e9cf6b2c86c1c1023d50b014cbd04fc18ac73e + checksum: 7505186c5b7de1ebf03bbf9ce109c809618652402ed01e93a98292432a2d31f958cb284af8b7a286a149736f0943839a098150d02034232036243b058f57d739 languageName: node linkType: hard -"web3-errors@npm:^1.1.2": - version: 1.1.2 - resolution: "web3-errors@npm:1.1.2" - dependencies: - web3-types: ^1.2.0 - checksum: 7f9e8a476aa8514a2926743680e5561950f684be0cd6ff87e6fb12a7978fa568492aee0f502ee68e88686c5a904348d32935dbcb852ba00b7612efb8baf14d34 - languageName: node - linkType: hard - -"web3-errors@npm:^1.1.4": +"web3-errors@npm:^1.0.2, web3-errors@npm:^1.1.0, web3-errors@npm:^1.1.1, web3-errors@npm:^1.1.2, web3-errors@npm:^1.1.3, web3-errors@npm:^1.1.4": version: 1.1.4 resolution: "web3-errors@npm:1.1.4" dependencies: @@ -48571,13 +45486,13 @@ __metadata: languageName: node linkType: hard -"web3-eth-abi@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth-abi@npm:1.10.1" +"web3-eth-abi@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth-abi@npm:1.10.3" dependencies: "@ethersproject/abi": ^5.6.3 - web3-utils: 1.10.1 - checksum: 2766681398039df7c1bb6f241c15fb7a0391540d63f1f8735a9a5fd20409f7593196079bdb0be47570fc6245ef3bb7ca81b9ecaadc331861dd5c551631821643 + web3-utils: 1.10.3 + checksum: 2740977211370efd69e78966d10bc69e7977c9204a5a64f4c96c995912ef791912f71333eee4b071727da35209ab0f4587ed08111ad7aa84ca7bb62ed0d1a486 languageName: node linkType: hard @@ -48624,20 +45539,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-abi@npm:^4.0.3, web3-eth-abi@npm:^4.1.1": - version: 4.1.1 - resolution: "web3-eth-abi@npm:4.1.1" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - checksum: 99e197707396a1083e46f28d5b6bc3af299ad17d196d00a78ce9b87c6dc4b00ce0b68750c7bc0a7809916f8f1d834b6de5c35dc7e04454b990b30f64beafc82c - languageName: node - linkType: hard - -"web3-eth-abi@npm:^4.1.0, web3-eth-abi@npm:^4.1.4": +"web3-eth-abi@npm:^4.0.3, web3-eth-abi@npm:^4.1.0, web3-eth-abi@npm:^4.1.1, web3-eth-abi@npm:^4.1.2, web3-eth-abi@npm:^4.1.3, web3-eth-abi@npm:^4.1.4": version: 4.1.4 resolution: "web3-eth-abi@npm:4.1.4" dependencies: @@ -48650,32 +45552,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-abi@npm:^4.1.2": - version: 4.1.2 - resolution: "web3-eth-abi@npm:4.1.2" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - web3-errors: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - checksum: 72c4374a29e6db0e2ddf74a8cc952c74a9cda16150c3a6df7fd54848ee00519b544dd313eadbfea53584f01eccd0ba285f5119bc8323bb5199678639ad28eda3 - languageName: node - linkType: hard - -"web3-eth-abi@npm:^4.1.3": - version: 4.1.3 - resolution: "web3-eth-abi@npm:4.1.3" - dependencies: - abitype: 0.7.1 - web3-errors: ^1.1.3 - web3-types: ^1.3.0 - web3-utils: ^4.0.7 - web3-validator: ^2.0.3 - checksum: 82739061ed63e2cac9ce9fdce9deecd6c4996621f4edf2ac501f3fd0a59d42b95ea253ffa63131bbf9a4eec43060501077190ffb17458bebe6a7cdf833b4d340 - languageName: node - linkType: hard - "web3-eth-accounts@npm:1.10.0": version: 1.10.0 resolution: "web3-eth-accounts@npm:1.10.0" @@ -48694,21 +45570,21 @@ __metadata: languageName: node linkType: hard -"web3-eth-accounts@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth-accounts@npm:1.10.1" +"web3-eth-accounts@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth-accounts@npm:1.10.3" dependencies: - "@ethereumjs/common": 2.5.0 - "@ethereumjs/tx": 3.3.2 + "@ethereumjs/common": 2.6.5 + "@ethereumjs/tx": 3.5.2 "@ethereumjs/util": ^8.1.0 eth-lib: 0.2.8 scrypt-js: ^3.0.1 uuid: ^9.0.0 - web3-core: 1.10.1 - web3-core-helpers: 1.10.1 - web3-core-method: 1.10.1 - web3-utils: 1.10.1 - checksum: ad7ee902d8496d1013adcb8e0a936cd89cc26edbf08e446c97b8df2abbc9c37cd93b95a1ce64d2c80dd4a758cf70cccd5a73d7ece751bc9a9c1a633fe92b40aa + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-utils: 1.10.3 + checksum: cc1672be7e95d3f6438b4d40a882d9842430b87d057fd70a9ee5cc0fabdb4a9e1c266612ab55849e980df3b61f2d30ee25660334dbbeece50d2655794bb2f1fe languageName: node linkType: hard @@ -48784,7 +45660,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-accounts@npm:4.0.6, web3-eth-accounts@npm:^4.0.6": +"web3-eth-accounts@npm:4.0.6": version: 4.0.6 resolution: "web3-eth-accounts@npm:4.0.6" dependencies: @@ -48799,22 +45675,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-accounts@npm:^4.0.3, web3-eth-accounts@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-eth-accounts@npm:4.0.5" - dependencies: - "@ethereumjs/rlp": ^4.0.1 - crc-32: ^1.2.2 - ethereum-cryptography: ^2.0.0 - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - web3-validator: ^2.0.1 - checksum: 681322374c391391c153011a17e6d00b125fb2d1537f1bd7028610fd09490c985b2fa268517a3b5fe036a1b6a19d70d6a616e587aeb029b8e895ff873a149d1d - languageName: node - linkType: hard - -"web3-eth-accounts@npm:^4.0.4, web3-eth-accounts@npm:^4.1.0": +"web3-eth-accounts@npm:^4.0.3, web3-eth-accounts@npm:^4.0.4, web3-eth-accounts@npm:^4.0.5, web3-eth-accounts@npm:^4.0.6, web3-eth-accounts@npm:^4.1.0": version: 4.1.0 resolution: "web3-eth-accounts@npm:4.1.0" dependencies: @@ -48845,19 +45706,19 @@ __metadata: languageName: node linkType: hard -"web3-eth-contract@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth-contract@npm:1.10.1" +"web3-eth-contract@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth-contract@npm:1.10.3" dependencies: "@types/bn.js": ^5.1.1 - web3-core: 1.10.1 - web3-core-helpers: 1.10.1 - web3-core-method: 1.10.1 - web3-core-promievent: 1.10.1 - web3-core-subscriptions: 1.10.1 - web3-eth-abi: 1.10.1 - web3-utils: 1.10.1 - checksum: 157dfdfc4669639207acce30abd618b21ca34dcfdf104c40f1fbc12becd7fe7808f34b56e837a09a588cea78896e1b28d9624f05f5535b209516c99d51aa7d1a + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-core-promievent: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-eth-abi: 1.10.3 + web3-utils: 1.10.3 + checksum: 8b12b1579d11bdefeecc063b9f4ca3e286e25549574a6131019f6b0eb9319b6ecf6304e5185a4874ee795da237482b9cc437c91c09db3c14d538537e819b3d0b languageName: node linkType: hard @@ -48909,7 +45770,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-contract@npm:4.1.0, web3-eth-contract@npm:^4.1.0": +"web3-eth-contract@npm:4.1.0": version: 4.1.0 resolution: "web3-eth-contract@npm:4.1.0" dependencies: @@ -48924,48 +45785,18 @@ __metadata: languageName: node linkType: hard -"web3-eth-contract@npm:^4.0.3, web3-eth-contract@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-eth-contract@npm:4.0.5" - dependencies: - web3-core: ^4.1.1 - web3-errors: ^1.1.1 - web3-eth: ^4.1.1 - web3-eth-abi: ^4.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - web3-validator: ^2.0.1 - checksum: 5b3f7ea8677942b5c0c514f89eb487c6d4f8821ddde4b6d7da0eb7ea7ea5b18a23f7f75002b2d9dd467fa68633351da74f8b2bcaf2de8d94f6d5e4dab24c2b5a - languageName: node - linkType: hard - -"web3-eth-contract@npm:^4.0.4, web3-eth-contract@npm:^4.1.2": - version: 4.1.2 - resolution: "web3-eth-contract@npm:4.1.2" - dependencies: - web3-core: ^4.3.0 - web3-errors: ^1.1.3 - web3-eth: ^4.3.1 - web3-eth-abi: ^4.1.4 - web3-types: ^1.3.0 - web3-utils: ^4.0.7 - web3-validator: ^2.0.3 - checksum: 209fd9dfa0d70434dbf37b933024777bc4b5be3cfba46ea331c28ea131c446fc7e33671fb2013588e09fbcab598f47386b37384bcf6891bd4237ef750b303d85 - languageName: node - linkType: hard - -"web3-eth-contract@npm:^4.1.1": - version: 4.1.3 - resolution: "web3-eth-contract@npm:4.1.3" +"web3-eth-contract@npm:^4.0.3, web3-eth-contract@npm:^4.0.4, web3-eth-contract@npm:^4.0.5, web3-eth-contract@npm:^4.1.0, web3-eth-contract@npm:^4.1.1, web3-eth-contract@npm:^4.1.2": + version: 4.1.4 + resolution: "web3-eth-contract@npm:4.1.4" dependencies: - web3-core: ^4.3.1 + web3-core: ^4.3.2 web3-errors: ^1.1.4 web3-eth: ^4.3.1 web3-eth-abi: ^4.1.4 web3-types: ^1.3.1 - web3-utils: ^4.0.7 + web3-utils: ^4.1.0 web3-validator: ^2.0.3 - checksum: 3e578ecffb982e67e06269fa53099b39634c81843abdf8b2d048d35089b6d1a8332e9ceba837aec2496740f1f3c620086c6e802cc9be15538e43bb5c74951cd6 + checksum: 86917ed909d4e02f2cd9e2c97a7ce36f0a6a7ad2ee02448394552a3f5cca4da69a8ec7ed6a1c91ef121c767670234f1570f8f23cb7faa57011df31465281b171 languageName: node linkType: hard @@ -48985,19 +45816,19 @@ __metadata: languageName: node linkType: hard -"web3-eth-ens@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth-ens@npm:1.10.1" +"web3-eth-ens@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth-ens@npm:1.10.3" dependencies: content-hash: ^2.5.2 eth-ens-namehash: 2.0.8 - web3-core: 1.10.1 - web3-core-helpers: 1.10.1 - web3-core-promievent: 1.10.1 - web3-eth-abi: 1.10.1 - web3-eth-contract: 1.10.1 - web3-utils: 1.10.1 - checksum: 6020bea7065f828d0c2ffb7638129d04a74968d2a8507d609b4cd4deecf01cf7319f0c6d708b0777388e15abc7923c3a1fd1edb949327dc0243d11968b747015 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-promievent: 1.10.3 + web3-eth-abi: 1.10.3 + web3-eth-contract: 1.10.3 + web3-utils: 1.10.3 + checksum: 6b3e8a2e02f6f044efb20e4c47a82c975c2ca70c1fdb34301abdb5cbcffd9e9cd2918c71eb464430743e361fd5c5dff5d265365d9b6803e505f726f0a2f32f14 languageName: node linkType: hard @@ -49049,24 +45880,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-ens@npm:^4.0.3, web3-eth-ens@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-eth-ens@npm:4.0.5" - dependencies: - "@adraffy/ens-normalize": ^1.8.8 - web3-core: ^4.1.1 - web3-errors: ^1.1.1 - web3-eth: ^4.1.1 - web3-eth-contract: ^4.0.5 - web3-net: ^4.0.5 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - web3-validator: ^2.0.1 - checksum: 87e0d34b42d973ec7adff6dce88ccd917b6df5a3d303c1a07c25cd937bf5cd6b2193e5bae7cdbce156e4f79fa16ce46f8633e6d921a56168a4f468d75f146794 - languageName: node - linkType: hard - -"web3-eth-ens@npm:^4.0.4": +"web3-eth-ens@npm:^4.0.3, web3-eth-ens@npm:^4.0.4, web3-eth-ens@npm:^4.0.5, web3-eth-ens@npm:^4.0.6, web3-eth-ens@npm:^4.0.7": version: 4.0.8 resolution: "web3-eth-ens@npm:4.0.8" dependencies: @@ -49083,40 +45897,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-ens@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-eth-ens@npm:4.0.6" - dependencies: - "@adraffy/ens-normalize": ^1.8.8 - web3-core: ^4.2.0 - web3-errors: ^1.1.2 - web3-eth: ^4.2.0 - web3-eth-contract: ^4.1.0 - web3-net: ^4.0.6 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - web3-validator: ^2.0.2 - checksum: 8417a5938c59f2a7d04b103c36868ea612d88afc18c35783ab60c48b375d355b47b994d753ad8507a304b3845d2f8e5d812e9ada5105ad276051f7305ccedafa - languageName: node - linkType: hard - -"web3-eth-ens@npm:^4.0.7": - version: 4.0.7 - resolution: "web3-eth-ens@npm:4.0.7" - dependencies: - "@adraffy/ens-normalize": ^1.8.8 - web3-core: ^4.3.0 - web3-errors: ^1.1.3 - web3-eth: ^4.3.0 - web3-eth-contract: ^4.1.1 - web3-net: ^4.0.7 - web3-types: ^1.3.0 - web3-utils: ^4.0.7 - web3-validator: ^2.0.3 - checksum: b8222fd5d9395767e3a585006fa89d1e85feb5625f53fe1a57c81a7031b27fb9405287f964ec3285963332c51db8de1a618e08e8034c43d54455d53c5000dcaf - languageName: node - linkType: hard - "web3-eth-iban@npm:1.10.0": version: 1.10.0 resolution: "web3-eth-iban@npm:1.10.0" @@ -49127,13 +45907,13 @@ __metadata: languageName: node linkType: hard -"web3-eth-iban@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth-iban@npm:1.10.1" +"web3-eth-iban@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth-iban@npm:1.10.3" dependencies: bn.js: ^5.2.1 - web3-utils: 1.10.1 - checksum: 2f51dd08f059926fe36aa0fb7cf7230924aedb0174acaef4579c5caac855dc158a3b7f44d3299f62f66c5668ca9dc3e872c1dbb0a2f44d0ed160e0713b926589 + web3-utils: 1.10.3 + checksum: 0603b45164e55a303215a6aa120eba68a63f7e9e9deffce67fd1d38623ba75696e4b4e0922b733c64a9a72c04f6ad7c90ca287d1d4c32868754fea0cac731917 languageName: node linkType: hard @@ -49177,19 +45957,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-iban@npm:^4.0.3, web3-eth-iban@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-eth-iban@npm:4.0.5" - dependencies: - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - web3-validator: ^2.0.1 - checksum: 305c1c87dfdc41ff8c61d91ac3ec620dac6dbd1a037dde1f252892d9f90fb6d34d7bf6ceb41548f8a7ff036a2ef47cc550426653c11052ac08d50b8e943c0298 - languageName: node - linkType: hard - -"web3-eth-iban@npm:^4.0.4, web3-eth-iban@npm:^4.0.7": +"web3-eth-iban@npm:^4.0.3, web3-eth-iban@npm:^4.0.4, web3-eth-iban@npm:^4.0.5, web3-eth-iban@npm:^4.0.6, web3-eth-iban@npm:^4.0.7": version: 4.0.7 resolution: "web3-eth-iban@npm:4.0.7" dependencies: @@ -49201,18 +45969,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-iban@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-eth-iban@npm:4.0.6" - dependencies: - web3-errors: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - web3-validator: ^2.0.2 - checksum: 7932961def8972aae01b409e28a98ccda6aece344bd3741bf967304b878a1722d77805d364ff61ca71c70cda937aadb077b506c9671e6b33db88c6a4e59ce5e8 - languageName: node - linkType: hard - "web3-eth-personal@npm:1.10.0": version: 1.10.0 resolution: "web3-eth-personal@npm:1.10.0" @@ -49227,17 +45983,17 @@ __metadata: languageName: node linkType: hard -"web3-eth-personal@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth-personal@npm:1.10.1" +"web3-eth-personal@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth-personal@npm:1.10.3" dependencies: "@types/node": ^12.12.6 - web3-core: 1.10.1 - web3-core-helpers: 1.10.1 - web3-core-method: 1.10.1 - web3-net: 1.10.1 - web3-utils: 1.10.1 - checksum: ec04e88cbb2a2c34837d30d49d9f4415bb204feaeb4b42ceac4e3db6dc7675965e858d721fc1fa89dc1f22b26859554a02da148342f4905a859ee4ee1565731f + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-net: 1.10.3 + web3-utils: 1.10.3 + checksum: 970d666deb45d6f2228c399b43114154cb66c43ec66e6065afa267f37dde8b3db217ac4e4a0ff1c7374cc9aa361b04cc3e35c6249bb1e81a417c3eccb9e5bc8e languageName: node linkType: hard @@ -49283,21 +46039,7 @@ __metadata: languageName: node linkType: hard -"web3-eth-personal@npm:^4.0.3, web3-eth-personal@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-eth-personal@npm:4.0.5" - dependencies: - web3-core: ^4.1.1 - web3-eth: ^4.1.1 - web3-rpc-methods: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - web3-validator: ^2.0.1 - checksum: b56951dae5589b626fc167c5eb68e89386a51513acc272e7ac2245d510fda2ca883ae73feab2d155f1fcc2f409dd934f93aa685fb9574239886d05e2261f9db7 - languageName: node - linkType: hard - -"web3-eth-personal@npm:^4.0.4": +"web3-eth-personal@npm:^4.0.3, web3-eth-personal@npm:^4.0.4, web3-eth-personal@npm:^4.0.5, web3-eth-personal@npm:^4.0.6, web3-eth-personal@npm:^4.0.7": version: 4.0.8 resolution: "web3-eth-personal@npm:4.0.8" dependencies: @@ -49311,34 +46053,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-personal@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-eth-personal@npm:4.0.6" - dependencies: - web3-core: ^4.2.0 - web3-eth: ^4.2.0 - web3-rpc-methods: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - web3-validator: ^2.0.2 - checksum: 7d6066b3cdaa20e6c19b581c44feea546fe0dd32b5f7db502626db2bd90de1e034cf36dcb5262fe3fdb145665925ae4cc81cb3ae051b7cf38765cd0a7e638ca8 - languageName: node - linkType: hard - -"web3-eth-personal@npm:^4.0.7": - version: 4.0.7 - resolution: "web3-eth-personal@npm:4.0.7" - dependencies: - web3-core: ^4.3.0 - web3-eth: ^4.3.0 - web3-rpc-methods: ^1.1.3 - web3-types: ^1.3.0 - web3-utils: ^4.0.7 - web3-validator: ^2.0.3 - checksum: d5235c167ce85b654ca9747818d7baf8848c9f5328eb1fdec5859ffb3283e1499d74491705f89e84322315e18f92f876d533c8f80d07757fae7ca3e0103df82e - languageName: node - linkType: hard - "web3-eth@npm:1.10.0": version: 1.10.0 resolution: "web3-eth@npm:1.10.0" @@ -49359,23 +46073,23 @@ __metadata: languageName: node linkType: hard -"web3-eth@npm:1.10.1": - version: 1.10.1 - resolution: "web3-eth@npm:1.10.1" +"web3-eth@npm:1.10.3": + version: 1.10.3 + resolution: "web3-eth@npm:1.10.3" dependencies: - web3-core: 1.10.1 - web3-core-helpers: 1.10.1 - web3-core-method: 1.10.1 - web3-core-subscriptions: 1.10.1 - web3-eth-abi: 1.10.1 - web3-eth-accounts: 1.10.1 - web3-eth-contract: 1.10.1 - web3-eth-ens: 1.10.1 - web3-eth-iban: 1.10.1 - web3-eth-personal: 1.10.1 - web3-net: 1.10.1 - web3-utils: 1.10.1 - checksum: 6b526b665301803916f63659c6e993f248d4d381668d878fdf4057ba447f45b48732a67b52e275432fd94204b20b4295cbeb18004d72349409bf78fa37736140 + web3-core: 1.10.3 + web3-core-helpers: 1.10.3 + web3-core-method: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-eth-abi: 1.10.3 + web3-eth-accounts: 1.10.3 + web3-eth-contract: 1.10.3 + web3-eth-ens: 1.10.3 + web3-eth-iban: 1.10.3 + web3-eth-personal: 1.10.3 + web3-net: 1.10.3 + web3-utils: 1.10.3 + checksum: 2ead7392b0eaf30152743e427fa3e4376683b6ba1a809434a0580bd9a7a37199c1a522f546a781057b48d99771d1b92435fc228d75e1906e3f40bab1fc996fb1 languageName: node linkType: hard @@ -49439,7 +46153,7 @@ __metadata: languageName: node linkType: hard -"web3-eth@npm:4.1.1, web3-eth@npm:^4.0.3, web3-eth@npm:^4.1.1": +"web3-eth@npm:4.1.1": version: 4.1.1 resolution: "web3-eth@npm:4.1.1" dependencies: @@ -49458,7 +46172,7 @@ __metadata: languageName: node linkType: hard -"web3-eth@npm:4.2.0, web3-eth@npm:^4.2.0": +"web3-eth@npm:4.2.0": version: 4.2.0 resolution: "web3-eth@npm:4.2.0" dependencies: @@ -49477,7 +46191,7 @@ __metadata: languageName: node linkType: hard -"web3-eth@npm:^4.1.0, web3-eth@npm:^4.3.0, web3-eth@npm:^4.3.1": +"web3-eth@npm:^4.0.3, web3-eth@npm:^4.1.0, web3-eth@npm:^4.1.1, web3-eth@npm:^4.2.0, web3-eth@npm:^4.3.0, web3-eth@npm:^4.3.1": version: 4.3.1 resolution: "web3-eth@npm:4.3.1" dependencies: @@ -49507,14 +46221,14 @@ __metadata: languageName: node linkType: hard -"web3-net@npm:1.10.1": - version: 1.10.1 - resolution: "web3-net@npm:1.10.1" +"web3-net@npm:1.10.3": + version: 1.10.3 + resolution: "web3-net@npm:1.10.3" dependencies: - web3-core: 1.10.1 - web3-core-method: 1.10.1 - web3-utils: 1.10.1 - checksum: 535e87452db2e8a30e08f9349c56555e59d76962de74b6ef09cd89cf89d5a70423f12db2bfcab4e4d8e411e0e198e6aa9abee3bb1c4c6d61fab7cfd76303d038 + web3-core: 1.10.3 + web3-core-method: 1.10.3 + web3-utils: 1.10.3 + checksum: 35ab560f51d5fa4d241ef514c0d7894b187a76ce7a73b03046281348e0ed2080eb20b8acb263ceb66b4e7874ecd4016833a83c24eae39fd4179cb53674c2b840 languageName: node linkType: hard @@ -49551,19 +46265,7 @@ __metadata: languageName: node linkType: hard -"web3-net@npm:^4.0.3, web3-net@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-net@npm:4.0.5" - dependencies: - web3-core: ^4.1.1 - web3-rpc-methods: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - checksum: 9c515e8110710637137ee0495e5a749105157027dbd432975d08a53e66280c2779001b496c6fac43590438538381ba6f2c1fc35ae9dcb518002004ad14953724 - languageName: node - linkType: hard - -"web3-net@npm:^4.0.4, web3-net@npm:^4.0.7": +"web3-net@npm:^4.0.3, web3-net@npm:^4.0.4, web3-net@npm:^4.0.5, web3-net@npm:^4.0.6, web3-net@npm:^4.0.7": version: 4.0.7 resolution: "web3-net@npm:4.0.7" dependencies: @@ -49575,18 +46277,6 @@ __metadata: languageName: node linkType: hard -"web3-net@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-net@npm:4.0.6" - dependencies: - web3-core: ^4.2.0 - web3-rpc-methods: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - checksum: 840ae451ca7cd7386cf68d1839bd4bf9ceda987bd8e74dee179375ab4297d36fddff7b4ec1472f66779326714e8c90912f612c124facea75c2039b3ac06d1e42 - languageName: node - linkType: hard - "web3-providers-http@npm:1.10.0": version: 1.10.0 resolution: "web3-providers-http@npm:1.10.0" @@ -49599,15 +46289,15 @@ __metadata: languageName: node linkType: hard -"web3-providers-http@npm:1.10.1": - version: 1.10.1 - resolution: "web3-providers-http@npm:1.10.1" +"web3-providers-http@npm:1.10.3": + version: 1.10.3 + resolution: "web3-providers-http@npm:1.10.3" dependencies: - abortcontroller-polyfill: ^1.7.3 - cross-fetch: ^3.1.4 + abortcontroller-polyfill: ^1.7.5 + cross-fetch: ^4.0.0 es6-promise: ^4.2.8 - web3-core-helpers: 1.10.1 - checksum: a569e3b0528147bbaeb0d6599c1653b5640e224418ea5978d1d2bc33fca8f73ff51d168db019315b130ac977d9049390cb86d515550aaead8b2594af87a1da16 + web3-core-helpers: 1.10.3 + checksum: 4b60778d1e7c0ca13aa7b348b9b9140c68851cf346989fc89c53cad5f2ae3c99a54eac78211d47feb513cf108db35df136a85e6a376fefd035a3fe93fbd0035d languageName: node linkType: hard @@ -49653,19 +46343,7 @@ __metadata: languageName: node linkType: hard -"web3-providers-http@npm:^4.0.3, web3-providers-http@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-providers-http@npm:4.0.5" - dependencies: - cross-fetch: ^3.1.5 - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - checksum: d406e4b9c661a3d8bf687f71fc8663a2433786531b58b3b8224c59335766e61a068bc3bfda7dff6dea441dcc85db082f91d433addff4f1523011d555782e3356 - languageName: node - linkType: hard - -"web3-providers-http@npm:^4.0.4, web3-providers-http@npm:^4.1.0": +"web3-providers-http@npm:^4.0.3, web3-providers-http@npm:^4.0.4, web3-providers-http@npm:^4.0.5, web3-providers-http@npm:^4.0.6, web3-providers-http@npm:^4.1.0": version: 4.1.0 resolution: "web3-providers-http@npm:4.1.0" dependencies: @@ -49677,18 +46355,6 @@ __metadata: languageName: node linkType: hard -"web3-providers-http@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-providers-http@npm:4.0.6" - dependencies: - cross-fetch: ^3.1.5 - web3-errors: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - checksum: a15b282a711c8a67ec69f2f54e057ef23ae67cd0f9bbe0f6189a8f7059bb5d80b55a1635eb2f13ff6e3a2fed13e18b67cdf60305ae1a35ff95fc1b288daaf7b5 - languageName: node - linkType: hard - "web3-providers-ipc@npm:1.10.0": version: 1.10.0 resolution: "web3-providers-ipc@npm:1.10.0" @@ -49699,13 +46365,13 @@ __metadata: languageName: node linkType: hard -"web3-providers-ipc@npm:1.10.1": - version: 1.10.1 - resolution: "web3-providers-ipc@npm:1.10.1" +"web3-providers-ipc@npm:1.10.3": + version: 1.10.3 + resolution: "web3-providers-ipc@npm:1.10.3" dependencies: oboe: 2.1.5 - web3-core-helpers: 1.10.1 - checksum: 717be1af3fa7bb75bf2bb7bd1701c903bca0ba954d33c0e24a5078ca9dd5d8af9707f8d052adcde7bd7b80a358697334cf4ccfc13d6bd2ec9a3a12172d56586d + web3-core-helpers: 1.10.3 + checksum: 54c2c13ab58b6712c54adfa1040bc9f3328843a5d0b649b1a30994dadae219427e72d3ba41e352f254c35858de42e988a3d36ef5e6a1f8e0b1a608e07e8c2591 languageName: node linkType: hard @@ -49749,29 +46415,7 @@ __metadata: languageName: node linkType: hard -"web3-providers-ipc@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-providers-ipc@npm:4.0.5" - dependencies: - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - checksum: 90746b699e1ea884c816618ff6ac98330557c9f7cc3ca0c9b033dcac9b7979b354acbaf05b8e37d1c0d05f386042b4c54b3f1bbeccf89d67cda45829843ba560 - languageName: node - linkType: hard - -"web3-providers-ipc@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-providers-ipc@npm:4.0.6" - dependencies: - web3-errors: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - checksum: 2939b47ab2828106f79df5a7c96b3a15802565ce8f72b8b3684af65925a930c9298ed691e94589871ba87e70a4f626669f9087e25b7aa9086fca205dc415b8ac - languageName: node - linkType: hard - -"web3-providers-ipc@npm:^4.0.7": +"web3-providers-ipc@npm:^4.0.5, web3-providers-ipc@npm:^4.0.7": version: 4.0.7 resolution: "web3-providers-ipc@npm:4.0.7" dependencies: @@ -49793,14 +46437,14 @@ __metadata: languageName: node linkType: hard -"web3-providers-ws@npm:1.10.1": - version: 1.10.1 - resolution: "web3-providers-ws@npm:1.10.1" +"web3-providers-ws@npm:1.10.3": + version: 1.10.3 + resolution: "web3-providers-ws@npm:1.10.3" dependencies: eventemitter3: 4.0.4 - web3-core-helpers: 1.10.1 + web3-core-helpers: 1.10.3 websocket: ^1.0.32 - checksum: f9f7f0e118c8b57f79004e9e8610e233aac4d2715b5b53b9a46593230cb4c5b0a76d3f42782068206e0349a2e14400deb6c87baffd98f27adddef1be65bd85e5 + checksum: 2f54abe361c38e6f35968aa6df984f787882f4f7208b1c00136763366f4060dea52c3157edc7cc3e7910626dc98ef453553f60a65f6a2b79ef76c09fc96fa173 languageName: node linkType: hard @@ -49848,21 +46492,7 @@ __metadata: languageName: node linkType: hard -"web3-providers-ws@npm:^4.0.3, web3-providers-ws@npm:^4.0.5": - version: 4.0.5 - resolution: "web3-providers-ws@npm:4.0.5" - dependencies: - "@types/ws": 8.5.3 - isomorphic-ws: ^5.0.0 - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - web3-utils: ^4.0.5 - ws: ^8.8.1 - checksum: 59d0d9cdfd0183744c7b0650cdb219a2a115c0fd5a8ba7e691a44404e2704f906726a04956970092c54ddf915fe6ed75831ffc6ed4dad1175c444fb63cca755a - languageName: node - linkType: hard - -"web3-providers-ws@npm:^4.0.4, web3-providers-ws@npm:^4.0.7": +"web3-providers-ws@npm:^4.0.3, web3-providers-ws@npm:^4.0.4, web3-providers-ws@npm:^4.0.5, web3-providers-ws@npm:^4.0.6, web3-providers-ws@npm:^4.0.7": version: 4.0.7 resolution: "web3-providers-ws@npm:4.0.7" dependencies: @@ -49876,50 +46506,14 @@ __metadata: languageName: node linkType: hard -"web3-providers-ws@npm:^4.0.6": - version: 4.0.6 - resolution: "web3-providers-ws@npm:4.0.6" - dependencies: - "@types/ws": 8.5.3 - isomorphic-ws: ^5.0.0 - web3-errors: ^1.1.2 - web3-types: ^1.2.0 - web3-utils: ^4.0.6 - ws: ^8.8.1 - checksum: af43ccabafcf85ef363bcb13796cee1c8849283fff822d25d7044774917fe5827c8f93dcf55dd98d1540b3198cb1c4bc65b01985af1791f764ef6a8a5f197f4a - languageName: node - linkType: hard - -"web3-rpc-methods@npm:^1.0.2, web3-rpc-methods@npm:^1.1.1": - version: 1.1.1 - resolution: "web3-rpc-methods@npm:1.1.1" - dependencies: - web3-core: ^4.1.1 - web3-types: ^1.1.1 - web3-validator: ^2.0.1 - checksum: ce9ebe6ae06903732246fdf3798d26b834428530cb4d0ad569c3913f955856e4ce8c57210a713946514e8780521b19f4f677725b625c57791140cf849048f074 - languageName: node - linkType: hard - -"web3-rpc-methods@npm:^1.1.0, web3-rpc-methods@npm:^1.1.3": - version: 1.1.3 - resolution: "web3-rpc-methods@npm:1.1.3" +"web3-rpc-methods@npm:^1.0.2, web3-rpc-methods@npm:^1.1.0, web3-rpc-methods@npm:^1.1.1, web3-rpc-methods@npm:^1.1.2, web3-rpc-methods@npm:^1.1.3": + version: 1.1.4 + resolution: "web3-rpc-methods@npm:1.1.4" dependencies: - web3-core: ^4.3.0 - web3-types: ^1.3.0 + web3-core: ^4.3.2 + web3-types: ^1.3.1 web3-validator: ^2.0.3 - checksum: 27127cdf20f3951593ec45661fb61e78a26e0fde1bab585a8dc9c676d0daa17902ed7a2f5360f5b5e92b0ba6c675783382a99ed92336b932884b77a378ad8dec - languageName: node - linkType: hard - -"web3-rpc-methods@npm:^1.1.2": - version: 1.1.2 - resolution: "web3-rpc-methods@npm:1.1.2" - dependencies: - web3-core: ^4.2.0 - web3-types: ^1.2.0 - web3-validator: ^2.0.2 - checksum: 452dcd18993d7fa2ab37a062d39a317100223b65f13fa9ecc0e95d91e05312e013b7cc3e21aaaf583f8a3261e819022d69d1c1ab1ac65a40afe14d28ff11becf + checksum: b51098af5eaee5f57f5684a1b6e3763f61d8141de398a4457ed2cdca2a4e7fabe49de1ef597694e98581884d5c0d74fec697fbf8d67baa3ad5d10f1e131d6c43 languageName: node linkType: hard @@ -49935,15 +46529,15 @@ __metadata: languageName: node linkType: hard -"web3-shh@npm:1.10.1": - version: 1.10.1 - resolution: "web3-shh@npm:1.10.1" +"web3-shh@npm:1.10.3": + version: 1.10.3 + resolution: "web3-shh@npm:1.10.3" dependencies: - web3-core: 1.10.1 - web3-core-method: 1.10.1 - web3-core-subscriptions: 1.10.1 - web3-net: 1.10.1 - checksum: 9e0433379369cdc5e378300d898e9746e53e31b6062cd64a3cd7722a77d8c8a90ade520669bb2fe466a1176d7d8fadf469109023f16488fd76368aa3cf3cdafd + web3-core: 1.10.3 + web3-core-method: 1.10.3 + web3-core-subscriptions: 1.10.3 + web3-net: 1.10.3 + checksum: 798311a89147bde51dffcf4f672fc344e7732c098ad16ca9a62ac26811dfd08ffcf9b23a26cbe2b9084c411e2e4f34df0f2f4bb2c5f52f00153ad650f800c1a7 languageName: node linkType: hard @@ -49983,42 +46577,14 @@ __metadata: languageName: node linkType: hard -"web3-types@npm:^1.0.2": - version: 1.0.2 - resolution: "web3-types@npm:1.0.2" - checksum: 2f558330db188bca47299f0607d4bbece6339e4003dcddeba7c704acfaf7126c35ad1bba710a815fad312f3976db5a04db376f1994286472c4ead166131baaf3 - languageName: node - linkType: hard - -"web3-types@npm:^1.1.0, web3-types@npm:^1.3.0": - version: 1.3.0 - resolution: "web3-types@npm:1.3.0" - checksum: 1d0319dce670c7f288fd7347421c79871f38a703634191265bd0d357a009ddbf7d972fd758894349501229e1ce2e88d0db3a95436667f7d8c19cb7414672f450 - languageName: node - linkType: hard - -"web3-types@npm:^1.1.1": - version: 1.1.1 - resolution: "web3-types@npm:1.1.1" - checksum: d477bf427581ed7350129d9c79958321afdbcb0f2ac9a956fc00ff1c534fc021d8fe8c9b8fb787926f7c487a29074bc85bda7eee3098e5abbe91fbb3e11b89f0 - languageName: node - linkType: hard - -"web3-types@npm:^1.2.0": - version: 1.2.0 - resolution: "web3-types@npm:1.2.0" - checksum: ed8c42df578fc51cb4a56d60d9dd018f0fbbf7cf4992ac4150361e2985e8a6fc91fde9589f74201495d7795ac563eecf62ec2e7496858433f3ba0350e1808bbc - languageName: node - linkType: hard - -"web3-types@npm:^1.3.1": +"web3-types@npm:^1.0.2, web3-types@npm:^1.1.0, web3-types@npm:^1.1.1, web3-types@npm:^1.2.0, web3-types@npm:^1.3.0, web3-types@npm:^1.3.1": version: 1.3.1 resolution: "web3-types@npm:1.3.1" checksum: 02819f803f926b45843335705343ace1ee6fe84bf5d09be9382532389ce7ef47ed7f95b23ef61330979039442062f0089ab4bac6000cb7246202b17a14b44878 languageName: node linkType: hard -"web3-utils@npm:1.10.0, web3-utils@npm:^1.0.0-beta.31": +"web3-utils@npm:1.10.0": version: 1.10.0 resolution: "web3-utils@npm:1.10.0" dependencies: @@ -50033,9 +46599,9 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:1.10.1": - version: 1.10.1 - resolution: "web3-utils@npm:1.10.1" +"web3-utils@npm:1.10.3, web3-utils@npm:^1.0.0-beta.31": + version: 1.10.3 + resolution: "web3-utils@npm:1.10.3" dependencies: "@ethereumjs/util": ^8.1.0 bn.js: ^5.2.1 @@ -50045,7 +46611,7 @@ __metadata: number-to-bn: 1.7.0 randombytes: ^2.1.0 utf8: 3.0.0 - checksum: 260a2efcbe3c241f2d3e1b5d77a3a33510ab270a5028a842f8262a5d0b9d8cb08a2da8e821b02765a3cc39de83502a7dc677124c02ed8e314fc45bc612e22c3e + checksum: 353226710b2089a8e84f2b97cc765093e3018b850d3a6d60c92fe012829fa15a54ad15d432f1927bc185c6ef5100397a32fd4a896da5f514817c3f53583df134 languageName: node linkType: hard @@ -50109,7 +46675,7 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:4.0.3, web3-utils@npm:^4.0.3": +"web3-utils@npm:4.0.3": version: 4.0.3 resolution: "web3-utils@npm:4.0.3" dependencies: @@ -50121,7 +46687,7 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:4.0.5, web3-utils@npm:^4.0.5": +"web3-utils@npm:4.0.5": version: 4.0.5 resolution: "web3-utils@npm:4.0.5" dependencies: @@ -50133,7 +46699,7 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:4.0.6, web3-utils@npm:^4.0.6": +"web3-utils@npm:4.0.6": version: 4.0.6 resolution: "web3-utils@npm:4.0.6" dependencies: @@ -50145,19 +46711,19 @@ __metadata: languageName: node linkType: hard -"web3-utils@npm:^4.0.4, web3-utils@npm:^4.0.7": - version: 4.0.7 - resolution: "web3-utils@npm:4.0.7" +"web3-utils@npm:^4.0.3, web3-utils@npm:^4.0.4, web3-utils@npm:^4.0.5, web3-utils@npm:^4.0.6, web3-utils@npm:^4.0.7, web3-utils@npm:^4.1.0": + version: 4.1.0 + resolution: "web3-utils@npm:4.1.0" dependencies: ethereum-cryptography: ^2.0.0 - web3-errors: ^1.1.3 - web3-types: ^1.3.0 + web3-errors: ^1.1.4 + web3-types: ^1.3.1 web3-validator: ^2.0.3 - checksum: 8dbf36d1813164efdc70c98ffac86c265c029b4df63a5b5833ad19520ac6782c26d3444fc1f95e1abbc95f17b4041f36f66664d552f5038543805fe5a5260ded + checksum: 5072ebc78ac62f26b5e17043f327f1046b4284a8e8a80f4771712ee9fc2ee895a0e292a225785b7392b647b6edc090d57f2262de5efd0a19571cd583c708c1c3 languageName: node linkType: hard -"web3-validator@npm:2.0.2, web3-validator@npm:^2.0.2": +"web3-validator@npm:2.0.2": version: 2.0.2 resolution: "web3-validator@npm:2.0.2" dependencies: @@ -50183,7 +46749,7 @@ __metadata: languageName: node linkType: hard -"web3-validator@npm:^2.0.0, web3-validator@npm:^2.0.3": +"web3-validator@npm:^2.0.0, web3-validator@npm:^2.0.1, web3-validator@npm:^2.0.2, web3-validator@npm:^2.0.3": version: 2.0.3 resolution: "web3-validator@npm:2.0.3" dependencies: @@ -50196,19 +46762,6 @@ __metadata: languageName: node linkType: hard -"web3-validator@npm:^2.0.1": - version: 2.0.1 - resolution: "web3-validator@npm:2.0.1" - dependencies: - ethereum-cryptography: ^2.0.0 - util: ^0.12.5 - web3-errors: ^1.1.1 - web3-types: ^1.1.1 - zod: ^3.21.4 - checksum: 4382a0d034751ca04d3f919efd4f1115abecee8541585179158662e46dd10b051c4ee29c885067d7aeff618dec971c4a2075baeb7df63249e3ed5b2d5695b782 - languageName: node - linkType: hard - "web3@npm:1.10.0": version: 1.10.0 resolution: "web3@npm:1.10.0" @@ -50390,17 +46943,17 @@ __metadata: linkType: hard "web3@npm:^1.2.4": - version: 1.10.1 - resolution: "web3@npm:1.10.1" + version: 1.10.3 + resolution: "web3@npm:1.10.3" dependencies: - web3-bzz: 1.10.1 - web3-core: 1.10.1 - web3-eth: 1.10.1 - web3-eth-personal: 1.10.1 - web3-net: 1.10.1 - web3-shh: 1.10.1 - web3-utils: 1.10.1 - checksum: f70c6658daec5d860946081d5eeea55edd991a8d4bacdca1d8335859f6d34b08ba815803aff7001a32e36d482379e291fa1a68313cff4afa83717d54f8d42721 + web3-bzz: 1.10.3 + web3-core: 1.10.3 + web3-eth: 1.10.3 + web3-eth-personal: 1.10.3 + web3-net: 1.10.3 + web3-shh: 1.10.3 + web3-utils: 1.10.3 + checksum: bd97eccd940bb2ae3ff6246e7ecaf2b147393e8d2070a267c3831ef55c32ea17b4d23676817d425cc046d12b4f7c044834a9061e9caacd06ee6c6f3aa1137000 languageName: node linkType: hard @@ -50603,12 +47156,13 @@ __metadata: linkType: hard "webpack-merge@npm:^5.7.3": - version: 5.8.0 - resolution: "webpack-merge@npm:5.8.0" + version: 5.10.0 + resolution: "webpack-merge@npm:5.10.0" dependencies: clone-deep: ^4.0.1 + flat: ^5.0.2 wildcard: ^2.0.0 - checksum: 88786ab91013f1bd2a683834ff381be81c245a4b0f63304a5103e90f6653f44dab496a0768287f8531761f8ad957d1f9f3ccb2cb55df0de1bd9ee343e079da26 + checksum: 1fe8bf5309add7298e1ac72fb3f2090e1dfa80c48c7e79fa48aa60b5961332c7d0d61efa8851acb805e6b91a4584537a347bc106e05e9aec87fa4f7088c62f2f languageName: node linkType: hard @@ -50654,7 +47208,7 @@ __metadata: languageName: node linkType: hard -"webpack@npm:5.88.2, webpack@npm:^5.64.4": +"webpack@npm:5.88.2": version: 5.88.2 resolution: "webpack@npm:5.88.2" dependencies: @@ -50691,6 +47245,43 @@ __metadata: languageName: node linkType: hard +"webpack@npm:^5.64.4": + version: 5.89.0 + resolution: "webpack@npm:5.89.0" + dependencies: + "@types/eslint-scope": ^3.7.3 + "@types/estree": ^1.0.0 + "@webassemblyjs/ast": ^1.11.5 + "@webassemblyjs/wasm-edit": ^1.11.5 + "@webassemblyjs/wasm-parser": ^1.11.5 + acorn: ^8.7.1 + acorn-import-assertions: ^1.9.0 + browserslist: ^4.14.5 + chrome-trace-event: ^1.0.2 + enhanced-resolve: ^5.15.0 + es-module-lexer: ^1.2.1 + eslint-scope: 5.1.1 + events: ^3.2.0 + glob-to-regexp: ^0.4.1 + graceful-fs: ^4.2.9 + json-parse-even-better-errors: ^2.3.1 + loader-runner: ^4.2.0 + mime-types: ^2.1.27 + neo-async: ^2.6.2 + schema-utils: ^3.2.0 + tapable: ^2.1.1 + terser-webpack-plugin: ^5.3.7 + watchpack: ^2.4.0 + webpack-sources: ^3.2.3 + peerDependenciesMeta: + webpack-cli: + optional: true + bin: + webpack: bin/webpack.js + checksum: 43fe0dbc30e168a685ef5a86759d5016a705f6563b39a240aa00826a80637d4a3deeb8062e709d6a4b05c63e796278244c84b04174704dc4a37bedb0f565c5ed + languageName: node + linkType: hard + "websocket-driver@npm:>=0.5.1, websocket-driver@npm:^0.7.4": version: 0.7.4 resolution: "websocket-driver@npm:0.7.4" @@ -50752,9 +47343,9 @@ __metadata: linkType: hard "whatwg-fetch@npm:^3.6.2": - version: 3.6.19 - resolution: "whatwg-fetch@npm:3.6.19" - checksum: 2896bc9ca867ea514392c73e2a272f65d5c4916248fe0837a9df5b1b92f247047bc76cf7c29c28a01ac6c5fb4314021d2718958c8a08292a96d56f72b2f56806 + version: 3.6.20 + resolution: "whatwg-fetch@npm:3.6.20" + checksum: c58851ea2c4efe5c2235f13450f426824cf0253c1d45da28f45900290ae602a20aff2ab43346f16ec58917d5562e159cd691efa368354b2e82918c2146a519c5 languageName: node linkType: hard @@ -50857,9 +47448,9 @@ __metadata: linkType: hard "which-module@npm:^2.0.0": - version: 2.0.0 - resolution: "which-module@npm:2.0.0" - checksum: 809f7fd3dfcb2cdbe0180b60d68100c88785084f8f9492b0998c051d7a8efe56784492609d3f09ac161635b78ea29219eb1418a98c15ce87d085bce905705c9c + version: 2.0.1 + resolution: "which-module@npm:2.0.1" + checksum: 1967b7ce17a2485544a4fdd9063599f0f773959cca24176dbe8f405e55472d748b7c549cd7920ff6abb8f1ab7db0b0f1b36de1a21c57a8ff741f4f1e792c52be languageName: node linkType: hard @@ -50870,20 +47461,7 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.10": - version: 1.1.11 - resolution: "which-typed-array@npm:1.1.11" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - checksum: 711ffc8ef891ca6597b19539075ec3e08bb9b4c2ca1f78887e3c07a977ab91ac1421940505a197758fb5939aa9524976d0a5bbcac34d07ed6faa75cedbb17206 - languageName: node - linkType: hard - -"which-typed-array@npm:^1.1.13": +"which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.13, which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": version: 1.1.13 resolution: "which-typed-array@npm:1.1.13" dependencies: @@ -50896,34 +47474,6 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.2": - version: 1.1.7 - resolution: "which-typed-array@npm:1.1.7" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - es-abstract: ^1.18.5 - foreach: ^2.0.5 - has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.7 - checksum: 147837cf5866e36b6b2e427731709e02f79f1578477cbde68ed773a5307520a6cb6836c73c79c30690a473266ee59010b83b6d9b25d8d677a40ff77fb37a8a84 - languageName: node - linkType: hard - -"which-typed-array@npm:^1.1.9": - version: 1.1.9 - resolution: "which-typed-array@npm:1.1.9" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.10 - checksum: fe0178ca44c57699ca2c0e657b64eaa8d2db2372a4e2851184f568f98c478ae3dc3fdb5f7e46c384487046b0cf9e23241423242b277e03e8ba3dabc7c84c98ef - languageName: node - linkType: hard - "which@npm:2.0.2, which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -50947,13 +47497,13 @@ __metadata: linkType: hard "which@npm:^3.0.0": - version: 3.0.0 - resolution: "which@npm:3.0.0" + version: 3.0.1 + resolution: "which@npm:3.0.1" dependencies: isexe: ^2.0.0 bin: node-which: bin/which.js - checksum: fdcf3cadab414e60b86c6836e7ac9de9273561a8926f57cbc28641b602a771527239ee4d47f2689ed255666f035ba0a0d72390986cc0c4e45344491adc7d0eeb + checksum: adf720fe9d84be2d9190458194f814b5e9015ae4b88711b150f30d0f4d0b646544794b86f02c7ebeec1db2029bc3e83a7ff156f542d7521447e5496543e26890 languageName: node linkType: hard @@ -50987,9 +47537,9 @@ __metadata: linkType: hard "wildcard@npm:^2.0.0": - version: 2.0.0 - resolution: "wildcard@npm:2.0.0" - checksum: 1f4fe4c03dfc492777c60f795bbba597ac78794f1b650d68f398fbee9adb765367c516ebd4220889b6a81e9626e7228bbe0d66237abb311573c2ee1f4902a5ad + version: 2.0.1 + resolution: "wildcard@npm:2.0.1" + checksum: e0c60a12a219e4b12065d1199802d81c27b841ed6ad6d9d28240980c73ceec6f856771d575af367cbec2982d9ae7838759168b551776577f155044f5a5ba843c languageName: node linkType: hard @@ -51003,17 +47553,17 @@ __metadata: linkType: hard "winston-transport@npm:^4.5.0": - version: 4.5.0 - resolution: "winston-transport@npm:4.5.0" + version: 4.6.0 + resolution: "winston-transport@npm:4.6.0" dependencies: logform: ^2.3.2 readable-stream: ^3.6.0 triple-beam: ^1.3.0 - checksum: a56e5678a80b88a73e77ed998fc6e19d0db19c989a356b137ec236782f2bf58ae4511b11c29163f99391fa4dc12102c7bc5738dcb6543f28877fa2819adc3ee9 + checksum: 19f06ebdbb57cb14cdd48a23145d418d3bbe538851053303f84f04a8a849bb530b78b1495a175059c1299f92945dc61d5421c4914fee32d9a41bc397d84f26d7 languageName: node linkType: hard -"winston@npm:3.10.0, winston@npm:^3.0.0": +"winston@npm:3.10.0": version: 3.10.0 resolution: "winston@npm:3.10.0" dependencies: @@ -51033,23 +47583,24 @@ __metadata: linkType: hard "winston@npm:^2.4.5": - version: 2.4.5 - resolution: "winston@npm:2.4.5" + version: 2.4.7 + resolution: "winston@npm:2.4.7" dependencies: - async: ~1.0.0 + async: ^2.6.4 colors: 1.0.x cycle: 1.0.x eyes: 0.1.x isstream: 0.1.x stack-trace: 0.0.x - checksum: aba54cae4c97df6f01c6ad98b5ecbf79eaa79326b5f99c379063e91a9bd6dd961b2958768d850546b7a54ef159ecc67bcaf08a6fec4029592be7436d955460f0 + checksum: 0843f39e7d5298b0bffbdea51bc0662715b3c49414fd2b245ebf9b9a4aca452683f35f03ae60e93542b7b16e1eeee34eb3c62bb7ec644201587a4067e8d64dda languageName: node linkType: hard -"winston@npm:^3.3.3": - version: 3.6.0 - resolution: "winston@npm:3.6.0" +"winston@npm:^3.0.0, winston@npm:^3.3.3": + version: 3.11.0 + resolution: "winston@npm:3.11.0" dependencies: + "@colors/colors": ^1.6.0 "@dabh/diagnostics": ^2.0.2 async: ^3.2.3 is-stream: ^2.0.0 @@ -51060,14 +47611,14 @@ __metadata: stack-trace: 0.0.x triple-beam: ^1.3.0 winston-transport: ^4.5.0 - checksum: 5641837781046a2f73111dfb2af500e88f4350521d01de184d33ac8ee60c28047a8897bd2ab7b438b3812fc31a88bbbee13fd9ed617d60bd16a56d0143e423dc + checksum: ca4454070f7a71b19f53c8c1765c59a013dab220edb49161b2e81917751d3e9edc3382430e4fb050feda04fb8463290ecab7cbc9240ec8d3d3b32a121849bbb0 languageName: node linkType: hard -"word-wrap@npm:^1.2.3, word-wrap@npm:~1.2.3": - version: 1.2.3 - resolution: "word-wrap@npm:1.2.3" - checksum: 30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f +"word-wrap@npm:~1.2.3": + version: 1.2.5 + resolution: "word-wrap@npm:1.2.5" + checksum: f93ba3586fc181f94afdaff3a6fef27920b4b6d9eaefed0f428f8e07adea2a7f54a5f2830ce59406c8416f033f86902b91eb824072354645eea687dff3691ccb languageName: node linkType: hard @@ -51395,17 +47946,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^5.0.0": - version: 5.0.0 - resolution: "write-file-atomic@npm:5.0.0" - dependencies: - imurmurhash: ^0.1.4 - signal-exit: ^3.0.7 - checksum: 6ee16b195572386cb1c905f9d29808f77f4de2fd063d74a6f1ab6b566363832d8906a493b764ee715e57ab497271d5fc91642a913724960e8e845adf504a9837 - languageName: node - linkType: hard - -"write-file-atomic@npm:^5.0.1": +"write-file-atomic@npm:^5.0.0, write-file-atomic@npm:^5.0.1": version: 5.0.1 resolution: "write-file-atomic@npm:5.0.1" dependencies: @@ -51542,7 +48083,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.5.0, ws@npm:^8.1.0": +"ws@npm:8.5.0": version: 8.5.0 resolution: "ws@npm:8.5.0" peerDependencies: @@ -51577,7 +48118,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^7, ws@npm:^7.2.0, ws@npm:^7.5.5": +"ws@npm:^7, ws@npm:^7.2.0, ws@npm:^7.3.1, ws@npm:^7.4.6, ws@npm:^7.5.5": version: 7.5.9 resolution: "ws@npm:7.5.9" peerDependencies: @@ -51592,24 +48133,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:^7.3.1, ws@npm:^7.4.6": - version: 7.5.7 - resolution: "ws@npm:7.5.7" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 5c1f669a166fb57560b4e07f201375137fa31d9186afde78b1508926345ce546332f109081574ddc4e38cc474c5406b5fc71c18d71eb75f6e2d2245576976cba - languageName: node - linkType: hard - -"ws@npm:^8.13.0": - version: 8.14.1 - resolution: "ws@npm:8.14.1" +"ws@npm:^8.1.0, ws@npm:^8.13.0, ws@npm:^8.4.0, ws@npm:^8.8.1": + version: 8.16.0 + resolution: "ws@npm:8.16.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -51618,37 +48144,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 9e310be2b0ff69e1f87d8c6d093ecd17a1ed4c37f281d17c35e8c30e2bd116401775b3d503249651374e6e0e1e9905db62fff096b694371c77561aee06bc3466 - languageName: node - linkType: hard - -"ws@npm:^8.4.0": - version: 8.8.1 - resolution: "ws@npm:8.8.1" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 2152cf862cae0693f3775bc688a6afb2e989d19d626d215e70f5fcd8eb55b1c3b0d3a6a4052905ec320e2d7734e20aeedbf9744496d62f15a26ad79cf4cf7dae - languageName: node - linkType: hard - -"ws@npm:^8.8.1": - version: 8.13.0 - resolution: "ws@npm:8.13.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c + checksum: feb3eecd2bae82fa8a8beef800290ce437d8b8063bdc69712725f21aef77c49cb2ff45c6e5e7fce622248f9c7abaee506bae0a9064067ffd6935460c7357321b languageName: node linkType: hard @@ -51880,17 +48376,17 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^1.10.0, yaml@npm:^1.10.2, yaml@npm:^1.5.0, yaml@npm:^1.7.2": +"yaml@npm:^1.10.0, yaml@npm:^1.10.2, yaml@npm:^1.7.2": version: 1.10.2 resolution: "yaml@npm:1.10.2" checksum: ce4ada136e8a78a0b08dc10b4b900936912d15de59905b2bf415b4d33c63df1d555d23acb2a41b23cf9fb5da41c256441afca3d6509de7247daa062fd2c5ea5f languageName: node linkType: hard -"yaml@npm:^2.1.1": - version: 2.3.3 - resolution: "yaml@npm:2.3.3" - checksum: cdfd132e7e0259f948929efe8835923df05c013c273c02bb7a2de9b46ac3af53c2778a35b32c7c0f877cc355dc9340ed564018c0242bfbb1278c2a3e53a0e99e +"yaml@npm:^2.3.4": + version: 2.3.4 + resolution: "yaml@npm:2.3.4" + checksum: e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8 languageName: node linkType: hard @@ -51967,7 +48463,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:17.7.2, yargs@npm:^17.7.2": +"yargs@npm:17.7.2, yargs@npm:^17.0.0, yargs@npm:^17.1.1, yargs@npm:^17.2.1, yargs@npm:^17.3.1, yargs@npm:^17.7.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: @@ -52002,7 +48498,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: @@ -52021,51 +48517,6 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.0.0, yargs@npm:^17.1.1": - version: 17.3.1 - resolution: "yargs@npm:17.3.1" - dependencies: - cliui: ^7.0.2 - escalade: ^3.1.1 - get-caller-file: ^2.0.5 - require-directory: ^2.1.1 - string-width: ^4.2.3 - y18n: ^5.0.5 - yargs-parser: ^21.0.0 - checksum: 64fc2e32c56739f1d14d2d24acd17a6944c3c8e3e3558f09fc1953ac112e868cc16013d282886b9d5be22187f8b9ed4f60741a6b1011f595ce2718805a656852 - languageName: node - linkType: hard - -"yargs@npm:^17.2.1": - version: 17.5.0 - resolution: "yargs@npm:17.5.0" - dependencies: - cliui: ^7.0.2 - escalade: ^3.1.1 - get-caller-file: ^2.0.5 - require-directory: ^2.1.1 - string-width: ^4.2.3 - y18n: ^5.0.5 - yargs-parser: ^21.0.0 - checksum: e2c662a7a63aa125a162cc0d77e38bdfe2a0dd5121a0d485a464499cd7782c5198b57103aed4608df96a017d01cb6a834bc22d4a1f20b92649fa82983d53522b - languageName: node - linkType: hard - -"yargs@npm:^17.3.1": - version: 17.5.1 - resolution: "yargs@npm:17.5.1" - dependencies: - cliui: ^7.0.2 - escalade: ^3.1.1 - get-caller-file: ^2.0.5 - require-directory: ^2.1.1 - string-width: ^4.2.3 - y18n: ^5.0.5 - yargs-parser: ^21.0.0 - checksum: 00d58a2c052937fa044834313f07910fd0a115dec5ee35919e857eeee3736b21a4eafa8264535800ba8bac312991ce785ecb8a51f4d2cc8c4676d865af1cfbde - languageName: node - linkType: hard - "yargs@npm:^4.7.1": version: 4.8.1 resolution: "yargs@npm:4.8.1"